@dpuse/dpuse-shared 1.0.241 → 1.0.243
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dpuse-shared.es.js","names":["LOAD_URL_PREFIX","DEFAULT_LOCALE_ID","SUPPORTED_LANGUAGES","createLabelMap","labels","resolveLabel","localizedLabel","localeId","fallbackLocaleId","DEFAULT_CONFIG","getGlobalConfig","config$1","_stringify","type","input","_addIssue","other","dataset","expected","context","received","issue","label","isSchema","message$1","_isSameValueZero","value1","value2","_isValidObjectKey","object$1","key","_joinExpects","list","values$1","separator","_standardSchema","schema","value$1","minLength","requirement","getFallback","getDefault","array","itemDataset","pathItem","boolean","literal","literal_","looseObject","entries$1","valueSchema","valueDataset","nullable","wrapped","default_","number","optional","record","entryKey","entryValue","keyDataset","strictObject","string","_subIssues","issues","datasets","union","options","option","validDataset","typedDatasets","untypedDatasets","optionDataset","pipe","pipe$1","item","safeParse","localeLabelSchema","baseConfigSchema","literalUnion","values","value","componentTypeIdSchema","componentStatusColorIdSchema","componentStatusIdSchema","componentStatusConfigSchema","componentBaseConfigSchema","componentReferenceConfigSchema","componentCoreFieldsConfig","componentInstanceConfigSchema","COMPONENT_STATUS_CONFIGS","getComponentStatus","componentStatus","id","\"en\"","DATA_FORMAT_CONFIGS","VALUE_DELIMITER_CONFIGS","DATA_TYPE_CONFIGS","DECIMAL_SEPARATOR_IDS","getValueDelimiterCharacter","valueDelimiterId","moduleConfigCoreFields","connectorActionNameSchema","connectorCategoryIdSchema","connectorCategoryConfigSchema","connectorItemTypeIdSchema","connectorUsageIdSchema","connectorUsageConfigSchema","connectorImplementationSchema","connectorConfigSchema","DPUSE_ERROR_NAMES","RESPONSE_ERROR_BODY_LIMIT","REDACTED","REDACTION_MAX_DEPTH","SECRET_KEY_PATTERN","SECRET_TEXT_PATTERNS","scheme","name","match","DPUseError","message","locator","AppError","APIError","EngineError","ConnectorError","FetchError","buildFetchError","responseStatusStuff","response","fetchMessage","bodyText","error","normalizeToError","sanitizeResponseErrorBody","concatenateSerialisedErrorMessages","serialisedErrors","serialisedError","ignoreErrors","serialiseError","seenCauses","cause","nextCause","serialiseSingleError","redactedError","redactSerialisedError","unserialiseError","rebuiltError","serialised","reconstructError","buildFallbackMessage","fallbackMessage","data","redactValue","redactText","stack","redactedText","text","pattern","replacement","groups","depth","seen","body","isDPUseError","customProperties","k","RANGE_BYTE_COUNT","RANGE_NOT_SATISFIABLE_STATUS","fetchObjectContentStream","doesFetchPauseUnreadDownloads","url","establishResponseBody","firstResponse","fetchObjectRange","nextResponse","nextOffset","bytes","controller","userAgentData","brand","range","startOffset","ENCODING_GROUP_CONFIG_DATA","ENCODING_TYPE_CONFIG_DATA","ENCODING_GROUP_CONFIG_MAP","ENCODING_TYPE_CONFIG_MAP","isEncodingTypeId","resolveDecoderId","encodingId","getEncodingTypeConfigs","groupLabel","groupId","resolveGroupLabel","textDecoderId","left","right","parserConfigSchema","toolActionNamesSchema","toolConfigSchema","parseDelimitedPreview","preview","recordDelimiterId","determineRecordDelimiter","determineValueDelimiter","parseWithDelimiter","countCRLF","countLF","countCR","priorAverageCount","priorSumCountDiffs","parsedRecords","fewestIssuesParse","hasParsedWithoutIssues","delimiter","delimiters","isComplete","chooseFewerIssues","records","measureValueCounts","sumOfValueCountDiffs","averageValueCount","isTabular","priorParse","parse","totalValueCount","priorValueCount","recordCountByValueCount","commonValueCount","commonRecordCount","LOAD_URL_PREFIX$1","DEFAULT_PARSER_TOOL_IDS","TOOL_NAME_PREFIX","listParserToolConfigs","toolConfigs","config","dataFormatId","first","second","resolveParserToolConfig","parserToolConfigs","firstParserToolConfig","defaultParserId","parserId","loadTool","toolName","toolId","toolModuleConfig","DEFAULT_RECORD_DELIMITER_ID","DEFAULT_VALUE_DELIMITER_ID","STRUCTURED_DATA_FORMAT_IDS","isStructured","CARRIAGE_RETURN_BYTE","LINE_FEED_BYTE","QUOTE_BYTE","MAX_AUDIT_READ_BYTE_COUNT","buildPreviewObjectResult","filePreview","isDeclared","declaredReadingConfig","size","sampleDecoding","encodingCandidates","detectedEncoding","constructFirstAuditConfig","detectedDataFormatId","declaredValueDelimiterId","parseTiming","detectedStructureIndex","previewStructure","previewEncodingId","detectedParse","parsePreviewText","sampleDataFormatId","readingChoiceConfig","isFormatChosen","isParseChosen","sampleStructureIndex","sampleParse","sampleRecords","sampleHasHeaders","columnAuditStartedAt","sampleInference","inferDataTypes","declaredColumnConfigs","detectedInference","retrieveRecordsWithParser","establishFileReading","loadParser","timedSource","timeSourceWaits","stream","countedSource","countBytes","parsing","parser","signal","parserReads","timeParserReads","isParsingDone","parsed","sourceWaitDuration","auditObjectContentWithParser","asAt","startedAt","columnAuditor","constructColumnAuditor","auditSource","endAtRecordBoundary","columnAuditDuration","auditStartedAt","onProgress","summary","completeStartedAt","columnConfigs","indexObjectStructureWithParser","loadStructuredParser","listObjectStructureEntriesWithParser","reader","recordEndFinder","constructRecordEndFinder","byteCount","pendingBytes","pieceBytes","result","limit","recordEnd","reason","decoderId","isUtf16","unitByteCount","lowByteOffset","quoteIsOpen","index","byte","position","searchFrom","waitDuration","usedParserId","structureIndex","isUnreadable","structurePath","timeParse","valueDelimiterIds","firstParsePreviewResult","isDelimitedText","parsePreviewResult","duration","parserToolConfig","constructStoreError","findStoreErrorId","seenErrors","storeErrorId","DATABASE_NAME_PATTERN","resolveStorePath","path","databaseName","tableName","extraSegments","convertStoreRecordToParsedRecord","storeRecord","convertStoreValueToText","storeValue","acquireWebLock","acquisition","grant","lockRequest","lock","release","endedRequest","TABLE_SCHEMA_SCHEMA","TABLE_DIALECT_SCHEMA","TABLE_SCHEMA_TYPES","TABLE_SCHEMA_STRING_SUBTYPES","readTableSchema","schemaResult","resource","dialectResult","declaredType","constructDeclaredType","field","header","headerRows","character","format","CONNECTOR_CATEGORY_CONFIGS","CONNECTOR_ITEM_TYPE_CONFIGS","CONNECTOR_ACTION_NAME_MAP","CONNECTOR_USAGE_CONFIGS","CONNECTOR_DESTINATION_OPERATIONS","CONNECTOR_SOURCE_OPERATIONS","determineConnectorUsageId","isSourceOperation","isDestinationOperation","actionName","actionNames","constructConnectorCategoryConfig","connectorCategory","constructConnectorItemTypeConfig","connectorItemType","constructConnectorUsageConfig","connectorUsage","getConnectorActionsTable","supportedSet","supported","md","cookbookActionNameSchema","cookbookConfigSchema","resolveRequestSignal","presenterActionNameSchema","presenterConfigSchema","LOAD_URL_PREFIX","loadPresenter","presenterName","presenterConfig","colorModeId","sanitizeHTML","localiseConfig","localiseConfigs","mapped","configs","isResultSorted","a","b","localiseReference","reference","MIME_TYPES_BY_EXTENSION","NUMBER_FORMATTER_DEFAULT_LOCALE","DURATION_UNITS","STORAGE_UNITS","LIST_FORMATTER_MAP","NUMBER_FORMATTER_MAP","formatNumberAsDecimalNumber","decimalPlaces","getNumberFormatter","locale","minimumFractionDigits","formatNumberAsWholeNumber","formatNumberAsSize","formatNumberAsStorageSize","unit","unitSize","roundNumber","formatNumberAsDuration","remaining","startIndex","firstIndex","stopIndex","stopAt","durationUnits","parts","count","signedCount","getListFormatter","extractPathWithoutExtension","itemPath","extensionSeparatorIndex","findExtensionSeparatorIndex","extractExtensionFromPath","hasMimeTypeForExtension","extension","lookupMimeTypeForExtension","convertODataTypeIdToUsageTypeId","oDataTypeId","basenameStartIndex","listFormatter","formatterId","numberFormatter","factor"],"sources":["../src/locale/label.ts","../node_modules/valibot/dist/index.mjs","../src/locale/locale.schema.ts","../src/baseConfig.schema.ts","../src/schema.ts","../src/component/componentConfig.schema.ts","../src/component/index.ts","../src/component/dataView/index.ts","../src/component/module/moduleConfig.schema.ts","../src/component/module/connector/connectorConfig.schema.ts","../src/errors/index.ts","../src/component/module/connector/objectFetching.ts","../src/encoding/index.ts","../src/component/module/tool/toolConfig.schema.ts","../src/component/module/tool/delimitedText.ts","../src/component/module/tool/index.ts","../src/component/module/connector/objectParsing.ts","../src/component/module/connector/storeErrors.ts","../src/component/module/connector/storePath.ts","../src/component/module/connector/storeValues.ts","../src/component/module/connector/webLock.ts","../src/component/module/connector/tableSchema.ts","../src/component/module/connector/index.ts","../src/component/module/cookbook/cookbookConfig.schema.ts","../src/component/module/engine/index.ts","../src/component/module/presenter/presenterConfig.schema.ts","../src/component/module/presenter/index.ts","../src/locale/index.ts","../src/utilities/index.ts"],"sourcesContent":["// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype FlagId = 'es' | 'gb';\n\nexport type LocaleId = 'en' | 'es';\n\nexport type LocaleLabel = Partial<Record<LocaleId, string>>;\n\nexport type LocaleDescription = Partial<Record<LocaleId, string>>;\n\nexport type LocaleLabelMap = ReadonlyMap<string, string>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const DEFAULT_LOCALE_ID: LocaleId = 'en';\n\nexport const SUPPORTED_LANGUAGES: { id: LocaleId; flag: FlagId; label: string }[] = [\n { id: 'en', flag: 'gb', label: 'English' },\n { id: 'es', flag: 'es', label: 'Español' }\n];\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function createLabelMap(labels: Record<string, string>): LocaleLabelMap {\n return new Map(Object.entries(labels));\n}\n\nexport function resolveLabel(labels: LocaleLabelMap, localeId: string, fallbackLocaleId = DEFAULT_LOCALE_ID): string | undefined {\n const localizedLabel = labels.get(localeId);\n if (localizedLabel !== undefined) return localizedLabel;\n return fallbackLocaleId === localeId ? undefined : labels.get(fallbackLocaleId);\n}\n","//#region src/storages/globalConfig/globalConfig.ts\nlet store$4;\nconst DEFAULT_CONFIG = {\n\tlang: void 0,\n\tmessage: void 0,\n\tabortEarly: void 0,\n\tabortPipeEarly: void 0\n};\n/**\n* Sets the global configuration.\n*\n* @param config The configuration.\n*/\nfunction setGlobalConfig(config$1) {\n\tstore$4 = {\n\t\t...store$4,\n\t\t...config$1\n\t};\n}\n/**\n* Returns the global configuration.\n*\n* @param config The config to merge.\n*\n* @returns The configuration.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalConfig(config$1) {\n\tif (!config$1 && !store$4) return DEFAULT_CONFIG;\n\treturn {\n\t\tlang: config$1?.lang ?? store$4?.lang,\n\t\tmessage: config$1?.message,\n\t\tabortEarly: config$1?.abortEarly ?? store$4?.abortEarly,\n\t\tabortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly\n\t};\n}\n/**\n* Deletes the global configuration.\n*/\nfunction deleteGlobalConfig() {\n\tstore$4 = void 0;\n}\n\n//#endregion\n//#region src/storages/globalMessage/globalMessage.ts\nlet store$3;\n/**\n* Sets a global error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setGlobalMessage(message$1, lang) {\n\tif (!store$3) store$3 = /* @__PURE__ */ new Map();\n\tstore$3.set(lang, message$1);\n}\n/**\n* Returns a global error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalMessage(lang) {\n\treturn store$3?.get(lang);\n}\n/**\n* Deletes a global error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteGlobalMessage(lang) {\n\tstore$3?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/schemaMessage/schemaMessage.ts\nlet store$2;\n/**\n* Sets a schema error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSchemaMessage(message$1, lang) {\n\tif (!store$2) store$2 = /* @__PURE__ */ new Map();\n\tstore$2.set(lang, message$1);\n}\n/**\n* Returns a schema error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSchemaMessage(lang) {\n\treturn store$2?.get(lang);\n}\n/**\n* Deletes a schema error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteSchemaMessage(lang) {\n\tstore$2?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/specificMessage/specificMessage.ts\nlet store$1;\n/**\n* Sets a specific error message.\n*\n* @param reference The identifier reference.\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSpecificMessage(reference, message$1, lang) {\n\tif (!store$1) store$1 = /* @__PURE__ */ new Map();\n\tif (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map());\n\tstore$1.get(reference).set(lang, message$1);\n}\n/**\n* Returns a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSpecificMessage(reference, lang) {\n\treturn store$1?.get(reference)?.get(lang);\n}\n/**\n* Deletes a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*/\nfunction deleteSpecificMessage(reference, lang) {\n\tstore$1?.get(reference)?.delete(lang);\n}\n\n//#endregion\n//#region src/utils/_stringify/_stringify.ts\n/**\n* Stringifies an unknown input to a literal or type string.\n*\n* @param input The unknown input.\n*\n* @returns A literal or type string.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _stringify(input) {\n\tconst type = typeof input;\n\tif (type === \"string\") return `\"${input}\"`;\n\tif (type === \"number\" || type === \"bigint\" || type === \"boolean\") return `${input}`;\n\tif (type === \"object\" || type === \"function\") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? \"null\";\n\treturn type;\n}\n\n//#endregion\n//#region src/utils/_addIssue/_addIssue.ts\n/**\n* Adds an issue to the dataset.\n*\n* @param context The issue context.\n* @param label The issue label.\n* @param dataset The input dataset.\n* @param config The configuration.\n* @param other The optional props.\n*\n* @internal\n*/\nfunction _addIssue(context, label, dataset, config$1, other) {\n\tconst input = other && \"input\" in other ? other.input : dataset.value;\n\tconst expected = other?.expected ?? context.expects ?? null;\n\tconst received = other?.received ?? /* @__PURE__ */ _stringify(input);\n\tconst issue = {\n\t\tkind: context.kind,\n\t\ttype: context.type,\n\t\tinput,\n\t\texpected,\n\t\treceived,\n\t\tmessage: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : \"R\"}eceived ${received}`,\n\t\trequirement: context.requirement,\n\t\tpath: other?.path,\n\t\tissues: other?.issues,\n\t\tlang: config$1.lang,\n\t\tabortEarly: config$1.abortEarly,\n\t\tabortPipeEarly: config$1.abortPipeEarly\n\t};\n\tconst isSchema = context.kind === \"schema\";\n\tconst message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);\n\tif (message$1 !== void 0) issue.message = typeof message$1 === \"function\" ? message$1(issue) : message$1;\n\tif (isSchema) dataset.typed = false;\n\tif (dataset.issues) dataset.issues.push(issue);\n\telse dataset.issues = [issue];\n}\n\n//#endregion\n//#region src/utils/_cloneDataset/_cloneDataset.ts\n/**\n* Creates a shallow copy of a dataset.\n*\n* Hint: The `value` is copied by reference, but the `issues` array, its issues\n* and their `path` arrays are cloned to avoid reusing mutable dataset state\n* across multiple runs. Mutating a returned object or array value can\n* therefore affect later cache hits that reuse the same cached output.\n*\n* @param dataset The output dataset.\n*\n* @returns The copied output dataset.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _cloneDataset(dataset) {\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tvalue: dataset.value,\n\t\tissues: dataset.issues?.map((issue) => ({\n\t\t\t...issue,\n\t\t\tpath: issue.path && [...issue.path]\n\t\t}))\n\t};\n}\n\n//#endregion\n//#region src/utils/_formatCase/_formatCase.ts\n/**\n* Splits a string into lowercase words and rejoins them with the given\n* separator and capitalization rules.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries. Whether the first or subsequent words are\n* capitalized is controlled by `capFirst` and `capRest`.\n*\n* Hint: Implemented in a single pass that emits directly to the result\n* string to avoid an intermediate `string[]` allocation. ASCII chars are\n* classified via char codes to skip `.toLowerCase()` and `.toUpperCase()`\n* method calls in the common case.\n*\n* Hint: Digits are treated as a separate character class, so `item2Name`\n* yields `item2` and `name` rather than `item`, `2` and `name`.\n*\n* @param input The input string.\n* @param separator The string inserted between words.\n* @param capFirst Whether to capitalize the first word.\n* @param capRest Whether to capitalize subsequent words.\n*\n* @returns The formatted string.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _formatCase(input, separator, capFirst, capRest) {\n\tlet result = \"\";\n\tlet firstWord = true;\n\tlet start = 0;\n\tlet prev = 0;\n\tlet prevPrev = 0;\n\tconst flush = (end) => {\n\t\tif (end > start) {\n\t\t\tlet word = input.slice(start, end).toLowerCase();\n\t\t\tif (firstWord ? capFirst : capRest) {\n\t\t\t\tconst firstCode = word.charCodeAt(0);\n\t\t\t\tif (firstCode >= 97 && firstCode <= 122) word = String.fromCharCode(firstCode - 32) + word.slice(1);\n\t\t\t\telse {\n\t\t\t\t\tconst charLen = firstCode >= 55296 && firstCode <= 56319 ? 2 : 1;\n\t\t\t\t\tword = word.slice(0, charLen).toUpperCase() + word.slice(charLen);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult += firstWord ? word : separator + word;\n\t\t\tfirstWord = false;\n\t\t}\n\t};\n\tfor (let index = 0; index < input.length; index++) {\n\t\tconst code = input.charCodeAt(index);\n\t\tlet type;\n\t\tif (code === 32 || code === 9 || code === 10 || code === 11 || code === 12 || code === 13 || code === 45 || code === 95) {\n\t\t\tflush(index);\n\t\t\tstart = index + 1;\n\t\t\ttype = 0;\n\t\t} else if (code < 128) type = code >= 65 && code <= 90 ? 1 : code >= 97 && code <= 122 ? 2 : 3;\n\t\telse {\n\t\t\tconst char = input[index];\n\t\t\tconst charLower = char.toLowerCase();\n\t\t\ttype = charLower === char.toUpperCase() ? 3 : char === charLower ? 2 : 1;\n\t\t}\n\t\tif (type === 1 && (prev === 2 || prev === 3) && index > start) {\n\t\t\tflush(index);\n\t\t\tstart = index;\n\t\t} else if (type === 2 && prev === 1 && prevPrev === 1 && index - 1 > start) {\n\t\t\tflush(index - 1);\n\t\t\tstart = index - 1;\n\t\t}\n\t\tprevPrev = prev;\n\t\tprev = type;\n\t}\n\tflush(input.length);\n\treturn result;\n}\n\n//#endregion\n//#region src/utils/_getByteCount/_getByteCount.ts\nlet textEncoder;\n/**\n* Returns the byte count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The byte count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getByteCount(input) {\n\tif (!textEncoder) textEncoder = new TextEncoder();\n\treturn textEncoder.encode(input).length;\n}\n\n//#endregion\n//#region src/utils/_getCodePointCount/_getCodePointCount.ts\n/**\n* Returns the code point count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The code point count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getCodePointCount(input) {\n\tlet count = input.length;\n\tconst lengthMinus1 = input.length - 1;\n\tfor (let i = 0; i < lengthMinus1;) if (input.codePointAt(i) <= 65535) i++;\n\telse {\n\t\ti += 2;\n\t\tcount--;\n\t}\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_getGraphemeCount/_getGraphemeCount.ts\nlet segmenter;\n/**\n* Returns the grapheme count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The grapheme count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getGraphemeCount(input) {\n\tif (!segmenter) segmenter = new Intl.Segmenter();\n\tconst segments = segmenter.segment(input);\n\tlet count = 0;\n\tfor (const _ of segments) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_getLastMetadata/_getLastMetadata.ts\n/**\n* Returns the last top-level value of a given metadata type from a schema\n* using a breadth-first search that starts with the last item in the pipeline.\n*\n* @param schema The schema to search.\n* @param type The metadata type.\n*\n* @returns The value, if any.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getLastMetadata(schema, type) {\n\tif (\"pipe\" in schema) {\n\t\tconst nestedSchemas = [];\n\t\tfor (let index = schema.pipe.length - 1; index >= 0; index--) {\n\t\t\tconst item = schema.pipe[index];\n\t\t\tif (item.kind === \"schema\" && \"pipe\" in item) nestedSchemas.push(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === type) return item[type];\n\t\t}\n\t\tfor (const nestedSchema of nestedSchemas) {\n\t\t\tconst result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type);\n\t\t\tif (result !== void 0) return result;\n\t\t}\n\t}\n}\n\n//#endregion\n//#region src/utils/_getWordCount/_getWordCount.ts\nlet store;\n/**\n* Returns the word count of the input.\n*\n* @param locales The locales to be used.\n* @param input The input to be measured.\n*\n* @returns The word count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getWordCount(locales, input) {\n\tif (!store) store = /* @__PURE__ */ new Map();\n\tconst key = String(locales);\n\tlet segmenter$1 = store.get(key);\n\tif (!segmenter$1) {\n\t\tsegmenter$1 = new Intl.Segmenter(locales, { granularity: \"word\" });\n\t\tstore.set(key, segmenter$1);\n\t}\n\tconst segments = segmenter$1.segment(input);\n\tlet count = 0;\n\tfor (const segment of segments) if (segment.isWordLike) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.ts\n/**\n* Non-digit regex.\n*/\nconst NON_DIGIT_REGEX = /\\D/gu;\n/**\n* Checks whether a string with numbers corresponds to the luhn algorithm.\n*\n* @param input The input to be checked.\n*\n* @returns Whether input is valid.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isLuhnAlgo(input) {\n\tconst number$1 = input.replace(NON_DIGIT_REGEX, \"\");\n\tlet length$1 = number$1.length;\n\tlet bit = 1;\n\tlet sum = 0;\n\twhile (length$1) {\n\t\tconst value$1 = +number$1[--length$1];\n\t\tbit ^= 1;\n\t\tsum += bit ? [\n\t\t\t0,\n\t\t\t2,\n\t\t\t4,\n\t\t\t6,\n\t\t\t8,\n\t\t\t1,\n\t\t\t3,\n\t\t\t5,\n\t\t\t7,\n\t\t\t9\n\t\t][value$1] : value$1;\n\t}\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/utils/_isSameValueZero/_isSameValueZero.ts\n/**\n* Compares two values using the SameValueZero algorithm, which treats `NaN`\n* as equal to itself unlike `===`.\n*\n* @param value1 The first value.\n* @param value2 The second value.\n*\n* @returns Whether the values are equal.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isSameValueZero(value1, value2) {\n\treturn value1 === value2 || Number.isNaN(value1) && Number.isNaN(value2);\n}\n\n//#endregion\n//#region src/utils/_isValidObjectKey/_isValidObjectKey.ts\n/**\n* Disallows inherited object properties and prevents object prototype\n* pollution by disallowing certain keys.\n*\n* @param object The object to check.\n* @param key The key to check.\n*\n* @returns Whether the key is allowed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isValidObjectKey(object$1, key) {\n\treturn Object.prototype.hasOwnProperty.call(object$1, key) && key !== \"__proto__\" && key !== \"prototype\" && key !== \"constructor\";\n}\n\n//#endregion\n//#region src/utils/_isValueMatch/_isValueMatch.ts\n/**\n* Checks whether a value matches a value action requirement.\n*\n* @param requirement The value action requirement.\n* @param value The value to check.\n*\n* @returns Whether the value matches the requirement.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isValueMatch(requirement, value$1) {\n\treturn Number.isNaN(requirement) && Number.isNaN(value$1) || requirement <= value$1 && requirement >= value$1;\n}\n\n//#endregion\n//#region src/utils/_joinExpects/_joinExpects.ts\n/**\n* Joins multiple `expects` values with the given separator.\n*\n* @param values The `expects` values.\n* @param separator The separator.\n*\n* @returns The joined `expects` property.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _joinExpects(values$1, separator) {\n\tconst list = [...new Set(values$1)];\n\tif (list.length > 1) return `(${list.join(` ${separator} `)})`;\n\treturn list[0] ?? \"never\";\n}\n\n//#endregion\n//#region src/utils/_standardSchema/_standardSchema.ts\n/**\n* Eagerly creates and attaches the Standard Schema properties of a schema.\n*\n* Hint: The contextual `this` type includes the standard properties that are\n* attached before the schema is returned.\n*\n* @param schema The schema to attach standard properties to.\n*\n* @returns The schema with standard properties attached.\n*\n* @internal\n*/\nfunction _standardSchema(schema) {\n\tschema[\"~standard\"] = {\n\t\tversion: 1,\n\t\tvendor: \"valibot\",\n\t\tvalidate: (value$1) => schema[\"~run\"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig())\n\t};\n\treturn schema;\n}\n\n//#endregion\n//#region src/utils/entriesFromList/entriesFromList.ts\n/**\n* Creates an object entries definition from a list of keys and a schema.\n*\n* @param list A list of keys.\n* @param schema The schema of the keys.\n*\n* @returns The object entries.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromList(list, schema) {\n\tconst entries$1 = {};\n\tfor (const key of list) entries$1[key] = schema;\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/entriesFromObjects/entriesFromObjects.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromObjects(schemas) {\n\tconst entries$1 = {};\n\tfor (const schema of schemas) Object.assign(entries$1, schema.entries);\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/getDotPath/getDotPath.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDotPath(issue) {\n\tif (issue.path) {\n\t\tlet key = \"\";\n\t\tfor (const item of issue.path) if (typeof item.key === \"string\" || typeof item.key === \"number\") if (key) key += `.${item.key}`;\n\t\telse key += item.key;\n\t\telse return null;\n\t\treturn key;\n\t}\n\treturn null;\n}\n\n//#endregion\n//#region src/utils/isOfKind/isOfKind.ts\n/**\n* A generic type guard to check the kind of an object.\n*\n* @param kind The kind to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfKind(kind, object$1) {\n\treturn object$1.kind === kind;\n}\n\n//#endregion\n//#region src/utils/isOfType/isOfType.ts\n/**\n* A generic type guard to check the type of an object.\n*\n* @param type The type to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfType(type, object$1) {\n\treturn object$1.type === type;\n}\n\n//#endregion\n//#region src/utils/ValiError/ValiError.ts\n/**\n* A Valibot error with useful information.\n*/\nvar ValiError = class extends Error {\n\t/**\n\t* Creates a Valibot error with useful information.\n\t*\n\t* @param issues The error issues.\n\t*/\n\tconstructor(issues) {\n\t\tsuper(issues[0].message);\n\t\tthis.name = \"ValiError\";\n\t\tthis.issues = issues;\n\t}\n};\n\n//#endregion\n//#region src/utils/isValiError/isValiError.ts\n/**\n* A type guard to check if an error is a ValiError.\n*\n* @param error The error to check.\n*\n* @returns Whether its a ValiError.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isValiError(error) {\n\treturn error instanceof ValiError;\n}\n\n//#endregion\n//#region src/actions/args/args.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction args(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: args,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst argsDataset = this.schema[\"~run\"]({ value: args_ }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/args/argsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction argsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: argsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args$1) => {\n\t\t\t\tconst argsDataset = await schema[\"~run\"]({ value: args$1 }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/await/awaitAsync.ts\n/**\n* Creates an await transformation action.\n*\n* @returns An await action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction awaitAsync() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"await\",\n\t\treference: awaitAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/regex.ts\n/**\n* [Base64](https://en.wikipedia.org/wiki/Base64) regex.\n*/\nconst BASE64_REGEX = /^(?:[\\da-z+/]{4})*(?:[\\da-z+/]{2}==|[\\da-z+/]{3}=)?$/iu;\n/**\n* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex.\n*/\nconst BIC_REGEX = /^[A-Z]{6}(?!00)[\\dA-Z]{2}(?:[\\dA-Z]{3})?$/u;\n/**\n* [Cuid2](https://github.com/paralleldrive/cuid2) regex.\n*/\nconst CUID2_REGEX = /^[a-z][\\da-z]*$/u;\n/**\n* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex.\n*/\nconst DECIMAL_REGEX = /^[+-]?(?:\\d*\\.)?\\d+$/u;\n/**\n* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex.\n*/\nconst DIGITS_REGEX = /^\\d+$/u;\n/**\n* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n* ASCII-only validation. Internationalized domain names (IDNs) are not\n* supported, including Punycode-encoded labels.\n*/\nconst DOMAIN_REGEX = /^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$/u;\n/**\n* [Email address](https://en.wikipedia.org/wiki/Email_address) regex.\n*\n* Hint: We decided against the `i` flag to avoid matching non-ASCII characters.\n*/\nconst EMAIL_REGEX = /^[\\w+-]+(?:\\.[\\w+-]+)*@[\\da-zA-Z]+(?:[.-][\\da-zA-Z]+)*\\.[a-zA-Z]{2,}$/u;\n/**\n* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license).\n*\n* Hint: We decided against the newer `/^\\p{RGI_Emoji}+$/v` regex because it is\n* not supported in older runtimes and does not match all emoji.\n*/\nconst EMOJI_REGEX = /^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation}))*)+$/u;\n/**\n* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEXADECIMAL_REGEX = /^(?:0[hx])?[\\da-fA-F]+$/u;\n/**\n* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEX_COLOR_REGEX = /^#(?:[\\da-fA-F]{3,4}|[\\da-fA-F]{6}|[\\da-fA-F]{8})$/u;\n/**\n* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex.\n*/\nconst IMEI_REGEX = /^\\d{15}$|^\\d{2}-\\d{6}-\\d{6}-\\d$/u;\n/**\n* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex.\n*/\nconst IPV4_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$/u;\n/**\n* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex.\n*/\nconst IPV6_REGEX = /^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [IP](https://en.wikipedia.org/wiki/IP_address) regex.\n*/\nconst IP_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$|^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex.\n*/\nconst ISO_DATE_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex.\n*/\nconst ISO_DATE_TIME_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with seconds regex.\n*/\nconst ISO_DATE_TIME_SECOND_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex.\n*/\nconst ISO_TIME_REGEX = /^(?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex.\n*/\nconst ISO_TIME_SECOND_REGEX = /^(?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a\n* space as a date/time separator and an optional space before the UTC offset.\n*/\nconst ISO_TIMESTAMP_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}(?:\\.\\d{1,9})?(?:Z| ?[+-](?:0\\d|1\\d|2[0-3])(?::?[0-5]\\d)?)$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex.\n*/\nconst ISO_WEEK_REGEX = /^\\d{4}-W(?:0[1-9]|[1-4]\\d|5[0-3])$/u;\n/**\n* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1)\n* regex.\n*\n* Hint: Empty payload and signature segments are allowed because the\n* Base64URL-encoded representation of an empty octet sequence is an empty\n* string.\n*/\nconst JWS_COMPACT_REGEX = /^(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?$/u;\n/**\n* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex.\n*/\nconst ISRC_REGEX = /^(?:[A-Z]{2}[A-Z\\d]{3}\\d{7}|[A-Z]{2}-[A-Z\\d]{3}-\\d{2}-\\d{5})$/u;\n/**\n* [KSUID](https://github.com/segmentio/ksuid) regex.\n*/\nconst KSUID_REGEX = /^[a-zA-Z0-9]{27}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC48_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC64_REGEX = /^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [Nano ID](https://github.com/ai/nanoid) regex.\n*/\nconst NANO_ID_REGEX = /^[\\w-]+$/u;\n/**\n* [Octal](https://en.wikipedia.org/wiki/Octal) regex.\n*/\nconst OCTAL_REGEX = /^(?:0o)?[0-7]+$/u;\n/**\n* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex.\n*\n* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322.\n*/\nconst RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/**\n* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex.\n*/\nconst SLUG_REGEX = /^[\\da-z]+(?:[-_][\\da-z]+)*$/u;\n/**\n* [ULID](https://github.com/ulid/spec) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n* Hint: The first character is restricted to `[0-7]` because the 48-bit\n* timestamp cannot exceed 2^48-1, making the maximum valid ULID\n* `7ZZZZZZZZZZZZZZZZZZZZZZZZZ` in Crockford's Base32 encoding.\n*/\nconst ULID_REGEX = /^[0-7][\\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}$/u;\n/**\n* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex.\n*/\nconst UUID_REGEX = /^[\\da-f]{8}(?:-[\\da-f]{4}){3}-[\\da-f]{12}$/iu;\n\n//#endregion\n//#region src/actions/base64/base64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction base64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"base64\",\n\t\treference: base64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BASE64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Base64\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bic/bic.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bic(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bic\",\n\t\treference: bic,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BIC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"BIC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/brand/brand.ts\n/**\n* Creates a brand transformation action.\n*\n* @param name The brand name.\n*\n* @returns A brand action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction brand(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"brand\",\n\t\treference: brand,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bytes/bytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bytes\",\n\t\treference: bytes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 !== this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/check.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction check(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: check,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/checkAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: checkAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItems(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItems,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) for (let index = 0; index < dataset.value.length; index++) {\n\t\t\t\tconst item = dataset.value[index];\n\t\t\t\tif (!this.requirement(item, index, dataset.value)) _addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\tinput: item,\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\tvalue: item\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItemsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItemsAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItemsAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst requirementResults = await Promise.all(dataset.value.map(this.requirement));\n\t\t\t\tfor (let index = 0; index < dataset.value.length; index++) if (!requirementResults[index]) {\n\t\t\t\t\tconst item = dataset.value[index];\n\t\t\t\t\t_addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\t\tinput: item,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\t\tvalue: item\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/codePoints/codePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction codePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"code_points\",\n\t\treference: codePoints,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/creditCard/creditCard.ts\n/**\n* Credit card regex.\n*/\nconst CREDIT_CARD_REGEX = /^(?:\\d{13,19}|\\d{4}(?: \\d{3,6}){2,4}|\\d{4}(?:-\\d{3,6}){2,4})$/u;\n/**\n* Sanitize regex.\n*/\nconst SANITIZE_REGEX = /[- ]/gu;\n/**\n* Provider regex list.\n*/\nconst PROVIDER_REGEX_LIST = [\n\t/^3[47]\\d{13}$/u,\n\t/^3(?:0[0-5]|[68]\\d)\\d{11,13}$/u,\n\t/^6(?:011|5\\d{2})\\d{12,15}$/u,\n\t/^(?:2131|1800|35\\d{3})\\d{11}$/u,\n\t/^(?:5[1-5]\\d{2}|222\\d|22[3-9]\\d|2[3-6]\\d{2}|27[01]\\d|2720)\\d{12}$/u,\n\t/^(?:6[27]\\d{14,17}|81\\d{14,17})$/u,\n\t/^4\\d{12}(?:\\d{3,6})?$/u\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction creditCard(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"credit_card\",\n\t\treference: creditCard,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tlet sanitized;\n\t\t\treturn CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, \"\")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"credit card\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/cuid2/cuid2.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cuid2(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"cuid2\",\n\t\treference: cuid2,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: CUID2_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Cuid2\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/decimal/decimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction decimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"decimal\",\n\t\treference: decimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"decimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/description/description.ts\n/**\n* Creates a description metadata action.\n*\n* @param description_ The description text.\n*\n* @returns A description action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction description(description_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"description\",\n\t\treference: description,\n\t\tdescription: description_\n\t};\n}\n\n//#endregion\n//#region src/actions/digits/digits.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction digits(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"digits\",\n\t\treference: digits,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DIGITS_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"digits\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/domain/domain.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction domain(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"domain\",\n\t\treference: domain,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: DOMAIN_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"domain\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/email/email.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction email(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"email\",\n\t\treference: email,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/emoji/emoji.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction emoji(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"emoji\",\n\t\treference: emoji,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: EMOJI_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"emoji\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/empty/empty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction empty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"empty\",\n\t\treference: empty,\n\t\tasync: false,\n\t\texpects: \"0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > 0) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/endsWith/endsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction endsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ends_with\",\n\t\treference: endsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, \"end\", dataset, config$1, { received: `\"${dataset.value.slice(-this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/entries/entries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"entries\",\n\t\treference: entries,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count !== this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/everyItem/everyItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction everyItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"every_item\",\n\t\treference: everyItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/examples/examples.ts\n/**\n* Creates an examples metadata action.\n*\n* @param examples_ The examples.\n*\n* @returns An examples action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction examples(examples_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"examples\",\n\t\treference: examples,\n\t\texamples: examples_\n\t};\n}\n\n//#endregion\n//#region src/actions/excludes/excludes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction excludes(requirement, message$1) {\n\tconst received = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"excludes\",\n\t\treference: excludes,\n\t\tasync: false,\n\t\texpects: `!${received}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/filterItems/filterItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction filterItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"filter_items\",\n\t\treference: filterItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.filter(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/findItem/findItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction findItem(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"find_item\",\n\t\treference: findItem,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.find(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/finite/finite.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction finite(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"finite\",\n\t\treference: finite,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isFinite,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"finite\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/flavor/flavor.ts\n/**\n* Creates a flavor transformation action.\n*\n* @param name The flavor name.\n*\n* @returns A flavor action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction flavor(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"flavor\",\n\t\treference: flavor,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/graphemes/graphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction graphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"graphemes\",\n\t\treference: graphemes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/gtValue/gtValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction gtValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"gt_value\",\n\t\treference: gtValue,\n\t\tasync: false,\n\t\texpects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/guard/guard.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction guard(requirement, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"guard\",\n\t\treference: guard,\n\t\tasync: false,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) {\n\t\t\t\t_addIssue(this, \"input\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hash/hash.ts\n/**\n* Hash lengths object.\n*/\nconst HASH_LENGTHS = {\n\tmd4: 32,\n\tmd5: 32,\n\tsha1: 40,\n\tsha256: 64,\n\tsha384: 96,\n\tsha512: 128,\n\tripemd128: 32,\n\tripemd160: 40,\n\ttiger128: 32,\n\ttiger160: 40,\n\ttiger192: 48,\n\tcrc32: 8,\n\tcrc32b: 8,\n\tadler32: 8\n};\n/* @__NO_SIDE_EFFECTS__ */\nfunction hash(types, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hash\",\n\t\treference: hash,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RegExp(types.map((type) => `^[a-fA-F0-9]{${HASH_LENGTHS[type]}}$`).join(\"|\"), \"u\"),\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hash\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexadecimal/hexadecimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexadecimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hexadecimal\",\n\t\treference: hexadecimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEXADECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hexadecimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexColor/hexColor.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexColor(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hex_color\",\n\t\treference: hexColor,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEX_COLOR_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hex color\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/imei/imei.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction imei(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"imei\",\n\t\treference: imei,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\treturn IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"IMEI\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/includes/includes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction includes(requirement, message$1) {\n\tconst expects = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"includes\",\n\t\treference: includes,\n\t\tasync: false,\n\t\texpects,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received: `!${expects}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/integer/integer.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction integer(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"integer\",\n\t\treference: integer,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ip/ip.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ip(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ip\",\n\t\treference: ip,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IP\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv4/ipv4.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv4(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv4\",\n\t\treference: ipv4,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV4_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv4\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv6/ipv6.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv6(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv6\",\n\t\treference: ipv6,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV6_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv6\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn10.ts\n/**\n* [Validates an ISBN-10](https://en.wikipedia.org/wiki/ISBN#ISBN-10_check_digits).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-10, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn10(input) {\n\tconst digits$1 = input.split(\"\").map((c) => c === \"X\" ? 10 : parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 10; i++) sum += digits$1[i] * (10 - i);\n\treturn sum % 11 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn13.ts\n/**\n* [Validates an ISBN-13](https://en.wikipedia.org/wiki/ISBN#ISBN-13_check_digit_calculation).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-13, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn13(input) {\n\tconst digits$1 = input.split(\"\").map((c) => parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 13; i++) sum += digits$1[i] * (i % 2 === 0 ? 1 : 3);\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/isbn.ts\n/**\n* ISBN separator regex.\n*/\nconst ISBN_SEPARATOR_REGEX = /[- ]/gu;\n/**\n* ISBN-10 detection regex.\n*/\nconst ISBN_10_DETECTION_REGEX = /^\\d{9}[\\dX]$/u;\n/**\n* ISBN-13 detection regex.\n*/\nconst ISBN_13_DETECTION_REGEX = /^\\d{13}$/u;\n/* @__NO_SIDE_EFFECTS__ */\nfunction isbn(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isbn\",\n\t\treference: isbn,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tconst replacedInput = input.replace(ISBN_SEPARATOR_REGEX, \"\");\n\t\t\tif (ISBN_10_DETECTION_REGEX.test(replacedInput)) return _isIsbn10(replacedInput);\n\t\t\telse if (ISBN_13_DETECTION_REGEX.test(replacedInput)) return _isIsbn13(replacedInput);\n\t\t\treturn false;\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"ISBN\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isrc/isrc.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isrc(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isrc\",\n\t\treference: isrc,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISRC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ISRC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDate/isoDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDate(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date\",\n\t\treference: isoDate,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDateTime/isoDateTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDateTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date_time\",\n\t\treference: isoDateTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date-time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDateTimeSecond/isoDateTimeSecond.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDateTimeSecond(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date_time_second\",\n\t\treference: isoDateTimeSecond,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_TIME_SECOND_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date-time-second\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTime/isoTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time\",\n\t\treference: isoTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimeSecond/isoTimeSecond.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimeSecond(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time_second\",\n\t\treference: isoTimeSecond,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_SECOND_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time-second\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimestamp/isoTimestamp.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimestamp(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_timestamp\",\n\t\treference: isoTimestamp,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIMESTAMP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"timestamp\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoWeek/isoWeek.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoWeek(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_week\",\n\t\treference: isoWeek,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_WEEK_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"week\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/jwsCompact/jwsCompact.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction jwsCompact(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"jws_compact\",\n\t\treference: jwsCompact,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: JWS_COMPACT_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"JWS compact\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ksuid/ksuid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ksuid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ksuid\",\n\t\treference: ksuid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: KSUID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"KSUID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/length/length.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction length(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"length\",\n\t\treference: length,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ltValue/ltValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ltValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"lt_value\",\n\t\treference: ltValue,\n\t\tasync: false,\n\t\texpects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac/mac.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac\",\n\t\treference: mac,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac48/mac48.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac48(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac48\",\n\t\treference: mac48,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC48_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"48-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac64/mac64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac64\",\n\t\treference: mac64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"64-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mapItems/mapItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"map_items\",\n\t\treference: mapItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.map(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxBytes/maxBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_bytes\",\n\t\treference: maxBytes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 > this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxCodePoints/maxCodePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxCodePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_code_points\",\n\t\treference: maxCodePoints,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxEntries/maxEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_entries\",\n\t\treference: maxEntries,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count > this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxGraphemes/maxGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_graphemes\",\n\t\treference: maxGraphemes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxLength/maxLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_length\",\n\t\treference: maxLength,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxSize/maxSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_size\",\n\t\treference: maxSize,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxValue/maxValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_value\",\n\t\treference: maxValue,\n\t\tasync: false,\n\t\texpects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxWords/maxWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_words\",\n\t\treference: maxWords,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/metadata/metadata.ts\n/**\n* Creates a custom metadata action.\n*\n* @param metadata_ The metadata object.\n*\n* @returns A metadata action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction metadata(metadata_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"metadata\",\n\t\treference: metadata,\n\t\tmetadata: metadata_\n\t};\n}\n\n//#endregion\n//#region src/actions/mimeType/mimeType.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mimeType(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mime_type\",\n\t\treference: mimeType,\n\t\tasync: false,\n\t\texpects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `\"${option}\"`), \"|\"),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, \"MIME type\", dataset, config$1, { received: `\"${dataset.value.type}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minBytes/minBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_bytes\",\n\t\treference: minBytes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 < this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minCodePoints/minCodePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minCodePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_code_points\",\n\t\treference: minCodePoints,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minEntries/minEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_entries\",\n\t\treference: minEntries,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count < this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minGraphemes/minGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_graphemes\",\n\t\treference: minGraphemes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minLength/minLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_length\",\n\t\treference: minLength,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minSize/minSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_size\",\n\t\treference: minSize,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minValue/minValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_value\",\n\t\treference: minValue,\n\t\tasync: false,\n\t\texpects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minWords/minWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_words\",\n\t\treference: minWords,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/multipleOf/multipleOf.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction multipleOf(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"multiple_of\",\n\t\treference: multipleOf,\n\t\tasync: false,\n\t\texpects: `%${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, \"multiple\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nanoid/nanoid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nanoid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"nanoid\",\n\t\treference: nanoid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: NANO_ID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Nano ID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nonEmpty/nonEmpty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonEmpty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"non_empty\",\n\t\treference: nonEmpty,\n\t\tasync: false,\n\t\texpects: \"!0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === 0) _addIssue(this, \"length\", dataset, config$1, { received: \"0\" });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/normalize/normalize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction normalize(form) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"normalize\",\n\t\treference: normalize,\n\t\tasync: false,\n\t\tform,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.normalize(this.form);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notBytes/notBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_bytes\",\n\t\treference: notBytes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 === this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notCodePoints/notCodePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notCodePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_code_points\",\n\t\treference: notCodePoints,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notEntries/notEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_entries\",\n\t\treference: notEntries,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count === this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notGraphemes/notGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_graphemes\",\n\t\treference: notGraphemes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notLength/notLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_length\",\n\t\treference: notLength,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notSize/notSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_size\",\n\t\treference: notSize,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValue/notValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_value\",\n\t\treference: notValue,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && /* @__PURE__ */ _isValueMatch(this.requirement, dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValues/notValues.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValues(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_values\",\n\t\treference: notValues,\n\t\tasync: false,\n\t\texpects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && this.requirement.some((requirement$1) => /* @__PURE__ */ _isValueMatch(requirement$1, dataset.value))) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notWords/notWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_words\",\n\t\treference: notWords,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/octal/octal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction octal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"octal\",\n\t\treference: octal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: OCTAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"octal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseBoolean/parseBoolean.ts\nconst TRUTHY = [\n\ttrue,\n\t1,\n\t\"true\",\n\t\"1\",\n\t\"yes\",\n\t\"y\",\n\t\"on\",\n\t\"enabled\"\n];\nconst FALSY = [\n\tfalse,\n\t0,\n\t\"false\",\n\t\"0\",\n\t\"no\",\n\t\"n\",\n\t\"off\",\n\t\"disabled\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseBoolean(config$1, message$1) {\n\tconst normalize$1 = (v) => typeof v === \"string\" ? v.toLowerCase() : v;\n\tconst truthyRaw = config$1?.truthy ?? TRUTHY;\n\tconst falsyRaw = config$1?.falsy ?? FALSY;\n\tconst truthy = config$1?.truthy ? config$1.truthy.map(normalize$1) : TRUTHY;\n\tconst falsy = config$1?.falsy ? config$1.falsy.map(normalize$1) : FALSY;\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_boolean\",\n\t\treference: parseBoolean,\n\t\texpects: /* @__PURE__ */ _joinExpects([...truthyRaw, ...falsyRaw].map(_stringify), \"|\"),\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\tconst input = normalize$1(dataset.value);\n\t\t\tif (truthy.includes(input)) dataset.value = true;\n\t\t\telse if (falsy.includes(input)) dataset.value = false;\n\t\t\telse {\n\t\t\t\t_addIssue(this, \"boolean\", dataset, config$2);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseJson/parseJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_json\",\n\t\treference: parseJson,\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tdataset.value = JSON.parse(dataset.value, this.config?.reviver);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/utils/_isPartiallyTyped/_isPartiallyTyped.ts\n/**\n* Checks if a dataset is partially typed.\n*\n* @param dataset The dataset to check.\n* @param paths The paths to check.\n*\n* @returns Whether it is partially typed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isPartiallyTyped(dataset, paths) {\n\tif (dataset.issues) for (const path of paths) for (const issue of dataset.issues) {\n\t\tlet typed = false;\n\t\tconst bound = Math.min(path.length, issue.path?.length ?? 0);\n\t\tfor (let index = 0; index < bound; index++) if (path[index] !== issue.path[index].key && (path[index] !== \"$\" || issue.path[index].type !== \"array\")) {\n\t\t\ttyped = true;\n\t\t\tbreak;\n\t\t}\n\t\tif (!typed) return false;\n\t}\n\treturn true;\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheck.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheck(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheckAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheckAsync(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheck.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheck(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\taction({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheckAsync.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheckAsync(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tawait action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransform.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransform(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransform,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst output = action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransformAsync.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransformAsync(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransformAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst output = await action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/readonly/readonly.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction readonly() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"readonly\",\n\t\treference: readonly,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/reduceItems/reduceItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction reduceItems(operation, initial) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"reduce_items\",\n\t\treference: reduceItems,\n\t\tasync: false,\n\t\toperation,\n\t\tinitial,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.reduce(this.operation, this.initial);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/regex/regex.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction regex(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"regex\",\n\t\treference: regex,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"format\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returns.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returns(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returns,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst returnsDataset = this.schema[\"~run\"]({ value: func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returnsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returnsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returnsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args_) => {\n\t\t\t\tconst returnsDataset = await this.schema[\"~run\"]({ value: await func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rfcEmail/rfcEmail.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction rfcEmail(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"rfc_email\",\n\t\treference: rfcEmail,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RFC_EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/safeInteger/safeInteger.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeInteger(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"safe_integer\",\n\t\treference: safeInteger,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isSafeInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"safe integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/size/size.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction size(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"size\",\n\t\treference: size,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/slug/slug.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction slug(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"slug\",\n\t\treference: slug,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: SLUG_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"slug\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/someItem/someItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction someItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"some_item\",\n\t\treference: someItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/sortItems/sortItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction sortItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"sort_items\",\n\t\treference: sortItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.sort(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/startsWith/startsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction startsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"starts_with\",\n\t\treference: startsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, \"start\", dataset, config$1, { received: `\"${dataset.value.slice(0, this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/stringifyJson/stringifyJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction stringifyJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"stringify_json\",\n\t\treference: stringifyJson,\n\t\tmessage: message$1,\n\t\tconfig: config$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tconst output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space);\n\t\t\t\tif (output === void 0) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else dataset.value = output;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/title/title.ts\n/**\n* Creates a title metadata action.\n*\n* @param title_ The title text.\n*\n* @returns A title action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction title(title_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"title\",\n\t\treference: title,\n\t\ttitle: title_\n\t};\n}\n\n//#endregion\n//#region src/actions/toBigint/toBigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBigint(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_bigint\",\n\t\treference: toBigint,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = BigInt(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"bigint\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toBoolean/toBoolean.ts\n/**\n* Creates a to boolean transformation action.\n*\n* @returns A to boolean action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBoolean() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_boolean\",\n\t\treference: toBoolean,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = Boolean(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toCamelCase/toCamelCase.ts\n/**\n* Creates a to camel case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `parseUrlValue`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `item2Name`).\n*\n* @returns A to camel case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toCamelCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_camel_case\",\n\t\treference: toCamelCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"\", false, true);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toDate/toDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toDate(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_date\",\n\t\treference: toDate,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = new Date(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"date\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"date\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toKebabCase/toKebabCase.ts\n/**\n* Creates a to kebab case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `parse-url-value`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `item2-name`).\n*\n* @returns A to kebab case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toKebabCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_kebab_case\",\n\t\treference: toKebabCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"-\", false, false);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toLowerCase/toLowerCase.ts\n/**\n* Creates a to lower case transformation action.\n*\n* @returns A to lower case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toLowerCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_lower_case\",\n\t\treference: toLowerCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toLowerCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMaxValue/toMaxValue.ts\n/**\n* Creates a to max value transformation action.\n*\n* @param requirement The maximum value.\n*\n* @returns A to max value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMaxValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_max_value\",\n\t\treference: toMaxValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value > this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMinValue/toMinValue.ts\n/**\n* Creates a to min value transformation action.\n*\n* @param requirement The minimum value.\n*\n* @returns A to min value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMinValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_min_value\",\n\t\treference: toMinValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value < this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toNumber/toNumber.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toNumber(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_number\",\n\t\treference: toNumber,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = Number(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toPascalCase/toPascalCase.ts\n/**\n* Creates a to pascal case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `ParseUrlValue`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `Item2Name`).\n*\n* @returns A to pascal case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toPascalCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_pascal_case\",\n\t\treference: toPascalCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"\", true, true);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toSnakeCase/toSnakeCase.ts\n/**\n* Creates a to snake case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `parse_url_value`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `item2_name`).\n*\n* @returns A to snake case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toSnakeCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_snake_case\",\n\t\treference: toSnakeCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"_\", false, false);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toString/toString.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toString(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_string\",\n\t\treference: toString,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = String(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"string\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toUpperCase/toUpperCase.ts\n/**\n* Creates a to upper case transformation action.\n*\n* @returns A to upper case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toUpperCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_upper_case\",\n\t\treference: toUpperCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toUpperCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transform.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transform(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transform,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transformAsync.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transformAsync(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transformAsync,\n\t\tasync: true,\n\t\toperation,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trim/trim.ts\n/**\n* Creates a trim transformation action.\n*\n* @returns A trim action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trim() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim\",\n\t\treference: trim,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trim();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimEnd/trimEnd.ts\n/**\n* Creates a trim end transformation action.\n*\n* @returns A trim end action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimEnd() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_end\",\n\t\treference: trimEnd,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimEnd();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimStart/trimStart.ts\n/**\n* Creates a trim start transformation action.\n*\n* @returns A trim start action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimStart() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_start\",\n\t\treference: trimStart,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimStart();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ulid/ulid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ulid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ulid\",\n\t\treference: ulid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ULID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ULID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/url/url.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction url(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"url\",\n\t\treference: url,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\ttry {\n\t\t\t\tif (URL.canParse) return URL.canParse(input);\n\t\t\t\tnew URL(input);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"URL\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/uuid/uuid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction uuid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"uuid\",\n\t\treference: uuid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: UUID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"UUID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/value/value.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction value(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"value\",\n\t\treference: value,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !/* @__PURE__ */ _isValueMatch(this.requirement, dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/values/values.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction values(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"values\",\n\t\treference: values,\n\t\tasync: false,\n\t\texpects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.some((requirement$1) => /* @__PURE__ */ _isValueMatch(requirement$1, dataset.value))) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/words/words.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction words(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"words\",\n\t\treference: words,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/const.ts\nconst ABORT_EARLY_CONFIG = { abortEarly: true };\n\n//#endregion\n//#region src/methods/assert/assert.ts\n/**\n* Checks if the input matches the schema. As this is an assertion function, it\n* can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*/\nfunction assert(schema, input) {\n\tconst issues = schema[\"~run\"]({ value: input }, ABORT_EARLY_CONFIG).issues;\n\tif (issues) throw new ValiError(issues);\n}\n\n//#endregion\n//#region src/methods/cache/_LruCache.ts\n/**\n* Efficient LRU cache using Map iteration order.\n*/\nvar _LruCache = class {\n\tconstructor(config$1) {\n\t\tthis.refCount = 0;\n\t\tthis.maxSize = config$1?.maxSize ?? 1e3;\n\t\tthis.maxAge = config$1?.maxAge ?? Infinity;\n\t\tthis.hasMaxAge = isFinite(this.maxAge);\n\t}\n\t/**\n\t* Stringifies an unknown input to a cache key component.\n\t*\n\t* @param input The unknown input.\n\t*\n\t* @returns A cache key component.\n\t*/\n\tstringify(input) {\n\t\tconst type = typeof input;\n\t\tif (type === \"string\") return `\"${input}\"`;\n\t\tif (type === \"number\" || type === \"boolean\") return `${input}`;\n\t\tif (type === \"bigint\") return `${input}n`;\n\t\tif (type === \"object\" || type === \"function\") {\n\t\t\tif (input) {\n\t\t\t\tthis.refIds ?? (this.refIds = /* @__PURE__ */ new WeakMap());\n\t\t\t\tlet id = this.refIds.get(input);\n\t\t\t\tif (!id) {\n\t\t\t\t\tid = ++this.refCount;\n\t\t\t\t\tthis.refIds.set(input, id);\n\t\t\t\t}\n\t\t\t\treturn `#${id}`;\n\t\t\t}\n\t\t\treturn \"null\";\n\t\t}\n\t\treturn type;\n\t}\n\t/**\n\t* Creates a cache key from input and config.\n\t*\n\t* @param input The input value.\n\t* @param config The parse configuration.\n\t*\n\t* @returns The cache key.\n\t*/\n\tkey(input, config$1 = {}) {\n\t\treturn `${this.stringify(input)}|${this.stringify(config$1.lang)}|${this.stringify(config$1.message)}|${this.stringify(config$1.abortEarly)}|${this.stringify(config$1.abortPipeEarly)}`;\n\t}\n\t/**\n\t* Gets a value from the cache by key.\n\t*\n\t* @param key The cache key.\n\t*\n\t* @returns The cached value.\n\t*/\n\tget(key) {\n\t\tif (!this.store) return void 0;\n\t\tconst entry = this.store.get(key);\n\t\tif (!entry) return void 0;\n\t\tif (this.hasMaxAge && Date.now() - entry[1] > this.maxAge) {\n\t\t\tthis.store.delete(key);\n\t\t\treturn;\n\t\t}\n\t\tthis.store.delete(key);\n\t\tthis.store.set(key, entry);\n\t\treturn entry[0];\n\t}\n\t/**\n\t* Sets a value in the cache by key.\n\t*\n\t* @param key The cache key.\n\t* @param value The cached value.\n\t*/\n\tset(key, value$1) {\n\t\tthis.store ?? (this.store = /* @__PURE__ */ new Map());\n\t\tthis.store.delete(key);\n\t\tconst timestamp = this.hasMaxAge ? Date.now() : 0;\n\t\tthis.store.set(key, [value$1, timestamp]);\n\t\tif (this.store.size > this.maxSize) this.store.delete(this.store.keys().next().value);\n\t}\n\t/**\n\t* Clears all entries from the cache.\n\t*/\n\tclear() {\n\t\tthis.store?.clear();\n\t}\n};\n\n//#endregion\n//#region src/methods/cache/cache.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cache(schema, config$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\t\"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tlet outputDataset = this.cache.get(key);\n\t\t\tif (!outputDataset) this.cache.set(key, outputDataset = schema[\"~run\"](dataset, runConfig));\n\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/cache/cacheAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cacheAsync(schema, config$1) {\n\tlet activeRuns;\n\treturn _standardSchema({\n\t\t...schema,\n\t\tasync: true,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\tasync \"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tconst cached = this.cache.get(key);\n\t\t\tif (cached) return /* @__PURE__ */ _cloneDataset(cached);\n\t\t\tlet promise$1 = activeRuns?.get(key);\n\t\t\tif (!promise$1) {\n\t\t\t\tactiveRuns ?? (activeRuns = /* @__PURE__ */ new Map());\n\t\t\t\tpromise$1 = Promise.resolve(schema[\"~run\"](dataset, runConfig));\n\t\t\t\tactiveRuns.set(key, promise$1);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst outputDataset = await promise$1;\n\t\t\t\tthis.cache.set(key, outputDataset);\n\t\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t\t} finally {\n\t\t\t\tactiveRuns?.delete(key);\n\t\t\t}\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/config/config.ts\n/**\n* Changes the local configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param config The parse configuration.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction config(schema, config$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\t\"~run\"(dataset, config_) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config_,\n\t\t\t\t...config$1\n\t\t\t});\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/getFallback/getFallback.ts\n/**\n* Returns the fallback value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The output dataset if available.\n* @param config The config if available.\n*\n* @returns The fallback value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallback(schema, dataset, config$1) {\n\treturn typeof schema.fallback === \"function\" ? schema.fallback(dataset, config$1) : schema.fallback;\n}\n\n//#endregion\n//#region src/methods/fallback/fallback.ts\n/**\n* Returns a fallback value as output if the input does not match the schema.\n*\n* @param schema The schema to catch.\n* @param fallback The fallback value.\n*\n* @returns The passed schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallback(schema, fallback$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/fallback/fallbackAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallbackAsync(schema, fallback$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = await schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: await /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/flatten/flatten.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction flatten(issues) {\n\tconst flatErrors = {};\n\tfor (const issue of issues) if (issue.path) {\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) {\n\t\t\tif (!flatErrors.nested) flatErrors.nested = {};\n\t\t\tif (Object.prototype.hasOwnProperty.call(flatErrors.nested, dotPath)) flatErrors.nested[dotPath].push(issue.message);\n\t\t\telse flatErrors.nested[dotPath] = [issue.message];\n\t\t} else if (flatErrors.other) flatErrors.other.push(issue.message);\n\t\telse flatErrors.other = [issue.message];\n\t} else if (flatErrors.root) flatErrors.root.push(issue.message);\n\telse flatErrors.root = [issue.message];\n\treturn flatErrors;\n}\n\n//#endregion\n//#region src/methods/forward/forward.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forward(action, path) {\n\treturn {\n\t\t...action,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/forward/forwardAsync.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forwardAsync(action, path) {\n\treturn {\n\t\t...action,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = await action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/getDefault/getDefault.ts\n/**\n* Returns the default value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The input dataset if available.\n* @param config The config if available.\n*\n* @returns The default value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefault(schema, dataset, config$1) {\n\treturn typeof schema.default === \"function\" ? schema.default(dataset, config$1) : schema.default;\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaults.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefaults(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getDefaults);\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaultsAsync.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getDefaultsAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getDefaultsAsync));\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDescription/getDescription.ts\n/**\n* Returns the description of the schema.\n*\n* If multiple descriptions are defined, the last one of the highest level is\n* returned. If no description is defined, `undefined` is returned.\n*\n* @param schema The schema to get the description from.\n*\n* @returns The description, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDescription(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"description\");\n}\n\n//#endregion\n//#region src/methods/getExamples/getExamples.ts\n/**\n* Returns the examples of a schema.\n*\n* If multiple examples are defined, it concatenates them using depth-first\n* search. If no examples are defined, an empty array is returned.\n*\n* @param schema The schema to get the examples from.\n*\n* @returns The examples, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getExamples(schema) {\n\tconst examples$1 = [];\n\tfunction depthFirstCollect(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstCollect(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"examples\") for (const example of item.examples) examples$1.push(example);\n\t\t}\n\t}\n\tdepthFirstCollect(schema);\n\treturn examples$1;\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacks.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallbacks(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getFallbacks);\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacksAsync.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getFallbacksAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getFallbacksAsync));\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getMetadata/getMetadata.ts\n/**\n* Returns the metadata of a schema.\n*\n* If multiple metadata are defined, it shallowly merges them using depth-first\n* search. If no metadata is defined, an empty object is returned.\n*\n* @param schema Schema to get the metadata from.\n*\n* @returns The metadata, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getMetadata(schema) {\n\tconst result = {};\n\tfunction depthFirstMerge(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstMerge(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"metadata\") Object.assign(result, item.metadata);\n\t\t}\n\t}\n\tdepthFirstMerge(schema);\n\treturn result;\n}\n\n//#endregion\n//#region src/methods/getTitle/getTitle.ts\n/**\n* Returns the title of the schema.\n*\n* If multiple titles are defined, the last one of the highest level is\n* returned. If no title is defined, `undefined` is returned.\n*\n* @param schema The schema to get the title from.\n*\n* @returns The title, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getTitle(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"title\");\n}\n\n//#endregion\n//#region src/methods/is/is.ts\n/**\n* Checks if the input matches the schema. By using a type predicate, this\n* function can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*\n* @returns Whether the input matches the schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction is(schema, input) {\n\treturn !schema[\"~run\"]({ value: input }, ABORT_EARLY_CONFIG).issues;\n}\n\n//#endregion\n//#region src/schemas/any/any.ts\n/**\n* Creates an any schema.\n*\n* Hint: This schema function exists only for completeness and is not\n* recommended in practice. Instead, `unknown` should be used to accept\n* unknown data.\n*\n* @returns An any schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction any() {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"any\",\n\t\treference: any,\n\t\texpects: \"any\",\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/array/array.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction array(item, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: array,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titem,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.item[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/array/arrayAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction arrayAsync(item, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: arrayAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titem,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(input.map((value$1) => this.item[\"~run\"]({ value: value$1 }, config$1)));\n\t\t\t\tfor (let key = 0; key < itemDatasets.length; key++) {\n\t\t\t\t\tconst itemDataset = itemDatasets[key];\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/bigint/bigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bigint(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"bigint\",\n\t\treference: bigint,\n\t\texpects: \"bigint\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"bigint\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/blob/blob.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction blob(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"blob\",\n\t\treference: blob,\n\t\texpects: \"Blob\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Blob) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/boolean/boolean.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction boolean(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"boolean\",\n\t\treference: boolean,\n\t\texpects: \"boolean\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"boolean\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/custom/custom.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction custom(check$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: custom,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/custom/customAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction customAsync(check$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: customAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (await this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/date/date.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction date(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"date\",\n\t\treference: date,\n\t\texpects: \"Date\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/enum/enum.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction enum_(enum__, message$1) {\n\tconst options = [];\n\tfor (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== \"string\" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]);\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"enum\",\n\t\treference: enum_,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\tenum: enum__,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptional(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptional,\n\t\texpects: wrapped.expects,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptionalAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptionalAsync,\n\t\texpects: wrapped.expects,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/file/file.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction file(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"file\",\n\t\treference: file,\n\t\texpects: \"File\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof File) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/function/function.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction function_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"function\",\n\t\treference: function_,\n\t\texpects: \"Function\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"function\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/instance/instance.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction instance(class_, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"instance\",\n\t\treference: instance,\n\t\texpects: class_.name,\n\t\tasync: false,\n\t\tclass: class_,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof this.class) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/intersect/utils/_merge/_merge.ts\n/**\n* Merges two values into one single output.\n*\n* @param value1 First value.\n* @param value2 Second value.\n*\n* @returns The merge dataset.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _merge(value1, value2) {\n\tif (typeof value1 === typeof value2) {\n\t\tif (/* @__PURE__ */ _isSameValueZero(value1, value2) || value1 instanceof Date && value2 instanceof Date && /* @__PURE__ */ _isSameValueZero(+value1, +value2)) return { value: value1 };\n\t\tif (value1 && value2 && value1.constructor === Object && value2.constructor === Object) {\n\t\t\tconst nextValue = {\n\t\t\t\t...value1,\n\t\t\t\t...value2\n\t\t\t};\n\t\t\tfor (const key in value2) if (Object.prototype.hasOwnProperty.call(value1, key) && Object.prototype.hasOwnProperty.call(value2, key)) {\n\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[key], value2[key]);\n\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\tnextValue[key] = dataset.value;\n\t\t\t}\n\t\t\treturn { value: nextValue };\n\t\t}\n\t\tif (Array.isArray(value1) && Array.isArray(value2)) {\n\t\t\tif (value1.length === value2.length) {\n\t\t\t\tconst nextValue = [...value1];\n\t\t\t\tfor (let index = 0; index < value1.length; index++) {\n\t\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[index], value2[index]);\n\t\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\t\tnextValue[index] = dataset.value;\n\t\t\t\t}\n\t\t\t\treturn { value: nextValue };\n\t\t\t}\n\t\t}\n\t}\n\treturn { issue: true };\n}\n\n//#endregion\n//#region src/schemas/intersect/intersect.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersect(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersect,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tfor (const schema of this.options) {\n\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/intersect/intersectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersectAsync(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersectAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tconst optionDatasets = await Promise.all(this.options.map((schema) => schema[\"~run\"]({ value: input }, config$1)));\n\t\t\t\tfor (const optionDataset of optionDatasets) {\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/lazy/lazy.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazy(getter) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazy,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tgetter,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.getter(dataset.value)[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/lazy/lazyAsync.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazyAsync(getter) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazyAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tgetter,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn (await this.getter(dataset.value))[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/literal/literal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction literal(literal_, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"literal\",\n\t\treference: literal,\n\t\texpects: /* @__PURE__ */ _stringify(literal_),\n\t\tasync: false,\n\t\tliteral: literal_,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (/* @__PURE__ */ _isSameValueZero(dataset.value, this.literal)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObject(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObjectAsync(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTuple(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTupleAsync(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/map/map.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction map(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: map,\n\t\texpects: \"Map\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const [inputKey, inputValue] of input) {\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: inputKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/map/mapAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapAsync(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: mapAsync,\n\t\texpects: \"Map\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tconst datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([\n\t\t\t\t\tinputKey,\n\t\t\t\t\tinputValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: inputKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: inputValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nan/nan.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nan(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nan\",\n\t\treference: nan,\n\t\texpects: \"NaN\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (Number.isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/never/never.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction never(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"never\",\n\t\treference: never,\n\t\texpects: \"never\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\t_addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullable(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullable,\n\t\texpects: \"!null\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullableAsync(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullableAsync,\n\t\texpects: \"!null\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullish(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullish,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullishAsync(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullishAsync,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptional(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptional,\n\t\texpects: \"!undefined\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptionalAsync(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptionalAsync,\n\t\texpects: \"!undefined\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/null/null.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction null_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"null\",\n\t\treference: null_,\n\t\texpects: \"null\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullable/nullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullable(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullable,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullable/nullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullableAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullableAsync,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullish/nullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullish(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullish,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullish/nullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullishAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullishAsync,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/number/number.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction number(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"number\",\n\t\treference: number,\n\t\texpects: \"number\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"number\" && !isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/object/object.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction object(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: object,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/object/objectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectAsync(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: objectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRest(entries$1, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRest,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)) {\n\t\t\t\t\t\tconst valueDataset = this.rest[\"~run\"]({ value: input[key] }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRestAsync(entries$1, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRestAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)).map(async ([key, value$1]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue$1,\n\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t]))]);\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/optional/optional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optional(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optional,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/optional/optionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optionalAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optionalAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/picklist/picklist.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction picklist(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"picklist\",\n\t\treference: picklist,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/promise/promise.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction promise(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"promise\",\n\t\treference: promise,\n\t\texpects: \"Promise\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Promise) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/record/record.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction record(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: record,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {\n\t\t\t\t\tconst entryValue = input[entryKey];\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: entryKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: entryValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/record/recordAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction recordAsync(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: recordAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([\n\t\t\t\t\tentryKey,\n\t\t\t\t\tentryValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: entryKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: entryValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/set/set.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction set(value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: set,\n\t\texpects: \"Set\",\n\t\tasync: false,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const inputValue of input) {\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/set/setAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction setAsync(value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: setAsync,\n\t\texpects: \"Set\",\n\t\tasync: true,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tconst valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value[\"~run\"]({ value: inputValue }, config$1)]));\n\t\t\t\tfor (const [inputValue, valueDataset] of valueDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObject(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!Object.prototype.hasOwnProperty.call(this.entries, key)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObjectAsync(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!Object.prototype.hasOwnProperty.call(this.entries, key)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTuple(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTupleAsync(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/string/string.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction string(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"string\",\n\t\treference: string,\n\t\texpects: \"string\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"string\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/symbol/symbol.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction symbol(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"symbol\",\n\t\treference: symbol,\n\t\texpects: \"symbol\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"symbol\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tuple/tuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tuple(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tuple/tupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleAsync(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRest(items, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRest,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.rest[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRestAsync(items, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRestAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(input.slice(this.items.length).map(async (value$1, key) => {\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey + this.items.length,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}))]);\n\t\t\t\tfor (const [key, value$1, itemDataset] of normalDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/undefined/undefined.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefined_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"undefined\",\n\t\treference: undefined_,\n\t\texpects: \"undefined\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedable(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedable,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedableAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedableAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/union/utils/_subIssues/_subIssues.ts\n/**\n* Returns the sub issues of the provided datasets for the union issue.\n*\n* @param datasets The datasets.\n*\n* @returns The sub issues.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _subIssues(datasets) {\n\tlet issues;\n\tif (datasets) for (const dataset of datasets) if (issues) for (const issue of dataset.issues) issues.push(issue);\n\telse issues = dataset.issues;\n\treturn issues;\n}\n\n//#endregion\n//#region src/schemas/union/union.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction union(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: union,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/union/unionAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction unionAsync(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: unionAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/unknown/unknown.ts\n/**\n* Creates a unknown schema.\n*\n* @returns A unknown schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unknown() {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"unknown\",\n\t\treference: unknown,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/variant/variant.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variant(key, options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variant,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, ABORT_EARLY_CONFIG).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tparseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/variant/variantAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variantAsync(key, options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variantAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = async (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") await parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? (await discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, ABORT_EARLY_CONFIG)).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tawait parseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/void/void.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction void_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"void\",\n\t\treference: void_,\n\t\texpects: \"void\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/keyof/keyof.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction keyof(schema, message$1) {\n\treturn /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1);\n}\n\n//#endregion\n//#region src/methods/message/message.ts\n/**\n* Changes the local message configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param message_ The error message.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction message(schema, message_) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config$1,\n\t\t\t\tmessage: message_\n\t\t\t});\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/omit/omit.ts\n/**\n* Creates a modified copy of an object schema that does not contain the\n* selected entries.\n*\n* @param schema The schema to omit from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction omit(schema, keys) {\n\tconst entries$1 = { ...schema.entries };\n\tfor (const key of keys) delete entries$1[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/parse/parse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nfunction parse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parse/parseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nasync function parseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parser/parser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parser(schema, config$1) {\n\tconst func = (input) => parse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/parser/parserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parserAsync(schema, config$1) {\n\tconst func = (input) => parseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/partial/partial.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partial(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/partial/partialAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialAsync(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/pick/pick.ts\n/**\n* Creates a modified copy of an object schema that contains only the selected\n* entries.\n*\n* @param schema The schema to pick from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction pick(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key of keys) entries$1[key] = schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/pipe/pipe.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipe(...pipe$1) {\n\treturn _standardSchema({\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/pipe/pipeAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipeAsync(...pipe$1) {\n\treturn _standardSchema({\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/required/required.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction required(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/required/requiredAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction requiredAsync(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function safeParseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParser(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParserAsync(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/summarize/summarize.ts\n/**\n* Summarize the error messages of issues in a pretty-printable multi-line string.\n*\n* @param issues The list of issues.\n*\n* @returns A summary of the issues.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction summarize(issues) {\n\tlet summary = \"\";\n\tfor (const issue of issues) {\n\t\tif (summary) summary += \"\\n\";\n\t\tsummary += `× ${issue.message}`;\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) summary += `\\n → at ${dotPath}`;\n\t}\n\treturn summary;\n}\n\n//#endregion\n//#region src/methods/unwrap/unwrap.ts\n/**\n* Unwraps the wrapped schema.\n*\n* @param schema The schema to be unwrapped.\n*\n* @returns The unwrapped schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unwrap(schema) {\n\treturn schema.wrapped;\n}\n\n//#endregion\nexport { BASE64_REGEX, BIC_REGEX, CUID2_REGEX, DECIMAL_REGEX, DIGITS_REGEX, DOMAIN_REGEX, EMAIL_REGEX, EMOJI_REGEX, HEXADECIMAL_REGEX, HEX_COLOR_REGEX, IMEI_REGEX, IPV4_REGEX, IPV6_REGEX, IP_REGEX, ISO_DATE_REGEX, ISO_DATE_TIME_REGEX, ISO_DATE_TIME_SECOND_REGEX, ISO_TIMESTAMP_REGEX, ISO_TIME_REGEX, ISO_TIME_SECOND_REGEX, ISO_WEEK_REGEX, ISRC_REGEX, JWS_COMPACT_REGEX, KSUID_REGEX, MAC48_REGEX, MAC64_REGEX, MAC_REGEX, NANO_ID_REGEX, OCTAL_REGEX, RFC_EMAIL_REGEX, SLUG_REGEX, ULID_REGEX, UUID_REGEX, ValiError, _addIssue, _cloneDataset, _formatCase, _getByteCount, _getCodePointCount, _getGraphemeCount, _getLastMetadata, _getWordCount, _isLuhnAlgo, _isSameValueZero, _isValidObjectKey, _isValueMatch, _joinExpects, _standardSchema, _stringify, any, args, argsAsync, array, arrayAsync, assert, awaitAsync, base64, bic, bigint, blob, boolean, brand, bytes, cache, cacheAsync, check, checkAsync, checkItems, checkItemsAsync, codePoints, config, creditCard, cuid2, custom, customAsync, date, decimal, deleteGlobalConfig, deleteGlobalMessage, deleteSchemaMessage, deleteSpecificMessage, description, digits, domain, email, emoji, empty, endsWith, entries, entriesFromList, entriesFromObjects, enum_ as enum, enum_, everyItem, exactOptional, exactOptionalAsync, examples, excludes, fallback, fallbackAsync, file, filterItems, findItem, finite, flatten, flavor, forward, forwardAsync, function_ as function, function_, getDefault, getDefaults, getDefaultsAsync, getDescription, getDotPath, getExamples, getFallback, getFallbacks, getFallbacksAsync, getGlobalConfig, getGlobalMessage, getMetadata, getSchemaMessage, getSpecificMessage, getTitle, graphemes, gtValue, guard, hash, hexColor, hexadecimal, imei, includes, instance, integer, intersect, intersectAsync, ip, ipv4, ipv6, is, isOfKind, isOfType, isValiError, isbn, isoDate, isoDateTime, isoDateTimeSecond, isoTime, isoTimeSecond, isoTimestamp, isoWeek, isrc, jwsCompact, keyof, ksuid, lazy, lazyAsync, length, literal, looseObject, looseObjectAsync, looseTuple, looseTupleAsync, ltValue, mac, mac48, mac64, map, mapAsync, mapItems, maxBytes, maxCodePoints, maxEntries, maxGraphemes, maxLength, maxSize, maxValue, maxWords, message, metadata, mimeType, minBytes, minCodePoints, minEntries, minGraphemes, minLength, minSize, minValue, minWords, multipleOf, nan, nanoid, never, nonEmpty, nonNullable, nonNullableAsync, nonNullish, nonNullishAsync, nonOptional, nonOptionalAsync, normalize, notBytes, notCodePoints, notEntries, notGraphemes, notLength, notSize, notValue, notValues, notWords, null_ as null, null_, nullable, nullableAsync, nullish, nullishAsync, number, object, objectAsync, objectWithRest, objectWithRestAsync, octal, omit, optional, optionalAsync, parse, parseAsync, parseBoolean, parseJson, parser, parserAsync, partial, partialAsync, partialCheck, partialCheckAsync, pick, picklist, pipe, pipeAsync, promise, rawCheck, rawCheckAsync, rawTransform, rawTransformAsync, readonly, record, recordAsync, reduceItems, regex, required, requiredAsync, returns, returnsAsync, rfcEmail, safeInteger, safeParse, safeParseAsync, safeParser, safeParserAsync, set, setAsync, setGlobalConfig, setGlobalMessage, setSchemaMessage, setSpecificMessage, size, slug, someItem, sortItems, startsWith, strictObject, strictObjectAsync, strictTuple, strictTupleAsync, string, stringifyJson, summarize, symbol, title, toBigint, toBoolean, toCamelCase, toDate, toKebabCase, toLowerCase, toMaxValue, toMinValue, toNumber, toPascalCase, toSnakeCase, toString, toUpperCase, transform, transformAsync, trim, trimEnd, trimStart, tuple, tupleAsync, tupleWithRest, tupleWithRestAsync, ulid, undefined_ as undefined, undefined_, undefinedable, undefinedableAsync, union, unionAsync, unknown, unwrap, url, uuid, value, values, variant, variantAsync, void_ as void, void_, words };","// ── External Dependencies & Registrations\nimport { optional, strictObject, string } from 'valibot';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const localeLabelSchema = strictObject({ en: string(), es: string() });\n\nexport const partialLocaleDescriptionSchema = strictObject({ en: optional(string()), es: optional(string()) });\n\nexport const partialLocaleLabelSchema = strictObject({ en: optional(string()), es: optional(string()) });\n","// ── External Dependencies & Registrations\nimport { nullable, string } from 'valibot';\n\n// ── DPUse Framework\nimport { partialLocaleDescriptionSchema, partialLocaleLabelSchema } from './locale/locale.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const baseConfigSchema = {\n id: string(),\n label: partialLocaleLabelSchema,\n description: partialLocaleDescriptionSchema,\n icon: nullable(string()),\n iconDark: nullable(string())\n};\n","// ── External Dependencies & Registrations\nimport { literal, type LiteralSchema, union, type UnionSchema } from 'valibot';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype LiteralUnionSchema<T extends readonly string[]> = UnionSchema<{ [K in keyof T]: LiteralSchema<T[K], undefined> }, undefined>;\n\nexport const literalUnion = <const T extends readonly string[]>(values: T): LiteralUnionSchema<T> => {\n return union(values.map((value) => literal(value))) as LiteralUnionSchema<T>;\n};\n","// ── External Dependencies & Registrations\nimport { nullable, number, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { baseConfigSchema } from '@/baseConfig.schema';\nimport { literalUnion } from '@/schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Type Identifier\nexport const componentTypeIdSchema = literalUnion([\n 'app',\n 'connector',\n 'connectorConnection',\n 'context',\n 'contextArea',\n 'contextModel',\n 'contextModelDimension',\n 'contextModelDimensionHierarchy',\n 'contextModelEntity',\n 'contextModelEntityDataItem',\n 'contextModelEntityEvent',\n 'contextModelEntityPrimaryMeasure',\n 'contextModelSecondaryMeasure',\n 'cookbook',\n 'cookbookRecipe',\n 'dataView',\n 'engine',\n 'eventQuery',\n 'presenter',\n 'presenterPresentation',\n 'tool'\n]);\n\n// ── Status\nexport const componentStatusColorIdSchema = literalUnion(['danger', 'success', 'warning']);\n\nconst componentStatusIdSchema = literalUnion(['alpha', 'beta', 'releaseCandidate', 'generalAvailability']);\n\nexport const componentStatusConfigSchema = strictObject({\n color: componentStatusColorIdSchema,\n label: string()\n});\n\n// ── Base\n// Common base structure components and component references.\nexport const componentBaseConfigSchema = {\n ...baseConfigSchema,\n typeId: componentTypeIdSchema\n};\n\n// ── Reference\n// Common structure for referencing all components.\nexport const componentReferenceConfigSchema = strictObject({\n ...componentBaseConfigSchema,\n order: number(),\n path: string()\n});\n\n// ── Configuration\n// Core fields present in all components.\nexport const componentCoreFieldsConfig = {\n ...componentBaseConfigSchema,\n firstCreatedAt: nullable(number()),\n lastUpdatedAt: nullable(number()),\n status: nullable(componentStatusConfigSchema),\n statusId: nullable(componentStatusIdSchema)\n};\n\nexport const componentInstanceConfigSchema = strictObject({\n ...componentCoreFieldsConfig\n});\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\nimport { strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentBaseConfigSchema } from './componentConfig.schema';\nimport { DEFAULT_LOCALE_ID } from '@/locale/label';\nimport type { componentInstanceConfigSchema, componentReferenceConfigSchema, componentStatusColorIdSchema, componentStatusConfigSchema } from './componentConfig.schema';\nimport type { LocaleId, LocaleLabel } from '@/locale/label';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { componentInstanceConfigSchema } from './componentConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface Component {\n readonly config: ComponentInstanceConfig;\n}\n\n// ── Base\nexport type ComponentBaseConfig = InferOutput<ReturnType<typeof strictObject<typeof componentBaseConfigSchema>>>;\n\n// ── Instance Configuration\nexport type ComponentInstanceConfig = InferOutput<typeof componentInstanceConfigSchema>;\n\n// ── Reference Configuration\nexport type ComponentReferenceConfig = InferOutput<typeof componentReferenceConfigSchema>;\n\n// ── Status\ntype ComponentStatus = InferOutput<typeof componentStatusConfigSchema>;\ntype ComponentStatusColorId = InferOutput<typeof componentStatusColorIdSchema>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Status\nconst COMPONENT_STATUS_CONFIGS: { id: string; color: ComponentStatusColorId; labels: LocaleLabel }[] = [\n { id: 'alpha', color: 'danger', labels: { en: 'alpha', es: 'alfa' } },\n { id: 'beta', color: 'warning', labels: { en: 'beta', es: 'beta' } },\n { id: 'releaseCandidate', color: 'success', labels: { en: 'release-candidate', es: 'candidato-de-lanzamiento' } },\n { id: 'generalAvailability', color: 'success', labels: { en: '', es: '' } }\n];\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Status\nexport function getComponentStatus(id: string, localeId: LocaleId = DEFAULT_LOCALE_ID): ComponentStatus {\n const componentStatus = COMPONENT_STATUS_CONFIGS.find((componentStatus) => componentStatus.id === id);\n if (componentStatus) {\n const label = componentStatus.labels[localeId] ?? componentStatus.labels[DEFAULT_LOCALE_ID] ?? componentStatus.id;\n return { color: componentStatus.color, label };\n }\n return { color: 'danger', label: id };\n}\n","// ── External Dependencies & Registrations\nimport type { FileTypeResult } from 'file-type';\n\n// ── DPUse Framework\nimport type { ComponentInstanceConfig } from '@/component';\nimport type { StructurePath } from '@/component/module/tool';\nimport type { ConnectionNodeConfig, ObjectColumnConfig } from '@/component/connection';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Data View\nexport interface DataViewConfig extends ComponentInstanceConfig {\n typeId: 'dataView';\n connectionId: string;\n connectionNodeConfig: ConnectionNodeConfig | undefined;\n readingConfig: ReadingConfig | undefined;\n readingChoiceConfig?: ReadingChoiceConfig | undefined; // The user's own choices. Kept apart, so the detected reading is never overwritten.\n sampleConfig: SampleConfig | undefined;\n contentAuditConfig: ContentAuditConfig | undefined; // Replaced whole by each audit.\n columnChoiceConfigs: ColumnChoiceConfigs | undefined; // Kept across audits, so the user's choices survive a new one.\n storeConnectorId: string | undefined;\n}\n\n// ── Reading ─ How an item is read. Detected when the item is first opened, then reused by every audit and load.\nexport interface ReadingConfig {\n dataFormatId: DataFormatId;\n dataFormatSourceId?: DataFormatSourceId | undefined; // Undefined when the item has no format, such as an empty file or a PDF.\n encodingConfidenceLevel: number | undefined; // From 0 to 1. Undefined when the encoding was assumed, not detected.\n encodingId: string | undefined;\n encodingSourceId?: EncodingSourceId | undefined; // Undefined when no text was decoded, such as from an empty or binary file.\n fileType: FileTypeResult | undefined;\n hasHeaders: boolean | undefined;\n isDeclared?: boolean | undefined; // The item's source says how it is read, such as a resource file beside it, so the user has nothing to choose.\n parserId: string | undefined; // The config id of the parser tool. Undefined when no tool parsed the item, such as an empty file or a format no tool reads yet.\n recordDelimiterId: RecordDelimiterId | undefined;\n structurePath?: StructurePath | undefined; // The part of a nested item read as the table, as its parser suggests. Undefined when there is none, or several to choose from.\n valueDelimiterId: ValueDelimiterId | undefined;\n\n // TODO: following are under review.\n // commentMarkId: string | undefined;\n // commentMarkOtherCharSeq: string | undefined;\n // linesToSkipAtStart: number | undefined;\n // quoteEscapeChar: string | undefined;\n // quoteMarkId: string | undefined;\n // quoteMarkOtherCharSeq: string | undefined;\n // recordDelimiterOtherCharSeq: string | undefined;\n // skipEmptyLines: boolean | undefined;\n // skipLinesWithEmptyValues: boolean | undefined;\n // skipLinesWithErrors: boolean | undefined;\n // valueDelimiterOtherCharSeq: string | undefined;\n // valueTrimMethodId: 'both' | 'left' | 'right' | 'none' | undefined;\n}\n\nexport type DataFormatId = (typeof DATA_FORMAT_CONFIGS)[number]['id'];\n\n// What the user chose in place of what was detected. Anything that decodes or parses the item uses a choice when there\n// is one, and otherwise the detected reading.\nexport interface ReadingChoiceConfig {\n dataFormatId: DataFormatId | undefined;\n encodingId: string | undefined;\n hasHeaders: boolean | undefined;\n parserId: string | undefined;\n structurePath?: StructurePath | undefined;\n valueDelimiterId: ValueDelimiterId | undefined;\n}\n\n// How the data format was found.\nexport type DataFormatSourceId =\n | 'fileContent' // The file was recognised from its content, such as Parquet, Excel or XML.\n | 'jsonSyntax' // The text is JSON or JSON Lines.\n | 'mimeType' // Markdown, recognised from the MIME type.\n | 'extension' // Markdown, recognised from the file extension.\n | 'default'; // None of the above, so the text is treated as delimited text.\n\n// How the encoding was found.\nexport type EncodingSourceId =\n | 'byteOrderMark' // The file starts with a byte order mark.\n | 'xmlDeclaration' // The XML declaration names it.\n | 'xmlDefault' // XML with no byte order mark or declaration, which XML defines as UTF-8.\n | 'utf8Validation' // The text is valid UTF-8 and contains characters other than ASCII.\n | 'detection' // jschardet's best guess that the browser can decode.\n | 'asciiAssumption' // The text is all ASCII, so UTF-8 is assumed.\n | 'fallback'; // jschardet found no encoding that the browser can decode, so UTF-8 is used.\nexport type RecordDelimiterId = '\\n' | '\\r' | '\\r\\n'; // TODO: We need a special value here (NOT '') for when a user specified delimiter is implemented.\nexport type ValueDelimiterId = (typeof VALUE_DELIMITER_CONFIGS)[number]['id'] | ''; // TODO: We need a special value here (NOT '') for when a user specified delimiter is implemented.\n\n// ── Sample Configuration ─ The start of an item, as text and parsed records. Small enough to hold in memory and save\n// with the data view, unlike the whole item an audit reads.\n// The sample is read with the user's choices, so it records what it was actually read with. An audit or a load reads the\n// item the same way.\nexport interface SampleConfig {\n dataFormatId?: DataFormatId | undefined; // The format the sample was read in: the chosen one, or the detected one when nothing was chosen.\n decodedEncodingId?: string | undefined; // The encoding the text was decoded with: the chosen one, or the detected one when nothing was chosen. UTF-8 when that encoding cannot be decoded.\n hasHeaders?: boolean | undefined; // Whether the sample's first record is a header record.\n issues: SampleIssue[]; // Problems found while sampling, such as an empty file or parse errors.\n parsedRecords: ParsedRecord[];\n parserId?: string | undefined; // The config id of the parser tool that read the sample. Undefined when no tool read it.\n recordDelimiterId?: RecordDelimiterId | undefined;\n replacementCharacterCount?: number | undefined; // How many '\\uFFFD' characters decoding put in place of bytes the decoded encoding cannot read. Undefined when no text was decoded.\n size: number | undefined; // The bytes the text and records came from. Undefined when the item is not read as bytes.\n structurePath?: StructurePath | undefined; // The part of a nested item the records were read from. Undefined when none has been chosen, so there are no records.\n text: string | undefined;\n valueDelimiterId?: ValueDelimiterId | undefined;\n}\n\n// A problem found while sampling an item. The sample still holds whatever was read, so the item can be shown and read\n// again with other settings.\nexport interface SampleIssue {\n columnNumber?: number | undefined; // Where on 'lineNumber' the problem is, counting characters from 1. Undefined when the parser does not say.\n endLineNumber: number | undefined; // Set when the issue spans several lines, such as an unclosed quote that runs on to where the parser stopped.\n fieldNumber: number | undefined; // The value's position in its record, counting from 1.\n id: string; // The parser's own code, such as 'CSV_QUOTE_NOT_CLOSED', or 'empty' for an item with no content.\n lineNumber: number | undefined; // The first line it covers, counting from 1. Undefined when the parser does not say.\n message: string; // The parser's own English text. The app shows its own wording for the ids it knows.\n recordNumber: number | undefined; // Counting from 1, with any header record included.\n severityId: SampleIssueSeverityId;\n value: string | undefined; // The value or character at fault, shortened when long.\n}\n\nexport type SampleIssueSeverityId = 'error' | 'info' | 'warning'; // Only an error stops the item being read as data.\n\n// A record's values as written, spaces kept. A value with nothing written, such as ',,', is null, and an empty quoted\n// value, '\"\"', is an empty string. Quotes are not kept otherwise, because nothing else depends on them.\nexport type ParsedRecord = (string | null)[];\n\n// ── Content Audit ─ What an audit found in an item. The first audit covers only the preview read when the item is\n// opened, and later audits read further from its start. A count is undefined when the audit did not take it, as in the\n// first audit, which does not count lines.\nexport interface ContentAuditConfig {\n asAt: number; // When the audit started, in milliseconds since the epoch.\n byteCount: number; // 0 when the item is not read as bytes.\n columns: ColumnAuditConfig[];\n commentLineCount: number | undefined;\n emptyLineCount: number | undefined;\n invalidFieldLengthCount: number | undefined; // Records with a different number of values from the first record.\n duration: number; // In milliseconds.\n isComplete: boolean; // Whether the audit reached the end of the item.\n lineCount: number | undefined;\n recordCount: number; // Data records only, without the header record.\n sourceWaitDuration: number | undefined; // The part of 'duration' spent waiting for the item's bytes, such as while it downloads. Undefined when the bytes were fetched before the audit started.\n parseDuration?: number | undefined; // The part of 'duration' the parser spent reading records, without the wait for bytes. Undefined when the audit did not time it.\n columnAuditDuration?: number | undefined; // The part of 'duration' spent auditing the parsed records' values. Undefined when the audit did not time it.\n}\n\n// ── Column Reading ─ How a column's values are read from an item's text, which a load needs as well as the column\n// itself. A database or an API gives typed values, so it has none of these.\nexport interface ColumnReadingConfig extends ObjectColumnConfig {\n derivedFromColumnIndex?: number | undefined; // For a column the audit adds, such as a number column's units: the column it is worked out from, by position.\n decimalSeparatorId: DecimalSeparatorId | undefined; // How a number such as 1,234 is read in this column. Undefined when it holds no separator.\n dateOrderId: DateOrderId | undefined; // How a date such as 03/04/2024 is read in this column. Undefined when no date in it could be read either way.\n nullWordsAreEmpty?: boolean | undefined; // For a text column: whether null words such as 'NA' or 'NULL' load as no value. They are text unless the user chooses otherwise, because 'NA' can be data.\n blankValuesAreEmpty?: boolean | undefined; // For a text column: whether blank values, such as '\"\"' or only spaces, load as no value. They load as written unless the user chooses otherwise, as databases keep them.\n}\n\nexport type DateOrderId = 'dayFirst' | 'monthFirst';\n\nexport type DecimalSeparatorId = (typeof DECIMAL_SEPARATOR_IDS)[number];\n\n// ── Column Audit ─ What an audit found in a column's values, with how the column is read.\nexport interface ColumnAuditConfig extends ColumnReadingConfig {\n // ── Inference ─ Each value read one by one, before the column settles its type.\n inferenceCounts: Record<string, number>;\n leadingInferenceCounts: Record<string, number>;\n isTypeDeclared?: boolean | undefined; // The item's source states the column's type, so it was taken rather than inferred.\n\n // ── Reading ─ What the values show about how they are read.\n numericReadings?: Partial<Record<DecimalSeparatorId, NumericReadingConfig>> | undefined; // A column's figures for each decimal separator, for a column whose values could be read with either.\n dateReadings?: Partial<Record<DateOrderId, DateReadingConfig>> | undefined; // A column's figures for each date order, for a column whose dates could be read either way.\n formatIssueIds: FormatIssueId[] | undefined; // Why the column's format is unclear. Empty when a number, date or yes/no column is clear. Undefined when the format was not checked.\n nullWordValueCount?: number | undefined; // For a text column: how many of its values are null words, counted as values.\n unitId?: string | undefined; // For a column of numbers: the one unit its values are written with, a currency as written, such as 'USD' or '€', or '%'. A value written without it is taken to have it. Undefined when no value has a unit, or when the values have more than one, which a unit column then holds for each.\n isCoded?: boolean | undefined; // The column holds codes, not free text or measurements: few distinct values for its many records, or values all written to one shape, such as 'AB-1234'.\n\n // ── Counts\n validValueCount: number | undefined;\n invalidValueCount: number | undefined; // Values that do not fit the column's type, and so are stored as null.\n // ── Missing Values ─ Blank, empty and null values together. Each loads as no value.\n blankValueCount: number | undefined; // Values written as an empty quoted value, or as only spaces.\n emptyValueCount: number | undefined; // Nothing between the delimiters, or a record too short to reach the column.\n nullValueCount: number | undefined; // Null words such as 'NULL', and 'NA' and the like where they are read as no value.\n hasMissingValues: boolean | undefined; // Any blank, empty or null value. Invalid values are counted apart.\n\n // ── Formats\n validFormats: Record<string, number>; // How many values that fit the column's type have each format, e.g. 'yyyy-MM-dd', '9,999.9' or 'Yes/No'.\n validMinSize: number | undefined;\n validMaxSize: number | undefined;\n validMinWholeDigits: number | undefined;\n validMaxWholeDigits: number | undefined;\n validMinDecimals: number | undefined;\n validMaxDecimals: number | undefined;\n\n // ── Distinct Values\n validCountsAreEstimated?: boolean | undefined; // The distinct count and the frequent values' counts are estimates, because the column holds more distinct values than are counted exactly. The counts of the lowest and highest values are still exact.\n validDistinctValueCount: number | undefined; // Distinct values that fit the column's type. An estimate when 'validCountsAreEstimated' is set, because counting them all would hold the whole column in memory. Undefined when it cannot be told.\n validSingleValueCount?: number | undefined; // Distinct values that fit the column's type and are seen only once. Undefined when there are too many values to count.\n invalidDistinctValueCount?: number | undefined; // Distinct values that do not fit the column's type. Undefined when there are too many values to count.\n validIsUnique: boolean | undefined; // Undefined when there are too many values to tell.\n\n // ── Frequent Values\n validFrequentValues: Record<string, number> | undefined; // The most frequent values that fit the column's type, with how often each is seen. A number or date is counted by its value, however it is written. Estimates when 'validCountsAreEstimated' is set. Empty when none stands out.\n validLeastFrequentValues?: Record<string, number> | undefined; // The least frequent values that fit the column's type and are not already in 'validFrequentValues', with how often each is seen. Empty when there are too many to count.\n invalidFrequentValues?: Record<string, number> | undefined; // The most frequent values that do not fit the column's type, with how often each is seen. Empty when there are too many to count.\n invalidValues: Record<string, string>; // A sample of the values that do not fit, each with the type it was read as.\n\n // ── Range\n validLowestValues?: [string, number][] | undefined; // The lowest values that fit the column's type, lowest first, with how often each is seen. Exact however many values there are.\n validHighestValues?: [string, number][] | undefined; // The highest values that fit the column's type, highest first, with how often each is seen. Exact however many values there are.\n validValueBins?: ValueBinConfig[] | undefined; // For a column of numbers, dates or times: how many of its valid values fall in each of up to 20 ranges with round edges, such as tens or months, lowest first. One range that starts and ends at the value when every value is the same.\n validValueBinScaleId?: ValueBinScaleId | undefined; // How 'validValueBins' divides the values. Absent for ranges of equal width.\n validValueBinOutliers?: ValueBinOutlierConfig | undefined; // When a few values lie far beyond the rest, 'validValueBins' covers only about the middle 98% of them, and this counts the values beyond its first and last ranges. Undefined when the ranges cover every value.\n}\n\n// ── Declared Columns ─ The columns an item's source states, as a database or an application does, or a schema file\n// beside a data file. An audit then takes each column's type rather than inferring it, and only counts the values.\nexport interface DeclaredColumnConfig {\n name: string; // As the item's header record writes it.\n label: string | undefined; // Shown in place of the name. Undefined to show the name.\n dataTypeId: Exclude<DataTypeId, 'unknown'> | undefined; // Undefined when the source does not say, so the type is inferred.\n dataSubtypeId: DataSubtypeId | undefined; // Undefined to take the type's 'defaultSubtypeId'.\n}\n\n// ── Declared Reading ─ How the source says its items are read, so it is not detected and the user has nothing to\n// choose. A value left undefined is detected as usual.\nexport interface DeclaredReadingConfig {\n dataFormatId: DataFormatId;\n encodingId: string | undefined;\n hasHeaders: boolean | undefined;\n valueDelimiterId: ValueDelimiterId | undefined;\n}\n\n// What a column of numbers measures when read with one decimal separator. Choosing the other separator swaps these in.\nexport type NumericReadingConfig = Pick<ColumnAuditConfig, 'dataSubtypeId' | 'validMaxDecimals' | 'validMaxWholeDigits' | 'validMinDecimals' | 'validMinWholeDigits'> &\n ValueDistributionConfig;\n\n// What a column of dates measures when read in one date order. Choosing the other order swaps these in.\nexport type DateReadingConfig = Pick<ColumnAuditConfig, 'validFormats'> & ValueDistributionConfig;\n\n// How many of each valid value a column holds, and how they spread from lowest to highest. A number or date can read\n// differently with each decimal separator or date order, such as '1,5' as 1.5 or 15, so each reading has its own.\nexport type ValueDistributionConfig = Pick<\n ColumnAuditConfig,\n | 'validCountsAreEstimated'\n | 'validDistinctValueCount'\n | 'validFrequentValues'\n | 'validHighestValues'\n | 'validIsUnique'\n | 'validLeastFrequentValues'\n | 'validLowestValues'\n | 'validSingleValueCount'\n | 'validValueBinOutliers'\n | 'validValueBinScaleId'\n | 'validValueBins'\n>;\n\n// Why a column's format is unclear. The decimal separator or date order is unproven when no value shows it, weakly\n// proven when the values that show it are outnumbered by the values it decides, and mixed when values show both ways.\nexport type FormatIssueId =\n | 'booleanPairMixed'\n | 'currencyMixed'\n | 'dateOrderMixed'\n | 'dateOrderUnproven'\n | 'decimalSeparatorMixed'\n | 'decimalSeparatorUnproven'\n | 'decimalSeparatorWeaklyProven'\n | 'percentageMixed'\n | 'scientificNotationMixed';\n\n// One range of a column's values, and how many valid values fall in it.\nexport interface ValueBinConfig {\n count: number;\n lowerValue: string; // Where the range starts: a number, or an ISO date, date-time or time.\n upperValue: string; // Where the range ends, and the next one starts.\n}\n\n// 'linear' ─ Ranges of equal width, such as tens or months.\n// 'log' ─ One range for each power of ten, or a few together, mirrored for negative numbers, with zero as a range of its\n// own. Used when the values span so many powers of ten that ranges of equal width would put nearly all of them in one.\nexport type ValueBinScaleId = 'linear' | 'log';\n\n// The values beyond a column's ranges, when its ranges leave out a few far from the rest.\nexport interface ValueBinOutlierConfig {\n aboveCount: number; // Values at or above the end of the last range.\n belowCount: number; // Values below the start of the first range.\n isEstimated: boolean; // The counts, the ranges' own included, are estimated from a sample, because the column held more values than the sample keeps.\n}\n\n// ── Column Choices ─ What the user chose for each column, keyed by the column's position as a string. Anything not\n// chosen keeps what the audit detected.\nexport type ColumnChoiceConfigs = Partial<Record<string, ColumnChoiceConfig>>;\n\n// A type chosen without a subtype keeps the detected subtype when it matches the detected type, and otherwise takes the\n// type's 'defaultSubtypeId'.\nexport interface ColumnChoiceConfig {\n dataTypeId: DataTypeId | undefined;\n dataSubtypeId: DataSubtypeId | undefined;\n dateOrderId: DateOrderId | undefined; // For a date column whose values fit more than one order, such as 03/04/2024.\n decimalSeparatorId: DecimalSeparatorId | undefined; // For a number column whose values fit either separator, such as 1,234.\n isIgnored: boolean | undefined; // Whether the column is left out when the data view loads.\n nullWordsAreEmpty: boolean | undefined; // For a text column: whether words such as 'NA' mean no value.\n blankValuesAreEmpty?: boolean | undefined; // For a text column: whether blank values, such as '\"\"' or only spaces, mean no value.\n}\n\n// ── Data Types\n\ntype DataTypeConfig = (typeof DATA_TYPE_CONFIGS)[number];\nexport type DataTypeId = DataTypeConfig['id'];\nexport type DataSubtypeId = DataTypeConfig['subtypeIds'][number];\nexport type NumericSubtypeId = Extract<DataTypeConfig, { id: 'numeric' }>['subtypeIds'][number];\nexport type StringSubtypeId = Extract<DataTypeConfig, { id: 'string' }>['subtypeIds'][number];\nexport type TemporalSubtypeId = Extract<DataTypeConfig, { id: 'temporal' }>['subtypeIds'][number];\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Data Formats ─ What DPUse can do with each format. 'supportId' says whether the format is read as data now, is\n// planned, or is not data. 'isText' means it can be shown as text, and 'isTable' as a table of records. 'isStructured'\n// means it nests, so the user chooses the part read as the table, and it has no value delimiter.\nexport const DATA_FORMAT_CONFIGS = [\n { id: 'arrow', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'avro', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'dtv', isStructured: false, isTable: true, isText: true, supportId: 'supported' }, // Delimited text, such as CSV or TSV.\n { id: 'json', isStructured: true, isTable: true, isText: true, supportId: 'supported' },\n { id: 'jsonl', isStructured: true, isTable: true, isText: true, supportId: 'supported' },\n { id: 'markdown', isStructured: false, isTable: false, isText: true, supportId: 'unsupported' }, // A document, so it is shown as text but not read as data.\n { id: 'ods', isStructured: true, isTable: false, isText: false, supportId: 'planned' },\n { id: 'parquet', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'sav', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'sqlite', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'xlsx', isStructured: true, isTable: false, isText: false, supportId: 'planned' },\n { id: 'xml', isStructured: true, isTable: false, isText: false, supportId: 'planned' },\n { id: 'unknown', isStructured: false, isTable: false, isText: false, supportId: 'unsupported' }\n] as const satisfies readonly { id: string; isStructured: boolean; isTable: boolean; isText: boolean; supportId: 'planned' | 'supported' | 'unsupported' }[];\n\n// ── Value Delimiters ─ In the order detection tries them, most common first. The unit separator is invisible, so its\n// id names it and 'character' holds the character itself. The record separator is not one of them: it ends a record,\n// so it belongs with the record delimiters.\nexport const VALUE_DELIMITER_CONFIGS = [\n { id: ',', character: ',' },\n { id: ';', character: ';' },\n { id: '\\t', character: '\\t' },\n { id: '|', character: '|' },\n { id: ' ', character: ' ' },\n { id: ':', character: ':' },\n { id: '_', character: '_' },\n { id: '!', character: '!' },\n { id: '0x1F', character: '\\u{1F}' }\n] as const satisfies readonly { character: string; id: string }[];\n\n// ── Data Types ─ In the order the type list shows them. A type stored without a subtype is read as its\n// 'defaultSubtypeId'. 'unknown' is only ever detected, so it cannot be chosen.\nexport const DATA_TYPE_CONFIGS = [\n {\n id: 'string',\n defaultSubtypeId: 'plain',\n isChoosable: true,\n subtypeIds: [\n 'plain',\n 'email',\n 'url',\n 'uuid',\n 'ulid',\n 'ipv4',\n 'ipv6',\n 'ipRange',\n 'macAddress',\n 'iban',\n 'isbn',\n 'paymentCard',\n 'hexColor',\n 'json',\n 'countryCode',\n 'currencyCode',\n 'languageCode'\n ]\n },\n { id: 'numeric', defaultSubtypeId: 'integer', isChoosable: true, subtypeIds: ['integer', 'decimal', 'bigint'] },\n { id: 'temporal', defaultSubtypeId: 'dateTime', isChoosable: true, subtypeIds: ['date', 'dateTime', 'time'] },\n { id: 'boolean', defaultSubtypeId: undefined, isChoosable: true, subtypeIds: [] },\n { id: 'unknown', defaultSubtypeId: undefined, isChoosable: false, subtypeIds: [] }\n] as const satisfies readonly { defaultSubtypeId: string | undefined; id: string; isChoosable: boolean; subtypeIds: readonly string[] }[];\n\n// ── Decimal Separators\nexport const DECIMAL_SEPARATOR_IDS = [',', '.'] as const;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The '' placeholder has no character, so it comes back unchanged.\nexport function getValueDelimiterCharacter(valueDelimiterId: ValueDelimiterId): string {\n return VALUE_DELIMITER_CONFIGS.find(({ id }) => id === valueDelimiterId)?.character ?? valueDelimiterId;\n}\n","// ── External Dependencies & Registrations\nimport { nullable, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { componentCoreFieldsConfig } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Type Identifier\n// We include 'app' here so we can monitor updates in 'dpuse-app'.\nexport const moduleTypeIdSchema = literalUnion(['app', 'engine', 'connector', 'cookbook', 'presenter', 'tool']);\n\n// ── Configuration\nexport const moduleConfigCoreFields = {\n ...componentCoreFieldsConfig,\n vendorAccountURL: nullable(string()),\n vendorDocumentationURL: nullable(string()),\n vendorHomeURL: nullable(string()),\n version: string()\n};\n\nexport const moduleConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: moduleTypeIdSchema\n});\n","/**\n * Defines the configuration metadata for a connector. Used for validation\n * of connector manifests and capability discovery at runtime.\n */\n\n// ── External Dependencies & Registrations\nimport { array, boolean, literal, nullable, number, optional, record, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { literalUnion } from '@/schema';\nimport { localeLabelSchema } from '@/locale/locale.schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Action Name\n// Names of the operations a connector may implement.\nexport const connectorActionNameSchema = literalUnion([\n 'auditObjectContent',\n 'closeStore',\n 'createObject',\n 'describeConnection',\n 'dropObject',\n 'findObject',\n 'getInfo',\n 'getObject',\n 'getReadableStream',\n 'getRecord',\n 'indexObjectStructure',\n 'listNodes',\n 'listObjectStructureEntries',\n 'loadObjectRecords',\n 'openStore',\n 'previewObject',\n 'queryRecords',\n 'removeRecords',\n 'retrieveRecords',\n 'upsertRecords'\n]);\n\n// ── Category Configuration\nconst connectorCategoryIdSchema = literalUnion(['application', 'curatedDataset', 'database', 'fileStore']); // Category identifiers used for grouping and filtering connectors.\n\nexport const connectorCategoryConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Item Type\n// The kind of item a connector's connections hold, which names the item a data view is built from.\nexport const connectorItemTypeIdSchema = literalUnion(['apiEndpoint', 'file', 'table']);\n\nexport const connectorItemTypeConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Usage\nexport const connectorUsageIdSchema = literalUnion(['bidirectional', 'destination', 'source', 'unknown']); // Connector data pipeline usage identifiers.\n\nexport const connectorUsageConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Implementation\nconst connectorAuthMethodIdSchema = literalUnion(['apiKey', 'disabled', 'oAuth2', 'none']); // Authentication method identifiers supported by a connector implementation.\n\nconst connectorImplementationParametersSchema = record(string(), string()); // One set of implementation parameters, keyed by name.\n\n// A connector implementation variant. A single connector may expose multiple implementations differing by auth method, limits, or vendor-specific behavior.\nconst connectorImplementationSchema = strictObject({\n authMethodId: connectorAuthMethodIdSchema,\n activeConnectionCount: optional(number()),\n canDescribe: optional(boolean()),\n id: optional(string()),\n label: optional(localeLabelSchema),\n maxConnectionCount: nullable(number()),\n params: optional(array(connectorImplementationParametersSchema))\n});\n\n// ── Configuration\nexport const connectorConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('connector'),\n actionNames: array(connectorActionNameSchema),\n category: nullable(connectorCategoryConfigSchema),\n categoryId: connectorCategoryIdSchema,\n implementations: record(string(), connectorImplementationSchema),\n itemTypeId: connectorItemTypeIdSchema,\n usage: nullable(connectorUsageConfigSchema),\n usageId: nullable(connectorUsageIdSchema)\n});\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The native 'Error' options, plus the details that travel with a DPUse error.\nexport interface DPUseErrorOptions extends ErrorOptions {\n data?: Record<string, unknown> | undefined;\n}\n\n// Serializable representation of an error; used for transporting errors across api and worker boundaries\nexport interface SerialisedError {\n data: Record<string, unknown> | undefined;\n locator: string; // Where the error is raised, e.g. 'dpuse-engine.engine.loadConnector'. See the DPUse 'CLAUDE.md'.\n message: string; // Human-readable error message\n name: string; // Error class or type name\n stack: string | undefined; // Stack trace if available\n}\n\n// ── Constants ───────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DPUSE_ERROR_NAMES = new Set(['APIError', 'AppError', 'ConnectorError', 'DPUseError', 'EngineError', 'FetchError']);\nconst RESPONSE_ERROR_BODY_LIMIT = 2048;\n\n// Redaction — serialised errors are shown in the browser and stored in Axiom, so secrets and email addresses are masked\n// first. Best effort: it catches the common shapes, not every possible secret.\nconst REDACTED = '[REDACTED]';\nconst REDACTION_MAX_DEPTH = 10; // Deeper 'data' is replaced whole rather than walked.\nconst SECRET_KEY_PATTERN = /api[-_]?key|authori[sz]ation|cookie|credential|passw(?:or)?d|private[-_]?key|secret|token/i; // A 'data' field whose name matches has its whole value masked.\n// Each pattern is anchored to the start of a word, so it runs in linear time even over a long response body.\nconst SECRET_TEXT_PATTERNS: [RegExp, (match: string, ...groups: string[]) => string][] = [\n [/\\b(Bearer|Basic) +[\\w.~+/=-]+/gi, (_match, scheme) => `${scheme} ${REDACTED}`], // Authorisation header values.\n // Any 'name: value' or 'name=value' pair, in JSON, query strings, form bodies or headers; masked when the name looks\n // secret. A bare 'Basic' or 'Bearer' value is the scheme left by the pattern above, whose token is already masked.\n [\n /(?<![\\w-])([\\w-]+)([\"']?[ \\t]*[:=][ \\t]*[\"']?)([^\\s\"'&,;}?#]+)/g,\n (match, name, separator, value) => (SECRET_KEY_PATTERN.test(name) && !/^(?:Basic|Bearer)$/i.test(value) ? `${name}${separator}${REDACTED}` : match)\n ],\n [/\\beyJ[\\w-]+\\.[\\w-]+\\.[\\w-]*/g, () => REDACTED], // JSON web tokens.\n [/\\b(?:sk-|xaat-|xapt-|sl\\.)[\\w-]{16,}/g, () => REDACTED], // Known token prefixes: OpenAI, Anthropic, Axiom, Dropbox.\n [/(?<![\\w.+-])[\\w.+-]+@[\\w-]+\\.[\\w.-]+/g, () => REDACTED] // Email addresses.\n];\n\n// ── Errors ───────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Base class for all DPUse errors; includes a locator for the error; never thrown directly\nclass DPUseError extends Error {\n readonly data: Record<string, unknown> | undefined;\n readonly locator: string; // Where the error is raised, e.g. 'dpuse-engine.engine.loadConnector'. See the DPUse 'CLAUDE.md'.\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, options);\n this.name = 'DPUseError';\n this.data = options?.data;\n this.locator = locator;\n }\n}\n\n// Thrown when an app (studio/assistant) error occurs\nexport class AppError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'AppError';\n }\n}\n\n// Thrown when an API request fails\nexport class APIError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'APIError';\n }\n}\n\n// Thrown when an engine request fails\nexport class EngineError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'EngineError';\n }\n}\n\n// Thrown when an connector operation fails; will always be wrapped in an engine error\nexport class ConnectorError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'ConnectorError';\n }\n}\n\n// Thrown when an HTTP request fails; may include a sanitized portion of the response body for diagnostic purposes\nexport class FetchError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'FetchError';\n }\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Builds a fetch error from an HTTP response; includes a text copy of the response body\nexport async function buildFetchError(response: { status: number; statusText: string; text: () => Promise<string> }, message: string, locator: string): Promise<FetchError> {\n const responseStatusStuff = ` - ${response.statusText}`;\n const fetchMessage = `${message} Response status '${String(response.status)}${response.statusText ? responseStatusStuff : ''}' received.`;\n let bodyText: string;\n try {\n bodyText = await response.text();\n } catch (error) {\n const normalised = normalizeToError(error);\n bodyText = `<body unavailable: ${normalised.message}>`;\n }\n return new FetchError(fetchMessage, locator, { data: { body: sanitizeResponseErrorBody(bodyText) } });\n}\n\n// Concatenates serialized error messages into a single string\nexport function concatenateSerialisedErrorMessages(serialisedErrors: SerialisedError[]): string {\n return serialisedErrors.map((serialisedError) => serialisedError.message).join(' ');\n}\n\n// Ignore best-effort cleanup errors to keep teardown noise-free\nexport function ignoreErrors(action: () => void): void {\n try {\n action();\n } catch {\n // Intentionally ignore errors\n }\n}\n\n// Normalizes an unknown thrown value into an error\nexport function normalizeToError(value: unknown): Error {\n if (value instanceof Error) return value;\n if (typeof value === 'string') return new Error(value);\n if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint') return new Error(String(value));\n if (typeof value === 'symbol') return new Error(value.description ?? 'Unknown error');\n if (typeof value === 'object') {\n try {\n return new Error(JSON.stringify(value));\n } catch {\n return new Error('Unknown error');\n }\n }\n return new Error('Unknown error');\n}\n\n// Serializes an error and its cause chain into a array of serialised error objects;\n// errors are ordered from outermost to root cause;\n// cycles in the cause chain are safely ignored;\n// messages are normalized to end with punctuation;\n// secrets and email addresses in messages, stacks and data are redacted\nexport function serialiseError(error?: unknown): SerialisedError[] {\n const seenCauses = new Set();\n const serialisedErrors: SerialisedError[] = [];\n let cause: Error | null = normalizeToError(error);\n while (cause != null && !seenCauses.has(cause)) {\n seenCauses.add(cause);\n const [serialisedError, nextCause] = serialiseSingleError(cause);\n // Redact before punctuating: a redacted email address swallows a full stop that follows it.\n const redactedError = redactSerialisedError(serialisedError);\n if (!/(?:\\.{3}|[.!?])$/.test(redactedError.message)) redactedError.message += '.';\n serialisedErrors.push(redactedError);\n cause = nextCause;\n }\n return serialisedErrors;\n}\n\n// Unserialises an array of serialised error objects back into an error with a cause chain;\n// reconstructs the appropriate error class based on serialized properties;\n// chains errors from outermost to root cause using the `cause` option;\n// returns a placeholder error if the input array is empty\nexport function unserialiseError(serialisedErrors: SerialisedError[]): Error {\n // Build the error chain from root cause (end) to outermost (start)\n let rebuiltError: Error | undefined;\n for (const serialised of serialisedErrors.toReversed()) {\n const error = reconstructError(serialised, rebuiltError);\n if (serialised.stack !== undefined) error.stack = serialised.stack; // Restore stack trace if available\n rebuiltError = error;\n }\n return rebuiltError ?? new Error('No error to unserialise.');\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Builds a fallback message for non-error throwables\nfunction buildFallbackMessage(cause: unknown): string {\n let fallbackMessage: string;\n try {\n fallbackMessage = JSON.stringify(cause);\n } catch {\n if (typeof cause === 'symbol') fallbackMessage = cause.description ?? 'Unknown error';\n else if (typeof cause === 'bigint') fallbackMessage = cause.toString();\n else fallbackMessage = 'Unknown error';\n }\n if (fallbackMessage === '') fallbackMessage = 'Unknown error';\n return fallbackMessage;\n}\n\nfunction reconstructError(serialised: SerialisedError, cause: Error | undefined): Error {\n switch (serialised.name) {\n case 'APIError':\n return new APIError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'AppError':\n return new AppError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'ConnectorError':\n return new ConnectorError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'EngineError':\n return new EngineError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'FetchError':\n return new FetchError(serialised.message, serialised.locator, { data: serialised.data, cause });\n default: {\n const name = serialised.name;\n return new (class extends Error {\n override name = name;\n })(serialised.message, { cause });\n }\n }\n}\n\nfunction redactSerialisedError(serialisedError: SerialisedError): SerialisedError {\n const { data, message, stack } = serialisedError;\n return {\n ...serialisedError,\n data: data === undefined ? undefined : (redactValue(data, new WeakSet(), 0) as Record<string, unknown>),\n message: redactText(message),\n stack: stack === undefined ? undefined : redactText(stack)\n };\n}\n\nfunction redactText(text: string): string {\n let redactedText = text;\n for (const [pattern, replacement] of SECRET_TEXT_PATTERNS)\n redactedText = redactedText.replaceAll(pattern, (match: string, ...groups: string[]) => replacement(match, ...groups));\n return redactedText;\n}\n\n// Walks 'data', masking any field whose name looks secret and any secret found in text.\nfunction redactValue(value: unknown, seen: WeakSet<object>, depth: number): unknown {\n if (typeof value === 'string') return redactText(value);\n if (typeof value !== 'object' || value === null) return value;\n if (depth >= REDACTION_MAX_DEPTH) return REDACTED;\n if (seen.has(value)) return '[Circular]';\n seen.add(value);\n return Array.isArray(value)\n ? value.map((item) => redactValue(item, seen, depth + 1))\n : Object.fromEntries(\n Object.entries(value).map(([key, entryValue]) => [key, entryValue != null && SECRET_KEY_PATTERN.test(key) ? REDACTED : redactValue(entryValue, seen, depth + 1)])\n );\n}\n\n// Sanitizes a response body; limits body size to avoid excessive payloads when logging\nfunction sanitizeResponseErrorBody(body?: string): string | undefined {\n if (body == null || body === '') return undefined;\n return body.length > RESPONSE_ERROR_BODY_LIMIT ? `${body.slice(0, RESPONSE_ERROR_BODY_LIMIT)}... [truncated]` : body;\n}\n\n// Each connector is built with its own copy of these classes, so an error it raises is not an instance of this copy's.\n// It is known by its name and its locator instead, so its data, such as a store error's id, is kept where it belongs.\nfunction isDPUseError(error: Error): error is DPUseError {\n return error instanceof DPUseError || (DPUSE_ERROR_NAMES.has(error.name) && typeof (error as { locator?: unknown }).locator === 'string');\n}\n\nfunction serialiseSingleError(cause: Error): [SerialisedError, Error | null] {\n const nextCause = cause.cause == null ? null : normalizeToError(cause.cause);\n if (isDPUseError(cause)) {\n return [{ data: cause.data, locator: cause.locator, message: cause.message, name: cause.name, stack: cause.stack }, nextCause];\n }\n const customProperties = Object.fromEntries(Object.entries(cause).filter(([k]) => k !== 'cause'));\n return cause.name\n ? [{ data: customProperties, locator: '', message: cause.message, name: cause.name, stack: cause.stack }, nextCause]\n : [{ data: customProperties, locator: '', message: buildFallbackMessage(cause), name: 'Error', stack: undefined }, null];\n}\n","// ── DPUse Framework\nimport { buildFetchError, ConnectorError } from '@/errors';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface FetchObjectContentStreamOptions {\n headers?: Record<string, string>; // Sent with every request, such as an authorisation header.\n locator: string; // Names where a failure is raised, e.g. 'dpuse-connector-file-store-emulator.fetchObjectStream'.\n path: string; // The object's path, as the user sees it in a failure message.\n signal: AbortSignal;\n}\n\n// The part of the User-Agent Client Hints API that names the browser's engine. Only Chromium has it.\ninterface UserAgentData {\n brands: { brand: string }[];\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst RANGE_BYTE_COUNT = 33_554_432; // An object is fetched 32 MiB at a time where the browser would otherwise hold all of it.\nconst RANGE_NOT_SATISFIABLE_STATUS = 416;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Fetches an object's content as a stream that holds no more of it in memory than the reader is about to use. Chromium\n// pauses a download while the page is not reading it, so there the object is fetched in one request. Firefox and WebKit,\n// which every browser on iOS uses, download a response as fast as the network allows and hold the unread bytes in\n// memory, about 1.5 times the size of a 200 MB file in Safari. Elsewhere, then, the object is fetched a range at a time,\n// and the next range only when the reader asks for more. The object ends at the first range that comes back short, or\n// that starts past the end, so a server that does not let the page read 'Content-Range' still works. A server that\n// ignores ranges sends the whole object in one response, which is read as it is. Aborting the signal stops the fetch and\n// the reading of the stream it returns.\nexport async function fetchObjectContentStream(url: string, options: FetchObjectContentStreamOptions): Promise<ReadableStream<Uint8Array>> {\n if (doesFetchPauseUnreadDownloads()) {\n const response = await fetch(url, { headers: options.headers ?? {}, signal: options.signal });\n if (!response.ok) throw await buildFetchError(response, `Failed to fetch '${options.path}' file.`, options.locator);\n return establishResponseBody(response, options);\n }\n const firstResponse = await fetchObjectRange(url, 0, options);\n if (firstResponse.status !== 206 && firstResponse.status !== RANGE_NOT_SATISFIABLE_STATUS) return establishResponseBody(firstResponse, options);\n let nextResponse: Response | undefined = firstResponse;\n let nextOffset = 0;\n return new ReadableStream<Uint8Array>(\n {\n pull: async (controller): Promise<void> => {\n const response = nextResponse ?? (await fetchObjectRange(url, nextOffset, options));\n nextResponse = undefined;\n if (response.status === RANGE_NOT_SATISFIABLE_STATUS) {\n controller.close();\n return;\n }\n if (response.status !== 206) throw new ConnectorError(`Failed to fetch part of '${options.path}' file.`, `${options.locator}.range`);\n const bytes = new Uint8Array(await response.arrayBuffer());\n nextOffset += bytes.length;\n if (bytes.length > 0) controller.enqueue(bytes);\n if (bytes.length < RANGE_BYTE_COUNT) controller.close();\n }\n },\n { highWaterMark: 0 } // Fetches nothing until the reader asks.\n );\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Chromium's User-Agent Client Hints name it among the brands, in a page and in a worker alike. Firefox and WebKit have\n// no 'userAgentData', and neither do Chrome and Edge on iOS, which are built on WebKit.\nfunction doesFetchPauseUnreadDownloads(): boolean {\n // eslint-disable-next-line n/no-unsupported-features/node-builtins -- The browser's 'navigator', not Node's.\n const { userAgentData } = globalThis.navigator as { userAgentData?: UserAgentData };\n return userAgentData?.brands.some(({ brand }) => brand === 'Chromium') === true;\n}\n\nfunction establishResponseBody(response: Response, options: FetchObjectContentStreamOptions): ReadableStream<Uint8Array> {\n if (response.body == null) throw new ConnectorError('Readable streams are not supported in this runtime.', `${options.locator}.unsupported`);\n return response.body;\n}\n\n// A range that starts past the end comes back as 'Range Not Satisfiable', which ends the object rather than failing. The\n// browser cache is not used for ranges. A server may compress a whole file but not a range, and Chrome answers a later\n// range from the compressed copy it keeps, which cannot be decoded.\nasync function fetchObjectRange(url: string, startOffset: number, options: FetchObjectContentStreamOptions): Promise<Response> {\n const range = `bytes=${String(startOffset)}-${String(startOffset + RANGE_BYTE_COUNT - 1)}`; // HTTP ranges include their last byte.\n const response = await fetch(url, { cache: 'no-store', headers: { ...options.headers, Range: range }, signal: options.signal });\n if (!response.ok && response.status !== RANGE_NOT_SATISFIABLE_STATUS) throw await buildFetchError(response, `Failed to fetch '${options.path}' file.`, options.locator);\n return response;\n}\n","// ── DPUse Framework\nimport { DEFAULT_LOCALE_ID, type LocaleId, type LocaleLabel } from '@/locale/label';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype EncodingGroupId = keyof typeof ENCODING_GROUP_CONFIG_DATA;\ntype EncodingTypeId = keyof typeof ENCODING_TYPE_CONFIG_DATA;\n\ninterface EncodingGroupConfig {\n id: EncodingGroupId;\n label: LocaleLabel;\n}\n\n// One per encoding jschardet can detect, keyed by the name its 'detect' reports, in lower case, plus those the browser's\n// 'TextDecoder' or iconv-lite can decode that jschardet never reports, so the user can still choose them.\ninterface EncodingTypeConfig {\n id: EncodingTypeId;\n groupId: EncodingGroupId | null; // Null for an encoding that belongs to no group, i.e. 'ascii'.\n isDetectable: boolean; // Whether jschardet's 'detect' can report it.\n textDecoderId: string | null; // The name the browser's 'TextDecoder' takes, from jschardet's own map where it detects it. Null when it cannot decode it.\n iconvLiteDecoderId: string | null; // The name iconv-lite takes. Null when it cannot decode it. Nothing decodes with iconv-lite yet.\n}\nexport interface EncodingTypeConfigLocalised {\n id: EncodingTypeId;\n groupLabel: string;\n label: string;\n isDetectable: boolean;\n isDecodable: boolean;\n textDecoderId: string | null;\n iconvLiteDecoderId: string | null;\n}\n\nexport interface EncodingDetectionConfig {\n id: EncodingTypeId;\n confidenceLevel: number | undefined;\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst ENCODING_GROUP_CONFIG_DATA = {\n arabic: { id: 'arabic', label: { en: 'Arabic', es: 'Árabe' } },\n armenian: { id: 'armenian', label: { en: 'Armenian', es: 'Armenio' } },\n baltic: { id: 'baltic', label: { en: 'Baltic', es: 'Báltico' } },\n celtic: { id: 'celtic', label: { en: 'Celtic', es: 'Celta' } },\n centralEuropean: { id: 'centralEuropean', label: { en: 'Central European', es: 'Centroeuropeo' } },\n chineseSimplified: { id: 'chineseSimplified', label: { en: 'Chinese Simplified', es: 'Chino simplificado' } },\n chineseTraditional: { id: 'chineseTraditional', label: { en: 'Chinese Traditional', es: 'Chino tradicional' } },\n cyrillic: { id: 'cyrillic', label: { en: 'Cyrillic', es: 'Cirílico' } },\n georgian: { id: 'georgian', label: { en: 'Georgian', es: 'Georgiano' } },\n greek: { id: 'greek', label: { en: 'Greek', es: 'Griego' } },\n hebrew: { id: 'hebrew', label: { en: 'Hebrew', es: 'Hebreo' } },\n japanese: { id: 'japanese', label: { en: 'Japanese', es: 'Japonés' } },\n korean: { id: 'korean', label: { en: 'Korean', es: 'Coreano' } },\n lao: { id: 'lao', label: { en: 'Lao', es: 'Lao' } },\n nordic: { id: 'nordic', label: { en: 'Nordic', es: 'Nórdico' } },\n southEasternEuropean: { id: 'southEasternEuropean', label: { en: 'South-Eastern European', es: 'Europeo sudoriental' } },\n southernEuropean: { id: 'southernEuropean', label: { en: 'Southern European', es: 'Europeo meridional' } },\n thai: { id: 'thai', label: { en: 'Thai', es: 'Tailandés' } },\n turkish: { id: 'turkish', label: { en: 'Turkish', es: 'Turco' } },\n unicode: { id: 'unicode', label: { en: 'Unicode', es: 'Unicode' } },\n vietnamese: { id: 'vietnamese', label: { en: 'Vietnamese', es: 'Vietnamita' } },\n western: { id: 'western', label: { en: 'Western', es: 'Occidental' } }\n} as const satisfies Record<string, { id: string; label: LocaleLabel }>;\n\nconst ENCODING_TYPE_CONFIG_DATA = {\n 'armscii-8': { id: 'armscii-8', groupId: 'armenian', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'armscii8' },\n ascii: { id: 'ascii', groupId: null, isDetectable: true, textDecoderId: 'windows-1252', iconvLiteDecoderId: 'ascii' },\n big5: { id: 'big5', groupId: 'chineseTraditional', isDetectable: true, textDecoderId: 'big5', iconvLiteDecoderId: 'big5hkscs' },\n 'cesu-8': { id: 'cesu-8', groupId: 'unicode', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cesu8' },\n cp273: { id: 'cp273', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp424: { id: 'cp424', groupId: 'hebrew', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp437: { id: 'cp437', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp437' },\n cp500: { id: 'cp500', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp720: { id: 'cp720', groupId: 'arabic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp720' },\n cp737: { id: 'cp737', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp737' },\n cp775: { id: 'cp775', groupId: 'baltic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp775' },\n cp808: { id: 'cp808', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp808' },\n cp850: { id: 'cp850', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp850' },\n cp852: { id: 'cp852', groupId: 'centralEuropean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp852' },\n cp856: { id: 'cp856', groupId: 'hebrew', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp856' },\n cp857: { id: 'cp857', groupId: 'turkish', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp857' },\n cp858: { id: 'cp858', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp858' },\n cp860: { id: 'cp860', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp860' },\n cp861: { id: 'cp861', groupId: 'nordic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp861' },\n cp862: { id: 'cp862', groupId: 'hebrew', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp862' },\n cp863: { id: 'cp863', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp863' },\n cp864: { id: 'cp864', groupId: 'arabic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp864' },\n cp865: { id: 'cp865', groupId: 'nordic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp865' },\n cp869: { id: 'cp869', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp869' },\n cp874: { id: 'cp874', groupId: 'thai', isDetectable: true, textDecoderId: 'windows-874', iconvLiteDecoderId: 'windows874' },\n cp875: { id: 'cp875', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp922: { id: 'cp922', groupId: 'baltic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp922' },\n cp932: { id: 'cp932', groupId: 'japanese', isDetectable: true, textDecoderId: 'shift_jis', iconvLiteDecoderId: 'shiftjis' },\n cp936: { id: 'cp936', groupId: 'chineseSimplified', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp936' },\n cp949: { id: 'cp949', groupId: 'korean', isDetectable: true, textDecoderId: 'euc-kr', iconvLiteDecoderId: 'cp949' },\n cp950: { id: 'cp950', groupId: 'chineseTraditional', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp950' },\n cp1006: { id: 'cp1006', groupId: 'arabic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp1026: { id: 'cp1026', groupId: 'turkish', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp1046: { id: 'cp1046', groupId: 'arabic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1046' },\n cp1124: { id: 'cp1124', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1124' },\n cp1125: { id: 'cp1125', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp1125' },\n cp1129: { id: 'cp1129', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1129' },\n cp1133: { id: 'cp1133', groupId: 'lao', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1133' },\n cp1140: { id: 'cp1140', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp1161: { id: 'cp1161', groupId: 'thai', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1161' },\n cp1162: { id: 'cp1162', groupId: 'thai', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1162' },\n cp1163: { id: 'cp1163', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1163' },\n cp1258: { id: 'cp1258', groupId: 'vietnamese', isDetectable: true, textDecoderId: 'windows-1258', iconvLiteDecoderId: 'windows1258' },\n 'euc-jp': { id: 'euc-jp', groupId: 'japanese', isDetectable: true, textDecoderId: 'euc-jp', iconvLiteDecoderId: 'eucjp' },\n 'euc-kr': { id: 'euc-kr', groupId: 'korean', isDetectable: true, textDecoderId: 'euc-kr', iconvLiteDecoderId: 'cp949' },\n gb18030: { id: 'gb18030', groupId: 'chineseSimplified', isDetectable: true, textDecoderId: 'gb18030', iconvLiteDecoderId: 'gb18030' },\n gbk: { id: 'gbk', groupId: 'chineseSimplified', isDetectable: false, textDecoderId: 'gbk', iconvLiteDecoderId: 'gbk' }, // 'gb18030' reads the same files, as it extends 'gbk'.\n 'georgian-academy': { id: 'georgian-academy', groupId: 'georgian', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'georgianacademy' },\n 'georgian-ps': { id: 'georgian-ps', groupId: 'georgian', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'georgianps' },\n 'hp-roman8': { id: 'hp-roman8', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'hproman8' },\n 'hz-gb-2312': { id: 'hz-gb-2312', groupId: 'chineseSimplified', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n ibm855: { id: 'ibm855', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp855' },\n ibm866: { id: 'ibm866', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'ibm866', iconvLiteDecoderId: 'cp866' },\n 'iso-2022-jp': { id: 'iso-2022-jp', groupId: 'japanese', isDetectable: true, textDecoderId: 'iso-2022-jp', iconvLiteDecoderId: null },\n 'iso-2022-kr': { id: 'iso-2022-kr', groupId: 'korean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n 'iso-8859-1': { id: 'iso-8859-1', groupId: 'western', isDetectable: true, textDecoderId: 'windows-1252', iconvLiteDecoderId: 'iso88591' },\n 'iso-8859-2': { id: 'iso-8859-2', groupId: 'centralEuropean', isDetectable: true, textDecoderId: 'iso-8859-2', iconvLiteDecoderId: 'iso88592' },\n 'iso-8859-5': { id: 'iso-8859-5', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'iso-8859-5', iconvLiteDecoderId: 'iso88595' },\n 'iso-8859-6': { id: 'iso-8859-6', groupId: 'arabic', isDetectable: true, textDecoderId: 'iso-8859-6', iconvLiteDecoderId: 'iso88596' },\n 'iso-8859-7': { id: 'iso-8859-7', groupId: 'greek', isDetectable: true, textDecoderId: 'iso-8859-7', iconvLiteDecoderId: 'iso88597' },\n 'iso-8859-8': { id: 'iso-8859-8', groupId: 'hebrew', isDetectable: true, textDecoderId: 'iso-8859-8-i', iconvLiteDecoderId: 'iso88598' },\n 'iso-8859-9': { id: 'iso-8859-9', groupId: 'turkish', isDetectable: true, textDecoderId: 'windows-1254', iconvLiteDecoderId: 'iso88599' },\n 'iso-8859-11': { id: 'iso-8859-11', groupId: 'thai', isDetectable: false, textDecoderId: 'windows-874', iconvLiteDecoderId: 'iso885911' },\n 'iso-8859-13': { id: 'iso-8859-13', groupId: 'baltic', isDetectable: true, textDecoderId: 'iso-8859-13', iconvLiteDecoderId: 'iso885913' },\n 'iso646-cn': { id: 'iso646-cn', groupId: 'chineseSimplified', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'iso646cn' },\n 'iso646-jp': { id: 'iso646-jp', groupId: 'japanese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'iso646jp' },\n iso2022_jp_2004: { id: 'iso2022_jp_2004', groupId: 'japanese', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n iso2022_jp_ext: { id: 'iso2022_jp_ext', groupId: 'japanese', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n 'iso8859-3': { id: 'iso8859-3', groupId: 'southernEuropean', isDetectable: true, textDecoderId: 'iso-8859-3', iconvLiteDecoderId: 'iso88593' },\n 'iso8859-4': { id: 'iso8859-4', groupId: 'baltic', isDetectable: true, textDecoderId: 'iso-8859-4', iconvLiteDecoderId: 'iso88594' },\n 'iso8859-10': { id: 'iso8859-10', groupId: 'nordic', isDetectable: true, textDecoderId: 'iso-8859-10', iconvLiteDecoderId: 'iso885910' },\n 'iso8859-14': { id: 'iso8859-14', groupId: 'celtic', isDetectable: true, textDecoderId: 'iso-8859-14', iconvLiteDecoderId: 'iso885914' },\n 'iso8859-15': { id: 'iso8859-15', groupId: 'western', isDetectable: true, textDecoderId: 'iso-8859-15', iconvLiteDecoderId: 'iso885915' },\n 'iso8859-16': { id: 'iso8859-16', groupId: 'southEasternEuropean', isDetectable: true, textDecoderId: 'iso-8859-16', iconvLiteDecoderId: 'iso885916' },\n johab: { id: 'johab', groupId: 'korean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n 'koi8-r': { id: 'koi8-r', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'koi8-r', iconvLiteDecoderId: 'koi8r' },\n 'koi8-ru': { id: 'koi8-ru', groupId: 'cyrillic', isDetectable: false, textDecoderId: 'koi8-u', iconvLiteDecoderId: 'koi8ru' },\n 'koi8-t': { id: 'koi8-t', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'koi8t' },\n 'koi8-u': { id: 'koi8-u', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'koi8-u', iconvLiteDecoderId: 'koi8u' },\n kz1048: { id: 'kz1048', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'rk1048' },\n maccroatian: { id: 'maccroatian', groupId: 'centralEuropean', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'maccroatian' },\n maccyrillic: { id: 'maccyrillic', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'x-mac-cyrillic', iconvLiteDecoderId: 'maccyrillic' },\n macgreek: { id: 'macgreek', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'macgreek' },\n maciceland: { id: 'maciceland', groupId: 'nordic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'maciceland' },\n maclatin2: { id: 'maclatin2', groupId: 'centralEuropean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'maccenteuro' },\n macroman: { id: 'macroman', groupId: 'western', isDetectable: true, textDecoderId: 'macintosh', iconvLiteDecoderId: 'macroman' },\n macromania: { id: 'macromania', groupId: 'southEasternEuropean', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'macromania' },\n macthai: { id: 'macthai', groupId: 'thai', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'macthai' },\n macturkish: { id: 'macturkish', groupId: 'turkish', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'macturkish' },\n macukraine: { id: 'macukraine', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'macukraine' },\n mik: { id: 'mik', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'mik' },\n ptcp154: { id: 'ptcp154', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'pt154' },\n shift_jis: { id: 'shift_jis', groupId: 'japanese', isDetectable: true, textDecoderId: 'shift_jis', iconvLiteDecoderId: 'shiftjis' },\n tcvn: { id: 'tcvn', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'tcvn' },\n 'tis-620': { id: 'tis-620', groupId: 'thai', isDetectable: true, textDecoderId: 'windows-874', iconvLiteDecoderId: 'tis620' },\n 'utf-7': { id: 'utf-7', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf7' },\n 'utf-8': { id: 'utf-8', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-8', iconvLiteDecoderId: 'utf-8' },\n 'utf-8-sig': { id: 'utf-8-sig', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-8', iconvLiteDecoderId: 'utf-8' }, // jschardet's map leaves it out, but 'utf-8' skips the byte-order mark.\n 'utf-16': { id: 'utf-16', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf16' },\n 'utf-16-be': { id: 'utf-16-be', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-16be', iconvLiteDecoderId: 'utf16be' },\n 'utf-16-le': { id: 'utf-16-le', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-16le', iconvLiteDecoderId: 'utf16le' },\n 'utf-32': { id: 'utf-32', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf32' },\n 'utf-32-be': { id: 'utf-32-be', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf32be' },\n 'utf-32-le': { id: 'utf-32-le', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf32le' },\n viscii: { id: 'viscii', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'viscii' },\n 'windows-1250': { id: 'windows-1250', groupId: 'centralEuropean', isDetectable: true, textDecoderId: 'windows-1250', iconvLiteDecoderId: 'windows1250' },\n 'windows-1251': { id: 'windows-1251', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'windows-1251', iconvLiteDecoderId: 'windows1251' },\n 'windows-1252': { id: 'windows-1252', groupId: 'western', isDetectable: true, textDecoderId: 'windows-1252', iconvLiteDecoderId: 'windows1252' },\n 'windows-1253': { id: 'windows-1253', groupId: 'greek', isDetectable: true, textDecoderId: 'windows-1253', iconvLiteDecoderId: 'windows1253' },\n 'windows-1254': { id: 'windows-1254', groupId: 'turkish', isDetectable: true, textDecoderId: 'windows-1254', iconvLiteDecoderId: 'windows1254' },\n 'windows-1255': { id: 'windows-1255', groupId: 'hebrew', isDetectable: true, textDecoderId: 'windows-1255', iconvLiteDecoderId: 'windows1255' },\n 'windows-1256': { id: 'windows-1256', groupId: 'arabic', isDetectable: true, textDecoderId: 'windows-1256', iconvLiteDecoderId: 'windows1256' },\n 'windows-1257': { id: 'windows-1257', groupId: 'baltic', isDetectable: true, textDecoderId: 'windows-1257', iconvLiteDecoderId: 'windows1257' }\n} as const satisfies Record<string, { id: string; groupId: keyof typeof ENCODING_GROUP_CONFIG_DATA | null; isDetectable: boolean; textDecoderId: string | null; iconvLiteDecoderId: string | null }>;\n\nexport const ENCODING_GROUP_CONFIG_MAP = ENCODING_GROUP_CONFIG_DATA as Record<EncodingGroupId, EncodingGroupConfig>;\nexport const ENCODING_TYPE_CONFIG_MAP = ENCODING_TYPE_CONFIG_DATA as Record<EncodingTypeId, EncodingTypeConfig>;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Narrows a name from outside the app, such as one reported by encoding detection and lower-cased, to a known encoding\n// id. Check with this once where the name arrives, so everything after it works with 'EncodingTypeId'.\nexport function isEncodingTypeId(value: string): value is EncodingTypeId {\n return Object.hasOwn(ENCODING_TYPE_CONFIG_MAP, value);\n}\n\n// The name to give the browser's 'TextDecoder' for an encoding id. An id browsers cannot decode, or one the table does\n// not know, passes through unchanged, so 'TextDecoder' rejects it.\nexport function resolveDecoderId(encodingId: string): string {\n return isEncodingTypeId(encodingId) ? (ENCODING_TYPE_CONFIG_MAP[encodingId].textDecoderId ?? encodingId) : encodingId;\n}\n\nexport function getEncodingTypeConfigs(localeId: LocaleId = DEFAULT_LOCALE_ID): EncodingTypeConfigLocalised[] {\n const encodingTypeConfigs: EncodingTypeConfigLocalised[] = Array.from(Object.values(ENCODING_TYPE_CONFIG_MAP), ({ groupId, iconvLiteDecoderId, id, isDetectable, textDecoderId }) => {\n const groupLabel = groupId == null ? '' : resolveGroupLabel(groupId, localeId);\n return { id, groupLabel, label: groupLabel ? `${groupLabel} (${id})` : id, isDetectable, isDecodable: textDecoderId != null, textDecoderId, iconvLiteDecoderId };\n });\n return encodingTypeConfigs.toSorted((left, right) => left.groupLabel.localeCompare(right.groupLabel, localeId) || left.id.localeCompare(right.id, localeId, { numeric: true })); // Ids, not labels, so 'utf-16' sorts before 'utf-16-le'.\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nfunction resolveGroupLabel(groupId: EncodingGroupId, localeId: LocaleId): string {\n const labels = ENCODING_GROUP_CONFIG_MAP[groupId].label;\n return labels[localeId] ?? labels[DEFAULT_LOCALE_ID] ?? groupId;\n}\n","/**\n * Defines the configuration metadata for a tool. Used for validation of tool manifests.\n */\n\n// ── External Dependencies & Registrations\nimport { array, literal, minLength, optional, pipe, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Parser\n// The data formats a parser may read: every data format except 'unknown', which has no records to read.\nexport const parserDataFormatIdSchema = literalUnion(['arrow', 'avro', 'dtv', 'json', 'jsonl', 'markdown', 'ods', 'parquet', 'sav', 'sqlite', 'xlsx', 'xml']);\n\nexport const parserConfigSchema = strictObject({\n dataFormatIds: pipe(array(parserDataFormatIdSchema), minLength(1)) // Written by hand, because only the tool's author knows which formats it reads.\n});\n\n// ── Configuration\nconst toolActionNamesSchema = array(string());\n\nexport const toolConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('tool'),\n actionNames: optional(toolActionNamesSchema), // Written by the build from the methods the tool's source implements.\n parser: optional(parserConfigSchema) // Only a tool that parses data records has one.\n});\n","// ── DPUse Framework\nimport { resolveDecoderId } from '@/encoding';\nimport type { ParsedRecord, RecordDelimiterId, SampleIssue, ValueDelimiterId } from '@/component/dataView';\nimport type { ParsePreviewOptions, ParsePreviewResult } from '@/component/module/tool';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A preview as its bytes, and as the text decoded from them, so a parser reads whichever its own 'parseStream' reads.\nexport interface DelimitedPreview {\n bytes: Uint8Array;\n encodingId: string;\n text: string;\n}\n\n// What a parser tool supplies: the preview read with one delimiter. A record it cannot read is left out and becomes an\n// issue, so every parser reports the same way and the choice of delimiter below is the same whichever parser reads.\nexport type ParsePreviewWithDelimiter = (\n preview: DelimitedPreview,\n delimiter: ValueDelimiterId,\n isComplete: boolean\n) => Promise<{ issues: SampleIssue[]; records: ParsedRecord[] }>;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n/**\n * Reads delimited text for a preview: detects its record delimiter, and which of the candidate value delimiters splits\n * it best. The value delimiter is undefined when the text is not delimited: the best one found does not split most\n * records into the same number of values, more than one, as a table's rows would be. The records parsed with it are\n * still returned, so the text can be shown as a table if the user chooses. A delimiter whose parse has issues is only\n * used when every delimiter's does, because a wrong delimiter can itself cause a quote error. Then the one with the\n * fewest issues is used, the first on a tie, and its issues are returned, so the user learns why the text cannot be read.\n * The bytes are decoded once, with the decoder 'parseStream' uses, both to find the record delimiter and for a parser\n * that reads text.\n */\nexport async function parseDelimitedPreview(bytes: Uint8Array, options: ParsePreviewOptions, parseWithDelimiter: ParsePreviewWithDelimiter): Promise<ParsePreviewResult> {\n const text = new TextDecoder(resolveDecoderId(options.encodingId)).decode(bytes);\n const preview: DelimitedPreview = { bytes, encodingId: options.encodingId, text };\n const recordDelimiterId = determineRecordDelimiter(text);\n const { issues, parsedRecords, valueDelimiterId } = await determineValueDelimiter(preview, options.valueDelimiterIds, options.isComplete, parseWithDelimiter);\n return { issues, parsedRecords, recordDelimiterId, valueDelimiterId };\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nfunction determineRecordDelimiter(text: string): RecordDelimiterId {\n const countCRLF = (text.match(/\\r\\n/g) ?? []).length; // Count all '\\r\\n'character sequences.\n const countLF = (text.match(/(?<!\\r)\\n/g) ?? []).length; // Count all '\\n' characters not preceded by '\\r' character.\n const countCR = (text.match(/\\r(?!\\n)/g) ?? []).length; // Count all '\\r' characters not followed by '\\n' character.\n if (countCRLF >= countLF && countCRLF >= countCR) return '\\r\\n';\n if (countLF >= countCRLF && countLF >= countCR) return '\\n';\n return countCR >= countCRLF && countCR >= countLF ? '\\r' : '\\n'; // Ties, including text with no line break, go to '\\r\\n' above, so the '\\n' here is never reached.\n}\n\nasync function determineValueDelimiter(\n preview: DelimitedPreview,\n delimiters: ValueDelimiterId[],\n isComplete: boolean,\n parseWithDelimiter: ParsePreviewWithDelimiter\n): Promise<{ issues: SampleIssue[]; parsedRecords: ParsedRecord[]; valueDelimiterId: ValueDelimiterId | undefined }> {\n let valueDelimiterId: ValueDelimiterId | undefined;\n let priorAverageCount: number | undefined;\n let priorSumCountDiffs: number | undefined;\n let parsedRecords: ParsedRecord[] = [];\n let fewestIssuesParse: { delimiter: ValueDelimiterId; issues: SampleIssue[]; records: ParsedRecord[] } | undefined;\n let hasParsedWithoutIssues = false;\n\n /* TODO: Could improve performance by limiting the number of delimiters\n processed by exiting if column count is the same for each line and\n by ordering delimiters in most common usage. Could also consider\n parallel parsing. Maybe group by most common delimiters and then by\n less common? */\n\n for (const delimiter of delimiters) {\n const { issues, records } = await parseWithDelimiter(preview, delimiter, isComplete);\n if (issues.length > 0) {\n fewestIssuesParse = chooseFewerIssues(fewestIssuesParse, { delimiter, issues, records });\n continue;\n }\n hasParsedWithoutIssues = true;\n if (records.length === 0) continue; // Nothing to compare, and the average below would be 0 / 0.\n const { averageValueCount, sumOfValueCountDiffs } = measureValueCounts(records);\n // A delimiter that split nothing has even records only because each holds one value, so any split beats it.\n const isEvenEnough = priorAverageCount === undefined || priorAverageCount <= 1 || sumOfValueCountDiffs <= (priorSumCountDiffs ?? 0);\n const isBetterFit = isEvenEnough && (priorAverageCount === undefined || averageValueCount > priorAverageCount);\n if (!isBetterFit) continue;\n valueDelimiterId = delimiter;\n priorAverageCount = averageValueCount;\n priorSumCountDiffs = sumOfValueCountDiffs;\n parsedRecords = records;\n }\n\n if (!hasParsedWithoutIssues && fewestIssuesParse != null) {\n const { delimiter, issues, records } = fewestIssuesParse;\n return { issues, parsedRecords: records, valueDelimiterId: isTabular(records) ? delimiter : undefined };\n }\n return { issues: [], parsedRecords, valueDelimiterId: valueDelimiterId != null && isTabular(parsedRecords) ? valueDelimiterId : undefined };\n}\n\n// The earlier parse wins a tie, so delimiters keep their order of preference.\nfunction chooseFewerIssues<T extends { issues: SampleIssue[] }>(priorParse: T | undefined, parse: T): T {\n return priorParse == null || parse.issues.length < priorParse.issues.length ? parse : priorParse;\n}\n\n// The average number of values per record, and how much that number changes from one record to the next.\nfunction measureValueCounts(records: ParsedRecord[]): { averageValueCount: number; sumOfValueCountDiffs: number } {\n let totalValueCount = 0;\n let sumOfValueCountDiffs = 0;\n let priorValueCount: number | undefined;\n for (const record of records) {\n if (priorValueCount != null) sumOfValueCountDiffs += Math.abs(record.length - priorValueCount);\n priorValueCount = record.length;\n totalValueCount += record.length;\n }\n return { averageValueCount: totalValueCount / records.length, sumOfValueCountDiffs };\n}\n\n// Most records have the same number of values, more than one. Ragged rows are allowed, as the parsers allow them.\nfunction isTabular(parsedRecords: ParsedRecord[]): boolean {\n const recordCountByValueCount = new Map<number, number>();\n for (const record of parsedRecords) recordCountByValueCount.set(record.length, (recordCountByValueCount.get(record.length) ?? 0) + 1);\n const [commonValueCount = 0, commonRecordCount = 0] = [...recordCountByValueCount].toSorted((left, right) => right[1] - left[1])[0] ?? [];\n return commonValueCount > 1 && commonRecordCount * 2 > parsedRecords.length;\n}\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\n\n// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport type { DataFormatId } from '@/component/dataView';\nimport type { parserConfigSchema, toolConfigSchema } from './toolConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { toolConfigSchema } from './toolConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Configuration\nexport type ToolConfig = InferOutput<typeof toolConfigSchema>;\n\nexport type ParserConfig = InferOutput<typeof parserConfigSchema>;\n\n// ── File Previewer\nexport type { FilePreviewerInterface, FilePreviewResult } from './filePreviewer';\n\n// ── Parser\nexport type { BuildStructureIndexOptions, ListStructureEntriesOptions, ListStructureEntriesResult, ParserInterface } from './parser';\nexport type { ParsePreviewOptions, ParsePreviewResult, ParseStreamOptions, ParseStreamSummary, StructureCheckpoint } from './parser';\nexport type { StructureContainerKindId, StructureEntry, StructureIndex, StructureKindId, StructureNode } from './parser';\nexport type { StructuredParserInterface, StructureLocator, StructurePath } from './parser';\nexport { type DelimitedPreview, parseDelimitedPreview, type ParsePreviewWithDelimiter } from './delimitedText';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst LOAD_URL_PREFIX = 'https://engine-eu.dpuse.app/tools';\n\nconst DEFAULT_PARSER_TOOL_IDS: Partial<Record<DataFormatId, string>> = { dtv: 'dpuse-tool-rust-csv-core-parser' }; // The tool used for a format with several, when the user has not chosen one.\n\nexport const TOOL_NAME_PREFIX = 'dpuse-tool-'; // A tool's config id is this followed by the id 'loadTool' takes.\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The tools that read the data format, sorted by id. The sort means the first is the same wherever the list came from.\nexport function listParserToolConfigs(toolConfigs: ToolConfig[], dataFormatId: DataFormatId): ToolConfig[] {\n return toolConfigs\n .filter((config) => config.parser?.dataFormatIds.some((id) => id === dataFormatId) === true)\n .toSorted((first, second) => first.id.localeCompare(second.id, 'en'));\n}\n\n// The tool that reads the data format: the one the user chose, or the format's default when none is chosen or the chosen\n// one no longer reads it, or else the first that reads it. 'parserId' is the tool's config id, e.g.\n// 'dpuse-tool-adaltas-csv-parser'.\nexport function resolveParserToolConfig(toolConfigs: ToolConfig[], dataFormatId: DataFormatId, parserId?: string): ToolConfig {\n const parserToolConfigs = listParserToolConfigs(toolConfigs, dataFormatId);\n const [firstParserToolConfig] = parserToolConfigs;\n if (firstParserToolConfig === undefined) {\n const data = { availableToolIds: toolConfigs.map((config) => config.id), dataFormatId };\n throw new AppError(`No tool reads the '${dataFormatId}' data format.`, 'dpuse-shared.component.module.tool.resolveParserToolConfig', { data });\n }\n const defaultParserId = DEFAULT_PARSER_TOOL_IDS[dataFormatId];\n return parserToolConfigs.find((config) => config.id === parserId) ?? parserToolConfigs.find((config) => config.id === defaultParserId) ?? firstParserToolConfig;\n}\n\n// Dynamically load tool.\nexport async function loadTool<T>(toolConfigs: ToolConfig[], toolId: string): Promise<T> {\n const toolName = `${TOOL_NAME_PREFIX}${toolId}`;\n const toolModuleConfig = toolConfigs.find((config) => config.id === toolName);\n // Carries a locator and the ids that were available for the same reason the import failure below does: this is\n // thrown out of a shared module into a caller that can only report what the error itself says.\n if (!toolModuleConfig) {\n const data = { availableToolIds: toolConfigs.map((config) => config.id), toolName };\n throw new AppError(`Tool '${toolId}' not found.`, 'dpuse-shared.component.module.tool.loadTool', { data });\n }\n\n const url = `${LOAD_URL_PREFIX}/${toolId}_v${toolModuleConfig.version}/${toolName}.es.js`;\n try {\n const toolModule = (await import(/* @vite-ignore */ url)) as { Tool: new () => T };\n return new toolModule.Tool();\n } catch (error) {\n // A bare import rejection says only 'Failed to fetch dynamically imported module', which names neither the\n // tool nor the version. The caller reports and displays this error but has no other way to identify the\n // module that went missing, so the identifying detail has to be attached here.\n const data = { toolName, url, version: toolModuleConfig.version };\n throw new AppError(`Failed to load tool '${toolName}' v${toolModuleConfig.version}.`, 'dpuse-shared.component.module.tool.loadTool', { data, cause: error });\n }\n}\n","// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport { resolveDecoderId } from '@/encoding';\nimport type { RetrieveRecordsSummary } from '@/component/module/connector';\nimport type { AuditObjectContentOptions, AuditObjectContentResult, ConnectorUtilities, IndexObjectStructureOptions } from '@/component/module/connector';\nimport type { ContentAuditConfig, DataFormatId, DeclaredColumnConfig, DeclaredReadingConfig } from '@/component/dataView';\nimport { DATA_FORMAT_CONFIGS, VALUE_DELIMITER_CONFIGS } from '@/component/dataView';\nimport type { FilePreviewResult, ListStructureEntriesResult, ParsePreviewResult, ParserInterface, ParseStreamSummary, StructuredParserInterface } from '@/component/module/tool';\nimport type { ListObjectStructureEntriesOptions, ParsedRecordsChunk, PreviewObjectResult, RetrieveRecordsOptions } from '@/component/module/connector';\nimport { listParserToolConfigs, loadTool, resolveParserToolConfig, TOOL_NAME_PREFIX } from '@/component/module/tool';\nimport type { ReadingChoiceConfig, RecordDelimiterId, ValueDelimiterId } from '@/component/dataView';\nimport type { StructureIndex, StructurePath, ToolConfig } from '@/component/module/tool';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Text the previewer takes as delimited is read as delimited even when no delimiter is found, such as a single column\n// or rows that split unevenly. It is then read with these, the most common ones. An empty file is read with them too.\nconst DEFAULT_RECORD_DELIMITER_ID: RecordDelimiterId = '\\n';\nconst DEFAULT_VALUE_DELIMITER_ID: ValueDelimiterId = ',';\n\n// Formats that nest, so the user chooses the part read as the table, and that have no value delimiter.\nconst STRUCTURED_DATA_FORMAT_IDS = new Set<DataFormatId>(DATA_FORMAT_CONFIGS.filter(({ isStructured }) => isStructured).map(({ id }) => id));\n\nconst CARRIAGE_RETURN_BYTE = 0x0d;\nconst LINE_FEED_BYTE = 0x0a;\nconst QUOTE_BYTE = 0x22;\n\n// The most an audit hands its parser at a time. WebKit reads an item in pieces of about 18 MB, against about 2 MB in\n// Chromium, and the bytes audited are counted as the parser takes them, so a whole piece at once made the progress jump\n// in large steps and reach 100% while the parser was still reading.\nconst MAX_AUDIT_READ_BYTE_COUNT = 1_048_576;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Builds the first audit and preview of an item from what the file previewer found. The reading reports what was\n// detected, and never a choice: the detected or declared format, the format's default tool, and the delimiters found.\n// The sample and the audit follow the user's choices, so the user sees the result of what they chose. When nothing\n// that affects parsing was chosen, one parse serves both. An item that is empty, or of a format no tool reads yet, comes\n// back with no records rather than as an error, and its text is kept so the picker can still show it. A source that\n// states its columns or how the item is read, such as a resource file beside it, passes them on. They are taken rather\n// than inferred or detected, and the reading is marked as declared.\nexport async function buildPreviewObjectResult(input: {\n asAt: number;\n declaredColumnConfigs?: DeclaredColumnConfig[] | undefined;\n declaredReadingConfig?: DeclaredReadingConfig | undefined;\n filePreview: FilePreviewResult;\n inferDataTypes: ConnectorUtilities['inferDataTypes'];\n readingChoiceConfig: ReadingChoiceConfig | undefined; // The previewer has already decoded the text with the chosen encoding.\n startedAt: number; // From 'performance.now()', before the item was fetched.\n toolConfigs: ToolConfig[];\n}): Promise<PreviewObjectResult> {\n const { asAt, declaredColumnConfigs, declaredReadingConfig, filePreview, inferDataTypes, readingChoiceConfig, startedAt, toolConfigs } = input;\n const { isComplete, text } = filePreview;\n const isDeclared = declaredReadingConfig != null;\n const size = filePreview.bytes.length;\n const sampleDecoding = { decodedEncodingId: filePreview.decodedEncodingId, replacementCharacterCount: filePreview.replacementCharacterCount };\n const encodingCandidates = filePreview.encodingCandidates;\n const detectedEncoding = {\n encodingConfidenceLevel: filePreview.encodingConfidenceLevel,\n encodingId: declaredReadingConfig?.encodingId ?? filePreview.encodingId,\n encodingSourceId: declaredReadingConfig?.encodingId == null ? filePreview.encodingSourceId : undefined // A declared encoding was not detected.\n };\n\n // An empty file is a table with no rows. An issue says so, because it is not an error but the user should know why\n // there is nothing to show.\n if (size === 0) {\n return {\n contentAuditConfig: constructFirstAuditConfig({ asAt, columns: [], isComplete: true, recordCount: 0, size, startedAt }),\n sampleConfig: {\n ...sampleDecoding,\n issues: [\n {\n endLineNumber: undefined,\n fieldNumber: undefined,\n id: 'empty',\n lineNumber: undefined,\n message: 'The file is empty.',\n recordNumber: undefined,\n severityId: 'info',\n value: undefined\n }\n ],\n dataFormatId: 'dtv',\n hasHeaders: false,\n parsedRecords: [],\n parserId: undefined,\n recordDelimiterId: DEFAULT_RECORD_DELIMITER_ID,\n size: 0,\n text: undefined,\n valueDelimiterId: DEFAULT_VALUE_DELIMITER_ID\n },\n readingConfig: {\n dataFormatId: 'dtv',\n dataFormatSourceId: undefined,\n ...detectedEncoding,\n fileType: undefined,\n hasHeaders: false,\n isDeclared,\n parserId: undefined,\n recordDelimiterId: DEFAULT_RECORD_DELIMITER_ID,\n valueDelimiterId: DEFAULT_VALUE_DELIMITER_ID\n },\n encodingCandidates\n };\n }\n\n // Detection parses with the detected or declared format and the format's default tool. The sample parses again only\n // when the user chose a format, a tool or a value delimiter.\n // A nested format is mapped from the preview's bytes first, and its parser suggests the part to read as the table.\n const detectedDataFormatId = declaredReadingConfig?.dataFormatId ?? filePreview.dataFormatId;\n const declaredValueDelimiterId = declaredReadingConfig?.valueDelimiterId;\n // The parser's time is added up apart from the value audit's, so the cost of each can be measured.\n const parseTiming = { duration: 0 };\n const detectedStructureIndex = await previewStructure({ dataFormatId: detectedDataFormatId, filePreview, parserId: undefined, parseTiming, toolConfigs });\n const previewEncodingId = filePreview.decodedEncodingId ?? 'utf-8'; // The encoding the preview's text was decoded with, so the parser reads the bytes the same way.\n const detectedParse = await parsePreviewText({\n bytes: filePreview.bytes,\n dataFormatId: detectedDataFormatId,\n encodingId: previewEncodingId,\n isComplete,\n parserId: undefined,\n parseTiming,\n structureIndex: detectedStructureIndex,\n structurePath: detectedStructureIndex?.suggestedStructurePath,\n text,\n toolConfigs,\n valueDelimiterId: declaredValueDelimiterId\n });\n const sampleDataFormatId = readingChoiceConfig?.dataFormatId ?? detectedDataFormatId;\n const isFormatChosen = readingChoiceConfig?.dataFormatId != null || readingChoiceConfig?.parserId != null;\n const isParseChosen = isFormatChosen || readingChoiceConfig?.valueDelimiterId != null || readingChoiceConfig?.structurePath != null;\n const sampleStructureIndex = isFormatChosen\n ? await previewStructure({ dataFormatId: sampleDataFormatId, filePreview, parserId: readingChoiceConfig.parserId, parseTiming, toolConfigs })\n : detectedStructureIndex;\n const sampleParse = isParseChosen\n ? await parsePreviewText({\n bytes: filePreview.bytes,\n dataFormatId: sampleDataFormatId,\n encodingId: previewEncodingId,\n isComplete,\n parserId: readingChoiceConfig.parserId,\n parseTiming,\n structureIndex: sampleStructureIndex,\n structurePath: readingChoiceConfig.structurePath ?? sampleStructureIndex?.suggestedStructurePath,\n text,\n toolConfigs,\n valueDelimiterId: declaredValueDelimiterId ?? readingChoiceConfig.valueDelimiterId\n })\n : detectedParse;\n\n // Infer and cast values for each parsed record. Detection is inferred separately only when the sample was parsed\n // with choices, because the header record can differ.\n // A parser whose first record is always a header, such as JSON keys, says so, and is not second-guessed.\n const sampleRecords = sampleParse?.parsePreviewResult.parsedRecords ?? [];\n const sampleHasHeaders = sampleParse?.parsePreviewResult.hasHeaders ?? declaredReadingConfig?.hasHeaders;\n const columnAuditStartedAt = performance.now();\n const sampleInference = sampleParse == null ? undefined : inferDataTypes(sampleRecords, sampleHasHeaders, declaredColumnConfigs);\n const detectedInference =\n isParseChosen && detectedParse != null\n ? inferDataTypes(detectedParse.parsePreviewResult.parsedRecords, detectedParse.parsePreviewResult.hasHeaders ?? declaredReadingConfig?.hasHeaders, declaredColumnConfigs)\n : sampleInference;\n const columnAuditDuration = performance.now() - columnAuditStartedAt;\n\n return {\n contentAuditConfig: constructFirstAuditConfig({\n asAt,\n columnAuditDuration,\n columns: sampleInference?.columnConfigs ?? [],\n isComplete,\n parseDuration: parseTiming.duration,\n recordCount: Math.max(0, sampleRecords.length - (sampleInference?.hasHeaders === true ? 1 : 0)), // A header record names the columns and is not data.\n size,\n startedAt\n }),\n sampleConfig: {\n ...sampleDecoding,\n dataFormatId: sampleDataFormatId ?? 'unknown',\n hasHeaders: sampleInference?.hasHeaders,\n issues: sampleParse?.parsePreviewResult.issues ?? [], // Records the parser could not read. The text is still returned, so the user can see them.\n parsedRecords: sampleRecords,\n parserId: sampleParse?.parserId,\n recordDelimiterId: sampleParse?.parsePreviewResult.recordDelimiterId,\n size,\n structurePath: sampleParse?.structurePath,\n text,\n valueDelimiterId: sampleParse?.valueDelimiterId\n },\n readingConfig: {\n dataFormatId: detectedDataFormatId ?? 'unknown',\n dataFormatSourceId: declaredReadingConfig == null ? filePreview.dataFormatSourceId : undefined, // A declared format was not detected.\n ...detectedEncoding,\n fileType: filePreview.fileTypeConfig,\n hasHeaders: detectedInference?.hasHeaders,\n isDeclared,\n parserId: detectedParse?.parserId,\n recordDelimiterId: detectedParse?.parsePreviewResult.recordDelimiterId,\n structurePath: detectedStructureIndex?.suggestedStructurePath,\n valueDelimiterId: detectedParse?.valueDelimiterId\n },\n encodingCandidates,\n structureIndex: sampleStructureIndex\n };\n}\n\n// Reads every record of an item, with the tool that read its preview. The caller supplies the stream and owns the abort\n// signal, because only the connector knows how to reach its items.\nexport async function* retrieveRecordsWithParser(input: {\n options: RetrieveRecordsOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): AsyncGenerator<ParsedRecordsChunk, RetrieveRecordsSummary, undefined> {\n const { options, signal, stream, toolConfigs } = input;\n const { encodingId, valueDelimiterId } = establishFileReading(options);\n const { parser } = await loadParser(toolConfigs, options.dataFormatId, options.parserId);\n const timedSource = timeSourceWaits(stream);\n const countedSource = countBytes(timedSource.stream);\n const parsing: AsyncIterator<ParsedRecordsChunk, ParseStreamSummary> = parser.parseStream(countedSource.stream, {\n abortSignal: signal,\n chunkSize: options.chunkSize,\n dataFormatId: options.dataFormatId,\n encodingId,\n structurePath: options.structurePath,\n valueDelimiterId\n });\n // The time the receiver holds each chunk, such as a store writing it, is not the parser's, so it is not counted.\n const parserReads = timeParserReads(parsing);\n let isParsingDone = false;\n try {\n let parsed = await parserReads.readNext();\n while (parsed.done !== true) {\n yield { ...parsed.value, byteCount: countedSource.byteCount() }; // The parser may have read a little past these records, so the count runs slightly ahead.\n parsed = await parserReads.readNext();\n }\n isParsingDone = true;\n const sourceWaitDuration = timedSource.waitDuration();\n // The parser's counts of lines and bytes are for an audit, so they are not passed on.\n return { recordCount: parsed.value.recordCount, sourceWaitDuration, parseDuration: Math.max(0, parserReads.duration() - sourceWaitDuration) };\n } finally {\n if (!isParsingDone) await parsing.return?.(); // A receiver that stops early, or a failure, also stops the parser's read.\n }\n}\n\n// Reads an item's records from its start, to count them and describe their columns, up to 'options.byteLimit' or until\n// 'options.stopSignal' fires. Records are audited one chunk at a time, so the item is never held in memory. 'onProgress'\n// receives the number of records in each chunk as it is audited, and the bytes read so far. A source that states its\n// columns passes them on, so the audit takes their types rather than inferring them.\nexport async function auditObjectContentWithParser(input: {\n constructColumnAuditor: ConnectorUtilities['constructColumnAuditor'];\n declaredColumnConfigs?: DeclaredColumnConfig[] | undefined;\n onProgress: (recordCount: number, byteCount: number) => void;\n options: AuditObjectContentOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): Promise<AuditObjectContentResult> {\n const { constructColumnAuditor, declaredColumnConfigs, onProgress, options, signal, stream, toolConfigs } = input;\n const { encodingId, valueDelimiterId } = establishFileReading(options);\n const asAt = Date.now();\n const startedAt = performance.now();\n const columnAuditor = constructColumnAuditor(options.hasHeaders, declaredColumnConfigs);\n const { parser } = await loadParser(toolConfigs, options.dataFormatId, options.parserId);\n const timedSource = timeSourceWaits(stream);\n // Delimited text is cut at a record boundary here. A nested format can only be cut between its items, which only its\n // parser can find, so it is given the limit and the stop signal instead.\n const isStructured = STRUCTURED_DATA_FORMAT_IDS.has(options.dataFormatId);\n const auditSource = isStructured ? countBytes(timedSource.stream) : endAtRecordBoundary(timedSource.stream, { byteLimit: options.byteLimit, encodingId, stopSignal: options.stopSignal });\n const parsing = parser.parseStream(auditSource.stream, {\n abortSignal: signal,\n byteLimit: isStructured ? options.byteLimit : undefined,\n chunkSize: options.chunkSize,\n dataFormatId: options.dataFormatId,\n encodingId,\n stopSignal: isStructured ? options.stopSignal : undefined,\n structurePath: options.structurePath,\n valueDelimiterId\n });\n // The parser and the column auditor are timed apart, so the cost of each can be measured. Read with 'next' rather\n // than 'for await', which drops the summary the parser returns at the end.\n const parserReads = timeParserReads(parsing);\n let columnAuditDuration = 0;\n let parsed = await parserReads.readNext();\n while (parsed.done !== true) {\n try {\n const auditStartedAt = performance.now();\n columnAuditor.auditRecords(parsed.value.records);\n columnAuditDuration += performance.now() - auditStartedAt;\n onProgress(parsed.value.records.length, auditSource.byteCount());\n } catch (error) {\n await parsing.throw(error); // Lets the parser stop its read, then rethrows the error.\n throw error;\n }\n parsed = await parserReads.readNext();\n }\n const summary = parsed.value;\n const sourceWaitDuration = timedSource.waitDuration();\n const completeStartedAt = performance.now();\n const isComplete = summary.isComplete ?? auditSource.isComplete();\n const { columnConfigs, hasHeaders } = columnAuditor.completeAudit(isComplete);\n columnAuditDuration += performance.now() - completeStartedAt; // Settling each column's type is part of auditing its values.\n const contentAuditConfig: ContentAuditConfig = {\n asAt,\n byteCount: auditSource.byteCount(),\n columns: columnConfigs,\n commentLineCount: summary.commentLineCount,\n duration: performance.now() - startedAt,\n emptyLineCount: summary.emptyLineCount,\n invalidFieldLengthCount: summary.nonUniformRecordCount,\n isComplete,\n lineCount: summary.lineCount,\n recordCount: Math.max(0, summary.recordCount - (hasHeaders ? 1 : 0)), // A header record names the columns and is not data.\n sourceWaitDuration,\n parseDuration: Math.max(0, parserReads.duration() - sourceWaitDuration),\n columnAuditDuration\n };\n return { contentAuditConfig, hasHeaders };\n}\n\n// Maps the structure of a whole nested item, reporting the bytes read as it goes. A syntax error ends the map early and\n// is reported in it, with what was read before it kept.\nexport async function indexObjectStructureWithParser(input: {\n onProgress: (byteCount: number) => void;\n options: IndexObjectStructureOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): Promise<StructureIndex> {\n const { onProgress, options, signal, stream, toolConfigs } = input;\n const parser = await loadStructuredParser(toolConfigs, options.dataFormatId, options.parserId);\n const encodingId = options.encodingId ?? 'utf-8';\n return await parser.buildStructureIndex(stream, { abortSignal: signal, dataFormatId: options.dataFormatId, encodingId, isComplete: true, maxDepth: undefined, onProgress });\n}\n\n// Lists one page of a part of a nested item. The stream must start at the locator's start offset and may stop at its end\n// offset, so a connector that can read part of an item reads only those bytes.\nexport async function listObjectStructureEntriesWithParser(input: {\n options: ListObjectStructureEntriesOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): Promise<ListStructureEntriesResult> {\n const { options, signal, stream, toolConfigs } = input;\n const parser = await loadStructuredParser(toolConfigs, options.dataFormatId, options.parserId);\n return await parser.listStructureEntries(stream, {\n abortSignal: signal,\n dataFormatId: options.dataFormatId,\n entryCount: options.entryCount,\n locator: options.locator,\n maxValueLength: options.maxValueLength,\n path: options.structurePath\n });\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Only a file has an encoding and a value delimiter, and a parser needs both to read one. A nested format has no value\n// delimiter.\nfunction establishFileReading(options: { dataFormatId: DataFormatId; encodingId: string | undefined; path: string; valueDelimiterId: ValueDelimiterId | undefined }): {\n encodingId: string;\n valueDelimiterId: ValueDelimiterId;\n} {\n const valueDelimiterId = options.valueDelimiterId ?? (STRUCTURED_DATA_FORMAT_IDS.has(options.dataFormatId) ? '' : undefined);\n if (valueDelimiterId == null || options.encodingId == null) throw new Error(`'${options.path}' has no encoding or value delimiter, which a parser needs to read it.`);\n return { encodingId: options.encodingId, valueDelimiterId };\n}\n\n// The first audit of an item, from the records its preview parsed. The bytes were fetched before it started, so it has no\n// wait to report, and the parser's text mode does not count lines.\nfunction constructFirstAuditConfig(input: {\n asAt: number;\n columnAuditDuration?: number | undefined;\n columns: ContentAuditConfig['columns'];\n isComplete: boolean;\n parseDuration?: number | undefined;\n recordCount: number;\n size: number;\n startedAt: number;\n}): ContentAuditConfig {\n const { asAt, columnAuditDuration, columns, isComplete, parseDuration, recordCount, size, startedAt } = input;\n return {\n asAt,\n byteCount: size,\n columns,\n commentLineCount: undefined,\n duration: performance.now() - startedAt,\n emptyLineCount: undefined,\n invalidFieldLengthCount: undefined,\n isComplete,\n lineCount: undefined,\n recordCount,\n sourceWaitDuration: undefined,\n parseDuration,\n columnAuditDuration\n };\n}\n\n// Passes the stream through until the limit is reached or the stop signal fires, then ends it just after the next record.\n// Ending the stream, rather than aborting, lets the parser finish normally, so its counts are kept and no record is cut\n// in two. The limit is a minimum, because a record that runs past it is read to its end. Line breaks inside quotes do not\n// end a record, so every byte is checked for quotes, even while no limit is near. A large piece is handed over a part at a\n// time, the rest kept for the next read, so the byte count follows what the parser has taken.\nfunction endAtRecordBoundary(\n stream: ReadableStream<Uint8Array>,\n options: Pick<AuditObjectContentOptions, 'byteLimit' | 'stopSignal'> & { encodingId: string }\n): { byteCount: () => number; isComplete: () => boolean; stream: ReadableStream<Uint8Array> } {\n const reader = stream.getReader();\n const recordEndFinder = constructRecordEndFinder(options.encodingId);\n let byteCount = 0;\n let isComplete = false;\n let pendingBytes: Uint8Array | undefined; // What is left of the last piece read, not yet handed over.\n const boundedStream = new ReadableStream<Uint8Array>(\n {\n async pull(controller): Promise<void> {\n let pieceBytes = pendingBytes;\n if (pieceBytes == null) {\n const result = await reader.read();\n if (result.done) {\n isComplete = true;\n controller.close();\n return;\n }\n pieceBytes = result.value;\n }\n const bytes = pieceBytes.subarray(0, MAX_AUDIT_READ_BYTE_COUNT); // A view, not a copy.\n pendingBytes = pieceBytes.length > MAX_AUDIT_READ_BYTE_COUNT ? pieceBytes.subarray(MAX_AUDIT_READ_BYTE_COUNT) : undefined;\n const limit = options.stopSignal?.aborted === true ? byteCount : (options.byteLimit ?? Infinity);\n const recordEnd = recordEndFinder(bytes, byteCount, limit - byteCount);\n if (recordEnd == null) {\n byteCount += bytes.length;\n controller.enqueue(bytes);\n return;\n }\n byteCount += recordEnd;\n pendingBytes = undefined;\n controller.enqueue(bytes.subarray(0, recordEnd));\n controller.close();\n await reader.cancel();\n },\n cancel(reason): Promise<void> {\n return reader.cancel(reason);\n }\n },\n { highWaterMark: 0 }\n );\n return { byteCount: () => byteCount, isComplete: () => isComplete, stream: boundedStream };\n}\n\n// Finds where the first record to end at or after 'searchFrom' ends in a piece of the item, remembering across pieces\n// whether a quote is open. Doubled quotes inside a value close and reopen it, which leaves the answer right. UTF-8 never\n// uses these byte values inside a longer character. UTF-16 can, so it is read as two-byte units.\nfunction constructRecordEndFinder(encodingId: string): (bytes: Uint8Array, position: number, searchFrom: number) => number | undefined {\n const decoderId = resolveDecoderId(encodingId);\n const isUtf16 = decoderId.startsWith('utf-16');\n const unitByteCount = isUtf16 ? 2 : 1;\n const lowByteOffset = decoderId === 'utf-16be' ? 1 : 0;\n let quoteIsOpen = false;\n\n return (bytes, position, searchFrom): number | undefined => {\n for (let index = 0; index < bytes.length; index++) {\n const byte = bytes[index];\n if (byte !== QUOTE_BYTE && byte !== LINE_FEED_BYTE && byte !== CARRIAGE_RETURN_BYTE) continue;\n if (isUtf16 && ((position + index) % 2 !== lowByteOffset || bytes[index + 1 - 2 * lowByteOffset] !== 0)) continue;\n if (byte === QUOTE_BYTE) quoteIsOpen = !quoteIsOpen;\n else if (!quoteIsOpen && index >= searchFrom && (byte === LINE_FEED_BYTE || bytes[index + unitByteCount] !== LINE_FEED_BYTE))\n return index + unitByteCount - lowByteOffset;\n }\n };\n}\n\n// Passes the stream through, counting the bytes the parser has taken, for an audit's progress.\nfunction countBytes(stream: ReadableStream<Uint8Array>): { byteCount: () => number; isComplete: () => boolean; stream: ReadableStream<Uint8Array> } {\n const reader = stream.getReader();\n let byteCount = 0;\n let isComplete = false;\n const countedStream = new ReadableStream<Uint8Array>(\n {\n async pull(controller): Promise<void> {\n const result = await reader.read();\n if (result.done) {\n isComplete = true;\n controller.close();\n return;\n }\n byteCount += result.value.length;\n controller.enqueue(result.value);\n },\n cancel(reason): Promise<void> {\n return reader.cancel(reason);\n }\n },\n { highWaterMark: 0 }\n );\n return { byteCount: () => byteCount, isComplete: () => isComplete, stream: countedStream };\n}\n\n// Passes the stream through, adding up how long the parser waits for each chunk, so an audit can show how much of its\n// time went on fetching the item rather than reading it. A chunk is only asked for when the parser wants one, so the\n// wait is time the parser sat idle. The browser keeps receiving the item meanwhile, so this does not slow the fetch.\nfunction timeSourceWaits(stream: ReadableStream<Uint8Array>): { stream: ReadableStream<Uint8Array>; waitDuration: () => number } {\n const reader = stream.getReader();\n let waitDuration = 0;\n const timedStream = new ReadableStream<Uint8Array>(\n {\n async pull(controller): Promise<void> {\n const startedAt = performance.now();\n const result = await reader.read();\n waitDuration += performance.now() - startedAt;\n if (result.done) controller.close();\n else controller.enqueue(result.value);\n },\n cancel(reason): Promise<void> {\n return reader.cancel(reason);\n }\n },\n { highWaterMark: 0 }\n );\n return { stream: timedStream, waitDuration: () => waitDuration };\n}\n\n// Loads the tool the user chose for the format, or the format's default. Returns the id of the tool actually used.\n// Parses the preview's bytes in a data format, decoded as an audit and a load decode them, with the tool and value\n// delimiter given, or else the format's default tool and the delimiter detected. Returns undefined when there is no\n// text, or no tool reads the format yet. Delimited text\n// with no delimiter found is parsed again with the default delimiter, so the records match the delimiter reported. A\n// delimiter that was given is the only one tried. Whether the preview holds the whole item decides if a quote left open\n// at its end is an error, or a value the preview cut off.\n// A nested format whose structure was mapped is read from the part at 'structurePath'. With no part chosen or suggested,\n// there are no records until the user chooses one. When its structure could not be read at all, such as in an encoding\n// its parser does not read, the structure's issues are the sample's.\nasync function parsePreviewText(input: {\n bytes: Uint8Array;\n dataFormatId: DataFormatId | undefined;\n encodingId: string;\n isComplete: boolean;\n parserId: string | undefined;\n parseTiming: { duration: number };\n structureIndex: StructureIndex | undefined;\n structurePath: StructurePath | undefined;\n text: string | undefined;\n toolConfigs: ToolConfig[];\n valueDelimiterId: ValueDelimiterId | undefined;\n}): Promise<{ parserId: string; parsePreviewResult: ParsePreviewResult; structurePath: StructurePath | undefined; valueDelimiterId: ValueDelimiterId | undefined } | undefined> {\n const { bytes, dataFormatId, encodingId, isComplete, parserId, parseTiming, structureIndex, structurePath, text, toolConfigs, valueDelimiterId } = input;\n if (dataFormatId == null || text == null || listParserToolConfigs(toolConfigs, dataFormatId).length === 0) return undefined;\n\n const { parser, parserId: usedParserId } = await loadParser(toolConfigs, dataFormatId, parserId);\n if (structureIndex != null) {\n const isUnreadable = structureIndex.nodes.length === 0 && structureIndex.issues.length > 0;\n if (isUnreadable || structurePath == null) {\n const issues = isUnreadable ? structureIndex.issues : [];\n return { parserId: usedParserId, parsePreviewResult: { issues, parsedRecords: [], recordDelimiterId: '\\n', valueDelimiterId: undefined }, structurePath: undefined, valueDelimiterId: undefined };\n }\n const parsePreviewResult = await timeParse(parseTiming, () => parser.parsePreview(bytes, { dataFormatId, encodingId, isComplete, structurePath, valueDelimiterIds: [] }));\n return { parserId: usedParserId, parsePreviewResult, structurePath, valueDelimiterId: undefined };\n }\n const valueDelimiterIds = valueDelimiterId == null ? VALUE_DELIMITER_CONFIGS.map(({ id }) => id) : [valueDelimiterId];\n const firstParsePreviewResult = await timeParse(parseTiming, () => parser.parsePreview(bytes, { dataFormatId, encodingId, isComplete, valueDelimiterIds }));\n const isDelimitedText = dataFormatId === 'dtv';\n const parsePreviewResult =\n isDelimitedText && valueDelimiterId == null && firstParsePreviewResult.valueDelimiterId == null\n ? await timeParse(parseTiming, () => parser.parsePreview(bytes, { dataFormatId, encodingId, isComplete, valueDelimiterIds: [DEFAULT_VALUE_DELIMITER_ID] }))\n : firstParsePreviewResult;\n const reportedValueDelimiterId = isDelimitedText ? (valueDelimiterId ?? parsePreviewResult.valueDelimiterId ?? DEFAULT_VALUE_DELIMITER_ID) : parsePreviewResult.valueDelimiterId;\n return { parserId: usedParserId, parsePreviewResult, structurePath: undefined, valueDelimiterId: reportedValueDelimiterId };\n}\n\n// Maps the structure of a nested item from the preview's bytes, with the tool that reads its format. Undefined for a\n// format that does not nest, or when its tool does not map structure, which then reads the item its own way.\nasync function previewStructure(input: {\n dataFormatId: DataFormatId | undefined;\n filePreview: FilePreviewResult;\n parserId: string | undefined;\n parseTiming: { duration: number };\n toolConfigs: ToolConfig[];\n}): Promise<StructureIndex | undefined> {\n const { dataFormatId, filePreview, parserId, parseTiming, toolConfigs } = input;\n const isMapped =\n dataFormatId != null &&\n STRUCTURED_DATA_FORMAT_IDS.has(dataFormatId) &&\n listParserToolConfigs(toolConfigs, dataFormatId).length > 0 &&\n resolveParserToolConfig(toolConfigs, dataFormatId, parserId).actionNames?.includes('buildStructureIndex') === true;\n if (!isMapped) return undefined;\n const parser = await loadStructuredParser(toolConfigs, dataFormatId, parserId);\n const stream = new Blob([filePreview.bytes as Uint8Array<ArrayBuffer>]).stream();\n const encodingId = filePreview.decodedEncodingId ?? 'utf-8';\n return await timeParse(parseTiming, () =>\n parser.buildStructureIndex(stream, {\n abortSignal: new AbortController().signal, // The bytes are already in memory, so there is nothing to cancel.\n dataFormatId,\n encodingId,\n isComplete: filePreview.isComplete,\n maxDepth: undefined,\n onProgress: undefined\n })\n );\n}\n\n// Reads a parser's chunks one at a time and adds up how long each read takes, so the parser's time is kept apart from\n// what is done with each chunk once it is read. The total includes any wait for the item's bytes.\nfunction timeParserReads<T, TReturn>(parsing: AsyncIterator<T, TReturn>): { duration: () => number; readNext: () => Promise<IteratorResult<T, TReturn>> } {\n let duration = 0;\n return {\n duration: () => duration,\n async readNext(): Promise<IteratorResult<T, TReturn>> {\n const startedAt = performance.now();\n const result = await parsing.next();\n duration += performance.now() - startedAt;\n return result;\n }\n };\n}\n\n// Adds the time a parser call takes to 'parseTiming', so the parser's time is kept apart from loading its tool.\nasync function timeParse<T>(parseTiming: { duration: number }, parse: () => Promise<T>): Promise<T> {\n const startedAt = performance.now();\n try {\n return await parse();\n } finally {\n parseTiming.duration += performance.now() - startedAt;\n }\n}\n\nasync function loadParser(toolConfigs: ToolConfig[], dataFormatId: DataFormatId, parserId: string | undefined): Promise<{ parser: ParserInterface; parserId: string }> {\n const parserToolConfig = resolveParserToolConfig(toolConfigs, dataFormatId, parserId);\n const parser = await loadTool<ParserInterface>(toolConfigs, parserToolConfig.id.slice(TOOL_NAME_PREFIX.length));\n return { parser, parserId: parserToolConfig.id };\n}\n\n// The tool for a nested format, which must also map structure.\nasync function loadStructuredParser(toolConfigs: ToolConfig[], dataFormatId: DataFormatId, parserId: string | undefined): Promise<StructuredParserInterface> {\n const { parser, parserId: usedParserId } = await loadParser(toolConfigs, dataFormatId, parserId);\n if (!('buildStructureIndex' in parser)) {\n throw new AppError(`Tool '${usedParserId}' does not map the structure of '${dataFormatId}' items.`, 'dpuse-shared.component.module.connector.objectParsing.loadStructuredParser');\n }\n return parser as StructuredParserInterface;\n}\n","// ── DPUse Framework\nimport { ConnectorError } from '@/errors';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// 'heldElsewhere' means another tab or window has the store open, or has just taken it from this one. 'notLoaded' means\n// the store has no table at the path asked for, because it was never loaded or has since been removed.\nexport type StoreErrorId = 'heldElsewhere' | 'notLoaded';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The id travels in the error's data, which survives the trip from a connector through the engine to the app, so the\n// app can show the right state rather than a failure.\nexport function constructStoreError(storeErrorId: StoreErrorId, message: string, locator: string, options?: ErrorOptions): ConnectorError {\n return new ConnectorError(message, locator, { data: { storeErrorId }, ...options });\n}\n\n// Looks through the error and its causes, because the engine and the app each wrap a connector's error in their own.\nexport function findStoreErrorId(error: unknown): StoreErrorId | undefined {\n const seenErrors = new Set<unknown>();\n for (let cause: unknown = error; cause instanceof Error && !seenErrors.has(cause); cause = cause.cause) {\n seenErrors.add(cause);\n const storeErrorId = (cause as { data?: { storeErrorId?: unknown } }).data?.storeErrorId;\n if (storeErrorId === 'heldElsewhere' || storeErrorId === 'notLoaded') return storeErrorId;\n }\n return undefined;\n}\n","// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A database name becomes part of a file name, so it is kept to letters, digits, '_' and '-'.\nconst DATABASE_NAME_PATTERN = /^[\\w-]+$/u;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A store keeps its tables in one or more databases. A path '/database/table' names both. A path that is only a table's\n// name uses the store's default database, as every path did before a store could hold several.\nexport function resolveStorePath(path: string): { databaseName: string | undefined; tableName: string } {\n if (!path.startsWith('/')) return { databaseName: undefined, tableName: path };\n const [, databaseName, tableName, ...extraSegments] = path.split('/');\n if (databaseName == null || tableName == null || tableName === '' || extraSegments.length > 0 || !DATABASE_NAME_PATTERN.test(databaseName)) {\n throw new Error(`Encountered invalid store path '${path}'.`);\n }\n return { databaseName, tableName };\n}\n","// ── DPUse Framework\nimport type { ParsedRecord } from '@/component/dataView';\nimport type { StoreRecord, StoreValue } from '@/component/module/connector';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A typed record as text, for the steps that read text: a preview's sample, the column auditor and a load's conversion\n// to a type the user chose. A date and time is written in ISO 8601, in UTC. A null stays null, and an empty string stays\n// empty, as in delimited text.\nexport function convertStoreRecordToParsedRecord(storeRecord: StoreRecord): ParsedRecord {\n return storeRecord.map((storeValue) => convertStoreValueToText(storeValue));\n}\n\nexport function convertStoreValueToText(storeValue: StoreValue): string | null {\n if (storeValue == null) return null;\n return storeValue instanceof Date ? storeValue.toISOString() : String(storeValue);\n}\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface AcquireWebLockOptions {\n onLost?: () => void; // Called when another tab takes the lock over while this one holds it.\n takeOver?: boolean; // Takes the lock even when another tab holds it, which that tab's 'onLost' then hears of.\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Takes a Web Lock without waiting, so a tab that cannot have it is told at once. Returns the function that releases it,\n// or undefined when another tab holds it. A request that fails, e.g. where Web Locks are blocked, rejects. The browser\n// frees a released lock a moment later, so the release resolves only once the lock is free. Otherwise a request made\n// straight after a release would find the lock still held.\n//\n// A takeover is the way out when a tab holds the lock but cannot be reached, such as one left open in another window.\n// The browser ends the holder's request with an 'AbortError', so the holder can close what the lock protects.\nexport async function acquireWebLock(name: string, options: AcquireWebLockOptions = {}): Promise<(() => Promise<void>) | undefined> {\n const acquisition = Promise.withResolvers<(() => void) | undefined>();\n const grant = { isGranted: false }; // An object, because the lock callback sets it where type narrowing cannot see.\n const lockRequest = navigator.locks.request(name, options.takeOver === true ? { steal: true } : { ifAvailable: true }, (lock) => {\n if (lock == null) {\n acquisition.resolve(undefined);\n return;\n }\n grant.isGranted = true;\n return new Promise<void>((release) => {\n acquisition.resolve(release);\n });\n });\n const endedRequest = (async (): Promise<void> => {\n try {\n await lockRequest;\n } catch (error) {\n if (!grant.isGranted) acquisition.reject(error instanceof Error ? error : new Error(String(error)));\n else if (error instanceof DOMException && error.name === 'AbortError') options.onLost?.();\n }\n })();\n const release = await acquisition.promise;\n if (release == null) return;\n return async (): Promise<void> => {\n release();\n await endedRequest; // Settles once the browser has freed the lock, or at once when it was taken over.\n };\n}\n","// ── External Dependencies & Registrations\nimport { array, boolean, looseObject, number, optional, safeParse, string } from 'valibot';\n\n// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport { VALUE_DELIMITER_CONFIGS } from '@/component/dataView';\nimport type { DataSubtypeId, DeclaredColumnConfig, DeclaredReadingConfig } from '@/component/dataView';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype DeclaredType = Pick<DeclaredColumnConfig, 'dataSubtypeId' | 'dataTypeId'>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Only the properties DPUse reads. Others, such as 'constraints', are allowed and left alone.\nconst TABLE_SCHEMA_FIELD_SCHEMA = looseObject({ format: optional(string()), name: string(), title: optional(string()), type: optional(string()) });\nconst TABLE_SCHEMA_SCHEMA = looseObject({ fields: array(TABLE_SCHEMA_FIELD_SCHEMA) });\nconst HEADER_ROWS_SCHEMA = optional(array(number()));\nconst TABLE_DIALECT_SCHEMA = looseObject({ delimiter: optional(string()), header: optional(boolean()), headerRows: HEADER_ROWS_SCHEMA });\n\n// Table Schema types DPUse has a type for. The rest, such as 'object', 'geopoint' and 'any', the default, are inferred.\n// A 'year' is a whole number, because DPUse has no year type.\nconst TABLE_SCHEMA_TYPES: Partial<Record<string, DeclaredType>> = {\n boolean: { dataSubtypeId: undefined, dataTypeId: 'boolean' },\n date: { dataSubtypeId: 'date', dataTypeId: 'temporal' },\n datetime: { dataSubtypeId: 'dateTime', dataTypeId: 'temporal' },\n integer: { dataSubtypeId: 'integer', dataTypeId: 'numeric' },\n number: { dataSubtypeId: 'decimal', dataTypeId: 'numeric' },\n string: { dataSubtypeId: 'plain', dataTypeId: 'string' },\n time: { dataSubtypeId: 'time', dataTypeId: 'temporal' },\n year: { dataSubtypeId: 'integer', dataTypeId: 'numeric' }\n};\n\n// The string formats that match a DPUse text subtype. Any other format is plain text.\nconst TABLE_SCHEMA_STRING_SUBTYPES: Partial<Record<string, DataSubtypeId>> = { email: 'email', uri: 'url', uuid: 'uuid' };\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Reads a Table Schema, with the Table Dialect and encoding of its data resource when given, into the columns and reading\n// an audit takes as declared (https://datapackage.org/standard/table-schema/). The input takes the property names of a\n// Data Package resource, so a resource can be passed as it is. Fields match the item's columns by position, the\n// standard's default. A dialect that is not given takes the standard's defaults: a header row and a comma.\nexport function readTableSchema(resource: { dialect?: unknown; encoding?: string | undefined; schema: unknown }): {\n declaredColumnConfigs: DeclaredColumnConfig[];\n declaredReadingConfig: DeclaredReadingConfig;\n} {\n const schemaResult = safeParse(TABLE_SCHEMA_SCHEMA, resource.schema);\n if (!schemaResult.success) throw new AppError('The table schema is not valid.', 'dpuse-shared.component.module.connector.tableSchema.readTableSchema');\n const dialectResult = safeParse(TABLE_DIALECT_SCHEMA, resource.dialect ?? {});\n if (!dialectResult.success) throw new AppError('The table dialect is not valid.', 'dpuse-shared.component.module.connector.tableSchema.readTableSchema');\n\n const declaredColumnConfigs = schemaResult.output.fields.map((field): DeclaredColumnConfig => {\n const declaredType = constructDeclaredType(field.type, field.format);\n return { name: field.name, label: field.title, dataTypeId: declaredType.dataTypeId, dataSubtypeId: declaredType.dataSubtypeId };\n });\n const { delimiter = ',', header = true, headerRows = [1] } = dialectResult.output;\n return {\n declaredColumnConfigs,\n declaredReadingConfig: {\n dataFormatId: 'dtv',\n encodingId: resource.encoding?.toLowerCase(), // Detected when the resource does not say, as the standard leaves it.\n hasHeaders: header && headerRows.length > 0,\n valueDelimiterId: VALUE_DELIMITER_CONFIGS.find(({ character }) => character === delimiter)?.id // A delimiter DPUse does not offer is detected.\n }\n };\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nfunction constructDeclaredType(type: string | undefined, format: string | undefined): DeclaredType {\n const declaredType = type == null ? undefined : TABLE_SCHEMA_TYPES[type];\n if (declaredType == null) return { dataSubtypeId: undefined, dataTypeId: undefined };\n if (format == null || declaredType.dataTypeId !== 'string') return declaredType;\n return { dataSubtypeId: TABLE_SCHEMA_STRING_SUBTYPES[format] ?? 'plain', dataTypeId: 'string' };\n}\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\n\n// ── DPUse Framework\nimport type { EncodingDetectionConfig } from '@/encoding';\nimport type { EngineConnectorActionOptions } from '@/component/module/engine';\nimport type { LocalisedConfig } from '@/locale';\nimport type { ToolConfig } from '@/component/module/tool';\nimport type {\n ColumnAuditConfig,\n ColumnReadingConfig,\n ContentAuditConfig,\n DataFormatId,\n DeclaredColumnConfig,\n ParsedRecord,\n ReadingConfig,\n SampleConfig,\n ValueDelimiterId\n} from '@/component/dataView';\nimport type { ConnectionConfig, ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '@/component/connection';\nimport type {\n connectorActionNameSchema,\n connectorCategoryConfigSchema,\n connectorConfigSchema,\n connectorItemTypeConfigSchema,\n connectorItemTypeIdSchema,\n connectorUsageConfigSchema,\n connectorUsageIdSchema\n} from './connectorConfig.schema';\nimport { createLabelMap, DEFAULT_LOCALE_ID, type LocaleLabel, resolveLabel } from '@/locale/label';\nimport type { ListStructureEntriesResult, StructureIndex, StructureLocator, StructurePath } from '@/component/module/tool';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { connectorConfigSchema } from './connectorConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Interface\nexport interface ConnectorInterface {\n auditObjectContent?(options: AuditObjectContentOptions, chunk: (recordCount: number, byteCount: number) => void): Promise<AuditObjectContentResult>;\n closeStore?(options: CloseStoreOptions): Promise<void>; // Close a store connector's database and release its hold on it, so another tab can open it.\n createObject?(options: CreateObjectOptions): Promise<void>; // Create an object for a specified connection.\n describeConnection?(options: DescribeConnectionOptions): Promise<DescribeConnectionResult>; // Describe a specified connection.\n dropObject?(options: DropObjectOptions): Promise<void>; // Drop (delete) an object for a specified connection.\n findObject?(options: FindObjectOptions): Promise<FindObjectResult>; // Checks that an object exists, given its path as its id, and throws when it does not.\n getInfo?(options: GetInfoOptions): Promise<GetInfoResult>; // Get metadata/info for a node (at any hierarchy level) for a specified connection.\n getObject?(options: GetObjectOptions): Promise<GetObjectResult>; // Looks an object up by its id, wherever it is in the connection, and gives its path.\n getReadableStream?(options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>>; // Get a reader that can retrieve all records from an object for a specified connection.\n getRecord?(options: GetRecordOptions): Promise<GetRecordResult>; // Get a record for an object for a specified connection.\n indexObjectStructure?(options: IndexObjectStructureOptions, chunk: (byteCount: number) => void): Promise<StructureIndex>; // Map the structure of a whole nested item, such as JSON, reporting the bytes read as it goes.\n listNodes?(options: ListNodesOptions): Promise<ListNodesResult>; // List nodes in a folder for a specified connection.\n listObjectStructureEntries?(options: ListObjectStructureEntriesOptions): Promise<ListStructureEntriesResult>; // List one page of a part of a nested item, such as JSON.\n loadObjectRecords?(options: LoadObjectRecordsOptions, chunks: AsyncIterable<StoreChunk>): Promise<LoadObjectRecordsResult>; // Replace an object in a store connector with the records given.\n readonly storeChunkLayoutId?: StoreChunkLayoutId; // The layout a store connector takes a load's chunks in. Records, unless it asks for columns.\n openStore?(options: OpenStoreOptions): Promise<OpenStoreResult>; // Open a store connector's database, unless another tab holds it.\n previewObject?(options: PreviewObjectOptions): Promise<PreviewObjectResult>; // Preview an object for a specified connection.\n queryRecords?(options: QueryRecordsOptions): Promise<QueryRecordsResult>; // Query one page of an object in a store connector.\n removeRecords?(options: RemoveRecordsOptions): Promise<void>; // Remove one or more records from an object for a specified connection.\n retrieveRecords?(options: RetrieveRecordsOptions): AsyncGenerator<RetrieveRecordsChunk, RetrieveRecordsSummary, undefined>; // Retrieve all records from an object, a chunk at a time, then return the summary.\n upsertRecords?(options: UpsertRecordsOptions): Promise<void>; // Upsert one or more records into an object for a specified connection.\n}\n\nexport type ConnectorActionName = InferOutput<typeof connectorActionNameSchema>; // Names of the actions a connector may implement.\n\nexport type ConnectorConstructor = new (connectorUtilities: ConnectorUtilities, toolConfigs: ToolConfig[]) => ConnectorInterface;\n\n// 'declaredColumnConfigs' are the columns the item's source states, matched to the item's columns by position. Each\n// declared type is taken in place of the one the values suggest.\nexport interface ConnectorUtilities {\n constructColumnAuditor: (hasHeaders: boolean | undefined, declaredColumnConfigs?: DeclaredColumnConfig[]) => ColumnAuditor;\n hasReadableStreamTransferSupport(): boolean;\n inferDataTypes: (parsedRecords: ParsedRecord[], hasHeaders?: boolean, declaredColumnConfigs?: DeclaredColumnConfig[]) => InferenceSummary;\n isLogged: boolean; // Informational console messages. A connector is prebuilt, so it cannot tell a dev app from a prod one.\n}\n\n// Audits a whole object's columns one chunk of records at a time, so the object never has to be held in memory.\n// 'isComplete' says every record of the object was audited, so what no value showed, such as a unit, is known not to\n// be there. Without it the audit is taken to be of part of the object.\nexport interface ColumnAuditor {\n auditRecords: (parsedRecords: ParsedRecord[]) => void;\n completeAudit: (isComplete?: boolean) => InferenceSummary;\n}\n\n// The columns detected from a set of records, from a sample held in memory or from an audit.\nexport interface InferenceSummary {\n columnConfigs: ColumnAuditConfig[];\n hasHeaders: boolean; // Whether the first record is a header, detected unless the caller said.\n}\n\n// ── Configuration\nexport type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;\n\ntype ConnectorCategoryConfig = InferOutput<typeof connectorCategoryConfigSchema>;\n\ntype ConnectorItemTypeConfig = InferOutput<typeof connectorItemTypeConfigSchema>;\n\nexport type ConnectorItemTypeId = InferOutput<typeof connectorItemTypeIdSchema>;\n\ntype ConnectorUsageConfig = InferOutput<typeof connectorUsageConfigSchema>;\n\n// ── Audit Object Content\nexport interface AuditObjectContentOptions extends EngineConnectorActionOptions {\n byteLimit: number | undefined; // Stops at the first record to end after this many bytes. Reads the whole item when undefined.\n chunkSize: number | undefined;\n dataFormatId: DataFormatId; // From the preview.\n encodingId: string | undefined; // Only a file has one.\n hasHeaders: boolean | undefined; // From the preview. A header record names the columns and is not audited as data. Undefined when it was detected as absent, so the audit checks again with more records.\n parserId: string | undefined; // From the preview. The tool that read it, so the audit reads the item the same way.\n path: string;\n stopSignal: AbortSignal | undefined; // Stops at the end of the next record and keeps the result, unlike an abort. The engine adds it, because a signal cannot cross into the worker.\n structurePath?: StructurePath | undefined; // From the preview. The part of a nested item read as the table.\n supportsTransferableStreams: boolean;\n valueDelimiterId: ValueDelimiterId | undefined; // Only a file has one.\n}\nexport interface AuditObjectContentResult {\n contentAuditConfig: ContentAuditConfig;\n hasHeaders: boolean; // Whether the first record is a header. An audit can find one the sample missed, because it reads more records. It belongs to the reading configuration, not the audit.\n}\n\n// ── Close Store\nexport type CloseStoreOptions = EngineConnectorActionOptions;\n\n// ── Create Object\n// Columns are named by their position, because an audited column has a label but no id.\nexport interface CreateObjectOptions extends EngineConnectorActionOptions {\n columnConfigs: ObjectColumnConfig[]; // The object's columns, in order.\n indexedColumnIndexes: number[]; // Columns to index, so finding and sorting records by them is quick.\n keyColumnIndex: number | undefined; // The column whose value identifies each record. When undefined, records are numbered as they are added.\n path: string;\n}\n\n// ── Describe Connection\nexport type DescribeConnectionOptions = EngineConnectorActionOptions;\n\ninterface DescribeConnectionResult {\n descriptionConfig: ConnectionDescriptionConfig;\n}\n\n// ── Drop Object\nexport interface DropObjectOptions extends EngineConnectorActionOptions {\n path: string;\n}\n\n// ── Find Object\nexport interface FindObjectOptions extends EngineConnectorActionOptions {\n id: string; // The object's path, which is its id in a store.\n}\nexport interface FindObjectResult {\n path: string; // The object's path, the same as its id.\n}\n\n// ── Get Info\nexport interface GetInfoOptions extends EngineConnectorActionOptions {\n path: string;\n}\nexport interface GetInfoResult {\n info: Record<string, unknown>; // Raw, connector-specific metadata — not yet normalized to a common shape.\n}\n\n// ── Get Object\nexport interface GetObjectOptions extends EngineConnectorActionOptions {\n id: string; // The object's id, as 'listNodes' gives it.\n}\nexport interface GetObjectResult {\n path: string; // The object's path, as the other actions take it.\n}\n\n// ── Get Readable Stream\nexport interface GetReadableStreamOptions extends EngineConnectorActionOptions {\n path: string;\n}\n\n// ── Get Record\nexport interface GetRecordOptions extends EngineConnectorActionOptions {\n id: RecordKey;\n path: string;\n}\n\n// Identifies a record within its object. Records numbered as they were added have a number.\nexport type RecordKey = number | string;\nexport interface GetRecordResult {\n record: StoreRecord;\n}\n\n// ── Index Object Structure\nexport interface IndexObjectStructureOptions extends EngineConnectorActionOptions {\n dataFormatId: DataFormatId; // From the preview.\n encodingId: string | undefined; // From the preview.\n parserId: string | undefined; // From the preview. The tool that read it, so the structure is read the same way.\n path: string;\n}\n\n// ── List Nodes\nexport interface ListNodesOptions extends EngineConnectorActionOptions {\n folderPath: string;\n limit?: number;\n offset?: number;\n totalCount?: number;\n}\nexport interface ListNodesResult {\n cursor: string | number | undefined;\n connectionNodeConfigs: ConnectionNodeConfig[];\n isMore: boolean;\n totalCount: number;\n}\n\n// ── List Object Structure Entries\nexport interface ListObjectStructureEntriesOptions extends EngineConnectorActionOptions {\n dataFormatId: DataFormatId; // From the preview.\n entryCount: number; // The most entries to list.\n locator: StructureLocator; // From the parser: the node's own, a checkpoint's, or the next page's. The connector reads only the bytes it names.\n maxValueLength: number | undefined; // Longer text values are cut short. The parser's own default when undefined.\n parserId: string | undefined; // From the preview. The tool that read it, so the structure is read the same way.\n path: string;\n structurePath: StructurePath; // The node being listed.\n}\n\n// ── Load Object Records\nexport interface LoadObjectRecordsOptions extends EngineConnectorActionOptions {\n columnConfigs: ObjectColumnConfig[]; // The data view's columns, each with the type to load it as. The store creates the object's columns from these, in this order.\n path: string;\n}\nexport interface LoadObjectRecordsResult {\n recordCount: number;\n}\n\n// The engine's load reads the records from the source connection and passes them to the store connection, so they\n// never travel through the app.\nexport interface EngineLoadObjectRecordsOptions extends LoadObjectRecordsOptions {\n columnConfigs: ColumnReadingConfig[]; // As 'LoadObjectRecordsOptions' has them, with how each is read from the item's text. The store gets only the column itself.\n hasHeaders: boolean; // From the preview. A header record names the columns and is not loaded.\n ignoredColumnIndexes: number[]; // The columns the user chose to ignore, by position. The store gets no column for them.\n headerValues: (string | null)[] | undefined; // The preview's header record as it was read. A different header record means the columns have moved, so nothing is loaded.\n sourceConnectionConfig: ConnectionConfig | LocalisedConfig<ConnectionConfig>; // The app passes the localised one it holds.\n sourceOptions: RetrieveRecordsOptions; // Read the item the same way the audit did.\n}\n\nexport interface EngineLoadObjectRecordsResult extends LoadObjectRecordsResult {\n columnsHaveChanged: boolean; // The item's header record no longer matches 'headerValues'. Nothing was loaded, and any earlier load is kept.\n invalidValueCounts: number[]; // Per column, in the order of 'columnConfigs', the values that did not fit its type and so loaded as null.\n timing?: LoadTiming | undefined; // Undefined when nothing was loaded.\n}\n\n// ── Load Timing ─ In milliseconds, so the cost of each part of a load can be measured. The parts add up to 'duration'.\nexport interface LoadTiming {\n duration: number; // From the first record asked for to the last one stored.\n retrieveDuration: number; // The source connector's time to hand over the records, including the wait for bytes and the parser's time.\n sourceWaitDuration: number | undefined; // The part of 'retrieveDuration' spent waiting for the item's bytes. Undefined when the source connector does not time it.\n parseDuration: number | undefined; // The part of 'retrieveDuration' the parser took. Undefined when the source does not parse, such as a database, or does not time it.\n conversionDuration: number; // Reading each value as its column's type.\n storeDuration: number; // The store connector's time to write the records.\n}\n\n// A record's values in the order of the data view's columns. A value that is void, or does not fit its column's type, is\n// null.\nexport type StoreRecord = StoreValue[];\nexport type StoreValue = bigint | boolean | Date | number | string | null;\n\n// A chunk of a load as a store connector takes it: its records one by one, or the same values as one list for each\n// column, each as long as the chunk has records. A store that keeps its data by column, such as DuckDB, asks for\n// columns, which spares it turning records into them.\nexport type StoreChunk = StoreColumnChunk | StoreRecord[];\nexport type StoreChunkLayoutId = 'columns' | 'packedColumns' | 'records';\nexport interface StoreColumnChunk {\n columns: StoreColumn[]; // In the order of the data view's columns.\n recordCount: number;\n}\n\n// A column of a chunk: its values as a list, or, for a store that asks for packed columns, a column of decimal numbers\n// as one block of 64-bit numbers. A store that reads such blocks, as DuckDB does through Arrow, takes the block as it\n// is, with no value to copy.\nexport type StoreColumn = StorePackedNumberColumn | StoreValue[];\nexport interface StorePackedNumberColumn {\n nullCount: number;\n typeId: 'packedNumbers';\n validity: Uint8Array; // A bit for each value, lowest bit first, set when the value is present, as Arrow keeps them.\n values: Float64Array; // A value that is not present is 0.\n}\n\n// ── Open Store\nexport interface OpenStoreOptions extends EngineConnectorActionOptions {\n takeOver?: boolean; // Opens the store even when another tab holds it. That tab closes its store when it hears.\n}\nexport interface OpenStoreResult {\n storeStateId: StoreStateId;\n}\n\n// 'heldElsewhere' means another tab has the store open, as only one tab can open a database saved in the browser. Opening\n// with 'takeOver' takes it from that tab.\n// 'unavailable' means the browser gives no storage to keep it in, e.g. in some private windows.\nexport type StoreStateId = 'heldElsewhere' | 'ready' | 'unavailable';\n\n// ── Preview Object\nexport interface PreviewObjectOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n dataFormatId: DataFormatId | undefined; // A format the user chose, read in place of the one detected.\n encodingId: string | undefined; // An encoding the user chose, decoded in place of the one detected.\n extension: string | undefined;\n mimeType: string | undefined; // The type the connection's listing gave the item, if any.\n parserId: string | undefined; // A tool the user chose to read the item, used in place of the first that reads its format.\n path: string;\n structurePath?: StructurePath | undefined; // The part of a nested item the user chose to read as the table, used in place of the one suggested.\n valueDelimiterId: ValueDelimiterId | undefined; // A value delimiter the user chose, used in place of the one detected.\n}\nexport interface PreviewObjectResult {\n contentAuditConfig: ContentAuditConfig;\n sampleConfig: SampleConfig;\n readingConfig: ReadingConfig;\n encodingCandidates?: EncodingDetectionConfig[] | undefined; // For choosing another encoding. Not part of the reading, so not saved with the data view.\n structureIndex?: StructureIndex | undefined; // The structure of a nested item, as far as the preview read, for choosing the part read as the table. Not saved with the data view.\n}\n\n// ── Query Records\n// Columns are named by their position in the audit's columns, because an audited column has a label but no id. With\n// 'groupColumnIndexes', each result record holds the group's values, then one value for each aggregate.\nexport interface QueryRecordsOptions extends EngineConnectorActionOptions {\n aggregates: QueryAggregate[]; // Only read with 'groupColumnIndexes'.\n columnConfigs: ObjectColumnConfig[]; // The columns the object was loaded with, in its order, so the store reads each value back as its type.\n filters: QueryFilter[]; // A record must pass them all.\n groupColumnIndexes: number[]; // No grouping when empty.\n limit: number;\n offset: number;\n path: string;\n sorts: QuerySort[]; // Applied in order.\n}\nexport interface QueryAggregate {\n columnIndex: number | undefined; // Not given for 'count', which counts records.\n functionId: QueryAggregateFunctionId;\n}\nexport type QueryAggregateFunctionId = 'average' | 'count' | 'countDistinct' | 'maximum' | 'minimum' | 'sum';\nexport interface QueryFilter {\n columnIndex: number;\n operatorId: QueryFilterOperatorId;\n value: StoreValue; // Not read by 'isEmpty' and 'isNotEmpty'.\n}\nexport type QueryFilterOperatorId =\n 'contains' | 'endsWith' | 'equals' | 'greaterThan' | 'greaterThanOrEquals' | 'isEmpty' | 'isNotEmpty' | 'lessThan' | 'lessThanOrEquals' | 'notEquals' | 'startsWith';\nexport interface QuerySort {\n columnIndex: number; // A position in the result record, which differs from the audit's columns when grouped.\n directionId: 'ascending' | 'descending';\n}\nexport interface QueryRecordsResult {\n records: StoreRecord[];\n totalCount: number; // How many records, or groups, pass the filters in all, so a table can size itself.\n}\n\n// ── Recount Preview Columns\n// Counts a preview's columns again when the user says whether its first record is a header, so the item is not read again.\nexport interface RecountPreviewColumnsOptions extends EngineConnectorActionOptions {\n hasHeaders: boolean;\n parsedRecords: ParsedRecord[];\n}\n\n// Says what each value of the records shown is, so the table can mark the ones that do not fit their column.\nexport interface ClassifyPreviewValuesOptions extends EngineConnectorActionOptions {\n columnConfigs: ColumnReadingConfig[]; // Each column as the user wants it read.\n parsedRecords: ParsedRecord[]; // Data records only, with no header record.\n}\n\nexport type PreviewValueStateId = 'blank' | 'empty' | 'invalid' | 'null' | 'valid';\n\n// ── Remove Records\nexport interface RemoveRecordsOptions extends EngineConnectorActionOptions {\n keys: RecordKey[]; // Every record is removed when empty.\n path: string;\n}\n\n// ── Retrieve Records\nexport interface RetrieveRecordsOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n dataFormatId: DataFormatId; // From the preview.\n encodingId: string | undefined; // Only a file has one.\n parserId: string | undefined; // From the preview. The tool that read it, so the records are read the same way.\n path: string;\n structurePath?: StructurePath | undefined; // From the preview. The part of a nested item read as the table.\n valueDelimiterId: ValueDelimiterId | undefined; // Only a file has one.\n}\n// What every connector can say about a retrieval. A parser's counts of lines and bytes are in 'ParseStreamSummary'.\nexport interface RetrieveRecordsSummary {\n recordCount: number; // Records retrieved.\n sourceWaitDuration?: number | undefined; // In milliseconds, the time spent waiting for the item's bytes, such as while it downloads. Undefined when the connector does not time it.\n parseDuration?: number | undefined; // In milliseconds, the parser's time, without the wait for bytes. Undefined when the connector does not parse, or does not time it.\n}\n\nexport type RecordRetrievalTypeId = 'parsingRecordArray' | 'storeRecordArray';\n\n// One chunk of retrieved records. Nothing more is read until the next chunk is asked for, so a slow receiver, such as a\n// store being written to, holds the read back. A connector that reads text hands over its records still as text, to be\n// typed by the columns the user chooses. A connector that holds typed values hands them over typed.\nexport type RetrieveRecordsChunk = ParsedRecordsChunk | { records: StoreRecord[]; typeId: 'storeRecordArray' };\nexport interface ParsedRecordsChunk {\n byteCount?: number; // The bytes of the item read so far, so a load can show how far it has got. Undefined from a parser, which only counts its records.\n records: ParsedRecord[];\n typeId: 'parsingRecordArray';\n}\n\n// ── Upsert Records\nexport interface UpsertRecordsOptions extends EngineConnectorActionOptions {\n records: StoreRecord[];\n path: string;\n}\n\n// ── Usage\nexport type ConnectorUsageId = InferOutput<typeof connectorUsageIdSchema>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst CONNECTOR_CATEGORY_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'application', label: { en: 'Application', es: 'Aplicación' } },\n { id: 'curatedDataset', label: { en: 'Curated Dataset', es: 'Conjunto de Datos Curado' } },\n { id: 'database', label: { en: 'Database', es: 'Base de Datos' } },\n { id: 'fileStore', label: { en: 'File Store', es: 'Almacén de Archivos' } }\n];\n\nconst CONNECTOR_ITEM_TYPE_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'apiEndpoint', label: { en: 'API Endpoint', es: 'Endpoint de API' } },\n { id: 'file', label: { en: 'File', es: 'Archivo' } },\n { id: 'table', label: { en: 'Table', es: 'Tabla' } }\n];\n\nconst CONNECTOR_ACTION_NAME_MAP: Record<ConnectorActionName, string> = {\n auditObjectContent: 'Audit Object Content',\n closeStore: 'Close Store',\n createObject: 'Create Object',\n describeConnection: 'Describe Connection',\n dropObject: 'Drop Object',\n findObject: 'Find Object',\n getInfo: 'Get Info',\n getObject: 'Get Object',\n getReadableStream: 'Get Readable Stream',\n getRecord: 'Get Record',\n indexObjectStructure: 'Index Object Structure',\n listNodes: 'List Nodes',\n listObjectStructureEntries: 'List Object Structure Entries',\n loadObjectRecords: 'Load Object Records',\n openStore: 'Open Store',\n previewObject: 'Preview Object',\n queryRecords: 'Query Records',\n removeRecords: 'Remove Records',\n retrieveRecords: 'Retrieve Records',\n upsertRecords: 'Upsert Records'\n};\n\nconst CONNECTOR_USAGE_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'bidirectional', label: { en: 'Bidirectional', es: 'Bidireccional' } },\n { id: 'destination', label: { en: 'Destination', es: 'Destino' } },\n { id: 'source', label: { en: 'Source', es: 'Origen' } },\n { id: 'unknown', label: { en: 'Unknown', es: 'Desconocido' } }\n];\n\nconst CONNECTOR_DESTINATION_OPERATIONS = new Set<ConnectorActionName>(['createObject', 'dropObject', 'loadObjectRecords', 'removeRecords', 'upsertRecords']);\nconst CONNECTOR_SOURCE_OPERATIONS = new Set<ConnectorActionName>([\n 'auditObjectContent',\n 'findObject',\n 'getInfo',\n 'getObject',\n 'getReadableStream',\n 'getRecord',\n 'indexObjectStructure',\n 'listNodes',\n 'listObjectStructureEntries',\n 'previewObject',\n 'queryRecords',\n 'retrieveRecords'\n]);\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Object Fetching\nexport { type FetchObjectContentStreamOptions, fetchObjectContentStream } from './objectFetching';\n\n// ── Object Parsing\nexport { auditObjectContentWithParser, buildPreviewObjectResult, indexObjectStructureWithParser } from './objectParsing';\nexport { listObjectStructureEntriesWithParser, retrieveRecordsWithParser } from './objectParsing';\n\n// ── Store Errors\nexport { constructStoreError, findStoreErrorId, type StoreErrorId } from './storeErrors';\n\n// ── Store Paths\nexport { resolveStorePath } from './storePath';\n\n// ── Store Values\nexport { convertStoreRecordToParsedRecord, convertStoreValueToText } from './storeValues';\n\n// ── Web Locks\nexport { type AcquireWebLockOptions, acquireWebLock } from './webLock';\n\n// ── Table Schema\nexport { readTableSchema } from './tableSchema';\n\n// Determines whether a connector is a source, destination, or bidirectional connector, based on the actions it implements.\nexport function determineConnectorUsageId(actionNames: ConnectorActionName[]): ConnectorUsageId {\n let isSourceOperation = false;\n let isDestinationOperation = false;\n for (const actionName of actionNames) {\n if (CONNECTOR_SOURCE_OPERATIONS.has(actionName)) isSourceOperation = true;\n if (CONNECTOR_DESTINATION_OPERATIONS.has(actionName)) isDestinationOperation = true;\n }\n if (isSourceOperation && isDestinationOperation) return 'bidirectional';\n if (isSourceOperation) return 'source';\n return isDestinationOperation ? 'destination' : 'unknown'; // Neither reads nor writes data, e.g. only 'describeConnection'.\n}\n\nexport const constructConnectorCategoryConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorCategoryConfig> => {\n const connectorCategory = CONNECTOR_CATEGORY_CONFIGS.find((connectorCategory) => connectorCategory.id === id);\n if (connectorCategory) {\n const labelMap = createLabelMap(connectorCategory.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorCategory.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport const constructConnectorItemTypeConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorItemTypeConfig> => {\n const connectorItemType = CONNECTOR_ITEM_TYPE_CONFIGS.find((connectorItemType) => connectorItemType.id === id);\n if (connectorItemType) {\n const labelMap = createLabelMap(connectorItemType.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorItemType.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport const constructConnectorUsageConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorUsageConfig> => {\n const connectorUsage = CONNECTOR_USAGE_CONFIGS.find((connectorUsage) => connectorUsage.id === id);\n if (connectorUsage) {\n const labelMap = createLabelMap(connectorUsage.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorUsage.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport function getConnectorActionsTable(supported: ConnectorActionName[]): string {\n const supportedSet = new Set(supported);\n let md = '|Action|Supported|\\n';\n md += '|:----|:-------:|\\n';\n for (const id of Object.keys(CONNECTOR_ACTION_NAME_MAP) as ConnectorActionName[]) {\n md += `| ${CONNECTOR_ACTION_NAME_MAP[id]} | ${supportedSet.has(id) ? '✓' : ''} |\\n`;\n }\n return md;\n}\n","// ── External Dependencies & Registrations\nimport { array, literal, strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentReferenceConfigSchema } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Action Name\nexport const cookbookActionNameSchema = literalUnion(['list']);\n\n// ── Configuration\nexport const cookbookConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('cookbook'),\n actionNames: array(cookbookActionNameSchema),\n recipes: array(componentReferenceConfigSchema)\n});\n","// ── DPUse Framework\nimport type { ComponentInstanceConfig } from '@/component';\nimport type { EncodingTypeConfigLocalised } from '@/encoding';\nimport type { LocaleId } from '@/locale/label';\nimport type { LocalisedConfig } from '@/locale';\nimport type { ModuleConfig } from '@/component/module';\nimport type { ToolConfig } from '@/component/module/tool';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Runtime\n// TODO: Should this be interface?\nexport interface EngineRuntime {\n getEncodingTypeConfigs: (localeId: LocaleId) => EncodingTypeConfigLocalised[];\n // eslint-disable-next-line n/no-unsupported-features/node-builtins -- The browser's 'ErrorEvent', not Node's.\n invokeWorker(errorEventCallback: (errorEvent: ErrorEvent) => void): EngineWorker;\n}\n\n// ── Worker\nexport interface EngineWorker {\n initialise: (options: EngineInitialiseOptions) => Promise<void>;\n processRequest: (\n id: string,\n config: ComponentInstanceConfig | LocalisedConfig<ComponentInstanceConfig>,\n options: EngineAuthActionOptions | EngineConnectorActionOptions | EngineContextActionOptions,\n callback?: (callbackData: EngineCallbackData) => void\n ) => Promise<unknown>;\n}\n\nexport interface EngineInitialiseOptions {\n connectorStorageURLPrefix: string;\n isLogged: boolean; // Informational console messages. The engine is prebuilt, so it cannot tell a dev app from a prod one.\n toolConfigs: ToolConfig[];\n}\n\nexport interface EngineAuthActionOptions {\n accountId?: string;\n windowCenterX: number;\n windowCenterY: number;\n}\n\nexport interface EngineConnectorActionOptions {\n accountId?: string;\n appCheckToken?: string;\n requestId?: string; // Names the request, so the app can stop it with an 'abort' request naming the same id.\n sessionAccessToken?: string;\n signal?: AbortSignal | undefined; // Stops the action when the app aborts its request. The engine adds it, because a signal cannot cross into the worker.\n}\n\nexport interface EngineContextActionOptions {\n accountId?: string;\n appCheckToken?: string;\n sessionAccessToken?: string;\n}\n\nexport interface EngineCallbackData {\n typeId: string;\n properties: Record<string, unknown>;\n}\n\n// ── Configuration\nexport interface EngineConfig extends ModuleConfig {\n typeId: 'engine';\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The signal that stops an action. A request the app did not name has none, so its action gets one that never fires.\nexport function resolveRequestSignal(options: Pick<EngineConnectorActionOptions, 'signal'>): AbortSignal {\n return options.signal ?? new AbortController().signal;\n}\n","// ── External Dependencies & Registrations\nimport { array, literal, strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentReferenceConfigSchema } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Action Name\nexport const presenterActionNameSchema = literalUnion(['list', 'render', 'setColorMode']);\n\n// ── Configuration\nexport const presenterConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('presenter'),\n actionNames: array(presenterActionNameSchema),\n presentations: array(componentReferenceConfigSchema)\n});\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\n\n// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport { LocalisedReference } from '@/locale';\nimport type { ToolConfig } from '@/component/module/tool';\nimport type { Component, ComponentReferenceConfig } from '@/component';\nimport type { presenterActionNameSchema, presenterConfigSchema } from './presenterConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { presenterConfigSchema } from './presenterConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Interface\nexport interface PresenterInterface extends Component {\n readonly config: PresenterConfig;\n\n list(): ComponentReferenceConfig[]; // TODO: Do we need this? Configuration contains list.\n render(presentationReference: LocalisedReference<ComponentReferenceConfig>, renderTo: HTMLElement, data?: unknown): Promise<void>;\n setColorMode(colorModeId: string): void;\n}\n\nexport type PresenterActionName = InferOutput<typeof presenterActionNameSchema>; // Names of the actions a presenter may implement.\n\n// ── Configuration\nexport type PresenterConfig = InferOutput<typeof presenterConfigSchema>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst LOAD_URL_PREFIX = 'https://engine-eu.dpuse.app/presenters';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The upload folder is the presenter's id without its 'dpuse-presenter-' prefix, as dpuse-development publishes it.\n// The app passes its own HTML sanitiser, so a presenter does not bundle a second copy of DOMPurify, which would create a\n// second 'dompurify' Trusted Types policy.\nexport async function loadPresenter(\n presenterConfig: PresenterConfig,\n toolConfigs: ToolConfig[],\n colorModeId: string,\n sanitizeHTML: (html: string) => string\n): Promise<PresenterInterface> {\n const presenterName = presenterConfig.id;\n const presenterId = presenterName.split('-').slice(2).join('-');\n const url = `${LOAD_URL_PREFIX}/${presenterId}_v${presenterConfig.version}/${presenterName}.es.js`;\n try {\n const presenterModule = (await import(/* @vite-ignore */ url)) as {\n Presenter: new (toolConfigs: ToolConfig[], colorModeId: string, sanitizeHTML: (html: string) => string) => PresenterInterface;\n };\n return new presenterModule.Presenter(toolConfigs, colorModeId, sanitizeHTML);\n } catch (error) {\n // A bare import rejection names neither the presenter nor the version, so they are attached here.\n const data = { presenterName, url, version: presenterConfig.version };\n throw new AppError(`Failed to load presenter '${presenterName}' v${presenterConfig.version}.`, 'dpuse-shared.component.module.presenter.loadPresenter', { data, cause: error });\n }\n}\n","// ── DPUse Framework\nimport { DEFAULT_LOCALE_ID } from './label';\nimport type { LocaleDescription, LocaleId, LocaleLabel } from './label';\n\n// The label vocabulary is re-exported so that the published '@dpuse/dpuse-shared/locale' entry point stays one import\n// for consumers, while modules inside this package can depend on '@/locale/label' alone.\nexport * from './label';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type LocalisedConfig<T> = Omit<T, 'label' | 'description' | 'verb'> & { label: string; description: string; verb?: string | undefined };\n\ninterface UnlocalisedConfig {\n id: string;\n label: LocaleLabel;\n description: LocaleDescription;\n verb?: LocaleLabel | undefined;\n}\n\nexport type LocalisedReference<T> = Omit<T, 'label' | 'description'> & { label: string; description: string };\n\ninterface UnlocalisedReference {\n id: string;\n label: LocaleLabel;\n description: LocaleDescription;\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function localiseConfig<T extends UnlocalisedConfig>(config: T, localeId: LocaleId): LocalisedConfig<T> {\n return {\n ...config,\n label: config.label[localeId] ?? config.id,\n description: config.description[localeId] ?? config.description[DEFAULT_LOCALE_ID] ?? '',\n verb: config.verb?.[localeId] ?? undefined\n };\n}\n\nexport function localiseConfigs<T extends UnlocalisedConfig>(configs: T[], localeId: LocaleId, isResultSorted = false): LocalisedConfig<T>[] {\n const mapped = configs.map((config) => ({\n ...config,\n label: config.label[localeId] ?? config.id,\n description: config.description[localeId] ?? config.description[DEFAULT_LOCALE_ID] ?? '',\n verb: config.verb?.[localeId] ?? undefined\n }));\n return isResultSorted ? mapped.toSorted((a, b) => a.label.localeCompare(b.label) || a.id.localeCompare(b.id)) : mapped;\n}\n\nexport function localiseReference<T extends UnlocalisedReference>(reference: T, localeId: LocaleId): LocalisedReference<T> {\n return {\n ...reference,\n label: reference.label[localeId] ?? reference.id,\n description: reference.description[localeId] ?? reference.description[DEFAULT_LOCALE_ID] ?? ''\n };\n}\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type DurationUnit = 'day' | 'hour' | 'minute' | 'second' | 'millisecond';\nexport type UsageTypeId = 'boolean' | 'decimalNumber' | 'moment' | 'momentTime' | 'string' | 'unknown' | 'wholeNumber';\ntype StorageUnit = 'byte' | 'KiB' | 'MiB' | 'GiB' | 'TiB';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── MIME Types ─ Content types by file extension, for the connectors and the sample data upload alike, so a file is\n// described the same way everywhere. Never with a charset: many sample files are deliberately not UTF-8, and a charset\n// would tell browsers how to decode them. An extension missing here is 'application/octet-stream'.\nconst MIME_TYPES_BY_EXTENSION = new Map([\n ['arrow', 'application/vnd.apache.arrow.file'],\n ['avro', 'application/vnd.apache.avro'], // Not registered with IANA. Named as Apache's registered formats are.\n ['bin', 'application/octet-stream'],\n ['cfb', 'application/x-cfb'], // As 'file-type' reports a Compound File Binary container.\n ['csv', 'text/csv'],\n ['dat', 'application/octet-stream'], // The extension says nothing about the content.\n ['json', 'application/json'],\n ['jsonl', 'application/jsonl'], // Not registered with IANA. The type the JSON Lines site and OpenAPI use.\n ['md', 'text/markdown'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['parquet', 'application/vnd.apache.parquet'],\n ['sav', 'application/x-spss-sav'], // Not registered with IANA. The type Apache Tika uses.\n ['sqlite', 'application/vnd.sqlite3'],\n ['tab', 'text/tab-separated-values'],\n ['tsv', 'text/tab-separated-values'],\n ['txt', 'text/plain'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsm', 'application/vnd.ms-excel.sheet.macroEnabled.12'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml']\n]);\n\n// ── Locale\nconst NUMBER_FORMATTER_DEFAULT_LOCALE = 'en';\n\n// ── Units ─ Each unit with its size. Durations run largest first and storage smallest first, the order each formatter\n// searches. The duration names are 'Intl' unit identifiers, so 'Intl.NumberFormat' supplies the label in the requested\n// locale. Storage sizes are binary, so above bytes they take the IEC symbols, which are the same in every language.\nconst DURATION_UNITS: [DurationUnit, number][] = [\n ['day', 86_400_000],\n ['hour', 3_600_000],\n ['minute', 60_000],\n ['second', 1000],\n ['millisecond', 1]\n];\nconst STORAGE_UNITS: [StorageUnit, number][] = [\n ['byte', 1],\n ['KiB', 1024],\n ['MiB', 1_048_576],\n ['GiB', 1_073_741_824],\n ['TiB', 1_099_511_627_776]\n];\n\n// ── State ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst LIST_FORMATTER_MAP = new Map<string, Intl.ListFormat>();\nconst NUMBER_FORMATTER_MAP = new Map<string, Intl.NumberFormat>();\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Number Formatting\nexport function formatNumberAsDecimalNumber(number?: number, decimalPlaces = 2, minimumFractionDigits = decimalPlaces, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n if (number == null) return '';\n return getNumberFormatter(locale, {\n localeMatcher: 'best fit',\n maximumFractionDigits: decimalPlaces,\n minimumFractionDigits: Math.min(minimumFractionDigits, decimalPlaces), // 'Intl.NumberFormat' throws a 'RangeError' when the minimum is above the maximum.\n minimumIntegerDigits: 1,\n style: 'decimal',\n useGrouping: true\n }).format(number);\n}\n\nexport function formatNumberAsWholeNumber(number?: number, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n return formatNumberAsDecimalNumber(number, 0, 0, locale);\n}\n\n// Compact notation chooses the unit after rounding, so 999,999 shows as '1M' rather than '1,000K'.\nexport function formatNumberAsSize(number?: number, decimalPlaces = 1, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n return number == null || !Number.isFinite(number) ? '' : getNumberFormatter(locale, { maximumFractionDigits: decimalPlaces, notation: 'compact' }).format(number);\n}\n\n// The unit is chosen after rounding, so 1,048,575 bytes shows as '1 MiB' rather than '1,024 KiB'. 'Intl.NumberFormat'\n// has no IEC units, so it formats only the number above bytes, and the symbol follows it.\nexport function formatNumberAsStorageSize(number?: number, decimalPlaces = 1, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n if (number == null || !Number.isFinite(number)) return '';\n const [unit, size] = STORAGE_UNITS.find(([, unitSize]) => roundNumber(Math.abs(number) / unitSize, unitSize === 1 ? 0 : decimalPlaces) < 1024) ?? ['TiB', 1_099_511_627_776];\n return size === 1\n ? getNumberFormatter(locale, { maximumFractionDigits: 0, style: 'unit', unit: 'byte', unitDisplay: 'long' }).format(number) // Long, because the short English label, 'byte', has no plural.\n : `${getNumberFormatter(locale, { maximumFractionDigits: decimalPlaces }).format(number / size)} ${unit}`;\n}\n\nexport function formatNumberAsDuration(number?: number, stopAt: DurationUnit = 'millisecond', locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n if (number == null || !Number.isFinite(number)) return '';\n\n // Fractions are rounded away before the value is split into units, so the last unit cannot round up to '1,000 ms'.\n let remaining = Math.round(Math.abs(number));\n\n // Start at the largest unit the value actually fills, so a value below the requested level still reads sensibly\n // rather than as a run of zeroes.\n const startIndex = DURATION_UNITS.findIndex(([, unitSize]) => remaining >= unitSize);\n const firstIndex = startIndex === -1 ? DURATION_UNITS.length - 1 : startIndex;\n const stopIndex = DURATION_UNITS.findIndex(([unit]) => unit === stopAt);\n\n const durationUnits = DURATION_UNITS.slice(firstIndex, Math.max(stopIndex, firstIndex) + 1);\n const parts: string[] = [];\n for (const [unit, unitSize] of durationUnits) {\n const count = Math.floor(remaining / unitSize);\n if (count === 0 && parts.length > 0) continue;\n remaining -= count * unitSize;\n const signedCount = parts.length === 0 && number < 0 && count > 0 ? -count : count; // Only the first part carries the sign: '-1 min 30 sec'.\n parts.push(getNumberFormatter(locale, { style: 'unit', unit, unitDisplay: 'short' }).format(signedCount));\n }\n return getListFormatter(locale).format(parts);\n}\n\n// ── File Paths ─ A path splits into the part before its extension and the extension, and the two always rebuild the\n// path. Dots in folder names, the leading dot of a dotfile such as '.gitignore' and a trailing dot do not start an\n// extension.\nexport function extractPathWithoutExtension(itemPath: string): string | undefined {\n if (!itemPath) return undefined;\n const extensionSeparatorIndex = findExtensionSeparatorIndex(itemPath);\n return extensionSeparatorIndex === undefined ? itemPath : itemPath.slice(0, extensionSeparatorIndex);\n}\n\nexport function extractExtensionFromPath(itemPath: string): string | undefined {\n if (!itemPath) return undefined;\n const extensionSeparatorIndex = findExtensionSeparatorIndex(itemPath);\n return extensionSeparatorIndex === undefined ? undefined : itemPath.slice(extensionSeparatorIndex + 1);\n}\n\n// ── Lookup\n// Extensions arrive from file names as typed, so 'REPORT.PDF' must resolve the same as 'report.pdf'.\nexport function hasMimeTypeForExtension(extension?: string): boolean {\n return extension != null && MIME_TYPES_BY_EXTENSION.has(extension.toLowerCase());\n}\n\nexport function lookupMimeTypeForExtension(extension?: string): string {\n return (extension == null ? undefined : MIME_TYPES_BY_EXTENSION.get(extension.toLowerCase())) ?? 'application/octet-stream';\n}\n\n// ── Data Type Conversion ─ Covers the primitive types of OData v2 and v4.\n// See: https://www.odata.org/documentation/odata-version-2-0/overview/ and\n// https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html#sec_PrimitiveTypes.\nexport function convertODataTypeIdToUsageTypeId(oDataTypeId: string): UsageTypeId {\n switch (oDataTypeId) {\n case 'Edm.Boolean':\n return 'boolean';\n case 'Edm.Byte':\n case 'Edm.Int16':\n case 'Edm.Int32':\n case 'Edm.Int64':\n case 'Edm.SByte':\n return 'wholeNumber';\n case 'Edm.Decimal':\n case 'Edm.Double':\n case 'Edm.Single':\n return 'decimalNumber';\n case 'Edm.Date':\n case 'Edm.DateTime':\n case 'Edm.DateTimeOffset':\n return 'moment';\n case 'Edm.Time':\n case 'Edm.TimeOfDay':\n return 'momentTime';\n case 'Edm.Guid':\n case 'Edm.String':\n return 'string';\n default:\n return 'unknown'; // 'Edm.Binary', 'Edm.Duration', 'Edm.Stream' and the geography types have no usage type.\n }\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Returns undefined when the last segment of the path has no extension.\nfunction findExtensionSeparatorIndex(itemPath: string): number | undefined {\n const basenameStartIndex = itemPath.lastIndexOf('/') + 1;\n const extensionSeparatorIndex = itemPath.lastIndexOf('.');\n return extensionSeparatorIndex > basenameStartIndex && extensionSeparatorIndex < itemPath.length - 1 ? extensionSeparatorIndex : undefined;\n}\n\n// 'Intl' formatters are costly to create, so each one is created once per locale and set of options, then reused.\nfunction getListFormatter(locale: string): Intl.ListFormat {\n let listFormatter = LIST_FORMATTER_MAP.get(locale);\n if (!listFormatter) {\n listFormatter = new Intl.ListFormat(locale, { style: 'narrow', type: 'unit' });\n LIST_FORMATTER_MAP.set(locale, listFormatter);\n }\n return listFormatter;\n}\n\nfunction getNumberFormatter(locale: string, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const formatterId = `${locale}|${JSON.stringify(options)}`;\n let numberFormatter = NUMBER_FORMATTER_MAP.get(formatterId);\n if (!numberFormatter) {\n numberFormatter = new Intl.NumberFormat(locale, options);\n NUMBER_FORMATTER_MAP.set(formatterId, numberFormatter);\n }\n return numberFormatter;\n}\n\nfunction roundNumber(number: number, decimalPlaces: number): number {\n const factor = 10 ** decimalPlaces;\n return Math.round(number * factor) / factor;\n}\n\n// TODO: Do we need this?\n// // export const establishVendorAccessToken = async (item: Item, accountId: string, sessionAccessToken: string, vendorRefreshURI: string): Promise<string> => {\n// export const establishVendorAccessToken = async (connectionConfig: ConnectionConfig, settings: ReadSettings, vendorRefreshURI: string): Promise<string> => {\n// let accessToken;\n//\n// // If the current dropbox access token expires within 5 minutes then refresh it and return the new one, otherwise return the current one.\n// if (connectionConfig.authorisation[''].expires_at - Date.now() < 300000) {\n// // TODO: Above is WRONG 'item.authorization!['']'. We need to know what authorisation.\n// const headers: HeadersInit = {\n// 'Account-Id': settings.accountId || '',\n// Authorization: settings.sessionAccessToken || '',\n// 'Connection-Id': connectionConfig.id\n// };\n// const response = await fetch(vendorRefreshURI, { headers });\n// if (!response.ok) {\n// const data = {\n// body: {\n// context: 'establishVendorAccessToken',\n// message: await response.text()\n// },\n// statusCode: response.status,\n// statusText: response.statusText\n// };\n// throw new Error('Unable to establish access token.|' + JSON.stringify(data));\n// }\n// accessToken = await response.text();\n// } else {\n// accessToken = connectionConfig.authorisation[''].access_token; // TODO: This is WRONG 'item.authorization!['']'. We need to know what authorisation.\n// }\n//\n// return accessToken;\n// };\n"],"ignoreList":[1],"mappings":";AAcA,IAAaC,IAA8B,MAE9BC,IAAuE,CAChF;CAAE,IAAI;CAAM,MAAM;CAAM,OAAO;AAAU,GACzC;CAAE,IAAI;CAAM,MAAM;CAAM,OAAO;AAAU,CAC7C;AAIA,SAAgBC,EAAe,GAAgD;CAC3E,OAAO,IAAI,IAAI,OAAO,QAAQC,CAAM,CAAC;AACzC;AAEA,SAAgBC,EAAa,GAAwB,GAAkB,IAAA,MAA0D;CAC7H,IAAMC,IAAiBF,EAAO,IAAIG,CAAQ;CAE1C,OADID,MAAmB,KAAA,IAChBE,MAAqBD,IAAW,KAAA,IAAYH,EAAO,IAAII,CAAgB,IADrCF;AAE7C;;AC9BA,IACMG,IAAiB;CACtB,MAAM,KAAK;CACX,SAAS,KAAK;CACd,YAAY,KAAK;CACjB,gBAAgB,KAAK;AACtB;;AAoBA,SAASC,EAAgB,GAAU;CAElC,OADKC,IACE;EACN,MAAMA,GAAU,QAAQ;EACxB,SAASA,GAAU;EACnB,YAAYA,GAAU,cAAc;EACpC,gBAAgBA,GAAU,kBAAkB;CAC7C,IANkCF;AAOnC;;AA2HA,SAASG,EAAW,GAAO;CAC1B,IAAMC,IAAO,OAAOC;CAIpB,OAHID,MAAS,WAAiB,IAAIC,EAAM,KACpCD,MAAS,YAAYA,MAAS,YAAYA,MAAS,YAAkB,GAAGC,MACxED,MAAS,YAAYA,MAAS,cAAoBC,KAAS,OAAO,eAAeA,CAAK,CAAC,EAAE,aAAa,SAAS,SAC5GD;AACR;AAeA,SAASE,EAAU,GAAS,GAAO,GAAS,GAAU,GAAO;CAC5D,IAAMD,IAAQE,KAAS,WAAWA,IAAQA,EAAM,QAAQC,EAAQ,OAC1DC,IAAWF,GAAO,YAA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iB,GAAiC;CACvD,IAAIY,IAAgBnC,GAAmB,IAAIK,CAAM;CAKjD,OAJK8B,MACD,IAAgB,IAAI,KAAK,WAAW9B,GAAQ;EAAE,OAAO;EAAU,MAAM;CAAO,CAAC,GAC7EL,GAAmB,IAAIK,GAAQ8B,CAAa,IAEzCA;AACX;AAEA,SAAS/B,EAAmB,GAAgB,GAAsD;CAC9F,IAAMgC,IAAc,GAAG/B,EAAO,GAAG,KAAK,UAAUhX,CAAO,KACnDgZ,IAAkBpC,GAAqB,IAAImC,CAAW;CAK1D,OAJKC,MACD,IAAkB,IAAI,KAAK,aAAahC,GAAQhX,CAAO,GACvD4W,GAAqB,IAAImC,GAAaC,CAAe,IAElDA;AACX;AAEA,SAASzB,GAAY,GAAgB,GAA+B;CAChE,IAAM0B,IAAS,MAAMnC;CACrB,OAAO,KAAK,MAAM1X,IAAS6Z,CAAM,IAAIA;AACzC"}
|
|
1
|
+
{"version":3,"file":"dpuse-shared.es.js","names":["LOAD_URL_PREFIX","DEFAULT_LOCALE_ID","SUPPORTED_LANGUAGES","createLabelMap","labels","resolveLabel","localizedLabel","localeId","fallbackLocaleId","DEFAULT_CONFIG","getGlobalConfig","config$1","_stringify","type","input","_addIssue","other","dataset","expected","context","received","issue","label","isSchema","message$1","_isSameValueZero","value1","value2","_isValidObjectKey","object$1","key","_joinExpects","list","values$1","separator","_standardSchema","schema","value$1","minLength","requirement","getFallback","getDefault","array","itemDataset","pathItem","boolean","literal","literal_","looseObject","entries$1","valueSchema","valueDataset","nullable","wrapped","default_","number","optional","record","entryKey","entryValue","keyDataset","strictObject","string","_subIssues","issues","datasets","union","options","option","validDataset","typedDatasets","untypedDatasets","optionDataset","pipe","pipe$1","item","safeParse","localeLabelSchema","baseConfigSchema","literalUnion","values","value","componentTypeIdSchema","componentStatusColorIdSchema","componentStatusIdSchema","componentStatusConfigSchema","componentBaseConfigSchema","componentReferenceConfigSchema","componentCoreFieldsConfig","componentInstanceConfigSchema","COMPONENT_STATUS_CONFIGS","getComponentStatus","componentStatus","id","\"en\"","DATA_FORMAT_CONFIGS","VALUE_DELIMITER_CONFIGS","DATA_TYPE_CONFIGS","DECIMAL_SEPARATOR_IDS","getValueDelimiterCharacter","valueDelimiterId","moduleConfigCoreFields","connectorActionNameSchema","connectorCategoryIdSchema","connectorCategoryConfigSchema","connectorItemTypeIdSchema","connectorUsageIdSchema","connectorUsageConfigSchema","connectorImplementationSchema","connectorConfigSchema","DPUSE_ERROR_NAMES","RESPONSE_ERROR_BODY_LIMIT","REDACTED","REDACTION_MAX_DEPTH","SECRET_KEY_PATTERN","SECRET_TEXT_PATTERNS","scheme","name","match","DPUseError","message","locator","AppError","APIError","EngineError","ConnectorError","FetchError","buildFetchError","responseStatusStuff","response","fetchMessage","bodyText","error","normalizeToError","sanitizeResponseErrorBody","concatenateSerialisedErrorMessages","serialisedErrors","serialisedError","ignoreErrors","serialiseError","seenCauses","cause","nextCause","serialiseSingleError","redactedError","redactSerialisedError","unserialiseError","rebuiltError","serialised","reconstructError","buildFallbackMessage","fallbackMessage","data","redactValue","redactText","stack","redactedText","text","pattern","replacement","groups","depth","seen","body","isDPUseError","customProperties","k","RANGE_BYTE_COUNT","RANGE_NOT_SATISFIABLE_STATUS","fetchObjectContentStream","doesFetchPauseUnreadDownloads","url","establishResponseBody","readAhead","rangeOptions","firstResponse","fetchObjectRange","nextOffset","pendingRange","holdObjectRange","heldRange","bytes","controller","userAgentData","brand","pendingResponse","range","startOffset","ENCODING_GROUP_CONFIG_DATA","ENCODING_TYPE_CONFIG_DATA","ENCODING_GROUP_CONFIG_MAP","ENCODING_TYPE_CONFIG_MAP","isEncodingTypeId","resolveDecoderId","encodingId","getEncodingTypeConfigs","groupLabel","groupId","resolveGroupLabel","textDecoderId","left","right","parserConfigSchema","toolActionNamesSchema","toolConfigSchema","parseDelimitedPreview","preview","recordDelimiterId","determineRecordDelimiter","determineValueDelimiter","parseWithDelimiter","countCRLF","countLF","countCR","priorAverageCount","priorSumCountDiffs","parsedRecords","fewestIssuesParse","hasParsedWithoutIssues","delimiter","delimiters","isComplete","chooseFewerIssues","records","measureValueCounts","sumOfValueCountDiffs","averageValueCount","isTabular","priorParse","parse","totalValueCount","priorValueCount","recordCountByValueCount","commonValueCount","commonRecordCount","LOAD_URL_PREFIX$1","DEFAULT_PARSER_TOOL_IDS","TOOL_NAME_PREFIX","listParserToolConfigs","toolConfigs","config","dataFormatId","first","second","resolveParserToolConfig","parserToolConfigs","firstParserToolConfig","defaultParserId","parserId","loadTool","toolName","toolId","toolModuleConfig","DEFAULT_RECORD_DELIMITER_ID","DEFAULT_VALUE_DELIMITER_ID","STRUCTURED_DATA_FORMAT_IDS","isStructured","CARRIAGE_RETURN_BYTE","LINE_FEED_BYTE","QUOTE_BYTE","MAX_AUDIT_READ_BYTE_COUNT","buildPreviewObjectResult","filePreview","isDeclared","declaredReadingConfig","size","sampleDecoding","encodingCandidates","detectedEncoding","constructFirstAuditConfig","detectedDataFormatId","declaredValueDelimiterId","parseTiming","detectedStructureIndex","previewStructure","previewEncodingId","detectedParse","parsePreviewText","sampleDataFormatId","readingChoiceConfig","isFormatChosen","isParseChosen","sampleStructureIndex","sampleParse","sampleRecords","sampleHasHeaders","columnAuditStartedAt","sampleInference","inferDataTypes","declaredColumnConfigs","detectedInference","retrieveRecordsWithParser","establishFileReading","loadParser","timedSource","timeSourceWaits","stream","countedSource","countBytes","parsing","parser","signal","parserReads","timeParserReads","isParsingDone","parsed","sourceWaitDuration","auditObjectContentWithParser","asAt","startedAt","columnAuditor","constructColumnAuditor","auditSource","endAtRecordBoundary","columnAuditDuration","auditStartedAt","onProgress","summary","completeStartedAt","columnConfigs","indexObjectStructureWithParser","loadStructuredParser","listObjectStructureEntriesWithParser","reader","recordEndFinder","constructRecordEndFinder","byteCount","pendingBytes","pieceBytes","result","limit","recordEnd","reason","decoderId","isUtf16","unitByteCount","lowByteOffset","quoteIsOpen","index","byte","position","searchFrom","waitDuration","usedParserId","structureIndex","isUnreadable","structurePath","timeParse","valueDelimiterIds","firstParsePreviewResult","isDelimitedText","parsePreviewResult","duration","parserToolConfig","constructStoreError","findStoreErrorId","seenErrors","storeErrorId","DATABASE_NAME_PATTERN","resolveStorePath","path","databaseName","tableName","extraSegments","convertStoreRecordToParsedRecord","storeRecord","convertStoreValueToText","storeValue","acquireWebLock","acquisition","grant","lockRequest","lock","release","endedRequest","TABLE_SCHEMA_SCHEMA","TABLE_DIALECT_SCHEMA","TABLE_SCHEMA_TYPES","TABLE_SCHEMA_STRING_SUBTYPES","readTableSchema","schemaResult","resource","dialectResult","declaredType","constructDeclaredType","field","header","headerRows","character","format","CONNECTOR_CATEGORY_CONFIGS","CONNECTOR_ITEM_TYPE_CONFIGS","CONNECTOR_ACTION_NAME_MAP","CONNECTOR_USAGE_CONFIGS","CONNECTOR_DESTINATION_OPERATIONS","CONNECTOR_SOURCE_OPERATIONS","determineConnectorUsageId","isSourceOperation","isDestinationOperation","actionName","actionNames","constructConnectorCategoryConfig","connectorCategory","constructConnectorItemTypeConfig","connectorItemType","constructConnectorUsageConfig","connectorUsage","getConnectorActionsTable","supportedSet","supported","md","cookbookActionNameSchema","cookbookConfigSchema","resolveRequestSignal","presenterActionNameSchema","presenterConfigSchema","LOAD_URL_PREFIX","loadPresenter","presenterName","presenterConfig","colorModeId","sanitizeHTML","localiseConfig","localiseConfigs","mapped","configs","isResultSorted","a","b","localiseReference","reference","MIME_TYPES_BY_EXTENSION","NUMBER_FORMATTER_DEFAULT_LOCALE","DURATION_UNITS","STORAGE_UNITS","LIST_FORMATTER_MAP","NUMBER_FORMATTER_MAP","formatNumberAsDecimalNumber","decimalPlaces","getNumberFormatter","locale","minimumFractionDigits","formatNumberAsWholeNumber","formatNumberAsSize","formatNumberAsStorageSize","unit","unitSize","roundNumber","formatNumberAsDuration","remaining","startIndex","firstIndex","stopIndex","stopAt","durationUnits","parts","count","signedCount","getListFormatter","extractPathWithoutExtension","itemPath","extensionSeparatorIndex","findExtensionSeparatorIndex","extractExtensionFromPath","hasMimeTypeForExtension","extension","lookupMimeTypeForExtension","convertODataTypeIdToUsageTypeId","oDataTypeId","basenameStartIndex","listFormatter","formatterId","numberFormatter","factor"],"sources":["../src/locale/label.ts","../node_modules/valibot/dist/index.mjs","../src/locale/locale.schema.ts","../src/baseConfig.schema.ts","../src/schema.ts","../src/component/componentConfig.schema.ts","../src/component/index.ts","../src/component/dataView/index.ts","../src/component/module/moduleConfig.schema.ts","../src/component/module/connector/connectorConfig.schema.ts","../src/errors/index.ts","../src/component/module/connector/objectFetching.ts","../src/encoding/index.ts","../src/component/module/tool/toolConfig.schema.ts","../src/component/module/tool/delimitedText.ts","../src/component/module/tool/index.ts","../src/component/module/connector/objectParsing.ts","../src/component/module/connector/storeErrors.ts","../src/component/module/connector/storePath.ts","../src/component/module/connector/storeValues.ts","../src/component/module/connector/webLock.ts","../src/component/module/connector/tableSchema.ts","../src/component/module/connector/index.ts","../src/component/module/cookbook/cookbookConfig.schema.ts","../src/component/module/engine/index.ts","../src/component/module/presenter/presenterConfig.schema.ts","../src/component/module/presenter/index.ts","../src/locale/index.ts","../src/utilities/index.ts"],"sourcesContent":["// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype FlagId = 'es' | 'gb';\n\nexport type LocaleId = 'en' | 'es';\n\nexport type LocaleLabel = Partial<Record<LocaleId, string>>;\n\nexport type LocaleDescription = Partial<Record<LocaleId, string>>;\n\nexport type LocaleLabelMap = ReadonlyMap<string, string>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const DEFAULT_LOCALE_ID: LocaleId = 'en';\n\nexport const SUPPORTED_LANGUAGES: { id: LocaleId; flag: FlagId; label: string }[] = [\n { id: 'en', flag: 'gb', label: 'English' },\n { id: 'es', flag: 'es', label: 'Español' }\n];\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function createLabelMap(labels: Record<string, string>): LocaleLabelMap {\n return new Map(Object.entries(labels));\n}\n\nexport function resolveLabel(labels: LocaleLabelMap, localeId: string, fallbackLocaleId = DEFAULT_LOCALE_ID): string | undefined {\n const localizedLabel = labels.get(localeId);\n if (localizedLabel !== undefined) return localizedLabel;\n return fallbackLocaleId === localeId ? undefined : labels.get(fallbackLocaleId);\n}\n","//#region src/storages/globalConfig/globalConfig.ts\nlet store$4;\nconst DEFAULT_CONFIG = {\n\tlang: void 0,\n\tmessage: void 0,\n\tabortEarly: void 0,\n\tabortPipeEarly: void 0\n};\n/**\n* Sets the global configuration.\n*\n* @param config The configuration.\n*/\nfunction setGlobalConfig(config$1) {\n\tstore$4 = {\n\t\t...store$4,\n\t\t...config$1\n\t};\n}\n/**\n* Returns the global configuration.\n*\n* @param config The config to merge.\n*\n* @returns The configuration.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalConfig(config$1) {\n\tif (!config$1 && !store$4) return DEFAULT_CONFIG;\n\treturn {\n\t\tlang: config$1?.lang ?? store$4?.lang,\n\t\tmessage: config$1?.message,\n\t\tabortEarly: config$1?.abortEarly ?? store$4?.abortEarly,\n\t\tabortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly\n\t};\n}\n/**\n* Deletes the global configuration.\n*/\nfunction deleteGlobalConfig() {\n\tstore$4 = void 0;\n}\n\n//#endregion\n//#region src/storages/globalMessage/globalMessage.ts\nlet store$3;\n/**\n* Sets a global error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setGlobalMessage(message$1, lang) {\n\tif (!store$3) store$3 = /* @__PURE__ */ new Map();\n\tstore$3.set(lang, message$1);\n}\n/**\n* Returns a global error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalMessage(lang) {\n\treturn store$3?.get(lang);\n}\n/**\n* Deletes a global error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteGlobalMessage(lang) {\n\tstore$3?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/schemaMessage/schemaMessage.ts\nlet store$2;\n/**\n* Sets a schema error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSchemaMessage(message$1, lang) {\n\tif (!store$2) store$2 = /* @__PURE__ */ new Map();\n\tstore$2.set(lang, message$1);\n}\n/**\n* Returns a schema error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSchemaMessage(lang) {\n\treturn store$2?.get(lang);\n}\n/**\n* Deletes a schema error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteSchemaMessage(lang) {\n\tstore$2?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/specificMessage/specificMessage.ts\nlet store$1;\n/**\n* Sets a specific error message.\n*\n* @param reference The identifier reference.\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSpecificMessage(reference, message$1, lang) {\n\tif (!store$1) store$1 = /* @__PURE__ */ new Map();\n\tif (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map());\n\tstore$1.get(reference).set(lang, message$1);\n}\n/**\n* Returns a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSpecificMessage(reference, lang) {\n\treturn store$1?.get(reference)?.get(lang);\n}\n/**\n* Deletes a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*/\nfunction deleteSpecificMessage(reference, lang) {\n\tstore$1?.get(reference)?.delete(lang);\n}\n\n//#endregion\n//#region src/utils/_stringify/_stringify.ts\n/**\n* Stringifies an unknown input to a literal or type string.\n*\n* @param input The unknown input.\n*\n* @returns A literal or type string.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _stringify(input) {\n\tconst type = typeof input;\n\tif (type === \"string\") return `\"${input}\"`;\n\tif (type === \"number\" || type === \"bigint\" || type === \"boolean\") return `${input}`;\n\tif (type === \"object\" || type === \"function\") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? \"null\";\n\treturn type;\n}\n\n//#endregion\n//#region src/utils/_addIssue/_addIssue.ts\n/**\n* Adds an issue to the dataset.\n*\n* @param context The issue context.\n* @param label The issue label.\n* @param dataset The input dataset.\n* @param config The configuration.\n* @param other The optional props.\n*\n* @internal\n*/\nfunction _addIssue(context, label, dataset, config$1, other) {\n\tconst input = other && \"input\" in other ? other.input : dataset.value;\n\tconst expected = other?.expected ?? context.expects ?? null;\n\tconst received = other?.received ?? /* @__PURE__ */ _stringify(input);\n\tconst issue = {\n\t\tkind: context.kind,\n\t\ttype: context.type,\n\t\tinput,\n\t\texpected,\n\t\treceived,\n\t\tmessage: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : \"R\"}eceived ${received}`,\n\t\trequirement: context.requirement,\n\t\tpath: other?.path,\n\t\tissues: other?.issues,\n\t\tlang: config$1.lang,\n\t\tabortEarly: config$1.abortEarly,\n\t\tabortPipeEarly: config$1.abortPipeEarly\n\t};\n\tconst isSchema = context.kind === \"schema\";\n\tconst message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);\n\tif (message$1 !== void 0) issue.message = typeof message$1 === \"function\" ? message$1(issue) : message$1;\n\tif (isSchema) dataset.typed = false;\n\tif (dataset.issues) dataset.issues.push(issue);\n\telse dataset.issues = [issue];\n}\n\n//#endregion\n//#region src/utils/_cloneDataset/_cloneDataset.ts\n/**\n* Creates a shallow copy of a dataset.\n*\n* Hint: The `value` is copied by reference, but the `issues` array, its issues\n* and their `path` arrays are cloned to avoid reusing mutable dataset state\n* across multiple runs. Mutating a returned object or array value can\n* therefore affect later cache hits that reuse the same cached output.\n*\n* @param dataset The output dataset.\n*\n* @returns The copied output dataset.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _cloneDataset(dataset) {\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tvalue: dataset.value,\n\t\tissues: dataset.issues?.map((issue) => ({\n\t\t\t...issue,\n\t\t\tpath: issue.path && [...issue.path]\n\t\t}))\n\t};\n}\n\n//#endregion\n//#region src/utils/_formatCase/_formatCase.ts\n/**\n* Splits a string into lowercase words and rejoins them with the given\n* separator and capitalization rules.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries. Whether the first or subsequent words are\n* capitalized is controlled by `capFirst` and `capRest`.\n*\n* Hint: Implemented in a single pass that emits directly to the result\n* string to avoid an intermediate `string[]` allocation. ASCII chars are\n* classified via char codes to skip `.toLowerCase()` and `.toUpperCase()`\n* method calls in the common case.\n*\n* Hint: Digits are treated as a separate character class, so `item2Name`\n* yields `item2` and `name` rather than `item`, `2` and `name`.\n*\n* @param input The input string.\n* @param separator The string inserted between words.\n* @param capFirst Whether to capitalize the first word.\n* @param capRest Whether to capitalize subsequent words.\n*\n* @returns The formatted string.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _formatCase(input, separator, capFirst, capRest) {\n\tlet result = \"\";\n\tlet firstWord = true;\n\tlet start = 0;\n\tlet prev = 0;\n\tlet prevPrev = 0;\n\tconst flush = (end) => {\n\t\tif (end > start) {\n\t\t\tlet word = input.slice(start, end).toLowerCase();\n\t\t\tif (firstWord ? capFirst : capRest) {\n\t\t\t\tconst firstCode = word.charCodeAt(0);\n\t\t\t\tif (firstCode >= 97 && firstCode <= 122) word = String.fromCharCode(firstCode - 32) + word.slice(1);\n\t\t\t\telse {\n\t\t\t\t\tconst charLen = firstCode >= 55296 && firstCode <= 56319 ? 2 : 1;\n\t\t\t\t\tword = word.slice(0, charLen).toUpperCase() + word.slice(charLen);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult += firstWord ? word : separator + word;\n\t\t\tfirstWord = false;\n\t\t}\n\t};\n\tfor (let index = 0; index < input.length; index++) {\n\t\tconst code = input.charCodeAt(index);\n\t\tlet type;\n\t\tif (code === 32 || code === 9 || code === 10 || code === 11 || code === 12 || code === 13 || code === 45 || code === 95) {\n\t\t\tflush(index);\n\t\t\tstart = index + 1;\n\t\t\ttype = 0;\n\t\t} else if (code < 128) type = code >= 65 && code <= 90 ? 1 : code >= 97 && code <= 122 ? 2 : 3;\n\t\telse {\n\t\t\tconst char = input[index];\n\t\t\tconst charLower = char.toLowerCase();\n\t\t\ttype = charLower === char.toUpperCase() ? 3 : char === charLower ? 2 : 1;\n\t\t}\n\t\tif (type === 1 && (prev === 2 || prev === 3) && index > start) {\n\t\t\tflush(index);\n\t\t\tstart = index;\n\t\t} else if (type === 2 && prev === 1 && prevPrev === 1 && index - 1 > start) {\n\t\t\tflush(index - 1);\n\t\t\tstart = index - 1;\n\t\t}\n\t\tprevPrev = prev;\n\t\tprev = type;\n\t}\n\tflush(input.length);\n\treturn result;\n}\n\n//#endregion\n//#region src/utils/_getByteCount/_getByteCount.ts\nlet textEncoder;\n/**\n* Returns the byte count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The byte count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getByteCount(input) {\n\tif (!textEncoder) textEncoder = new TextEncoder();\n\treturn textEncoder.encode(input).length;\n}\n\n//#endregion\n//#region src/utils/_getCodePointCount/_getCodePointCount.ts\n/**\n* Returns the code point count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The code point count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getCodePointCount(input) {\n\tlet count = input.length;\n\tconst lengthMinus1 = input.length - 1;\n\tfor (let i = 0; i < lengthMinus1;) if (input.codePointAt(i) <= 65535) i++;\n\telse {\n\t\ti += 2;\n\t\tcount--;\n\t}\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_getGraphemeCount/_getGraphemeCount.ts\nlet segmenter;\n/**\n* Returns the grapheme count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The grapheme count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getGraphemeCount(input) {\n\tif (!segmenter) segmenter = new Intl.Segmenter();\n\tconst segments = segmenter.segment(input);\n\tlet count = 0;\n\tfor (const _ of segments) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_getLastMetadata/_getLastMetadata.ts\n/**\n* Returns the last top-level value of a given metadata type from a schema\n* using a breadth-first search that starts with the last item in the pipeline.\n*\n* @param schema The schema to search.\n* @param type The metadata type.\n*\n* @returns The value, if any.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getLastMetadata(schema, type) {\n\tif (\"pipe\" in schema) {\n\t\tconst nestedSchemas = [];\n\t\tfor (let index = schema.pipe.length - 1; index >= 0; index--) {\n\t\t\tconst item = schema.pipe[index];\n\t\t\tif (item.kind === \"schema\" && \"pipe\" in item) nestedSchemas.push(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === type) return item[type];\n\t\t}\n\t\tfor (const nestedSchema of nestedSchemas) {\n\t\t\tconst result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type);\n\t\t\tif (result !== void 0) return result;\n\t\t}\n\t}\n}\n\n//#endregion\n//#region src/utils/_getWordCount/_getWordCount.ts\nlet store;\n/**\n* Returns the word count of the input.\n*\n* @param locales The locales to be used.\n* @param input The input to be measured.\n*\n* @returns The word count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getWordCount(locales, input) {\n\tif (!store) store = /* @__PURE__ */ new Map();\n\tconst key = String(locales);\n\tlet segmenter$1 = store.get(key);\n\tif (!segmenter$1) {\n\t\tsegmenter$1 = new Intl.Segmenter(locales, { granularity: \"word\" });\n\t\tstore.set(key, segmenter$1);\n\t}\n\tconst segments = segmenter$1.segment(input);\n\tlet count = 0;\n\tfor (const segment of segments) if (segment.isWordLike) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.ts\n/**\n* Non-digit regex.\n*/\nconst NON_DIGIT_REGEX = /\\D/gu;\n/**\n* Checks whether a string with numbers corresponds to the luhn algorithm.\n*\n* @param input The input to be checked.\n*\n* @returns Whether input is valid.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isLuhnAlgo(input) {\n\tconst number$1 = input.replace(NON_DIGIT_REGEX, \"\");\n\tlet length$1 = number$1.length;\n\tlet bit = 1;\n\tlet sum = 0;\n\twhile (length$1) {\n\t\tconst value$1 = +number$1[--length$1];\n\t\tbit ^= 1;\n\t\tsum += bit ? [\n\t\t\t0,\n\t\t\t2,\n\t\t\t4,\n\t\t\t6,\n\t\t\t8,\n\t\t\t1,\n\t\t\t3,\n\t\t\t5,\n\t\t\t7,\n\t\t\t9\n\t\t][value$1] : value$1;\n\t}\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/utils/_isSameValueZero/_isSameValueZero.ts\n/**\n* Compares two values using the SameValueZero algorithm, which treats `NaN`\n* as equal to itself unlike `===`.\n*\n* @param value1 The first value.\n* @param value2 The second value.\n*\n* @returns Whether the values are equal.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isSameValueZero(value1, value2) {\n\treturn value1 === value2 || Number.isNaN(value1) && Number.isNaN(value2);\n}\n\n//#endregion\n//#region src/utils/_isValidObjectKey/_isValidObjectKey.ts\n/**\n* Disallows inherited object properties and prevents object prototype\n* pollution by disallowing certain keys.\n*\n* @param object The object to check.\n* @param key The key to check.\n*\n* @returns Whether the key is allowed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isValidObjectKey(object$1, key) {\n\treturn Object.prototype.hasOwnProperty.call(object$1, key) && key !== \"__proto__\" && key !== \"prototype\" && key !== \"constructor\";\n}\n\n//#endregion\n//#region src/utils/_isValueMatch/_isValueMatch.ts\n/**\n* Checks whether a value matches a value action requirement.\n*\n* @param requirement The value action requirement.\n* @param value The value to check.\n*\n* @returns Whether the value matches the requirement.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isValueMatch(requirement, value$1) {\n\treturn Number.isNaN(requirement) && Number.isNaN(value$1) || requirement <= value$1 && requirement >= value$1;\n}\n\n//#endregion\n//#region src/utils/_joinExpects/_joinExpects.ts\n/**\n* Joins multiple `expects` values with the given separator.\n*\n* @param values The `expects` values.\n* @param separator The separator.\n*\n* @returns The joined `expects` property.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _joinExpects(values$1, separator) {\n\tconst list = [...new Set(values$1)];\n\tif (list.length > 1) return `(${list.join(` ${separator} `)})`;\n\treturn list[0] ?? \"never\";\n}\n\n//#endregion\n//#region src/utils/_standardSchema/_standardSchema.ts\n/**\n* Eagerly creates and attaches the Standard Schema properties of a schema.\n*\n* Hint: The contextual `this` type includes the standard properties that are\n* attached before the schema is returned.\n*\n* @param schema The schema to attach standard properties to.\n*\n* @returns The schema with standard properties attached.\n*\n* @internal\n*/\nfunction _standardSchema(schema) {\n\tschema[\"~standard\"] = {\n\t\tversion: 1,\n\t\tvendor: \"valibot\",\n\t\tvalidate: (value$1) => schema[\"~run\"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig())\n\t};\n\treturn schema;\n}\n\n//#endregion\n//#region src/utils/entriesFromList/entriesFromList.ts\n/**\n* Creates an object entries definition from a list of keys and a schema.\n*\n* @param list A list of keys.\n* @param schema The schema of the keys.\n*\n* @returns The object entries.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromList(list, schema) {\n\tconst entries$1 = {};\n\tfor (const key of list) entries$1[key] = schema;\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/entriesFromObjects/entriesFromObjects.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromObjects(schemas) {\n\tconst entries$1 = {};\n\tfor (const schema of schemas) Object.assign(entries$1, schema.entries);\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/getDotPath/getDotPath.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDotPath(issue) {\n\tif (issue.path) {\n\t\tlet key = \"\";\n\t\tfor (const item of issue.path) if (typeof item.key === \"string\" || typeof item.key === \"number\") if (key) key += `.${item.key}`;\n\t\telse key += item.key;\n\t\telse return null;\n\t\treturn key;\n\t}\n\treturn null;\n}\n\n//#endregion\n//#region src/utils/isOfKind/isOfKind.ts\n/**\n* A generic type guard to check the kind of an object.\n*\n* @param kind The kind to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfKind(kind, object$1) {\n\treturn object$1.kind === kind;\n}\n\n//#endregion\n//#region src/utils/isOfType/isOfType.ts\n/**\n* A generic type guard to check the type of an object.\n*\n* @param type The type to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfType(type, object$1) {\n\treturn object$1.type === type;\n}\n\n//#endregion\n//#region src/utils/ValiError/ValiError.ts\n/**\n* A Valibot error with useful information.\n*/\nvar ValiError = class extends Error {\n\t/**\n\t* Creates a Valibot error with useful information.\n\t*\n\t* @param issues The error issues.\n\t*/\n\tconstructor(issues) {\n\t\tsuper(issues[0].message);\n\t\tthis.name = \"ValiError\";\n\t\tthis.issues = issues;\n\t}\n};\n\n//#endregion\n//#region src/utils/isValiError/isValiError.ts\n/**\n* A type guard to check if an error is a ValiError.\n*\n* @param error The error to check.\n*\n* @returns Whether its a ValiError.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isValiError(error) {\n\treturn error instanceof ValiError;\n}\n\n//#endregion\n//#region src/actions/args/args.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction args(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: args,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst argsDataset = this.schema[\"~run\"]({ value: args_ }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/args/argsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction argsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: argsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args$1) => {\n\t\t\t\tconst argsDataset = await schema[\"~run\"]({ value: args$1 }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/await/awaitAsync.ts\n/**\n* Creates an await transformation action.\n*\n* @returns An await action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction awaitAsync() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"await\",\n\t\treference: awaitAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/regex.ts\n/**\n* [Base64](https://en.wikipedia.org/wiki/Base64) regex.\n*/\nconst BASE64_REGEX = /^(?:[\\da-z+/]{4})*(?:[\\da-z+/]{2}==|[\\da-z+/]{3}=)?$/iu;\n/**\n* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex.\n*/\nconst BIC_REGEX = /^[A-Z]{6}(?!00)[\\dA-Z]{2}(?:[\\dA-Z]{3})?$/u;\n/**\n* [Cuid2](https://github.com/paralleldrive/cuid2) regex.\n*/\nconst CUID2_REGEX = /^[a-z][\\da-z]*$/u;\n/**\n* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex.\n*/\nconst DECIMAL_REGEX = /^[+-]?(?:\\d*\\.)?\\d+$/u;\n/**\n* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex.\n*/\nconst DIGITS_REGEX = /^\\d+$/u;\n/**\n* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n* ASCII-only validation. Internationalized domain names (IDNs) are not\n* supported, including Punycode-encoded labels.\n*/\nconst DOMAIN_REGEX = /^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$/u;\n/**\n* [Email address](https://en.wikipedia.org/wiki/Email_address) regex.\n*\n* Hint: We decided against the `i` flag to avoid matching non-ASCII characters.\n*/\nconst EMAIL_REGEX = /^[\\w+-]+(?:\\.[\\w+-]+)*@[\\da-zA-Z]+(?:[.-][\\da-zA-Z]+)*\\.[a-zA-Z]{2,}$/u;\n/**\n* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license).\n*\n* Hint: We decided against the newer `/^\\p{RGI_Emoji}+$/v` regex because it is\n* not supported in older runtimes and does not match all emoji.\n*/\nconst EMOJI_REGEX = /^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation}))*)+$/u;\n/**\n* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEXADECIMAL_REGEX = /^(?:0[hx])?[\\da-fA-F]+$/u;\n/**\n* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEX_COLOR_REGEX = /^#(?:[\\da-fA-F]{3,4}|[\\da-fA-F]{6}|[\\da-fA-F]{8})$/u;\n/**\n* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex.\n*/\nconst IMEI_REGEX = /^\\d{15}$|^\\d{2}-\\d{6}-\\d{6}-\\d$/u;\n/**\n* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex.\n*/\nconst IPV4_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$/u;\n/**\n* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex.\n*/\nconst IPV6_REGEX = /^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [IP](https://en.wikipedia.org/wiki/IP_address) regex.\n*/\nconst IP_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$|^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex.\n*/\nconst ISO_DATE_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex.\n*/\nconst ISO_DATE_TIME_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with seconds regex.\n*/\nconst ISO_DATE_TIME_SECOND_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex.\n*/\nconst ISO_TIME_REGEX = /^(?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex.\n*/\nconst ISO_TIME_SECOND_REGEX = /^(?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a\n* space as a date/time separator and an optional space before the UTC offset.\n*/\nconst ISO_TIMESTAMP_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}(?:\\.\\d{1,9})?(?:Z| ?[+-](?:0\\d|1\\d|2[0-3])(?::?[0-5]\\d)?)$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex.\n*/\nconst ISO_WEEK_REGEX = /^\\d{4}-W(?:0[1-9]|[1-4]\\d|5[0-3])$/u;\n/**\n* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1)\n* regex.\n*\n* Hint: Empty payload and signature segments are allowed because the\n* Base64URL-encoded representation of an empty octet sequence is an empty\n* string.\n*/\nconst JWS_COMPACT_REGEX = /^(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?$/u;\n/**\n* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex.\n*/\nconst ISRC_REGEX = /^(?:[A-Z]{2}[A-Z\\d]{3}\\d{7}|[A-Z]{2}-[A-Z\\d]{3}-\\d{2}-\\d{5})$/u;\n/**\n* [KSUID](https://github.com/segmentio/ksuid) regex.\n*/\nconst KSUID_REGEX = /^[a-zA-Z0-9]{27}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC48_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC64_REGEX = /^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [Nano ID](https://github.com/ai/nanoid) regex.\n*/\nconst NANO_ID_REGEX = /^[\\w-]+$/u;\n/**\n* [Octal](https://en.wikipedia.org/wiki/Octal) regex.\n*/\nconst OCTAL_REGEX = /^(?:0o)?[0-7]+$/u;\n/**\n* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex.\n*\n* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322.\n*/\nconst RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/**\n* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex.\n*/\nconst SLUG_REGEX = /^[\\da-z]+(?:[-_][\\da-z]+)*$/u;\n/**\n* [ULID](https://github.com/ulid/spec) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n* Hint: The first character is restricted to `[0-7]` because the 48-bit\n* timestamp cannot exceed 2^48-1, making the maximum valid ULID\n* `7ZZZZZZZZZZZZZZZZZZZZZZZZZ` in Crockford's Base32 encoding.\n*/\nconst ULID_REGEX = /^[0-7][\\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}$/u;\n/**\n* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex.\n*/\nconst UUID_REGEX = /^[\\da-f]{8}(?:-[\\da-f]{4}){3}-[\\da-f]{12}$/iu;\n\n//#endregion\n//#region src/actions/base64/base64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction base64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"base64\",\n\t\treference: base64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BASE64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Base64\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bic/bic.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bic(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bic\",\n\t\treference: bic,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BIC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"BIC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/brand/brand.ts\n/**\n* Creates a brand transformation action.\n*\n* @param name The brand name.\n*\n* @returns A brand action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction brand(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"brand\",\n\t\treference: brand,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bytes/bytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bytes\",\n\t\treference: bytes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 !== this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/check.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction check(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: check,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/checkAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: checkAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItems(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItems,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) for (let index = 0; index < dataset.value.length; index++) {\n\t\t\t\tconst item = dataset.value[index];\n\t\t\t\tif (!this.requirement(item, index, dataset.value)) _addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\tinput: item,\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\tvalue: item\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItemsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItemsAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItemsAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst requirementResults = await Promise.all(dataset.value.map(this.requirement));\n\t\t\t\tfor (let index = 0; index < dataset.value.length; index++) if (!requirementResults[index]) {\n\t\t\t\t\tconst item = dataset.value[index];\n\t\t\t\t\t_addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\t\tinput: item,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\t\tvalue: item\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/codePoints/codePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction codePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"code_points\",\n\t\treference: codePoints,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/creditCard/creditCard.ts\n/**\n* Credit card regex.\n*/\nconst CREDIT_CARD_REGEX = /^(?:\\d{13,19}|\\d{4}(?: \\d{3,6}){2,4}|\\d{4}(?:-\\d{3,6}){2,4})$/u;\n/**\n* Sanitize regex.\n*/\nconst SANITIZE_REGEX = /[- ]/gu;\n/**\n* Provider regex list.\n*/\nconst PROVIDER_REGEX_LIST = [\n\t/^3[47]\\d{13}$/u,\n\t/^3(?:0[0-5]|[68]\\d)\\d{11,13}$/u,\n\t/^6(?:011|5\\d{2})\\d{12,15}$/u,\n\t/^(?:2131|1800|35\\d{3})\\d{11}$/u,\n\t/^(?:5[1-5]\\d{2}|222\\d|22[3-9]\\d|2[3-6]\\d{2}|27[01]\\d|2720)\\d{12}$/u,\n\t/^(?:6[27]\\d{14,17}|81\\d{14,17})$/u,\n\t/^4\\d{12}(?:\\d{3,6})?$/u\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction creditCard(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"credit_card\",\n\t\treference: creditCard,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tlet sanitized;\n\t\t\treturn CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, \"\")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"credit card\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/cuid2/cuid2.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cuid2(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"cuid2\",\n\t\treference: cuid2,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: CUID2_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Cuid2\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/decimal/decimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction decimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"decimal\",\n\t\treference: decimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"decimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/description/description.ts\n/**\n* Creates a description metadata action.\n*\n* @param description_ The description text.\n*\n* @returns A description action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction description(description_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"description\",\n\t\treference: description,\n\t\tdescription: description_\n\t};\n}\n\n//#endregion\n//#region src/actions/digits/digits.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction digits(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"digits\",\n\t\treference: digits,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DIGITS_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"digits\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/domain/domain.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction domain(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"domain\",\n\t\treference: domain,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: DOMAIN_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"domain\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/email/email.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction email(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"email\",\n\t\treference: email,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/emoji/emoji.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction emoji(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"emoji\",\n\t\treference: emoji,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: EMOJI_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"emoji\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/empty/empty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction empty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"empty\",\n\t\treference: empty,\n\t\tasync: false,\n\t\texpects: \"0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > 0) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/endsWith/endsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction endsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ends_with\",\n\t\treference: endsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, \"end\", dataset, config$1, { received: `\"${dataset.value.slice(-this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/entries/entries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"entries\",\n\t\treference: entries,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count !== this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/everyItem/everyItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction everyItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"every_item\",\n\t\treference: everyItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/examples/examples.ts\n/**\n* Creates an examples metadata action.\n*\n* @param examples_ The examples.\n*\n* @returns An examples action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction examples(examples_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"examples\",\n\t\treference: examples,\n\t\texamples: examples_\n\t};\n}\n\n//#endregion\n//#region src/actions/excludes/excludes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction excludes(requirement, message$1) {\n\tconst received = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"excludes\",\n\t\treference: excludes,\n\t\tasync: false,\n\t\texpects: `!${received}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/filterItems/filterItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction filterItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"filter_items\",\n\t\treference: filterItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.filter(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/findItem/findItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction findItem(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"find_item\",\n\t\treference: findItem,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.find(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/finite/finite.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction finite(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"finite\",\n\t\treference: finite,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isFinite,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"finite\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/flavor/flavor.ts\n/**\n* Creates a flavor transformation action.\n*\n* @param name The flavor name.\n*\n* @returns A flavor action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction flavor(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"flavor\",\n\t\treference: flavor,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/graphemes/graphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction graphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"graphemes\",\n\t\treference: graphemes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/gtValue/gtValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction gtValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"gt_value\",\n\t\treference: gtValue,\n\t\tasync: false,\n\t\texpects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/guard/guard.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction guard(requirement, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"guard\",\n\t\treference: guard,\n\t\tasync: false,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) {\n\t\t\t\t_addIssue(this, \"input\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hash/hash.ts\n/**\n* Hash lengths object.\n*/\nconst HASH_LENGTHS = {\n\tmd4: 32,\n\tmd5: 32,\n\tsha1: 40,\n\tsha256: 64,\n\tsha384: 96,\n\tsha512: 128,\n\tripemd128: 32,\n\tripemd160: 40,\n\ttiger128: 32,\n\ttiger160: 40,\n\ttiger192: 48,\n\tcrc32: 8,\n\tcrc32b: 8,\n\tadler32: 8\n};\n/* @__NO_SIDE_EFFECTS__ */\nfunction hash(types, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hash\",\n\t\treference: hash,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RegExp(types.map((type) => `^[a-fA-F0-9]{${HASH_LENGTHS[type]}}$`).join(\"|\"), \"u\"),\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hash\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexadecimal/hexadecimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexadecimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hexadecimal\",\n\t\treference: hexadecimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEXADECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hexadecimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexColor/hexColor.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexColor(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hex_color\",\n\t\treference: hexColor,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEX_COLOR_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hex color\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/imei/imei.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction imei(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"imei\",\n\t\treference: imei,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\treturn IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"IMEI\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/includes/includes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction includes(requirement, message$1) {\n\tconst expects = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"includes\",\n\t\treference: includes,\n\t\tasync: false,\n\t\texpects,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received: `!${expects}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/integer/integer.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction integer(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"integer\",\n\t\treference: integer,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ip/ip.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ip(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ip\",\n\t\treference: ip,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IP\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv4/ipv4.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv4(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv4\",\n\t\treference: ipv4,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV4_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv4\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv6/ipv6.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv6(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv6\",\n\t\treference: ipv6,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV6_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv6\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn10.ts\n/**\n* [Validates an ISBN-10](https://en.wikipedia.org/wiki/ISBN#ISBN-10_check_digits).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-10, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn10(input) {\n\tconst digits$1 = input.split(\"\").map((c) => c === \"X\" ? 10 : parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 10; i++) sum += digits$1[i] * (10 - i);\n\treturn sum % 11 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn13.ts\n/**\n* [Validates an ISBN-13](https://en.wikipedia.org/wiki/ISBN#ISBN-13_check_digit_calculation).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-13, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn13(input) {\n\tconst digits$1 = input.split(\"\").map((c) => parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 13; i++) sum += digits$1[i] * (i % 2 === 0 ? 1 : 3);\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/isbn.ts\n/**\n* ISBN separator regex.\n*/\nconst ISBN_SEPARATOR_REGEX = /[- ]/gu;\n/**\n* ISBN-10 detection regex.\n*/\nconst ISBN_10_DETECTION_REGEX = /^\\d{9}[\\dX]$/u;\n/**\n* ISBN-13 detection regex.\n*/\nconst ISBN_13_DETECTION_REGEX = /^\\d{13}$/u;\n/* @__NO_SIDE_EFFECTS__ */\nfunction isbn(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isbn\",\n\t\treference: isbn,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tconst replacedInput = input.replace(ISBN_SEPARATOR_REGEX, \"\");\n\t\t\tif (ISBN_10_DETECTION_REGEX.test(replacedInput)) return _isIsbn10(replacedInput);\n\t\t\telse if (ISBN_13_DETECTION_REGEX.test(replacedInput)) return _isIsbn13(replacedInput);\n\t\t\treturn false;\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"ISBN\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isrc/isrc.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isrc(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isrc\",\n\t\treference: isrc,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISRC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ISRC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDate/isoDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDate(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date\",\n\t\treference: isoDate,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDateTime/isoDateTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDateTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date_time\",\n\t\treference: isoDateTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date-time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDateTimeSecond/isoDateTimeSecond.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDateTimeSecond(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date_time_second\",\n\t\treference: isoDateTimeSecond,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_TIME_SECOND_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date-time-second\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTime/isoTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time\",\n\t\treference: isoTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimeSecond/isoTimeSecond.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimeSecond(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time_second\",\n\t\treference: isoTimeSecond,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_SECOND_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time-second\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimestamp/isoTimestamp.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimestamp(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_timestamp\",\n\t\treference: isoTimestamp,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIMESTAMP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"timestamp\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoWeek/isoWeek.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoWeek(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_week\",\n\t\treference: isoWeek,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_WEEK_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"week\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/jwsCompact/jwsCompact.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction jwsCompact(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"jws_compact\",\n\t\treference: jwsCompact,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: JWS_COMPACT_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"JWS compact\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ksuid/ksuid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ksuid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ksuid\",\n\t\treference: ksuid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: KSUID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"KSUID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/length/length.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction length(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"length\",\n\t\treference: length,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ltValue/ltValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ltValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"lt_value\",\n\t\treference: ltValue,\n\t\tasync: false,\n\t\texpects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac/mac.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac\",\n\t\treference: mac,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac48/mac48.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac48(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac48\",\n\t\treference: mac48,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC48_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"48-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac64/mac64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac64\",\n\t\treference: mac64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"64-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mapItems/mapItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"map_items\",\n\t\treference: mapItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.map(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxBytes/maxBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_bytes\",\n\t\treference: maxBytes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 > this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxCodePoints/maxCodePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxCodePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_code_points\",\n\t\treference: maxCodePoints,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxEntries/maxEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_entries\",\n\t\treference: maxEntries,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count > this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxGraphemes/maxGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_graphemes\",\n\t\treference: maxGraphemes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxLength/maxLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_length\",\n\t\treference: maxLength,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxSize/maxSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_size\",\n\t\treference: maxSize,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxValue/maxValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_value\",\n\t\treference: maxValue,\n\t\tasync: false,\n\t\texpects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxWords/maxWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_words\",\n\t\treference: maxWords,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/metadata/metadata.ts\n/**\n* Creates a custom metadata action.\n*\n* @param metadata_ The metadata object.\n*\n* @returns A metadata action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction metadata(metadata_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"metadata\",\n\t\treference: metadata,\n\t\tmetadata: metadata_\n\t};\n}\n\n//#endregion\n//#region src/actions/mimeType/mimeType.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mimeType(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mime_type\",\n\t\treference: mimeType,\n\t\tasync: false,\n\t\texpects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `\"${option}\"`), \"|\"),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, \"MIME type\", dataset, config$1, { received: `\"${dataset.value.type}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minBytes/minBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_bytes\",\n\t\treference: minBytes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 < this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minCodePoints/minCodePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minCodePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_code_points\",\n\t\treference: minCodePoints,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minEntries/minEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_entries\",\n\t\treference: minEntries,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count < this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minGraphemes/minGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_graphemes\",\n\t\treference: minGraphemes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minLength/minLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_length\",\n\t\treference: minLength,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minSize/minSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_size\",\n\t\treference: minSize,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minValue/minValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_value\",\n\t\treference: minValue,\n\t\tasync: false,\n\t\texpects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minWords/minWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_words\",\n\t\treference: minWords,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/multipleOf/multipleOf.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction multipleOf(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"multiple_of\",\n\t\treference: multipleOf,\n\t\tasync: false,\n\t\texpects: `%${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, \"multiple\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nanoid/nanoid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nanoid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"nanoid\",\n\t\treference: nanoid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: NANO_ID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Nano ID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nonEmpty/nonEmpty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonEmpty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"non_empty\",\n\t\treference: nonEmpty,\n\t\tasync: false,\n\t\texpects: \"!0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === 0) _addIssue(this, \"length\", dataset, config$1, { received: \"0\" });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/normalize/normalize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction normalize(form) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"normalize\",\n\t\treference: normalize,\n\t\tasync: false,\n\t\tform,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.normalize(this.form);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notBytes/notBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_bytes\",\n\t\treference: notBytes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 === this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notCodePoints/notCodePoints.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notCodePoints(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_code_points\",\n\t\treference: notCodePoints,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getCodePointCount(dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"code points\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notEntries/notEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_entries\",\n\t\treference: notEntries,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count === this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notGraphemes/notGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_graphemes\",\n\t\treference: notGraphemes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notLength/notLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_length\",\n\t\treference: notLength,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notSize/notSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_size\",\n\t\treference: notSize,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValue/notValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_value\",\n\t\treference: notValue,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && /* @__PURE__ */ _isValueMatch(this.requirement, dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValues/notValues.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValues(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_values\",\n\t\treference: notValues,\n\t\tasync: false,\n\t\texpects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && this.requirement.some((requirement$1) => /* @__PURE__ */ _isValueMatch(requirement$1, dataset.value))) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notWords/notWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_words\",\n\t\treference: notWords,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/octal/octal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction octal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"octal\",\n\t\treference: octal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: OCTAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"octal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseBoolean/parseBoolean.ts\nconst TRUTHY = [\n\ttrue,\n\t1,\n\t\"true\",\n\t\"1\",\n\t\"yes\",\n\t\"y\",\n\t\"on\",\n\t\"enabled\"\n];\nconst FALSY = [\n\tfalse,\n\t0,\n\t\"false\",\n\t\"0\",\n\t\"no\",\n\t\"n\",\n\t\"off\",\n\t\"disabled\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseBoolean(config$1, message$1) {\n\tconst normalize$1 = (v) => typeof v === \"string\" ? v.toLowerCase() : v;\n\tconst truthyRaw = config$1?.truthy ?? TRUTHY;\n\tconst falsyRaw = config$1?.falsy ?? FALSY;\n\tconst truthy = config$1?.truthy ? config$1.truthy.map(normalize$1) : TRUTHY;\n\tconst falsy = config$1?.falsy ? config$1.falsy.map(normalize$1) : FALSY;\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_boolean\",\n\t\treference: parseBoolean,\n\t\texpects: /* @__PURE__ */ _joinExpects([...truthyRaw, ...falsyRaw].map(_stringify), \"|\"),\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\tconst input = normalize$1(dataset.value);\n\t\t\tif (truthy.includes(input)) dataset.value = true;\n\t\t\telse if (falsy.includes(input)) dataset.value = false;\n\t\t\telse {\n\t\t\t\t_addIssue(this, \"boolean\", dataset, config$2);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseJson/parseJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_json\",\n\t\treference: parseJson,\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tdataset.value = JSON.parse(dataset.value, this.config?.reviver);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/utils/_isPartiallyTyped/_isPartiallyTyped.ts\n/**\n* Checks if a dataset is partially typed.\n*\n* @param dataset The dataset to check.\n* @param paths The paths to check.\n*\n* @returns Whether it is partially typed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isPartiallyTyped(dataset, paths) {\n\tif (dataset.issues) for (const path of paths) for (const issue of dataset.issues) {\n\t\tlet typed = false;\n\t\tconst bound = Math.min(path.length, issue.path?.length ?? 0);\n\t\tfor (let index = 0; index < bound; index++) if (path[index] !== issue.path[index].key && (path[index] !== \"$\" || issue.path[index].type !== \"array\")) {\n\t\t\ttyped = true;\n\t\t\tbreak;\n\t\t}\n\t\tif (!typed) return false;\n\t}\n\treturn true;\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheck.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheck(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheckAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheckAsync(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheck.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheck(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\taction({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheckAsync.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheckAsync(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tawait action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransform.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransform(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransform,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst output = action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransformAsync.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransformAsync(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransformAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst output = await action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/readonly/readonly.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction readonly() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"readonly\",\n\t\treference: readonly,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/reduceItems/reduceItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction reduceItems(operation, initial) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"reduce_items\",\n\t\treference: reduceItems,\n\t\tasync: false,\n\t\toperation,\n\t\tinitial,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.reduce(this.operation, this.initial);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/regex/regex.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction regex(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"regex\",\n\t\treference: regex,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"format\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returns.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returns(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returns,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst returnsDataset = this.schema[\"~run\"]({ value: func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returnsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returnsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returnsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args_) => {\n\t\t\t\tconst returnsDataset = await this.schema[\"~run\"]({ value: await func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rfcEmail/rfcEmail.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction rfcEmail(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"rfc_email\",\n\t\treference: rfcEmail,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RFC_EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/safeInteger/safeInteger.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeInteger(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"safe_integer\",\n\t\treference: safeInteger,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isSafeInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"safe integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/size/size.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction size(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"size\",\n\t\treference: size,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/slug/slug.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction slug(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"slug\",\n\t\treference: slug,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: SLUG_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"slug\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/someItem/someItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction someItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"some_item\",\n\t\treference: someItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/sortItems/sortItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction sortItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"sort_items\",\n\t\treference: sortItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.sort(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/startsWith/startsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction startsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"starts_with\",\n\t\treference: startsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, \"start\", dataset, config$1, { received: `\"${dataset.value.slice(0, this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/stringifyJson/stringifyJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction stringifyJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"stringify_json\",\n\t\treference: stringifyJson,\n\t\tmessage: message$1,\n\t\tconfig: config$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tconst output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space);\n\t\t\t\tif (output === void 0) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else dataset.value = output;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/title/title.ts\n/**\n* Creates a title metadata action.\n*\n* @param title_ The title text.\n*\n* @returns A title action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction title(title_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"title\",\n\t\treference: title,\n\t\ttitle: title_\n\t};\n}\n\n//#endregion\n//#region src/actions/toBigint/toBigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBigint(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_bigint\",\n\t\treference: toBigint,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = BigInt(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"bigint\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toBoolean/toBoolean.ts\n/**\n* Creates a to boolean transformation action.\n*\n* @returns A to boolean action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBoolean() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_boolean\",\n\t\treference: toBoolean,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = Boolean(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toCamelCase/toCamelCase.ts\n/**\n* Creates a to camel case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `parseUrlValue`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `item2Name`).\n*\n* @returns A to camel case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toCamelCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_camel_case\",\n\t\treference: toCamelCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"\", false, true);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toDate/toDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toDate(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_date\",\n\t\treference: toDate,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = new Date(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"date\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"date\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toKebabCase/toKebabCase.ts\n/**\n* Creates a to kebab case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `parse-url-value`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `item2-name`).\n*\n* @returns A to kebab case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toKebabCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_kebab_case\",\n\t\treference: toKebabCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"-\", false, false);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toLowerCase/toLowerCase.ts\n/**\n* Creates a to lower case transformation action.\n*\n* @returns A to lower case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toLowerCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_lower_case\",\n\t\treference: toLowerCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toLowerCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMaxValue/toMaxValue.ts\n/**\n* Creates a to max value transformation action.\n*\n* @param requirement The maximum value.\n*\n* @returns A to max value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMaxValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_max_value\",\n\t\treference: toMaxValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value > this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMinValue/toMinValue.ts\n/**\n* Creates a to min value transformation action.\n*\n* @param requirement The minimum value.\n*\n* @returns A to min value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMinValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_min_value\",\n\t\treference: toMinValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value < this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toNumber/toNumber.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toNumber(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_number\",\n\t\treference: toNumber,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = Number(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toPascalCase/toPascalCase.ts\n/**\n* Creates a to pascal case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `ParseUrlValue`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `Item2Name`).\n*\n* @returns A to pascal case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toPascalCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_pascal_case\",\n\t\treference: toPascalCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"\", true, true);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toSnakeCase/toSnakeCase.ts\n/**\n* Creates a to snake case transformation action.\n*\n* Words are separated by `_`, `-` and ASCII whitespace, as well as by case\n* and acronym boundaries.\n*\n* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` →\n* `parse_url_value`) and digits stay attached to the preceding token (e.g.\n* `item2Name` → `item2_name`).\n*\n* @returns A to snake case action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toSnakeCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_snake_case\",\n\t\treference: toSnakeCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = /* @__PURE__ */ _formatCase(dataset.value, \"_\", false, false);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toString/toString.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toString(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_string\",\n\t\treference: toString,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = String(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"string\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toUpperCase/toUpperCase.ts\n/**\n* Creates a to upper case transformation action.\n*\n* @returns A to upper case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toUpperCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_upper_case\",\n\t\treference: toUpperCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toUpperCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transform.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transform(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transform,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transformAsync.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transformAsync(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transformAsync,\n\t\tasync: true,\n\t\toperation,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trim/trim.ts\n/**\n* Creates a trim transformation action.\n*\n* @returns A trim action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trim() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim\",\n\t\treference: trim,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trim();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimEnd/trimEnd.ts\n/**\n* Creates a trim end transformation action.\n*\n* @returns A trim end action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimEnd() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_end\",\n\t\treference: trimEnd,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimEnd();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimStart/trimStart.ts\n/**\n* Creates a trim start transformation action.\n*\n* @returns A trim start action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimStart() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_start\",\n\t\treference: trimStart,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimStart();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ulid/ulid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ulid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ulid\",\n\t\treference: ulid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ULID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ULID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/url/url.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction url(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"url\",\n\t\treference: url,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\ttry {\n\t\t\t\tif (URL.canParse) return URL.canParse(input);\n\t\t\t\tnew URL(input);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"URL\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/uuid/uuid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction uuid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"uuid\",\n\t\treference: uuid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: UUID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"UUID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/value/value.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction value(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"value\",\n\t\treference: value,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !/* @__PURE__ */ _isValueMatch(this.requirement, dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/values/values.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction values(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"values\",\n\t\treference: values,\n\t\tasync: false,\n\t\texpects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.some((requirement$1) => /* @__PURE__ */ _isValueMatch(requirement$1, dataset.value))) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/words/words.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction words(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"words\",\n\t\treference: words,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/const.ts\nconst ABORT_EARLY_CONFIG = { abortEarly: true };\n\n//#endregion\n//#region src/methods/assert/assert.ts\n/**\n* Checks if the input matches the schema. As this is an assertion function, it\n* can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*/\nfunction assert(schema, input) {\n\tconst issues = schema[\"~run\"]({ value: input }, ABORT_EARLY_CONFIG).issues;\n\tif (issues) throw new ValiError(issues);\n}\n\n//#endregion\n//#region src/methods/cache/_LruCache.ts\n/**\n* Efficient LRU cache using Map iteration order.\n*/\nvar _LruCache = class {\n\tconstructor(config$1) {\n\t\tthis.refCount = 0;\n\t\tthis.maxSize = config$1?.maxSize ?? 1e3;\n\t\tthis.maxAge = config$1?.maxAge ?? Infinity;\n\t\tthis.hasMaxAge = isFinite(this.maxAge);\n\t}\n\t/**\n\t* Stringifies an unknown input to a cache key component.\n\t*\n\t* @param input The unknown input.\n\t*\n\t* @returns A cache key component.\n\t*/\n\tstringify(input) {\n\t\tconst type = typeof input;\n\t\tif (type === \"string\") return `\"${input}\"`;\n\t\tif (type === \"number\" || type === \"boolean\") return `${input}`;\n\t\tif (type === \"bigint\") return `${input}n`;\n\t\tif (type === \"object\" || type === \"function\") {\n\t\t\tif (input) {\n\t\t\t\tthis.refIds ?? (this.refIds = /* @__PURE__ */ new WeakMap());\n\t\t\t\tlet id = this.refIds.get(input);\n\t\t\t\tif (!id) {\n\t\t\t\t\tid = ++this.refCount;\n\t\t\t\t\tthis.refIds.set(input, id);\n\t\t\t\t}\n\t\t\t\treturn `#${id}`;\n\t\t\t}\n\t\t\treturn \"null\";\n\t\t}\n\t\treturn type;\n\t}\n\t/**\n\t* Creates a cache key from input and config.\n\t*\n\t* @param input The input value.\n\t* @param config The parse configuration.\n\t*\n\t* @returns The cache key.\n\t*/\n\tkey(input, config$1 = {}) {\n\t\treturn `${this.stringify(input)}|${this.stringify(config$1.lang)}|${this.stringify(config$1.message)}|${this.stringify(config$1.abortEarly)}|${this.stringify(config$1.abortPipeEarly)}`;\n\t}\n\t/**\n\t* Gets a value from the cache by key.\n\t*\n\t* @param key The cache key.\n\t*\n\t* @returns The cached value.\n\t*/\n\tget(key) {\n\t\tif (!this.store) return void 0;\n\t\tconst entry = this.store.get(key);\n\t\tif (!entry) return void 0;\n\t\tif (this.hasMaxAge && Date.now() - entry[1] > this.maxAge) {\n\t\t\tthis.store.delete(key);\n\t\t\treturn;\n\t\t}\n\t\tthis.store.delete(key);\n\t\tthis.store.set(key, entry);\n\t\treturn entry[0];\n\t}\n\t/**\n\t* Sets a value in the cache by key.\n\t*\n\t* @param key The cache key.\n\t* @param value The cached value.\n\t*/\n\tset(key, value$1) {\n\t\tthis.store ?? (this.store = /* @__PURE__ */ new Map());\n\t\tthis.store.delete(key);\n\t\tconst timestamp = this.hasMaxAge ? Date.now() : 0;\n\t\tthis.store.set(key, [value$1, timestamp]);\n\t\tif (this.store.size > this.maxSize) this.store.delete(this.store.keys().next().value);\n\t}\n\t/**\n\t* Clears all entries from the cache.\n\t*/\n\tclear() {\n\t\tthis.store?.clear();\n\t}\n};\n\n//#endregion\n//#region src/methods/cache/cache.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cache(schema, config$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\t\"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tlet outputDataset = this.cache.get(key);\n\t\t\tif (!outputDataset) this.cache.set(key, outputDataset = schema[\"~run\"](dataset, runConfig));\n\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/cache/cacheAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cacheAsync(schema, config$1) {\n\tlet activeRuns;\n\treturn _standardSchema({\n\t\t...schema,\n\t\tasync: true,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\tasync \"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tconst cached = this.cache.get(key);\n\t\t\tif (cached) return /* @__PURE__ */ _cloneDataset(cached);\n\t\t\tlet promise$1 = activeRuns?.get(key);\n\t\t\tif (!promise$1) {\n\t\t\t\tactiveRuns ?? (activeRuns = /* @__PURE__ */ new Map());\n\t\t\t\tpromise$1 = Promise.resolve(schema[\"~run\"](dataset, runConfig));\n\t\t\t\tactiveRuns.set(key, promise$1);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst outputDataset = await promise$1;\n\t\t\t\tthis.cache.set(key, outputDataset);\n\t\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t\t} finally {\n\t\t\t\tactiveRuns?.delete(key);\n\t\t\t}\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/config/config.ts\n/**\n* Changes the local configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param config The parse configuration.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction config(schema, config$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\t\"~run\"(dataset, config_) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config_,\n\t\t\t\t...config$1\n\t\t\t});\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/getFallback/getFallback.ts\n/**\n* Returns the fallback value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The output dataset if available.\n* @param config The config if available.\n*\n* @returns The fallback value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallback(schema, dataset, config$1) {\n\treturn typeof schema.fallback === \"function\" ? schema.fallback(dataset, config$1) : schema.fallback;\n}\n\n//#endregion\n//#region src/methods/fallback/fallback.ts\n/**\n* Returns a fallback value as output if the input does not match the schema.\n*\n* @param schema The schema to catch.\n* @param fallback The fallback value.\n*\n* @returns The passed schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallback(schema, fallback$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/fallback/fallbackAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallbackAsync(schema, fallback$1) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = await schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: await /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/flatten/flatten.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction flatten(issues) {\n\tconst flatErrors = {};\n\tfor (const issue of issues) if (issue.path) {\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) {\n\t\t\tif (!flatErrors.nested) flatErrors.nested = {};\n\t\t\tif (Object.prototype.hasOwnProperty.call(flatErrors.nested, dotPath)) flatErrors.nested[dotPath].push(issue.message);\n\t\t\telse flatErrors.nested[dotPath] = [issue.message];\n\t\t} else if (flatErrors.other) flatErrors.other.push(issue.message);\n\t\telse flatErrors.other = [issue.message];\n\t} else if (flatErrors.root) flatErrors.root.push(issue.message);\n\telse flatErrors.root = [issue.message];\n\treturn flatErrors;\n}\n\n//#endregion\n//#region src/methods/forward/forward.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forward(action, path) {\n\treturn {\n\t\t...action,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/forward/forwardAsync.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forwardAsync(action, path) {\n\treturn {\n\t\t...action,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = await action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/getDefault/getDefault.ts\n/**\n* Returns the default value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The input dataset if available.\n* @param config The config if available.\n*\n* @returns The default value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefault(schema, dataset, config$1) {\n\treturn typeof schema.default === \"function\" ? schema.default(dataset, config$1) : schema.default;\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaults.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefaults(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getDefaults);\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaultsAsync.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getDefaultsAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getDefaultsAsync));\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDescription/getDescription.ts\n/**\n* Returns the description of the schema.\n*\n* If multiple descriptions are defined, the last one of the highest level is\n* returned. If no description is defined, `undefined` is returned.\n*\n* @param schema The schema to get the description from.\n*\n* @returns The description, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDescription(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"description\");\n}\n\n//#endregion\n//#region src/methods/getExamples/getExamples.ts\n/**\n* Returns the examples of a schema.\n*\n* If multiple examples are defined, it concatenates them using depth-first\n* search. If no examples are defined, an empty array is returned.\n*\n* @param schema The schema to get the examples from.\n*\n* @returns The examples, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getExamples(schema) {\n\tconst examples$1 = [];\n\tfunction depthFirstCollect(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstCollect(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"examples\") for (const example of item.examples) examples$1.push(example);\n\t\t}\n\t}\n\tdepthFirstCollect(schema);\n\treturn examples$1;\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacks.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallbacks(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getFallbacks);\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacksAsync.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getFallbacksAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getFallbacksAsync));\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getMetadata/getMetadata.ts\n/**\n* Returns the metadata of a schema.\n*\n* If multiple metadata are defined, it shallowly merges them using depth-first\n* search. If no metadata is defined, an empty object is returned.\n*\n* @param schema Schema to get the metadata from.\n*\n* @returns The metadata, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getMetadata(schema) {\n\tconst result = {};\n\tfunction depthFirstMerge(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstMerge(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"metadata\") Object.assign(result, item.metadata);\n\t\t}\n\t}\n\tdepthFirstMerge(schema);\n\treturn result;\n}\n\n//#endregion\n//#region src/methods/getTitle/getTitle.ts\n/**\n* Returns the title of the schema.\n*\n* If multiple titles are defined, the last one of the highest level is\n* returned. If no title is defined, `undefined` is returned.\n*\n* @param schema The schema to get the title from.\n*\n* @returns The title, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getTitle(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"title\");\n}\n\n//#endregion\n//#region src/methods/is/is.ts\n/**\n* Checks if the input matches the schema. By using a type predicate, this\n* function can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*\n* @returns Whether the input matches the schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction is(schema, input) {\n\treturn !schema[\"~run\"]({ value: input }, ABORT_EARLY_CONFIG).issues;\n}\n\n//#endregion\n//#region src/schemas/any/any.ts\n/**\n* Creates an any schema.\n*\n* Hint: This schema function exists only for completeness and is not\n* recommended in practice. Instead, `unknown` should be used to accept\n* unknown data.\n*\n* @returns An any schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction any() {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"any\",\n\t\treference: any,\n\t\texpects: \"any\",\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/array/array.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction array(item, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: array,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titem,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.item[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/array/arrayAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction arrayAsync(item, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: arrayAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titem,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(input.map((value$1) => this.item[\"~run\"]({ value: value$1 }, config$1)));\n\t\t\t\tfor (let key = 0; key < itemDatasets.length; key++) {\n\t\t\t\t\tconst itemDataset = itemDatasets[key];\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/bigint/bigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bigint(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"bigint\",\n\t\treference: bigint,\n\t\texpects: \"bigint\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"bigint\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/blob/blob.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction blob(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"blob\",\n\t\treference: blob,\n\t\texpects: \"Blob\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Blob) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/boolean/boolean.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction boolean(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"boolean\",\n\t\treference: boolean,\n\t\texpects: \"boolean\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"boolean\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/custom/custom.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction custom(check$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: custom,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/custom/customAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction customAsync(check$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: customAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (await this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/date/date.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction date(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"date\",\n\t\treference: date,\n\t\texpects: \"Date\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/enum/enum.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction enum_(enum__, message$1) {\n\tconst options = [];\n\tfor (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== \"string\" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]);\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"enum\",\n\t\treference: enum_,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\tenum: enum__,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptional(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptional,\n\t\texpects: wrapped.expects,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptionalAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptionalAsync,\n\t\texpects: wrapped.expects,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/file/file.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction file(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"file\",\n\t\treference: file,\n\t\texpects: \"File\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof File) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/function/function.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction function_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"function\",\n\t\treference: function_,\n\t\texpects: \"Function\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"function\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/instance/instance.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction instance(class_, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"instance\",\n\t\treference: instance,\n\t\texpects: class_.name,\n\t\tasync: false,\n\t\tclass: class_,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof this.class) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/intersect/utils/_merge/_merge.ts\n/**\n* Merges two values into one single output.\n*\n* @param value1 First value.\n* @param value2 Second value.\n*\n* @returns The merge dataset.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _merge(value1, value2) {\n\tif (typeof value1 === typeof value2) {\n\t\tif (/* @__PURE__ */ _isSameValueZero(value1, value2) || value1 instanceof Date && value2 instanceof Date && /* @__PURE__ */ _isSameValueZero(+value1, +value2)) return { value: value1 };\n\t\tif (value1 && value2 && value1.constructor === Object && value2.constructor === Object) {\n\t\t\tconst nextValue = {\n\t\t\t\t...value1,\n\t\t\t\t...value2\n\t\t\t};\n\t\t\tfor (const key in value2) if (Object.prototype.hasOwnProperty.call(value1, key) && Object.prototype.hasOwnProperty.call(value2, key)) {\n\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[key], value2[key]);\n\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\tnextValue[key] = dataset.value;\n\t\t\t}\n\t\t\treturn { value: nextValue };\n\t\t}\n\t\tif (Array.isArray(value1) && Array.isArray(value2)) {\n\t\t\tif (value1.length === value2.length) {\n\t\t\t\tconst nextValue = [...value1];\n\t\t\t\tfor (let index = 0; index < value1.length; index++) {\n\t\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[index], value2[index]);\n\t\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\t\tnextValue[index] = dataset.value;\n\t\t\t\t}\n\t\t\t\treturn { value: nextValue };\n\t\t\t}\n\t\t}\n\t}\n\treturn { issue: true };\n}\n\n//#endregion\n//#region src/schemas/intersect/intersect.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersect(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersect,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tfor (const schema of this.options) {\n\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/intersect/intersectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersectAsync(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersectAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tconst optionDatasets = await Promise.all(this.options.map((schema) => schema[\"~run\"]({ value: input }, config$1)));\n\t\t\t\tfor (const optionDataset of optionDatasets) {\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/lazy/lazy.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazy(getter) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazy,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tgetter,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.getter(dataset.value)[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/lazy/lazyAsync.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazyAsync(getter) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazyAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tgetter,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn (await this.getter(dataset.value))[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/literal/literal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction literal(literal_, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"literal\",\n\t\treference: literal,\n\t\texpects: /* @__PURE__ */ _stringify(literal_),\n\t\tasync: false,\n\t\tliteral: literal_,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (/* @__PURE__ */ _isSameValueZero(dataset.value, this.literal)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObject(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObjectAsync(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTuple(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTupleAsync(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/map/map.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction map(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: map,\n\t\texpects: \"Map\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const [inputKey, inputValue] of input) {\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: inputKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/map/mapAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapAsync(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: mapAsync,\n\t\texpects: \"Map\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tconst datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([\n\t\t\t\t\tinputKey,\n\t\t\t\t\tinputValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: inputKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: inputValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nan/nan.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nan(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nan\",\n\t\treference: nan,\n\t\texpects: \"NaN\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (Number.isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/never/never.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction never(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"never\",\n\t\treference: never,\n\t\texpects: \"never\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\t_addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullable(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullable,\n\t\texpects: \"!null\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullableAsync(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullableAsync,\n\t\texpects: \"!null\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullish(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullish,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullishAsync(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullishAsync,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptional(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptional,\n\t\texpects: \"!undefined\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptionalAsync(wrapped, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptionalAsync,\n\t\texpects: \"!undefined\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/null/null.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction null_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"null\",\n\t\treference: null_,\n\t\texpects: \"null\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullable/nullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullable(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullable,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullable/nullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullableAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullableAsync,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullish/nullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullish(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullish,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/nullish/nullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullishAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullishAsync,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/number/number.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction number(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"number\",\n\t\treference: number,\n\t\texpects: \"number\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"number\" && !isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/object/object.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction object(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: object,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/object/objectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectAsync(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: objectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRest(entries$1, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRest,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)) {\n\t\t\t\t\t\tconst valueDataset = this.rest[\"~run\"]({ value: input[key] }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRestAsync(entries$1, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRestAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !Object.prototype.hasOwnProperty.call(this.entries, key)).map(async ([key, value$1]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue$1,\n\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t]))]);\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/optional/optional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optional(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optional,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/optional/optionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optionalAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optionalAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/picklist/picklist.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction picklist(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"picklist\",\n\t\treference: picklist,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/promise/promise.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction promise(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"promise\",\n\t\treference: promise,\n\t\texpects: \"Promise\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Promise) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/record/record.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction record(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: record,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {\n\t\t\t\t\tconst entryValue = input[entryKey];\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: entryKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: entryValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/record/recordAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction recordAsync(key, value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: recordAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([\n\t\t\t\t\tentryKey,\n\t\t\t\t\tentryValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: entryKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: entryValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/set/set.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction set(value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: set,\n\t\texpects: \"Set\",\n\t\tasync: false,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const inputValue of input) {\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/set/setAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction setAsync(value$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: setAsync,\n\t\texpects: \"Set\",\n\t\tasync: true,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tconst valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value[\"~run\"]({ value: inputValue }, config$1)]));\n\t\t\t\tfor (const [inputValue, valueDataset] of valueDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObject(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!Object.prototype.hasOwnProperty.call(this.entries, key)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObjectAsync(entries$1, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!Object.prototype.hasOwnProperty.call(this.entries, key)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTuple(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTupleAsync(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/string/string.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction string(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"string\",\n\t\treference: string,\n\t\texpects: \"string\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"string\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/symbol/symbol.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction symbol(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"symbol\",\n\t\treference: symbol,\n\t\texpects: \"symbol\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"symbol\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tuple/tuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tuple(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tuple/tupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleAsync(items, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRest(items, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRest,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.rest[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRestAsync(items, rest, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRestAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(input.slice(this.items.length).map(async (value$1, key) => {\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey + this.items.length,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}))]);\n\t\t\t\tfor (const [key, value$1, itemDataset] of normalDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/undefined/undefined.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefined_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"undefined\",\n\t\treference: undefined_,\n\t\texpects: \"undefined\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedable(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedable,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedableAsync(wrapped, default_) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedableAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/union/utils/_subIssues/_subIssues.ts\n/**\n* Returns the sub issues of the provided datasets for the union issue.\n*\n* @param datasets The datasets.\n*\n* @returns The sub issues.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _subIssues(datasets) {\n\tlet issues;\n\tif (datasets) for (const dataset of datasets) if (issues) for (const issue of dataset.issues) issues.push(issue);\n\telse issues = dataset.issues;\n\treturn issues;\n}\n\n//#endregion\n//#region src/schemas/union/union.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction union(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: union,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/union/unionAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction unionAsync(options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: unionAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/unknown/unknown.ts\n/**\n* Creates a unknown schema.\n*\n* @returns A unknown schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unknown() {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"unknown\",\n\t\treference: unknown,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/variant/variant.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variant(key, options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variant,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, ABORT_EARLY_CONFIG).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tparseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/variant/variantAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variantAsync(key, options, message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variantAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = async (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") await parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? (await discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, ABORT_EARLY_CONFIG)).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tawait parseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/schemas/void/void.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction void_(message$1) {\n\treturn _standardSchema({\n\t\tkind: \"schema\",\n\t\ttype: \"void\",\n\t\treference: void_,\n\t\texpects: \"void\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/keyof/keyof.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction keyof(schema, message$1) {\n\treturn /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1);\n}\n\n//#endregion\n//#region src/methods/message/message.ts\n/**\n* Changes the local message configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param message_ The error message.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction message(schema, message_) {\n\treturn _standardSchema({\n\t\t...schema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config$1,\n\t\t\t\tmessage: message_\n\t\t\t});\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/omit/omit.ts\n/**\n* Creates a modified copy of an object schema that does not contain the\n* selected entries.\n*\n* @param schema The schema to omit from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction omit(schema, keys) {\n\tconst entries$1 = { ...schema.entries };\n\tfor (const key of keys) delete entries$1[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/parse/parse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nfunction parse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parse/parseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nasync function parseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parser/parser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parser(schema, config$1) {\n\tconst func = (input) => parse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/parser/parserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parserAsync(schema, config$1) {\n\tconst func = (input) => parseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/partial/partial.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partial(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/partial/partialAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialAsync(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/pick/pick.ts\n/**\n* Creates a modified copy of an object schema that contains only the selected\n* entries.\n*\n* @param schema The schema to pick from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction pick(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key of keys) entries$1[key] = schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/pipe/pipe.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipe(...pipe$1) {\n\treturn _standardSchema({\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/pipe/pipeAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipeAsync(...pipe$1) {\n\treturn _standardSchema({\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/methods/required/required.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction required(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/required/requiredAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction requiredAsync(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key];\n\treturn _standardSchema({\n\t\t...schema,\n\t\tentries: entries$1\n\t});\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function safeParseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParser(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParserAsync(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/summarize/summarize.ts\n/**\n* Summarize the error messages of issues in a pretty-printable multi-line string.\n*\n* @param issues The list of issues.\n*\n* @returns A summary of the issues.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction summarize(issues) {\n\tlet summary = \"\";\n\tfor (const issue of issues) {\n\t\tif (summary) summary += \"\\n\";\n\t\tsummary += `× ${issue.message}`;\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) summary += `\\n → at ${dotPath}`;\n\t}\n\treturn summary;\n}\n\n//#endregion\n//#region src/methods/unwrap/unwrap.ts\n/**\n* Unwraps the wrapped schema.\n*\n* @param schema The schema to be unwrapped.\n*\n* @returns The unwrapped schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unwrap(schema) {\n\treturn schema.wrapped;\n}\n\n//#endregion\nexport { BASE64_REGEX, BIC_REGEX, CUID2_REGEX, DECIMAL_REGEX, DIGITS_REGEX, DOMAIN_REGEX, EMAIL_REGEX, EMOJI_REGEX, HEXADECIMAL_REGEX, HEX_COLOR_REGEX, IMEI_REGEX, IPV4_REGEX, IPV6_REGEX, IP_REGEX, ISO_DATE_REGEX, ISO_DATE_TIME_REGEX, ISO_DATE_TIME_SECOND_REGEX, ISO_TIMESTAMP_REGEX, ISO_TIME_REGEX, ISO_TIME_SECOND_REGEX, ISO_WEEK_REGEX, ISRC_REGEX, JWS_COMPACT_REGEX, KSUID_REGEX, MAC48_REGEX, MAC64_REGEX, MAC_REGEX, NANO_ID_REGEX, OCTAL_REGEX, RFC_EMAIL_REGEX, SLUG_REGEX, ULID_REGEX, UUID_REGEX, ValiError, _addIssue, _cloneDataset, _formatCase, _getByteCount, _getCodePointCount, _getGraphemeCount, _getLastMetadata, _getWordCount, _isLuhnAlgo, _isSameValueZero, _isValidObjectKey, _isValueMatch, _joinExpects, _standardSchema, _stringify, any, args, argsAsync, array, arrayAsync, assert, awaitAsync, base64, bic, bigint, blob, boolean, brand, bytes, cache, cacheAsync, check, checkAsync, checkItems, checkItemsAsync, codePoints, config, creditCard, cuid2, custom, customAsync, date, decimal, deleteGlobalConfig, deleteGlobalMessage, deleteSchemaMessage, deleteSpecificMessage, description, digits, domain, email, emoji, empty, endsWith, entries, entriesFromList, entriesFromObjects, enum_ as enum, enum_, everyItem, exactOptional, exactOptionalAsync, examples, excludes, fallback, fallbackAsync, file, filterItems, findItem, finite, flatten, flavor, forward, forwardAsync, function_ as function, function_, getDefault, getDefaults, getDefaultsAsync, getDescription, getDotPath, getExamples, getFallback, getFallbacks, getFallbacksAsync, getGlobalConfig, getGlobalMessage, getMetadata, getSchemaMessage, getSpecificMessage, getTitle, graphemes, gtValue, guard, hash, hexColor, hexadecimal, imei, includes, instance, integer, intersect, intersectAsync, ip, ipv4, ipv6, is, isOfKind, isOfType, isValiError, isbn, isoDate, isoDateTime, isoDateTimeSecond, isoTime, isoTimeSecond, isoTimestamp, isoWeek, isrc, jwsCompact, keyof, ksuid, lazy, lazyAsync, length, literal, looseObject, looseObjectAsync, looseTuple, looseTupleAsync, ltValue, mac, mac48, mac64, map, mapAsync, mapItems, maxBytes, maxCodePoints, maxEntries, maxGraphemes, maxLength, maxSize, maxValue, maxWords, message, metadata, mimeType, minBytes, minCodePoints, minEntries, minGraphemes, minLength, minSize, minValue, minWords, multipleOf, nan, nanoid, never, nonEmpty, nonNullable, nonNullableAsync, nonNullish, nonNullishAsync, nonOptional, nonOptionalAsync, normalize, notBytes, notCodePoints, notEntries, notGraphemes, notLength, notSize, notValue, notValues, notWords, null_ as null, null_, nullable, nullableAsync, nullish, nullishAsync, number, object, objectAsync, objectWithRest, objectWithRestAsync, octal, omit, optional, optionalAsync, parse, parseAsync, parseBoolean, parseJson, parser, parserAsync, partial, partialAsync, partialCheck, partialCheckAsync, pick, picklist, pipe, pipeAsync, promise, rawCheck, rawCheckAsync, rawTransform, rawTransformAsync, readonly, record, recordAsync, reduceItems, regex, required, requiredAsync, returns, returnsAsync, rfcEmail, safeInteger, safeParse, safeParseAsync, safeParser, safeParserAsync, set, setAsync, setGlobalConfig, setGlobalMessage, setSchemaMessage, setSpecificMessage, size, slug, someItem, sortItems, startsWith, strictObject, strictObjectAsync, strictTuple, strictTupleAsync, string, stringifyJson, summarize, symbol, title, toBigint, toBoolean, toCamelCase, toDate, toKebabCase, toLowerCase, toMaxValue, toMinValue, toNumber, toPascalCase, toSnakeCase, toString, toUpperCase, transform, transformAsync, trim, trimEnd, trimStart, tuple, tupleAsync, tupleWithRest, tupleWithRestAsync, ulid, undefined_ as undefined, undefined_, undefinedable, undefinedableAsync, union, unionAsync, unknown, unwrap, url, uuid, value, values, variant, variantAsync, void_ as void, void_, words };","// ── External Dependencies & Registrations\nimport { optional, strictObject, string } from 'valibot';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const localeLabelSchema = strictObject({ en: string(), es: string() });\n\nexport const partialLocaleDescriptionSchema = strictObject({ en: optional(string()), es: optional(string()) });\n\nexport const partialLocaleLabelSchema = strictObject({ en: optional(string()), es: optional(string()) });\n","// ── External Dependencies & Registrations\nimport { nullable, string } from 'valibot';\n\n// ── DPUse Framework\nimport { partialLocaleDescriptionSchema, partialLocaleLabelSchema } from './locale/locale.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const baseConfigSchema = {\n id: string(),\n label: partialLocaleLabelSchema,\n description: partialLocaleDescriptionSchema,\n icon: nullable(string()),\n iconDark: nullable(string())\n};\n","// ── External Dependencies & Registrations\nimport { literal, type LiteralSchema, union, type UnionSchema } from 'valibot';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype LiteralUnionSchema<T extends readonly string[]> = UnionSchema<{ [K in keyof T]: LiteralSchema<T[K], undefined> }, undefined>;\n\nexport const literalUnion = <const T extends readonly string[]>(values: T): LiteralUnionSchema<T> => {\n return union(values.map((value) => literal(value))) as LiteralUnionSchema<T>;\n};\n","// ── External Dependencies & Registrations\nimport { nullable, number, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { baseConfigSchema } from '@/baseConfig.schema';\nimport { literalUnion } from '@/schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Type Identifier\nexport const componentTypeIdSchema = literalUnion([\n 'app',\n 'connector',\n 'connectorConnection',\n 'context',\n 'contextArea',\n 'contextModel',\n 'contextModelDimension',\n 'contextModelDimensionHierarchy',\n 'contextModelEntity',\n 'contextModelEntityDataItem',\n 'contextModelEntityEvent',\n 'contextModelEntityPrimaryMeasure',\n 'contextModelSecondaryMeasure',\n 'cookbook',\n 'cookbookRecipe',\n 'dataView',\n 'engine',\n 'eventQuery',\n 'presenter',\n 'presenterPresentation',\n 'tool'\n]);\n\n// ── Status\nexport const componentStatusColorIdSchema = literalUnion(['danger', 'success', 'warning']);\n\nconst componentStatusIdSchema = literalUnion(['alpha', 'beta', 'releaseCandidate', 'generalAvailability']);\n\nexport const componentStatusConfigSchema = strictObject({\n color: componentStatusColorIdSchema,\n label: string()\n});\n\n// ── Base\n// Common base structure components and component references.\nexport const componentBaseConfigSchema = {\n ...baseConfigSchema,\n typeId: componentTypeIdSchema\n};\n\n// ── Reference\n// Common structure for referencing all components.\nexport const componentReferenceConfigSchema = strictObject({\n ...componentBaseConfigSchema,\n order: number(),\n path: string()\n});\n\n// ── Configuration\n// Core fields present in all components.\nexport const componentCoreFieldsConfig = {\n ...componentBaseConfigSchema,\n firstCreatedAt: nullable(number()),\n lastUpdatedAt: nullable(number()),\n status: nullable(componentStatusConfigSchema),\n statusId: nullable(componentStatusIdSchema)\n};\n\nexport const componentInstanceConfigSchema = strictObject({\n ...componentCoreFieldsConfig\n});\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\nimport { strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentBaseConfigSchema } from './componentConfig.schema';\nimport { DEFAULT_LOCALE_ID } from '@/locale/label';\nimport type { componentInstanceConfigSchema, componentReferenceConfigSchema, componentStatusColorIdSchema, componentStatusConfigSchema } from './componentConfig.schema';\nimport type { LocaleId, LocaleLabel } from '@/locale/label';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { componentInstanceConfigSchema } from './componentConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface Component {\n readonly config: ComponentInstanceConfig;\n}\n\n// ── Base\nexport type ComponentBaseConfig = InferOutput<ReturnType<typeof strictObject<typeof componentBaseConfigSchema>>>;\n\n// ── Instance Configuration\nexport type ComponentInstanceConfig = InferOutput<typeof componentInstanceConfigSchema>;\n\n// ── Reference Configuration\nexport type ComponentReferenceConfig = InferOutput<typeof componentReferenceConfigSchema>;\n\n// ── Status\ntype ComponentStatus = InferOutput<typeof componentStatusConfigSchema>;\ntype ComponentStatusColorId = InferOutput<typeof componentStatusColorIdSchema>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Status\nconst COMPONENT_STATUS_CONFIGS: { id: string; color: ComponentStatusColorId; labels: LocaleLabel }[] = [\n { id: 'alpha', color: 'danger', labels: { en: 'alpha', es: 'alfa' } },\n { id: 'beta', color: 'warning', labels: { en: 'beta', es: 'beta' } },\n { id: 'releaseCandidate', color: 'success', labels: { en: 'release-candidate', es: 'candidato-de-lanzamiento' } },\n { id: 'generalAvailability', color: 'success', labels: { en: '', es: '' } }\n];\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Status\nexport function getComponentStatus(id: string, localeId: LocaleId = DEFAULT_LOCALE_ID): ComponentStatus {\n const componentStatus = COMPONENT_STATUS_CONFIGS.find((componentStatus) => componentStatus.id === id);\n if (componentStatus) {\n const label = componentStatus.labels[localeId] ?? componentStatus.labels[DEFAULT_LOCALE_ID] ?? componentStatus.id;\n return { color: componentStatus.color, label };\n }\n return { color: 'danger', label: id };\n}\n","// ── External Dependencies & Registrations\nimport type { FileTypeResult } from 'file-type';\n\n// ── DPUse Framework\nimport type { ComponentInstanceConfig } from '@/component';\nimport type { StructurePath } from '@/component/module/tool';\nimport type { ConnectionNodeConfig, ObjectColumnConfig } from '@/component/connection';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Data View\nexport interface DataViewConfig extends ComponentInstanceConfig {\n typeId: 'dataView';\n connectionId: string;\n connectionNodeConfig: ConnectionNodeConfig | undefined;\n readingConfig: ReadingConfig | undefined;\n readingChoiceConfig?: ReadingChoiceConfig | undefined; // The user's own choices. Kept apart, so the detected reading is never overwritten.\n sampleConfig: SampleConfig | undefined;\n contentAuditConfig: ContentAuditConfig | undefined; // Replaced whole by each audit.\n columnChoiceConfigs: ColumnChoiceConfigs | undefined; // Kept across audits, so the user's choices survive a new one.\n storeConnectorId: string | undefined;\n}\n\n// ── Reading ─ How an item is read. Detected when the item is first opened, then reused by every audit and load.\nexport interface ReadingConfig {\n dataFormatId: DataFormatId;\n dataFormatSourceId?: DataFormatSourceId | undefined; // Undefined when the item has no format, such as an empty file or a PDF.\n encodingConfidenceLevel: number | undefined; // From 0 to 1. Undefined when the encoding was assumed, not detected.\n encodingId: string | undefined;\n encodingSourceId?: EncodingSourceId | undefined; // Undefined when no text was decoded, such as from an empty or binary file.\n fileType: FileTypeResult | undefined;\n hasHeaders: boolean | undefined;\n isDeclared?: boolean | undefined; // The item's source says how it is read, such as a resource file beside it, so the user has nothing to choose.\n parserId: string | undefined; // The config id of the parser tool. Undefined when no tool parsed the item, such as an empty file or a format no tool reads yet.\n recordDelimiterId: RecordDelimiterId | undefined;\n structurePath?: StructurePath | undefined; // The part of a nested item read as the table, as its parser suggests. Undefined when there is none, or several to choose from.\n valueDelimiterId: ValueDelimiterId | undefined;\n\n // TODO: following are under review.\n // commentMarkId: string | undefined;\n // commentMarkOtherCharSeq: string | undefined;\n // linesToSkipAtStart: number | undefined;\n // quoteEscapeChar: string | undefined;\n // quoteMarkId: string | undefined;\n // quoteMarkOtherCharSeq: string | undefined;\n // recordDelimiterOtherCharSeq: string | undefined;\n // skipEmptyLines: boolean | undefined;\n // skipLinesWithEmptyValues: boolean | undefined;\n // skipLinesWithErrors: boolean | undefined;\n // valueDelimiterOtherCharSeq: string | undefined;\n // valueTrimMethodId: 'both' | 'left' | 'right' | 'none' | undefined;\n}\n\nexport type DataFormatId = (typeof DATA_FORMAT_CONFIGS)[number]['id'];\n\n// What the user chose in place of what was detected. Anything that decodes or parses the item uses a choice when there\n// is one, and otherwise the detected reading.\nexport interface ReadingChoiceConfig {\n dataFormatId: DataFormatId | undefined;\n encodingId: string | undefined;\n hasHeaders: boolean | undefined;\n parserId: string | undefined;\n structurePath?: StructurePath | undefined;\n valueDelimiterId: ValueDelimiterId | undefined;\n}\n\n// How the data format was found.\nexport type DataFormatSourceId =\n | 'fileContent' // The file was recognised from its content, such as Parquet, Excel or XML.\n | 'jsonSyntax' // The text is JSON or JSON Lines.\n | 'mimeType' // Markdown, recognised from the MIME type.\n | 'extension' // Markdown, recognised from the file extension.\n | 'default'; // None of the above, so the text is treated as delimited text.\n\n// How the encoding was found.\nexport type EncodingSourceId =\n | 'byteOrderMark' // The file starts with a byte order mark.\n | 'xmlDeclaration' // The XML declaration names it.\n | 'xmlDefault' // XML with no byte order mark or declaration, which XML defines as UTF-8.\n | 'utf8Validation' // The text is valid UTF-8 and contains characters other than ASCII.\n | 'detection' // jschardet's best guess that the browser can decode.\n | 'asciiAssumption' // The text is all ASCII, so UTF-8 is assumed.\n | 'fallback'; // jschardet found no encoding that the browser can decode, so UTF-8 is used.\nexport type RecordDelimiterId = '\\n' | '\\r' | '\\r\\n'; // TODO: We need a special value here (NOT '') for when a user specified delimiter is implemented.\nexport type ValueDelimiterId = (typeof VALUE_DELIMITER_CONFIGS)[number]['id'] | ''; // TODO: We need a special value here (NOT '') for when a user specified delimiter is implemented.\n\n// ── Sample Configuration ─ The start of an item, as text and parsed records. Small enough to hold in memory and save\n// with the data view, unlike the whole item an audit reads.\n// The sample is read with the user's choices, so it records what it was actually read with. An audit or a load reads the\n// item the same way.\nexport interface SampleConfig {\n dataFormatId?: DataFormatId | undefined; // The format the sample was read in: the chosen one, or the detected one when nothing was chosen.\n decodedEncodingId?: string | undefined; // The encoding the text was decoded with: the chosen one, or the detected one when nothing was chosen. UTF-8 when that encoding cannot be decoded.\n hasHeaders?: boolean | undefined; // Whether the sample's first record is a header record.\n issues: SampleIssue[]; // Problems found while sampling, such as an empty file or parse errors.\n parsedRecords: ParsedRecord[];\n parserId?: string | undefined; // The config id of the parser tool that read the sample. Undefined when no tool read it.\n recordDelimiterId?: RecordDelimiterId | undefined;\n replacementCharacterCount?: number | undefined; // How many '\\uFFFD' characters decoding put in place of bytes the decoded encoding cannot read. Undefined when no text was decoded.\n size: number | undefined; // The bytes the text and records came from. Undefined when the item is not read as bytes.\n structurePath?: StructurePath | undefined; // The part of a nested item the records were read from. Undefined when none has been chosen, so there are no records.\n text: string | undefined;\n valueDelimiterId?: ValueDelimiterId | undefined;\n}\n\n// A problem found while sampling an item. The sample still holds whatever was read, so the item can be shown and read\n// again with other settings.\nexport interface SampleIssue {\n columnNumber?: number | undefined; // Where on 'lineNumber' the problem is, counting characters from 1. Undefined when the parser does not say.\n endLineNumber: number | undefined; // Set when the issue spans several lines, such as an unclosed quote that runs on to where the parser stopped.\n fieldNumber: number | undefined; // The value's position in its record, counting from 1.\n id: string; // The parser's own code, such as 'CSV_QUOTE_NOT_CLOSED', or 'empty' for an item with no content.\n lineNumber: number | undefined; // The first line it covers, counting from 1. Undefined when the parser does not say.\n message: string; // The parser's own English text. The app shows its own wording for the ids it knows.\n recordNumber: number | undefined; // Counting from 1, with any header record included.\n severityId: SampleIssueSeverityId;\n value: string | undefined; // The value or character at fault, shortened when long.\n}\n\nexport type SampleIssueSeverityId = 'error' | 'info' | 'warning'; // Only an error stops the item being read as data.\n\n// A record's values as written, spaces kept. A value with nothing written, such as ',,', is null, and an empty quoted\n// value, '\"\"', is an empty string. Quotes are not kept otherwise, because nothing else depends on them.\nexport type ParsedRecord = (string | null)[];\n\n// ── Content Audit ─ What an audit found in an item. The first audit covers only the preview read when the item is\n// opened, and later audits read further from its start. A count is undefined when the audit did not take it, as in the\n// first audit, which does not count lines.\nexport interface ContentAuditConfig {\n asAt: number; // When the audit started, in milliseconds since the epoch.\n byteCount: number; // 0 when the item is not read as bytes.\n columns: ColumnAuditConfig[];\n commentLineCount: number | undefined;\n emptyLineCount: number | undefined;\n invalidFieldLengthCount: number | undefined; // Records with a different number of values from the first record.\n duration: number; // In milliseconds.\n isComplete: boolean; // Whether the audit reached the end of the item.\n lineCount: number | undefined;\n recordCount: number; // Data records only, without the header record.\n sourceWaitDuration: number | undefined; // The part of 'duration' spent waiting for the item's bytes, such as while it downloads. Undefined when the bytes were fetched before the audit started.\n parseDuration?: number | undefined; // The part of 'duration' the parser spent reading records, without the wait for bytes. Undefined when the audit did not time it.\n columnAuditDuration?: number | undefined; // The part of 'duration' spent auditing the parsed records' values. Undefined when the audit did not time it.\n}\n\n// ── Column Reading ─ How a column's values are read from an item's text, which a load needs as well as the column\n// itself. A database or an API gives typed values, so it has none of these.\nexport interface ColumnReadingConfig extends ObjectColumnConfig {\n derivedFromColumnIndex?: number | undefined; // For a column the audit adds, such as a number column's units: the column it is worked out from, by position.\n decimalSeparatorId: DecimalSeparatorId | undefined; // How a number such as 1,234 is read in this column. Undefined when it holds no separator.\n dateOrderId: DateOrderId | undefined; // How a date such as 03/04/2024 is read in this column. Undefined when no date in it could be read either way.\n nullWordsAreEmpty?: boolean | undefined; // For a text column: whether null words such as 'NA' or 'NULL' load as no value. They are text unless the user chooses otherwise, because 'NA' can be data.\n blankValuesAreEmpty?: boolean | undefined; // For a text column: whether blank values, such as '\"\"' or only spaces, load as no value. They load as written unless the user chooses otherwise, as databases keep them.\n}\n\nexport type DateOrderId = 'dayFirst' | 'monthFirst';\n\nexport type DecimalSeparatorId = (typeof DECIMAL_SEPARATOR_IDS)[number];\n\n// ── Column Audit ─ What an audit found in a column's values, with how the column is read.\nexport interface ColumnAuditConfig extends ColumnReadingConfig {\n // ── Inference ─ Each value read one by one, before the column settles its type.\n inferenceCounts: Record<string, number>;\n leadingInferenceCounts: Record<string, number>;\n isTypeDeclared?: boolean | undefined; // The item's source states the column's type, so it was taken rather than inferred.\n\n // ── Reading ─ What the values show about how they are read.\n numericReadings?: Partial<Record<DecimalSeparatorId, NumericReadingConfig>> | undefined; // A column's figures for each decimal separator, for a column whose values could be read with either.\n dateReadings?: Partial<Record<DateOrderId, DateReadingConfig>> | undefined; // A column's figures for each date order, for a column whose dates could be read either way.\n formatIssueIds: FormatIssueId[] | undefined; // Why the column's format is unclear. Empty when a number, date or yes/no column is clear. Undefined when the format was not checked.\n nullWordValueCount?: number | undefined; // For a text column: how many of its values are null words, counted as values.\n unitId?: string | undefined; // For a column of numbers: the one unit its values are written with, a currency as written, such as 'USD' or '€', or '%'. A value written without it is taken to have it. Undefined when no value has a unit, or when the values have more than one, which a unit column then holds for each.\n isCoded?: boolean | undefined; // The column holds codes, not free text or measurements: few distinct values for its many records, or values all written to one shape, such as 'AB-1234'.\n\n // ── Counts\n validValueCount: number | undefined;\n invalidValueCount: number | undefined; // Values that do not fit the column's type, and so are stored as null.\n // ── Missing Values ─ Blank, empty and null values together. Each loads as no value.\n blankValueCount: number | undefined; // Values written as an empty quoted value, or as only spaces.\n emptyValueCount: number | undefined; // Nothing between the delimiters, or a record too short to reach the column.\n nullValueCount: number | undefined; // Null words such as 'NULL', and 'NA' and the like where they are read as no value.\n hasMissingValues: boolean | undefined; // Any blank, empty or null value. Invalid values are counted apart.\n\n // ── Formats\n validFormats: Record<string, number>; // How many values that fit the column's type have each format, e.g. 'yyyy-MM-dd', '9,999.9' or 'Yes/No'.\n validMinSize: number | undefined;\n validMaxSize: number | undefined;\n validMinWholeDigits: number | undefined;\n validMaxWholeDigits: number | undefined;\n validMinDecimals: number | undefined;\n validMaxDecimals: number | undefined;\n\n // ── Distinct Values\n validCountsAreEstimated?: boolean | undefined; // The distinct count and the frequent values' counts are estimates, because the column holds more distinct values than are counted exactly. The counts of the lowest and highest values are still exact.\n validDistinctValueCount: number | undefined; // Distinct values that fit the column's type. An estimate when 'validCountsAreEstimated' is set, because counting them all would hold the whole column in memory. Undefined when it cannot be told.\n validSingleValueCount?: number | undefined; // Distinct values that fit the column's type and are seen only once. Undefined when there are too many values to count.\n invalidDistinctValueCount?: number | undefined; // Distinct values that do not fit the column's type. Undefined when there are too many values to count.\n validIsUnique: boolean | undefined; // Undefined when there are too many values to tell.\n\n // ── Frequent Values\n validFrequentValues: Record<string, number> | undefined; // The most frequent values that fit the column's type, with how often each is seen. A number or date is counted by its value, however it is written. Estimates when 'validCountsAreEstimated' is set. Empty when none stands out.\n validLeastFrequentValues?: Record<string, number> | undefined; // The least frequent values that fit the column's type and are not already in 'validFrequentValues', with how often each is seen. Empty when there are too many to count.\n invalidFrequentValues?: Record<string, number> | undefined; // The most frequent values that do not fit the column's type, with how often each is seen. Empty when there are too many to count.\n invalidValues: Record<string, string>; // A sample of the values that do not fit, each with the type it was read as.\n\n // ── Range\n validLowestValues?: [string, number][] | undefined; // The lowest values that fit the column's type, lowest first, with how often each is seen. Exact however many values there are.\n validHighestValues?: [string, number][] | undefined; // The highest values that fit the column's type, highest first, with how often each is seen. Exact however many values there are.\n validValueBins?: ValueBinConfig[] | undefined; // For a column of numbers, dates or times: how many of its valid values fall in each of up to 20 ranges with round edges, such as tens or months, lowest first. One range that starts and ends at the value when every value is the same.\n validValueBinScaleId?: ValueBinScaleId | undefined; // How 'validValueBins' divides the values. Absent for ranges of equal width.\n validValueBinOutliers?: ValueBinOutlierConfig | undefined; // When a few values lie far beyond the rest, 'validValueBins' covers only about the middle 98% of them, and this counts the values beyond its first and last ranges. Undefined when the ranges cover every value.\n}\n\n// ── Declared Columns ─ The columns an item's source states, as a database or an application does, or a schema file\n// beside a data file. An audit then takes each column's type rather than inferring it, and only counts the values.\nexport interface DeclaredColumnConfig {\n name: string; // As the item's header record writes it.\n label: string | undefined; // Shown in place of the name. Undefined to show the name.\n dataTypeId: Exclude<DataTypeId, 'unknown'> | undefined; // Undefined when the source does not say, so the type is inferred.\n dataSubtypeId: DataSubtypeId | undefined; // Undefined to take the type's 'defaultSubtypeId'.\n}\n\n// ── Declared Reading ─ How the source says its items are read, so it is not detected and the user has nothing to\n// choose. A value left undefined is detected as usual.\nexport interface DeclaredReadingConfig {\n dataFormatId: DataFormatId;\n encodingId: string | undefined;\n hasHeaders: boolean | undefined;\n valueDelimiterId: ValueDelimiterId | undefined;\n}\n\n// What a column of numbers measures when read with one decimal separator. Choosing the other separator swaps these in.\nexport type NumericReadingConfig = Pick<ColumnAuditConfig, 'dataSubtypeId' | 'validMaxDecimals' | 'validMaxWholeDigits' | 'validMinDecimals' | 'validMinWholeDigits'> &\n ValueDistributionConfig;\n\n// What a column of dates measures when read in one date order. Choosing the other order swaps these in.\nexport type DateReadingConfig = Pick<ColumnAuditConfig, 'validFormats'> & ValueDistributionConfig;\n\n// How many of each valid value a column holds, and how they spread from lowest to highest. A number or date can read\n// differently with each decimal separator or date order, such as '1,5' as 1.5 or 15, so each reading has its own.\nexport type ValueDistributionConfig = Pick<\n ColumnAuditConfig,\n | 'validCountsAreEstimated'\n | 'validDistinctValueCount'\n | 'validFrequentValues'\n | 'validHighestValues'\n | 'validIsUnique'\n | 'validLeastFrequentValues'\n | 'validLowestValues'\n | 'validSingleValueCount'\n | 'validValueBinOutliers'\n | 'validValueBinScaleId'\n | 'validValueBins'\n>;\n\n// Why a column's format is unclear. The decimal separator or date order is unproven when no value shows it, weakly\n// proven when the values that show it are outnumbered by the values it decides, and mixed when values show both ways.\nexport type FormatIssueId =\n | 'booleanPairMixed'\n | 'currencyMixed'\n | 'dateOrderMixed'\n | 'dateOrderUnproven'\n | 'decimalSeparatorMixed'\n | 'decimalSeparatorUnproven'\n | 'decimalSeparatorWeaklyProven'\n | 'percentageMixed'\n | 'scientificNotationMixed';\n\n// One range of a column's values, and how many valid values fall in it.\nexport interface ValueBinConfig {\n count: number;\n lowerValue: string; // Where the range starts: a number, or an ISO date, date-time or time.\n upperValue: string; // Where the range ends, and the next one starts.\n}\n\n// 'linear' ─ Ranges of equal width, such as tens or months.\n// 'log' ─ One range for each power of ten, or a few together, mirrored for negative numbers, with zero as a range of its\n// own. Used when the values span so many powers of ten that ranges of equal width would put nearly all of them in one.\nexport type ValueBinScaleId = 'linear' | 'log';\n\n// The values beyond a column's ranges, when its ranges leave out a few far from the rest.\nexport interface ValueBinOutlierConfig {\n aboveCount: number; // Values at or above the end of the last range.\n belowCount: number; // Values below the start of the first range.\n isEstimated: boolean; // The counts, the ranges' own included, are estimated from a sample, because the column held more values than the sample keeps.\n}\n\n// ── Column Choices ─ What the user chose for each column, keyed by the column's position as a string. Anything not\n// chosen keeps what the audit detected.\nexport type ColumnChoiceConfigs = Partial<Record<string, ColumnChoiceConfig>>;\n\n// A type chosen without a subtype keeps the detected subtype when it matches the detected type, and otherwise takes the\n// type's 'defaultSubtypeId'.\nexport interface ColumnChoiceConfig {\n dataTypeId: DataTypeId | undefined;\n dataSubtypeId: DataSubtypeId | undefined;\n dateOrderId: DateOrderId | undefined; // For a date column whose values fit more than one order, such as 03/04/2024.\n decimalSeparatorId: DecimalSeparatorId | undefined; // For a number column whose values fit either separator, such as 1,234.\n isIgnored: boolean | undefined; // Whether the column is left out when the data view loads.\n nullWordsAreEmpty: boolean | undefined; // For a text column: whether words such as 'NA' mean no value.\n blankValuesAreEmpty?: boolean | undefined; // For a text column: whether blank values, such as '\"\"' or only spaces, mean no value.\n}\n\n// ── Data Types\n\ntype DataTypeConfig = (typeof DATA_TYPE_CONFIGS)[number];\nexport type DataTypeId = DataTypeConfig['id'];\nexport type DataSubtypeId = DataTypeConfig['subtypeIds'][number];\nexport type NumericSubtypeId = Extract<DataTypeConfig, { id: 'numeric' }>['subtypeIds'][number];\nexport type StringSubtypeId = Extract<DataTypeConfig, { id: 'string' }>['subtypeIds'][number];\nexport type TemporalSubtypeId = Extract<DataTypeConfig, { id: 'temporal' }>['subtypeIds'][number];\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Data Formats ─ What DPUse can do with each format. 'supportId' says whether the format is read as data now, is\n// planned, or is not data. 'isText' means it can be shown as text, and 'isTable' as a table of records. 'isStructured'\n// means it nests, so the user chooses the part read as the table, and it has no value delimiter.\nexport const DATA_FORMAT_CONFIGS = [\n { id: 'arrow', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'avro', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'dtv', isStructured: false, isTable: true, isText: true, supportId: 'supported' }, // Delimited text, such as CSV or TSV.\n { id: 'json', isStructured: true, isTable: true, isText: true, supportId: 'supported' },\n { id: 'jsonl', isStructured: true, isTable: true, isText: true, supportId: 'supported' },\n { id: 'markdown', isStructured: false, isTable: false, isText: true, supportId: 'unsupported' }, // A document, so it is shown as text but not read as data.\n { id: 'ods', isStructured: true, isTable: false, isText: false, supportId: 'planned' },\n { id: 'parquet', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'sav', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'sqlite', isStructured: false, isTable: false, isText: false, supportId: 'planned' },\n { id: 'xlsx', isStructured: true, isTable: false, isText: false, supportId: 'planned' },\n { id: 'xml', isStructured: true, isTable: false, isText: false, supportId: 'planned' },\n { id: 'unknown', isStructured: false, isTable: false, isText: false, supportId: 'unsupported' }\n] as const satisfies readonly { id: string; isStructured: boolean; isTable: boolean; isText: boolean; supportId: 'planned' | 'supported' | 'unsupported' }[];\n\n// ── Value Delimiters ─ In the order detection tries them, most common first. The unit separator is invisible, so its\n// id names it and 'character' holds the character itself. The record separator is not one of them: it ends a record,\n// so it belongs with the record delimiters.\nexport const VALUE_DELIMITER_CONFIGS = [\n { id: ',', character: ',' },\n { id: ';', character: ';' },\n { id: '\\t', character: '\\t' },\n { id: '|', character: '|' },\n { id: ' ', character: ' ' },\n { id: ':', character: ':' },\n { id: '_', character: '_' },\n { id: '!', character: '!' },\n { id: '0x1F', character: '\\u{1F}' }\n] as const satisfies readonly { character: string; id: string }[];\n\n// ── Data Types ─ In the order the type list shows them. A type stored without a subtype is read as its\n// 'defaultSubtypeId'. 'unknown' is only ever detected, so it cannot be chosen.\nexport const DATA_TYPE_CONFIGS = [\n {\n id: 'string',\n defaultSubtypeId: 'plain',\n isChoosable: true,\n subtypeIds: [\n 'plain',\n 'email',\n 'url',\n 'uuid',\n 'ulid',\n 'ipv4',\n 'ipv6',\n 'ipRange',\n 'macAddress',\n 'iban',\n 'isbn',\n 'paymentCard',\n 'hexColor',\n 'json',\n 'countryCode',\n 'currencyCode',\n 'languageCode'\n ]\n },\n { id: 'numeric', defaultSubtypeId: 'integer', isChoosable: true, subtypeIds: ['integer', 'decimal', 'bigint'] },\n { id: 'temporal', defaultSubtypeId: 'dateTime', isChoosable: true, subtypeIds: ['date', 'dateTime', 'time'] },\n { id: 'boolean', defaultSubtypeId: undefined, isChoosable: true, subtypeIds: [] },\n { id: 'unknown', defaultSubtypeId: undefined, isChoosable: false, subtypeIds: [] }\n] as const satisfies readonly { defaultSubtypeId: string | undefined; id: string; isChoosable: boolean; subtypeIds: readonly string[] }[];\n\n// ── Decimal Separators\nexport const DECIMAL_SEPARATOR_IDS = [',', '.'] as const;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The '' placeholder has no character, so it comes back unchanged.\nexport function getValueDelimiterCharacter(valueDelimiterId: ValueDelimiterId): string {\n return VALUE_DELIMITER_CONFIGS.find(({ id }) => id === valueDelimiterId)?.character ?? valueDelimiterId;\n}\n","// ── External Dependencies & Registrations\nimport { nullable, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { componentCoreFieldsConfig } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Type Identifier\n// We include 'app' here so we can monitor updates in 'dpuse-app'.\nexport const moduleTypeIdSchema = literalUnion(['app', 'engine', 'connector', 'cookbook', 'presenter', 'tool']);\n\n// ── Configuration\nexport const moduleConfigCoreFields = {\n ...componentCoreFieldsConfig,\n vendorAccountURL: nullable(string()),\n vendorDocumentationURL: nullable(string()),\n vendorHomeURL: nullable(string()),\n version: string()\n};\n\nexport const moduleConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: moduleTypeIdSchema\n});\n","/**\n * Defines the configuration metadata for a connector. Used for validation\n * of connector manifests and capability discovery at runtime.\n */\n\n// ── External Dependencies & Registrations\nimport { array, boolean, literal, nullable, number, optional, record, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { literalUnion } from '@/schema';\nimport { localeLabelSchema } from '@/locale/locale.schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Action Name\n// Names of the operations a connector may implement.\nexport const connectorActionNameSchema = literalUnion([\n 'auditObjectContent',\n 'closeStore',\n 'createObject',\n 'describeConnection',\n 'dropObject',\n 'findObject',\n 'getInfo',\n 'getObject',\n 'getReadableStream',\n 'getRecord',\n 'indexObjectStructure',\n 'listNodes',\n 'listObjectStructureEntries',\n 'loadObjectRecords',\n 'openStore',\n 'previewObject',\n 'queryRecords',\n 'removeRecords',\n 'retrieveRecords',\n 'upsertRecords'\n]);\n\n// ── Category Configuration\nconst connectorCategoryIdSchema = literalUnion(['application', 'curatedDataset', 'database', 'fileStore']); // Category identifiers used for grouping and filtering connectors.\n\nexport const connectorCategoryConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Item Type\n// The kind of item a connector's connections hold, which names the item a data view is built from.\nexport const connectorItemTypeIdSchema = literalUnion(['apiEndpoint', 'file', 'table']);\n\nexport const connectorItemTypeConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Usage\nexport const connectorUsageIdSchema = literalUnion(['bidirectional', 'destination', 'source', 'unknown']); // Connector data pipeline usage identifiers.\n\nexport const connectorUsageConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Implementation\nconst connectorAuthMethodIdSchema = literalUnion(['apiKey', 'disabled', 'oAuth2', 'none']); // Authentication method identifiers supported by a connector implementation.\n\nconst connectorImplementationParametersSchema = record(string(), string()); // One set of implementation parameters, keyed by name.\n\n// A connector implementation variant. A single connector may expose multiple implementations differing by auth method, limits, or vendor-specific behavior.\nconst connectorImplementationSchema = strictObject({\n authMethodId: connectorAuthMethodIdSchema,\n activeConnectionCount: optional(number()),\n canDescribe: optional(boolean()),\n id: optional(string()),\n label: optional(localeLabelSchema),\n maxConnectionCount: nullable(number()),\n params: optional(array(connectorImplementationParametersSchema))\n});\n\n// ── Configuration\nexport const connectorConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('connector'),\n actionNames: array(connectorActionNameSchema),\n category: nullable(connectorCategoryConfigSchema),\n categoryId: connectorCategoryIdSchema,\n implementations: record(string(), connectorImplementationSchema),\n itemTypeId: connectorItemTypeIdSchema,\n usage: nullable(connectorUsageConfigSchema),\n usageId: nullable(connectorUsageIdSchema)\n});\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The native 'Error' options, plus the details that travel with a DPUse error.\nexport interface DPUseErrorOptions extends ErrorOptions {\n data?: Record<string, unknown> | undefined;\n}\n\n// Serializable representation of an error; used for transporting errors across api and worker boundaries\nexport interface SerialisedError {\n data: Record<string, unknown> | undefined;\n locator: string; // Where the error is raised, e.g. 'dpuse-engine.engine.loadConnector'. See the DPUse 'CLAUDE.md'.\n message: string; // Human-readable error message\n name: string; // Error class or type name\n stack: string | undefined; // Stack trace if available\n}\n\n// ── Constants ───────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DPUSE_ERROR_NAMES = new Set(['APIError', 'AppError', 'ConnectorError', 'DPUseError', 'EngineError', 'FetchError']);\nconst RESPONSE_ERROR_BODY_LIMIT = 2048;\n\n// Redaction — serialised errors are shown in the browser and stored in Axiom, so secrets and email addresses are masked\n// first. Best effort: it catches the common shapes, not every possible secret.\nconst REDACTED = '[REDACTED]';\nconst REDACTION_MAX_DEPTH = 10; // Deeper 'data' is replaced whole rather than walked.\nconst SECRET_KEY_PATTERN = /api[-_]?key|authori[sz]ation|cookie|credential|passw(?:or)?d|private[-_]?key|secret|token/i; // A 'data' field whose name matches has its whole value masked.\n// Each pattern is anchored to the start of a word, so it runs in linear time even over a long response body.\nconst SECRET_TEXT_PATTERNS: [RegExp, (match: string, ...groups: string[]) => string][] = [\n [/\\b(Bearer|Basic) +[\\w.~+/=-]+/gi, (_match, scheme) => `${scheme} ${REDACTED}`], // Authorisation header values.\n // Any 'name: value' or 'name=value' pair, in JSON, query strings, form bodies or headers; masked when the name looks\n // secret. A bare 'Basic' or 'Bearer' value is the scheme left by the pattern above, whose token is already masked.\n [\n /(?<![\\w-])([\\w-]+)([\"']?[ \\t]*[:=][ \\t]*[\"']?)([^\\s\"'&,;}?#]+)/g,\n (match, name, separator, value) => (SECRET_KEY_PATTERN.test(name) && !/^(?:Basic|Bearer)$/i.test(value) ? `${name}${separator}${REDACTED}` : match)\n ],\n [/\\beyJ[\\w-]+\\.[\\w-]+\\.[\\w-]*/g, () => REDACTED], // JSON web tokens.\n [/\\b(?:sk-|xaat-|xapt-|sl\\.)[\\w-]{16,}/g, () => REDACTED], // Known token prefixes: OpenAI, Anthropic, Axiom, Dropbox.\n [/(?<![\\w.+-])[\\w.+-]+@[\\w-]+\\.[\\w.-]+/g, () => REDACTED] // Email addresses.\n];\n\n// ── Errors ───────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Base class for all DPUse errors; includes a locator for the error; never thrown directly\nclass DPUseError extends Error {\n readonly data: Record<string, unknown> | undefined;\n readonly locator: string; // Where the error is raised, e.g. 'dpuse-engine.engine.loadConnector'. See the DPUse 'CLAUDE.md'.\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, options);\n this.name = 'DPUseError';\n this.data = options?.data;\n this.locator = locator;\n }\n}\n\n// Thrown when an app (studio/assistant) error occurs\nexport class AppError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'AppError';\n }\n}\n\n// Thrown when an API request fails\nexport class APIError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'APIError';\n }\n}\n\n// Thrown when an engine request fails\nexport class EngineError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'EngineError';\n }\n}\n\n// Thrown when an connector operation fails; will always be wrapped in an engine error\nexport class ConnectorError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'ConnectorError';\n }\n}\n\n// Thrown when an HTTP request fails; may include a sanitized portion of the response body for diagnostic purposes\nexport class FetchError extends DPUseError {\n constructor(message: string, locator: string, options?: DPUseErrorOptions) {\n super(message, locator, options);\n this.name = 'FetchError';\n }\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Builds a fetch error from an HTTP response; includes a text copy of the response body\nexport async function buildFetchError(response: { status: number; statusText: string; text: () => Promise<string> }, message: string, locator: string): Promise<FetchError> {\n const responseStatusStuff = ` - ${response.statusText}`;\n const fetchMessage = `${message} Response status '${String(response.status)}${response.statusText ? responseStatusStuff : ''}' received.`;\n let bodyText: string;\n try {\n bodyText = await response.text();\n } catch (error) {\n const normalised = normalizeToError(error);\n bodyText = `<body unavailable: ${normalised.message}>`;\n }\n return new FetchError(fetchMessage, locator, { data: { body: sanitizeResponseErrorBody(bodyText) } });\n}\n\n// Concatenates serialized error messages into a single string\nexport function concatenateSerialisedErrorMessages(serialisedErrors: SerialisedError[]): string {\n return serialisedErrors.map((serialisedError) => serialisedError.message).join(' ');\n}\n\n// Ignore best-effort cleanup errors to keep teardown noise-free\nexport function ignoreErrors(action: () => void): void {\n try {\n action();\n } catch {\n // Intentionally ignore errors\n }\n}\n\n// Normalizes an unknown thrown value into an error\nexport function normalizeToError(value: unknown): Error {\n if (value instanceof Error) return value;\n if (typeof value === 'string') return new Error(value);\n if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint') return new Error(String(value));\n if (typeof value === 'symbol') return new Error(value.description ?? 'Unknown error');\n if (typeof value === 'object') {\n try {\n return new Error(JSON.stringify(value));\n } catch {\n return new Error('Unknown error');\n }\n }\n return new Error('Unknown error');\n}\n\n// Serializes an error and its cause chain into a array of serialised error objects;\n// errors are ordered from outermost to root cause;\n// cycles in the cause chain are safely ignored;\n// messages are normalized to end with punctuation;\n// secrets and email addresses in messages, stacks and data are redacted\nexport function serialiseError(error?: unknown): SerialisedError[] {\n const seenCauses = new Set();\n const serialisedErrors: SerialisedError[] = [];\n let cause: Error | null = normalizeToError(error);\n while (cause != null && !seenCauses.has(cause)) {\n seenCauses.add(cause);\n const [serialisedError, nextCause] = serialiseSingleError(cause);\n // Redact before punctuating: a redacted email address swallows a full stop that follows it.\n const redactedError = redactSerialisedError(serialisedError);\n if (!/(?:\\.{3}|[.!?])$/.test(redactedError.message)) redactedError.message += '.';\n serialisedErrors.push(redactedError);\n cause = nextCause;\n }\n return serialisedErrors;\n}\n\n// Unserialises an array of serialised error objects back into an error with a cause chain;\n// reconstructs the appropriate error class based on serialized properties;\n// chains errors from outermost to root cause using the `cause` option;\n// returns a placeholder error if the input array is empty\nexport function unserialiseError(serialisedErrors: SerialisedError[]): Error {\n // Build the error chain from root cause (end) to outermost (start)\n let rebuiltError: Error | undefined;\n for (const serialised of serialisedErrors.toReversed()) {\n const error = reconstructError(serialised, rebuiltError);\n if (serialised.stack !== undefined) error.stack = serialised.stack; // Restore stack trace if available\n rebuiltError = error;\n }\n return rebuiltError ?? new Error('No error to unserialise.');\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Builds a fallback message for non-error throwables\nfunction buildFallbackMessage(cause: unknown): string {\n let fallbackMessage: string;\n try {\n fallbackMessage = JSON.stringify(cause);\n } catch {\n if (typeof cause === 'symbol') fallbackMessage = cause.description ?? 'Unknown error';\n else if (typeof cause === 'bigint') fallbackMessage = cause.toString();\n else fallbackMessage = 'Unknown error';\n }\n if (fallbackMessage === '') fallbackMessage = 'Unknown error';\n return fallbackMessage;\n}\n\nfunction reconstructError(serialised: SerialisedError, cause: Error | undefined): Error {\n switch (serialised.name) {\n case 'APIError':\n return new APIError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'AppError':\n return new AppError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'ConnectorError':\n return new ConnectorError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'EngineError':\n return new EngineError(serialised.message, serialised.locator, { data: serialised.data, cause });\n case 'FetchError':\n return new FetchError(serialised.message, serialised.locator, { data: serialised.data, cause });\n default: {\n const name = serialised.name;\n return new (class extends Error {\n override name = name;\n })(serialised.message, { cause });\n }\n }\n}\n\nfunction redactSerialisedError(serialisedError: SerialisedError): SerialisedError {\n const { data, message, stack } = serialisedError;\n return {\n ...serialisedError,\n data: data === undefined ? undefined : (redactValue(data, new WeakSet(), 0) as Record<string, unknown>),\n message: redactText(message),\n stack: stack === undefined ? undefined : redactText(stack)\n };\n}\n\nfunction redactText(text: string): string {\n let redactedText = text;\n for (const [pattern, replacement] of SECRET_TEXT_PATTERNS)\n redactedText = redactedText.replaceAll(pattern, (match: string, ...groups: string[]) => replacement(match, ...groups));\n return redactedText;\n}\n\n// Walks 'data', masking any field whose name looks secret and any secret found in text.\nfunction redactValue(value: unknown, seen: WeakSet<object>, depth: number): unknown {\n if (typeof value === 'string') return redactText(value);\n if (typeof value !== 'object' || value === null) return value;\n if (depth >= REDACTION_MAX_DEPTH) return REDACTED;\n if (seen.has(value)) return '[Circular]';\n seen.add(value);\n return Array.isArray(value)\n ? value.map((item) => redactValue(item, seen, depth + 1))\n : Object.fromEntries(\n Object.entries(value).map(([key, entryValue]) => [key, entryValue != null && SECRET_KEY_PATTERN.test(key) ? REDACTED : redactValue(entryValue, seen, depth + 1)])\n );\n}\n\n// Sanitizes a response body; limits body size to avoid excessive payloads when logging\nfunction sanitizeResponseErrorBody(body?: string): string | undefined {\n if (body == null || body === '') return undefined;\n return body.length > RESPONSE_ERROR_BODY_LIMIT ? `${body.slice(0, RESPONSE_ERROR_BODY_LIMIT)}... [truncated]` : body;\n}\n\n// Each connector is built with its own copy of these classes, so an error it raises is not an instance of this copy's.\n// It is known by its name and its locator instead, so its data, such as a store error's id, is kept where it belongs.\nfunction isDPUseError(error: Error): error is DPUseError {\n return error instanceof DPUseError || (DPUSE_ERROR_NAMES.has(error.name) && typeof (error as { locator?: unknown }).locator === 'string');\n}\n\nfunction serialiseSingleError(cause: Error): [SerialisedError, Error | null] {\n const nextCause = cause.cause == null ? null : normalizeToError(cause.cause);\n if (isDPUseError(cause)) {\n return [{ data: cause.data, locator: cause.locator, message: cause.message, name: cause.name, stack: cause.stack }, nextCause];\n }\n const customProperties = Object.fromEntries(Object.entries(cause).filter(([k]) => k !== 'cause'));\n return cause.name\n ? [{ data: customProperties, locator: '', message: cause.message, name: cause.name, stack: cause.stack }, nextCause]\n : [{ data: customProperties, locator: '', message: buildFallbackMessage(cause), name: 'Error', stack: undefined }, null];\n}\n","// ── DPUse Framework\nimport { buildFetchError, ConnectorError } from '@/errors';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface FetchObjectContentStreamOptions {\n headers?: Record<string, string>; // Sent with every request, such as an authorisation header.\n locator: string; // Names where a failure is raised, e.g. 'dpuse-connector-file-store-emulator.fetchObjectStream'.\n path: string; // The object's path, as the user sees it in a failure message.\n signal: AbortSignal;\n}\n\n// A range fetched for the reader: its bytes, none when it starts past the object's end, or why it could not be fetched.\ntype HeldRange = { bytes: Uint8Array | undefined } | { error: unknown };\n\n// The part of the User-Agent Client Hints API that names the browser's engine. Only Chromium has it.\ninterface UserAgentData {\n brands: { brand: string }[];\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// An object is fetched 16 MiB at a time where the browser would otherwise hold all of it. One range is fetched ahead of\n// the reader, so at most two ranges, 32 MiB, are held.\nconst RANGE_BYTE_COUNT = 16_777_216;\nconst RANGE_NOT_SATISFIABLE_STATUS = 416;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Fetches an object's content as a stream that holds no more of it in memory than the reader is about to use. Chromium\n// pauses a download while the page is not reading it, so there the object is fetched in one request. Firefox and WebKit,\n// which every browser on iOS uses, download a response as fast as the network allows and hold the unread bytes in\n// memory, about 1.5 times the size of a 200 MB file in Safari. Elsewhere, then, the object is fetched a range at a time.\n// Each range the reader takes starts the fetch of the one after it, so that range downloads while the reader works. A\n// range fetched only when asked for left the reader waiting for the whole download: 4.5 seconds of a 13 second audit of\n// a 190 MB file on an iPhone. The object ends at the first range that comes back short, or that starts past the end, so\n// a server that does not let the page read 'Content-Range' still works. A server that ignores ranges sends the whole\n// object in one response, which is read as it is. Aborting the signal stops the fetch and the reading of the stream it\n// returns, and cancelling the stream stops the range being fetched ahead.\nexport async function fetchObjectContentStream(url: string, options: FetchObjectContentStreamOptions): Promise<ReadableStream<Uint8Array>> {\n if (doesFetchPauseUnreadDownloads()) {\n const response = await fetch(url, { headers: options.headers ?? {}, signal: options.signal });\n if (!response.ok) throw await buildFetchError(response, `Failed to fetch '${options.path}' file.`, options.locator);\n return establishResponseBody(response, options);\n }\n const readAhead = new AbortController();\n const rangeOptions = { ...options, signal: AbortSignal.any([options.signal, readAhead.signal]) };\n const firstResponse = await fetchObjectRange(url, 0, rangeOptions);\n if (firstResponse.status !== 206 && firstResponse.status !== RANGE_NOT_SATISFIABLE_STATUS) return establishResponseBody(firstResponse, options);\n let nextOffset = 0;\n let pendingRange = holdObjectRange(Promise.resolve(firstResponse), options);\n return new ReadableStream<Uint8Array>(\n {\n pull: async (controller): Promise<void> => {\n const heldRange = await pendingRange;\n if ('error' in heldRange) throw heldRange.error;\n const { bytes } = heldRange;\n if (bytes != null && bytes.length > 0) controller.enqueue(bytes);\n if (bytes == null || bytes.length < RANGE_BYTE_COUNT) {\n controller.close();\n return;\n }\n nextOffset += bytes.length;\n pendingRange = holdObjectRange(fetchObjectRange(url, nextOffset, rangeOptions), options);\n },\n cancel: (): void => {\n readAhead.abort();\n }\n },\n { highWaterMark: 0 } // Takes a range only when the reader asks, so no more than one is fetched ahead.\n );\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Chromium's User-Agent Client Hints name it among the brands, in a page and in a worker alike. Firefox and WebKit have\n// no 'userAgentData', and neither do Chrome and Edge on iOS, which are built on WebKit.\nfunction doesFetchPauseUnreadDownloads(): boolean {\n // eslint-disable-next-line n/no-unsupported-features/node-builtins -- The browser's 'navigator', not Node's.\n const { userAgentData } = globalThis.navigator as { userAgentData?: UserAgentData };\n return userAgentData?.brands.some(({ brand }) => brand === 'Chromium') === true;\n}\n\nfunction establishResponseBody(response: Response, options: FetchObjectContentStreamOptions): ReadableStream<Uint8Array> {\n if (response.body == null) throw new ConnectorError('Readable streams are not supported in this runtime.', `${options.locator}.unsupported`);\n return response.body;\n}\n\n// A range's bytes once they have all arrived, or none for a range that starts past the end. A failure is held, not\n// thrown, because a range fetched ahead fails before anything is waiting for it. It is raised when the reader asks for\n// the range.\nasync function holdObjectRange(pendingResponse: Promise<Response>, options: FetchObjectContentStreamOptions): Promise<HeldRange> {\n try {\n const response = await pendingResponse;\n if (response.status === RANGE_NOT_SATISFIABLE_STATUS) return { bytes: undefined };\n if (response.status !== 206) throw new ConnectorError(`Failed to fetch part of '${options.path}' file.`, `${options.locator}.range`);\n return { bytes: new Uint8Array(await response.arrayBuffer()) };\n } catch (error) {\n return { error };\n }\n}\n\n// A range that starts past the end comes back as 'Range Not Satisfiable', which ends the object rather than failing. The\n// browser cache is not used for ranges. A server may compress a whole file but not a range, and Chrome answers a later\n// range from the compressed copy it keeps, which cannot be decoded.\nasync function fetchObjectRange(url: string, startOffset: number, options: FetchObjectContentStreamOptions): Promise<Response> {\n const range = `bytes=${String(startOffset)}-${String(startOffset + RANGE_BYTE_COUNT - 1)}`; // HTTP ranges include their last byte.\n const response = await fetch(url, { cache: 'no-store', headers: { ...options.headers, Range: range }, signal: options.signal });\n if (!response.ok && response.status !== RANGE_NOT_SATISFIABLE_STATUS) throw await buildFetchError(response, `Failed to fetch '${options.path}' file.`, options.locator);\n return response;\n}\n","// ── DPUse Framework\nimport { DEFAULT_LOCALE_ID, type LocaleId, type LocaleLabel } from '@/locale/label';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype EncodingGroupId = keyof typeof ENCODING_GROUP_CONFIG_DATA;\ntype EncodingTypeId = keyof typeof ENCODING_TYPE_CONFIG_DATA;\n\ninterface EncodingGroupConfig {\n id: EncodingGroupId;\n label: LocaleLabel;\n}\n\n// One per encoding jschardet can detect, keyed by the name its 'detect' reports, in lower case, plus those the browser's\n// 'TextDecoder' or iconv-lite can decode that jschardet never reports, so the user can still choose them.\ninterface EncodingTypeConfig {\n id: EncodingTypeId;\n groupId: EncodingGroupId | null; // Null for an encoding that belongs to no group, i.e. 'ascii'.\n isDetectable: boolean; // Whether jschardet's 'detect' can report it.\n textDecoderId: string | null; // The name the browser's 'TextDecoder' takes, from jschardet's own map where it detects it. Null when it cannot decode it.\n iconvLiteDecoderId: string | null; // The name iconv-lite takes. Null when it cannot decode it. Nothing decodes with iconv-lite yet.\n}\nexport interface EncodingTypeConfigLocalised {\n id: EncodingTypeId;\n groupLabel: string;\n label: string;\n isDetectable: boolean;\n isDecodable: boolean;\n textDecoderId: string | null;\n iconvLiteDecoderId: string | null;\n}\n\nexport interface EncodingDetectionConfig {\n id: EncodingTypeId;\n confidenceLevel: number | undefined;\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst ENCODING_GROUP_CONFIG_DATA = {\n arabic: { id: 'arabic', label: { en: 'Arabic', es: 'Árabe' } },\n armenian: { id: 'armenian', label: { en: 'Armenian', es: 'Armenio' } },\n baltic: { id: 'baltic', label: { en: 'Baltic', es: 'Báltico' } },\n celtic: { id: 'celtic', label: { en: 'Celtic', es: 'Celta' } },\n centralEuropean: { id: 'centralEuropean', label: { en: 'Central European', es: 'Centroeuropeo' } },\n chineseSimplified: { id: 'chineseSimplified', label: { en: 'Chinese Simplified', es: 'Chino simplificado' } },\n chineseTraditional: { id: 'chineseTraditional', label: { en: 'Chinese Traditional', es: 'Chino tradicional' } },\n cyrillic: { id: 'cyrillic', label: { en: 'Cyrillic', es: 'Cirílico' } },\n georgian: { id: 'georgian', label: { en: 'Georgian', es: 'Georgiano' } },\n greek: { id: 'greek', label: { en: 'Greek', es: 'Griego' } },\n hebrew: { id: 'hebrew', label: { en: 'Hebrew', es: 'Hebreo' } },\n japanese: { id: 'japanese', label: { en: 'Japanese', es: 'Japonés' } },\n korean: { id: 'korean', label: { en: 'Korean', es: 'Coreano' } },\n lao: { id: 'lao', label: { en: 'Lao', es: 'Lao' } },\n nordic: { id: 'nordic', label: { en: 'Nordic', es: 'Nórdico' } },\n southEasternEuropean: { id: 'southEasternEuropean', label: { en: 'South-Eastern European', es: 'Europeo sudoriental' } },\n southernEuropean: { id: 'southernEuropean', label: { en: 'Southern European', es: 'Europeo meridional' } },\n thai: { id: 'thai', label: { en: 'Thai', es: 'Tailandés' } },\n turkish: { id: 'turkish', label: { en: 'Turkish', es: 'Turco' } },\n unicode: { id: 'unicode', label: { en: 'Unicode', es: 'Unicode' } },\n vietnamese: { id: 'vietnamese', label: { en: 'Vietnamese', es: 'Vietnamita' } },\n western: { id: 'western', label: { en: 'Western', es: 'Occidental' } }\n} as const satisfies Record<string, { id: string; label: LocaleLabel }>;\n\nconst ENCODING_TYPE_CONFIG_DATA = {\n 'armscii-8': { id: 'armscii-8', groupId: 'armenian', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'armscii8' },\n ascii: { id: 'ascii', groupId: null, isDetectable: true, textDecoderId: 'windows-1252', iconvLiteDecoderId: 'ascii' },\n big5: { id: 'big5', groupId: 'chineseTraditional', isDetectable: true, textDecoderId: 'big5', iconvLiteDecoderId: 'big5hkscs' },\n 'cesu-8': { id: 'cesu-8', groupId: 'unicode', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cesu8' },\n cp273: { id: 'cp273', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp424: { id: 'cp424', groupId: 'hebrew', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp437: { id: 'cp437', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp437' },\n cp500: { id: 'cp500', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp720: { id: 'cp720', groupId: 'arabic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp720' },\n cp737: { id: 'cp737', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp737' },\n cp775: { id: 'cp775', groupId: 'baltic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp775' },\n cp808: { id: 'cp808', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp808' },\n cp850: { id: 'cp850', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp850' },\n cp852: { id: 'cp852', groupId: 'centralEuropean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp852' },\n cp856: { id: 'cp856', groupId: 'hebrew', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp856' },\n cp857: { id: 'cp857', groupId: 'turkish', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp857' },\n cp858: { id: 'cp858', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp858' },\n cp860: { id: 'cp860', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp860' },\n cp861: { id: 'cp861', groupId: 'nordic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp861' },\n cp862: { id: 'cp862', groupId: 'hebrew', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp862' },\n cp863: { id: 'cp863', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp863' },\n cp864: { id: 'cp864', groupId: 'arabic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp864' },\n cp865: { id: 'cp865', groupId: 'nordic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp865' },\n cp869: { id: 'cp869', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp869' },\n cp874: { id: 'cp874', groupId: 'thai', isDetectable: true, textDecoderId: 'windows-874', iconvLiteDecoderId: 'windows874' },\n cp875: { id: 'cp875', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp922: { id: 'cp922', groupId: 'baltic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp922' },\n cp932: { id: 'cp932', groupId: 'japanese', isDetectable: true, textDecoderId: 'shift_jis', iconvLiteDecoderId: 'shiftjis' },\n cp936: { id: 'cp936', groupId: 'chineseSimplified', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp936' },\n cp949: { id: 'cp949', groupId: 'korean', isDetectable: true, textDecoderId: 'euc-kr', iconvLiteDecoderId: 'cp949' },\n cp950: { id: 'cp950', groupId: 'chineseTraditional', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp950' },\n cp1006: { id: 'cp1006', groupId: 'arabic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp1026: { id: 'cp1026', groupId: 'turkish', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp1046: { id: 'cp1046', groupId: 'arabic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1046' },\n cp1124: { id: 'cp1124', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1124' },\n cp1125: { id: 'cp1125', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp1125' },\n cp1129: { id: 'cp1129', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1129' },\n cp1133: { id: 'cp1133', groupId: 'lao', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1133' },\n cp1140: { id: 'cp1140', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n cp1161: { id: 'cp1161', groupId: 'thai', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1161' },\n cp1162: { id: 'cp1162', groupId: 'thai', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1162' },\n cp1163: { id: 'cp1163', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'cp1163' },\n cp1258: { id: 'cp1258', groupId: 'vietnamese', isDetectable: true, textDecoderId: 'windows-1258', iconvLiteDecoderId: 'windows1258' },\n 'euc-jp': { id: 'euc-jp', groupId: 'japanese', isDetectable: true, textDecoderId: 'euc-jp', iconvLiteDecoderId: 'eucjp' },\n 'euc-kr': { id: 'euc-kr', groupId: 'korean', isDetectable: true, textDecoderId: 'euc-kr', iconvLiteDecoderId: 'cp949' },\n gb18030: { id: 'gb18030', groupId: 'chineseSimplified', isDetectable: true, textDecoderId: 'gb18030', iconvLiteDecoderId: 'gb18030' },\n gbk: { id: 'gbk', groupId: 'chineseSimplified', isDetectable: false, textDecoderId: 'gbk', iconvLiteDecoderId: 'gbk' }, // 'gb18030' reads the same files, as it extends 'gbk'.\n 'georgian-academy': { id: 'georgian-academy', groupId: 'georgian', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'georgianacademy' },\n 'georgian-ps': { id: 'georgian-ps', groupId: 'georgian', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'georgianps' },\n 'hp-roman8': { id: 'hp-roman8', groupId: 'western', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'hproman8' },\n 'hz-gb-2312': { id: 'hz-gb-2312', groupId: 'chineseSimplified', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n ibm855: { id: 'ibm855', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'cp855' },\n ibm866: { id: 'ibm866', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'ibm866', iconvLiteDecoderId: 'cp866' },\n 'iso-2022-jp': { id: 'iso-2022-jp', groupId: 'japanese', isDetectable: true, textDecoderId: 'iso-2022-jp', iconvLiteDecoderId: null },\n 'iso-2022-kr': { id: 'iso-2022-kr', groupId: 'korean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n 'iso-8859-1': { id: 'iso-8859-1', groupId: 'western', isDetectable: true, textDecoderId: 'windows-1252', iconvLiteDecoderId: 'iso88591' },\n 'iso-8859-2': { id: 'iso-8859-2', groupId: 'centralEuropean', isDetectable: true, textDecoderId: 'iso-8859-2', iconvLiteDecoderId: 'iso88592' },\n 'iso-8859-5': { id: 'iso-8859-5', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'iso-8859-5', iconvLiteDecoderId: 'iso88595' },\n 'iso-8859-6': { id: 'iso-8859-6', groupId: 'arabic', isDetectable: true, textDecoderId: 'iso-8859-6', iconvLiteDecoderId: 'iso88596' },\n 'iso-8859-7': { id: 'iso-8859-7', groupId: 'greek', isDetectable: true, textDecoderId: 'iso-8859-7', iconvLiteDecoderId: 'iso88597' },\n 'iso-8859-8': { id: 'iso-8859-8', groupId: 'hebrew', isDetectable: true, textDecoderId: 'iso-8859-8-i', iconvLiteDecoderId: 'iso88598' },\n 'iso-8859-9': { id: 'iso-8859-9', groupId: 'turkish', isDetectable: true, textDecoderId: 'windows-1254', iconvLiteDecoderId: 'iso88599' },\n 'iso-8859-11': { id: 'iso-8859-11', groupId: 'thai', isDetectable: false, textDecoderId: 'windows-874', iconvLiteDecoderId: 'iso885911' },\n 'iso-8859-13': { id: 'iso-8859-13', groupId: 'baltic', isDetectable: true, textDecoderId: 'iso-8859-13', iconvLiteDecoderId: 'iso885913' },\n 'iso646-cn': { id: 'iso646-cn', groupId: 'chineseSimplified', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'iso646cn' },\n 'iso646-jp': { id: 'iso646-jp', groupId: 'japanese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'iso646jp' },\n iso2022_jp_2004: { id: 'iso2022_jp_2004', groupId: 'japanese', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n iso2022_jp_ext: { id: 'iso2022_jp_ext', groupId: 'japanese', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n 'iso8859-3': { id: 'iso8859-3', groupId: 'southernEuropean', isDetectable: true, textDecoderId: 'iso-8859-3', iconvLiteDecoderId: 'iso88593' },\n 'iso8859-4': { id: 'iso8859-4', groupId: 'baltic', isDetectable: true, textDecoderId: 'iso-8859-4', iconvLiteDecoderId: 'iso88594' },\n 'iso8859-10': { id: 'iso8859-10', groupId: 'nordic', isDetectable: true, textDecoderId: 'iso-8859-10', iconvLiteDecoderId: 'iso885910' },\n 'iso8859-14': { id: 'iso8859-14', groupId: 'celtic', isDetectable: true, textDecoderId: 'iso-8859-14', iconvLiteDecoderId: 'iso885914' },\n 'iso8859-15': { id: 'iso8859-15', groupId: 'western', isDetectable: true, textDecoderId: 'iso-8859-15', iconvLiteDecoderId: 'iso885915' },\n 'iso8859-16': { id: 'iso8859-16', groupId: 'southEasternEuropean', isDetectable: true, textDecoderId: 'iso-8859-16', iconvLiteDecoderId: 'iso885916' },\n johab: { id: 'johab', groupId: 'korean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: null },\n 'koi8-r': { id: 'koi8-r', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'koi8-r', iconvLiteDecoderId: 'koi8r' },\n 'koi8-ru': { id: 'koi8-ru', groupId: 'cyrillic', isDetectable: false, textDecoderId: 'koi8-u', iconvLiteDecoderId: 'koi8ru' },\n 'koi8-t': { id: 'koi8-t', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'koi8t' },\n 'koi8-u': { id: 'koi8-u', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'koi8-u', iconvLiteDecoderId: 'koi8u' },\n kz1048: { id: 'kz1048', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'rk1048' },\n maccroatian: { id: 'maccroatian', groupId: 'centralEuropean', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'maccroatian' },\n maccyrillic: { id: 'maccyrillic', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'x-mac-cyrillic', iconvLiteDecoderId: 'maccyrillic' },\n macgreek: { id: 'macgreek', groupId: 'greek', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'macgreek' },\n maciceland: { id: 'maciceland', groupId: 'nordic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'maciceland' },\n maclatin2: { id: 'maclatin2', groupId: 'centralEuropean', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'maccenteuro' },\n macroman: { id: 'macroman', groupId: 'western', isDetectable: true, textDecoderId: 'macintosh', iconvLiteDecoderId: 'macroman' },\n macromania: { id: 'macromania', groupId: 'southEasternEuropean', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'macromania' },\n macthai: { id: 'macthai', groupId: 'thai', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'macthai' },\n macturkish: { id: 'macturkish', groupId: 'turkish', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'macturkish' },\n macukraine: { id: 'macukraine', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'macukraine' },\n mik: { id: 'mik', groupId: 'cyrillic', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'mik' },\n ptcp154: { id: 'ptcp154', groupId: 'cyrillic', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'pt154' },\n shift_jis: { id: 'shift_jis', groupId: 'japanese', isDetectable: true, textDecoderId: 'shift_jis', iconvLiteDecoderId: 'shiftjis' },\n tcvn: { id: 'tcvn', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'tcvn' },\n 'tis-620': { id: 'tis-620', groupId: 'thai', isDetectable: true, textDecoderId: 'windows-874', iconvLiteDecoderId: 'tis620' },\n 'utf-7': { id: 'utf-7', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf7' },\n 'utf-8': { id: 'utf-8', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-8', iconvLiteDecoderId: 'utf-8' },\n 'utf-8-sig': { id: 'utf-8-sig', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-8', iconvLiteDecoderId: 'utf-8' }, // jschardet's map leaves it out, but 'utf-8' skips the byte-order mark.\n 'utf-16': { id: 'utf-16', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf16' },\n 'utf-16-be': { id: 'utf-16-be', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-16be', iconvLiteDecoderId: 'utf16be' },\n 'utf-16-le': { id: 'utf-16-le', groupId: 'unicode', isDetectable: true, textDecoderId: 'utf-16le', iconvLiteDecoderId: 'utf16le' },\n 'utf-32': { id: 'utf-32', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf32' },\n 'utf-32-be': { id: 'utf-32-be', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf32be' },\n 'utf-32-le': { id: 'utf-32-le', groupId: 'unicode', isDetectable: true, textDecoderId: null, iconvLiteDecoderId: 'utf32le' },\n viscii: { id: 'viscii', groupId: 'vietnamese', isDetectable: false, textDecoderId: null, iconvLiteDecoderId: 'viscii' },\n 'windows-1250': { id: 'windows-1250', groupId: 'centralEuropean', isDetectable: true, textDecoderId: 'windows-1250', iconvLiteDecoderId: 'windows1250' },\n 'windows-1251': { id: 'windows-1251', groupId: 'cyrillic', isDetectable: true, textDecoderId: 'windows-1251', iconvLiteDecoderId: 'windows1251' },\n 'windows-1252': { id: 'windows-1252', groupId: 'western', isDetectable: true, textDecoderId: 'windows-1252', iconvLiteDecoderId: 'windows1252' },\n 'windows-1253': { id: 'windows-1253', groupId: 'greek', isDetectable: true, textDecoderId: 'windows-1253', iconvLiteDecoderId: 'windows1253' },\n 'windows-1254': { id: 'windows-1254', groupId: 'turkish', isDetectable: true, textDecoderId: 'windows-1254', iconvLiteDecoderId: 'windows1254' },\n 'windows-1255': { id: 'windows-1255', groupId: 'hebrew', isDetectable: true, textDecoderId: 'windows-1255', iconvLiteDecoderId: 'windows1255' },\n 'windows-1256': { id: 'windows-1256', groupId: 'arabic', isDetectable: true, textDecoderId: 'windows-1256', iconvLiteDecoderId: 'windows1256' },\n 'windows-1257': { id: 'windows-1257', groupId: 'baltic', isDetectable: true, textDecoderId: 'windows-1257', iconvLiteDecoderId: 'windows1257' }\n} as const satisfies Record<string, { id: string; groupId: keyof typeof ENCODING_GROUP_CONFIG_DATA | null; isDetectable: boolean; textDecoderId: string | null; iconvLiteDecoderId: string | null }>;\n\nexport const ENCODING_GROUP_CONFIG_MAP = ENCODING_GROUP_CONFIG_DATA as Record<EncodingGroupId, EncodingGroupConfig>;\nexport const ENCODING_TYPE_CONFIG_MAP = ENCODING_TYPE_CONFIG_DATA as Record<EncodingTypeId, EncodingTypeConfig>;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Narrows a name from outside the app, such as one reported by encoding detection and lower-cased, to a known encoding\n// id. Check with this once where the name arrives, so everything after it works with 'EncodingTypeId'.\nexport function isEncodingTypeId(value: string): value is EncodingTypeId {\n return Object.hasOwn(ENCODING_TYPE_CONFIG_MAP, value);\n}\n\n// The name to give the browser's 'TextDecoder' for an encoding id. An id browsers cannot decode, or one the table does\n// not know, passes through unchanged, so 'TextDecoder' rejects it.\nexport function resolveDecoderId(encodingId: string): string {\n return isEncodingTypeId(encodingId) ? (ENCODING_TYPE_CONFIG_MAP[encodingId].textDecoderId ?? encodingId) : encodingId;\n}\n\nexport function getEncodingTypeConfigs(localeId: LocaleId = DEFAULT_LOCALE_ID): EncodingTypeConfigLocalised[] {\n const encodingTypeConfigs: EncodingTypeConfigLocalised[] = Array.from(Object.values(ENCODING_TYPE_CONFIG_MAP), ({ groupId, iconvLiteDecoderId, id, isDetectable, textDecoderId }) => {\n const groupLabel = groupId == null ? '' : resolveGroupLabel(groupId, localeId);\n return { id, groupLabel, label: groupLabel ? `${groupLabel} (${id})` : id, isDetectable, isDecodable: textDecoderId != null, textDecoderId, iconvLiteDecoderId };\n });\n return encodingTypeConfigs.toSorted((left, right) => left.groupLabel.localeCompare(right.groupLabel, localeId) || left.id.localeCompare(right.id, localeId, { numeric: true })); // Ids, not labels, so 'utf-16' sorts before 'utf-16-le'.\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nfunction resolveGroupLabel(groupId: EncodingGroupId, localeId: LocaleId): string {\n const labels = ENCODING_GROUP_CONFIG_MAP[groupId].label;\n return labels[localeId] ?? labels[DEFAULT_LOCALE_ID] ?? groupId;\n}\n","/**\n * Defines the configuration metadata for a tool. Used for validation of tool manifests.\n */\n\n// ── External Dependencies & Registrations\nimport { array, literal, minLength, optional, pipe, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Parser\n// The data formats a parser may read: every data format except 'unknown', which has no records to read.\nexport const parserDataFormatIdSchema = literalUnion(['arrow', 'avro', 'dtv', 'json', 'jsonl', 'markdown', 'ods', 'parquet', 'sav', 'sqlite', 'xlsx', 'xml']);\n\nexport const parserConfigSchema = strictObject({\n dataFormatIds: pipe(array(parserDataFormatIdSchema), minLength(1)) // Written by hand, because only the tool's author knows which formats it reads.\n});\n\n// ── Configuration\nconst toolActionNamesSchema = array(string());\n\nexport const toolConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('tool'),\n actionNames: optional(toolActionNamesSchema), // Written by the build from the methods the tool's source implements.\n parser: optional(parserConfigSchema) // Only a tool that parses data records has one.\n});\n","// ── DPUse Framework\nimport { resolveDecoderId } from '@/encoding';\nimport type { ParsedRecord, RecordDelimiterId, SampleIssue, ValueDelimiterId } from '@/component/dataView';\nimport type { ParsePreviewOptions, ParsePreviewResult } from '@/component/module/tool';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A preview as its bytes, and as the text decoded from them, so a parser reads whichever its own 'parseStream' reads.\nexport interface DelimitedPreview {\n bytes: Uint8Array;\n encodingId: string;\n text: string;\n}\n\n// What a parser tool supplies: the preview read with one delimiter. A record it cannot read is left out and becomes an\n// issue, so every parser reports the same way and the choice of delimiter below is the same whichever parser reads.\nexport type ParsePreviewWithDelimiter = (\n preview: DelimitedPreview,\n delimiter: ValueDelimiterId,\n isComplete: boolean\n) => Promise<{ issues: SampleIssue[]; records: ParsedRecord[] }>;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n/**\n * Reads delimited text for a preview: detects its record delimiter, and which of the candidate value delimiters splits\n * it best. The value delimiter is undefined when the text is not delimited: the best one found does not split most\n * records into the same number of values, more than one, as a table's rows would be. The records parsed with it are\n * still returned, so the text can be shown as a table if the user chooses. A delimiter whose parse has issues is only\n * used when every delimiter's does, because a wrong delimiter can itself cause a quote error. Then the one with the\n * fewest issues is used, the first on a tie, and its issues are returned, so the user learns why the text cannot be read.\n * The bytes are decoded once, with the decoder 'parseStream' uses, both to find the record delimiter and for a parser\n * that reads text.\n */\nexport async function parseDelimitedPreview(bytes: Uint8Array, options: ParsePreviewOptions, parseWithDelimiter: ParsePreviewWithDelimiter): Promise<ParsePreviewResult> {\n const text = new TextDecoder(resolveDecoderId(options.encodingId)).decode(bytes);\n const preview: DelimitedPreview = { bytes, encodingId: options.encodingId, text };\n const recordDelimiterId = determineRecordDelimiter(text);\n const { issues, parsedRecords, valueDelimiterId } = await determineValueDelimiter(preview, options.valueDelimiterIds, options.isComplete, parseWithDelimiter);\n return { issues, parsedRecords, recordDelimiterId, valueDelimiterId };\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nfunction determineRecordDelimiter(text: string): RecordDelimiterId {\n const countCRLF = (text.match(/\\r\\n/g) ?? []).length; // Count all '\\r\\n'character sequences.\n const countLF = (text.match(/(?<!\\r)\\n/g) ?? []).length; // Count all '\\n' characters not preceded by '\\r' character.\n const countCR = (text.match(/\\r(?!\\n)/g) ?? []).length; // Count all '\\r' characters not followed by '\\n' character.\n if (countCRLF >= countLF && countCRLF >= countCR) return '\\r\\n';\n if (countLF >= countCRLF && countLF >= countCR) return '\\n';\n return countCR >= countCRLF && countCR >= countLF ? '\\r' : '\\n'; // Ties, including text with no line break, go to '\\r\\n' above, so the '\\n' here is never reached.\n}\n\nasync function determineValueDelimiter(\n preview: DelimitedPreview,\n delimiters: ValueDelimiterId[],\n isComplete: boolean,\n parseWithDelimiter: ParsePreviewWithDelimiter\n): Promise<{ issues: SampleIssue[]; parsedRecords: ParsedRecord[]; valueDelimiterId: ValueDelimiterId | undefined }> {\n let valueDelimiterId: ValueDelimiterId | undefined;\n let priorAverageCount: number | undefined;\n let priorSumCountDiffs: number | undefined;\n let parsedRecords: ParsedRecord[] = [];\n let fewestIssuesParse: { delimiter: ValueDelimiterId; issues: SampleIssue[]; records: ParsedRecord[] } | undefined;\n let hasParsedWithoutIssues = false;\n\n /* TODO: Could improve performance by limiting the number of delimiters\n processed by exiting if column count is the same for each line and\n by ordering delimiters in most common usage. Could also consider\n parallel parsing. Maybe group by most common delimiters and then by\n less common? */\n\n for (const delimiter of delimiters) {\n const { issues, records } = await parseWithDelimiter(preview, delimiter, isComplete);\n if (issues.length > 0) {\n fewestIssuesParse = chooseFewerIssues(fewestIssuesParse, { delimiter, issues, records });\n continue;\n }\n hasParsedWithoutIssues = true;\n if (records.length === 0) continue; // Nothing to compare, and the average below would be 0 / 0.\n const { averageValueCount, sumOfValueCountDiffs } = measureValueCounts(records);\n // A delimiter that split nothing has even records only because each holds one value, so any split beats it.\n const isEvenEnough = priorAverageCount === undefined || priorAverageCount <= 1 || sumOfValueCountDiffs <= (priorSumCountDiffs ?? 0);\n const isBetterFit = isEvenEnough && (priorAverageCount === undefined || averageValueCount > priorAverageCount);\n if (!isBetterFit) continue;\n valueDelimiterId = delimiter;\n priorAverageCount = averageValueCount;\n priorSumCountDiffs = sumOfValueCountDiffs;\n parsedRecords = records;\n }\n\n if (!hasParsedWithoutIssues && fewestIssuesParse != null) {\n const { delimiter, issues, records } = fewestIssuesParse;\n return { issues, parsedRecords: records, valueDelimiterId: isTabular(records) ? delimiter : undefined };\n }\n return { issues: [], parsedRecords, valueDelimiterId: valueDelimiterId != null && isTabular(parsedRecords) ? valueDelimiterId : undefined };\n}\n\n// The earlier parse wins a tie, so delimiters keep their order of preference.\nfunction chooseFewerIssues<T extends { issues: SampleIssue[] }>(priorParse: T | undefined, parse: T): T {\n return priorParse == null || parse.issues.length < priorParse.issues.length ? parse : priorParse;\n}\n\n// The average number of values per record, and how much that number changes from one record to the next.\nfunction measureValueCounts(records: ParsedRecord[]): { averageValueCount: number; sumOfValueCountDiffs: number } {\n let totalValueCount = 0;\n let sumOfValueCountDiffs = 0;\n let priorValueCount: number | undefined;\n for (const record of records) {\n if (priorValueCount != null) sumOfValueCountDiffs += Math.abs(record.length - priorValueCount);\n priorValueCount = record.length;\n totalValueCount += record.length;\n }\n return { averageValueCount: totalValueCount / records.length, sumOfValueCountDiffs };\n}\n\n// Most records have the same number of values, more than one. Ragged rows are allowed, as the parsers allow them.\nfunction isTabular(parsedRecords: ParsedRecord[]): boolean {\n const recordCountByValueCount = new Map<number, number>();\n for (const record of parsedRecords) recordCountByValueCount.set(record.length, (recordCountByValueCount.get(record.length) ?? 0) + 1);\n const [commonValueCount = 0, commonRecordCount = 0] = [...recordCountByValueCount].toSorted((left, right) => right[1] - left[1])[0] ?? [];\n return commonValueCount > 1 && commonRecordCount * 2 > parsedRecords.length;\n}\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\n\n// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport type { DataFormatId } from '@/component/dataView';\nimport type { parserConfigSchema, toolConfigSchema } from './toolConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { toolConfigSchema } from './toolConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Configuration\nexport type ToolConfig = InferOutput<typeof toolConfigSchema>;\n\nexport type ParserConfig = InferOutput<typeof parserConfigSchema>;\n\n// ── File Previewer\nexport type { FilePreviewerInterface, FilePreviewResult } from './filePreviewer';\n\n// ── Parser\nexport type { BuildStructureIndexOptions, ListStructureEntriesOptions, ListStructureEntriesResult, ParserInterface } from './parser';\nexport type { ParsePreviewOptions, ParsePreviewResult, ParseStreamOptions, ParseStreamSummary, StructureCheckpoint } from './parser';\nexport type { StructureContainerKindId, StructureEntry, StructureIndex, StructureKindId, StructureNode } from './parser';\nexport type { StructuredParserInterface, StructureLocator, StructurePath } from './parser';\nexport { type DelimitedPreview, parseDelimitedPreview, type ParsePreviewWithDelimiter } from './delimitedText';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst LOAD_URL_PREFIX = 'https://engine-eu.dpuse.app/tools';\n\nconst DEFAULT_PARSER_TOOL_IDS: Partial<Record<DataFormatId, string>> = { dtv: 'dpuse-tool-rust-csv-core-parser' }; // The tool used for a format with several, when the user has not chosen one.\n\nexport const TOOL_NAME_PREFIX = 'dpuse-tool-'; // A tool's config id is this followed by the id 'loadTool' takes.\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The tools that read the data format, sorted by id. The sort means the first is the same wherever the list came from.\nexport function listParserToolConfigs(toolConfigs: ToolConfig[], dataFormatId: DataFormatId): ToolConfig[] {\n return toolConfigs\n .filter((config) => config.parser?.dataFormatIds.some((id) => id === dataFormatId) === true)\n .toSorted((first, second) => first.id.localeCompare(second.id, 'en'));\n}\n\n// The tool that reads the data format: the one the user chose, or the format's default when none is chosen or the chosen\n// one no longer reads it, or else the first that reads it. 'parserId' is the tool's config id, e.g.\n// 'dpuse-tool-adaltas-csv-parser'.\nexport function resolveParserToolConfig(toolConfigs: ToolConfig[], dataFormatId: DataFormatId, parserId?: string): ToolConfig {\n const parserToolConfigs = listParserToolConfigs(toolConfigs, dataFormatId);\n const [firstParserToolConfig] = parserToolConfigs;\n if (firstParserToolConfig === undefined) {\n const data = { availableToolIds: toolConfigs.map((config) => config.id), dataFormatId };\n throw new AppError(`No tool reads the '${dataFormatId}' data format.`, 'dpuse-shared.component.module.tool.resolveParserToolConfig', { data });\n }\n const defaultParserId = DEFAULT_PARSER_TOOL_IDS[dataFormatId];\n return parserToolConfigs.find((config) => config.id === parserId) ?? parserToolConfigs.find((config) => config.id === defaultParserId) ?? firstParserToolConfig;\n}\n\n// Dynamically load tool.\nexport async function loadTool<T>(toolConfigs: ToolConfig[], toolId: string): Promise<T> {\n const toolName = `${TOOL_NAME_PREFIX}${toolId}`;\n const toolModuleConfig = toolConfigs.find((config) => config.id === toolName);\n // Carries a locator and the ids that were available for the same reason the import failure below does: this is\n // thrown out of a shared module into a caller that can only report what the error itself says.\n if (!toolModuleConfig) {\n const data = { availableToolIds: toolConfigs.map((config) => config.id), toolName };\n throw new AppError(`Tool '${toolId}' not found.`, 'dpuse-shared.component.module.tool.loadTool', { data });\n }\n\n const url = `${LOAD_URL_PREFIX}/${toolId}_v${toolModuleConfig.version}/${toolName}.es.js`;\n try {\n const toolModule = (await import(/* @vite-ignore */ url)) as { Tool: new () => T };\n return new toolModule.Tool();\n } catch (error) {\n // A bare import rejection says only 'Failed to fetch dynamically imported module', which names neither the\n // tool nor the version. The caller reports and displays this error but has no other way to identify the\n // module that went missing, so the identifying detail has to be attached here.\n const data = { toolName, url, version: toolModuleConfig.version };\n throw new AppError(`Failed to load tool '${toolName}' v${toolModuleConfig.version}.`, 'dpuse-shared.component.module.tool.loadTool', { data, cause: error });\n }\n}\n","// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport { resolveDecoderId } from '@/encoding';\nimport type { RetrieveRecordsSummary } from '@/component/module/connector';\nimport type { AuditObjectContentOptions, AuditObjectContentResult, ConnectorUtilities, IndexObjectStructureOptions } from '@/component/module/connector';\nimport type { ContentAuditConfig, DataFormatId, DeclaredColumnConfig, DeclaredReadingConfig } from '@/component/dataView';\nimport { DATA_FORMAT_CONFIGS, VALUE_DELIMITER_CONFIGS } from '@/component/dataView';\nimport type { FilePreviewResult, ListStructureEntriesResult, ParsePreviewResult, ParserInterface, ParseStreamSummary, StructuredParserInterface } from '@/component/module/tool';\nimport type { ListObjectStructureEntriesOptions, ParsedRecordsChunk, PreviewObjectResult, RetrieveRecordsOptions } from '@/component/module/connector';\nimport { listParserToolConfigs, loadTool, resolveParserToolConfig, TOOL_NAME_PREFIX } from '@/component/module/tool';\nimport type { ReadingChoiceConfig, RecordDelimiterId, ValueDelimiterId } from '@/component/dataView';\nimport type { StructureIndex, StructurePath, ToolConfig } from '@/component/module/tool';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Text the previewer takes as delimited is read as delimited even when no delimiter is found, such as a single column\n// or rows that split unevenly. It is then read with these, the most common ones. An empty file is read with them too.\nconst DEFAULT_RECORD_DELIMITER_ID: RecordDelimiterId = '\\n';\nconst DEFAULT_VALUE_DELIMITER_ID: ValueDelimiterId = ',';\n\n// Formats that nest, so the user chooses the part read as the table, and that have no value delimiter.\nconst STRUCTURED_DATA_FORMAT_IDS = new Set<DataFormatId>(DATA_FORMAT_CONFIGS.filter(({ isStructured }) => isStructured).map(({ id }) => id));\n\nconst CARRIAGE_RETURN_BYTE = 0x0d;\nconst LINE_FEED_BYTE = 0x0a;\nconst QUOTE_BYTE = 0x22;\n\n// The most an audit hands its parser at a time. WebKit reads an item in pieces of about 18 MB, against about 2 MB in\n// Chromium, and the bytes audited are counted as the parser takes them, so a whole piece at once made the progress jump\n// in large steps and reach 100% while the parser was still reading.\nconst MAX_AUDIT_READ_BYTE_COUNT = 1_048_576;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Builds the first audit and preview of an item from what the file previewer found. The reading reports what was\n// detected, and never a choice: the detected or declared format, the format's default tool, and the delimiters found.\n// The sample and the audit follow the user's choices, so the user sees the result of what they chose. When nothing\n// that affects parsing was chosen, one parse serves both. An item that is empty, or of a format no tool reads yet, comes\n// back with no records rather than as an error, and its text is kept so the picker can still show it. A source that\n// states its columns or how the item is read, such as a resource file beside it, passes them on. They are taken rather\n// than inferred or detected, and the reading is marked as declared.\nexport async function buildPreviewObjectResult(input: {\n asAt: number;\n declaredColumnConfigs?: DeclaredColumnConfig[] | undefined;\n declaredReadingConfig?: DeclaredReadingConfig | undefined;\n filePreview: FilePreviewResult;\n inferDataTypes: ConnectorUtilities['inferDataTypes'];\n readingChoiceConfig: ReadingChoiceConfig | undefined; // The previewer has already decoded the text with the chosen encoding.\n startedAt: number; // From 'performance.now()', before the item was fetched.\n toolConfigs: ToolConfig[];\n}): Promise<PreviewObjectResult> {\n const { asAt, declaredColumnConfigs, declaredReadingConfig, filePreview, inferDataTypes, readingChoiceConfig, startedAt, toolConfigs } = input;\n const { isComplete, text } = filePreview;\n const isDeclared = declaredReadingConfig != null;\n const size = filePreview.bytes.length;\n const sampleDecoding = { decodedEncodingId: filePreview.decodedEncodingId, replacementCharacterCount: filePreview.replacementCharacterCount };\n const encodingCandidates = filePreview.encodingCandidates;\n const detectedEncoding = {\n encodingConfidenceLevel: filePreview.encodingConfidenceLevel,\n encodingId: declaredReadingConfig?.encodingId ?? filePreview.encodingId,\n encodingSourceId: declaredReadingConfig?.encodingId == null ? filePreview.encodingSourceId : undefined // A declared encoding was not detected.\n };\n\n // An empty file is a table with no rows. An issue says so, because it is not an error but the user should know why\n // there is nothing to show.\n if (size === 0) {\n return {\n contentAuditConfig: constructFirstAuditConfig({ asAt, columns: [], isComplete: true, recordCount: 0, size, startedAt }),\n sampleConfig: {\n ...sampleDecoding,\n issues: [\n {\n endLineNumber: undefined,\n fieldNumber: undefined,\n id: 'empty',\n lineNumber: undefined,\n message: 'The file is empty.',\n recordNumber: undefined,\n severityId: 'info',\n value: undefined\n }\n ],\n dataFormatId: 'dtv',\n hasHeaders: false,\n parsedRecords: [],\n parserId: undefined,\n recordDelimiterId: DEFAULT_RECORD_DELIMITER_ID,\n size: 0,\n text: undefined,\n valueDelimiterId: DEFAULT_VALUE_DELIMITER_ID\n },\n readingConfig: {\n dataFormatId: 'dtv',\n dataFormatSourceId: undefined,\n ...detectedEncoding,\n fileType: undefined,\n hasHeaders: false,\n isDeclared,\n parserId: undefined,\n recordDelimiterId: DEFAULT_RECORD_DELIMITER_ID,\n valueDelimiterId: DEFAULT_VALUE_DELIMITER_ID\n },\n encodingCandidates\n };\n }\n\n // Detection parses with the detected or declared format and the format's default tool. The sample parses again only\n // when the user chose a format, a tool or a value delimiter.\n // A nested format is mapped from the preview's bytes first, and its parser suggests the part to read as the table.\n const detectedDataFormatId = declaredReadingConfig?.dataFormatId ?? filePreview.dataFormatId;\n const declaredValueDelimiterId = declaredReadingConfig?.valueDelimiterId;\n // The parser's time is added up apart from the value audit's, so the cost of each can be measured.\n const parseTiming = { duration: 0 };\n const detectedStructureIndex = await previewStructure({ dataFormatId: detectedDataFormatId, filePreview, parserId: undefined, parseTiming, toolConfigs });\n const previewEncodingId = filePreview.decodedEncodingId ?? 'utf-8'; // The encoding the preview's text was decoded with, so the parser reads the bytes the same way.\n const detectedParse = await parsePreviewText({\n bytes: filePreview.bytes,\n dataFormatId: detectedDataFormatId,\n encodingId: previewEncodingId,\n isComplete,\n parserId: undefined,\n parseTiming,\n structureIndex: detectedStructureIndex,\n structurePath: detectedStructureIndex?.suggestedStructurePath,\n text,\n toolConfigs,\n valueDelimiterId: declaredValueDelimiterId\n });\n const sampleDataFormatId = readingChoiceConfig?.dataFormatId ?? detectedDataFormatId;\n const isFormatChosen = readingChoiceConfig?.dataFormatId != null || readingChoiceConfig?.parserId != null;\n const isParseChosen = isFormatChosen || readingChoiceConfig?.valueDelimiterId != null || readingChoiceConfig?.structurePath != null;\n const sampleStructureIndex = isFormatChosen\n ? await previewStructure({ dataFormatId: sampleDataFormatId, filePreview, parserId: readingChoiceConfig.parserId, parseTiming, toolConfigs })\n : detectedStructureIndex;\n const sampleParse = isParseChosen\n ? await parsePreviewText({\n bytes: filePreview.bytes,\n dataFormatId: sampleDataFormatId,\n encodingId: previewEncodingId,\n isComplete,\n parserId: readingChoiceConfig.parserId,\n parseTiming,\n structureIndex: sampleStructureIndex,\n structurePath: readingChoiceConfig.structurePath ?? sampleStructureIndex?.suggestedStructurePath,\n text,\n toolConfigs,\n valueDelimiterId: declaredValueDelimiterId ?? readingChoiceConfig.valueDelimiterId\n })\n : detectedParse;\n\n // Infer and cast values for each parsed record. Detection is inferred separately only when the sample was parsed\n // with choices, because the header record can differ.\n // A parser whose first record is always a header, such as JSON keys, says so, and is not second-guessed.\n const sampleRecords = sampleParse?.parsePreviewResult.parsedRecords ?? [];\n const sampleHasHeaders = sampleParse?.parsePreviewResult.hasHeaders ?? declaredReadingConfig?.hasHeaders;\n const columnAuditStartedAt = performance.now();\n const sampleInference = sampleParse == null ? undefined : inferDataTypes(sampleRecords, sampleHasHeaders, declaredColumnConfigs);\n const detectedInference =\n isParseChosen && detectedParse != null\n ? inferDataTypes(detectedParse.parsePreviewResult.parsedRecords, detectedParse.parsePreviewResult.hasHeaders ?? declaredReadingConfig?.hasHeaders, declaredColumnConfigs)\n : sampleInference;\n const columnAuditDuration = performance.now() - columnAuditStartedAt;\n\n return {\n contentAuditConfig: constructFirstAuditConfig({\n asAt,\n columnAuditDuration,\n columns: sampleInference?.columnConfigs ?? [],\n isComplete,\n parseDuration: parseTiming.duration,\n recordCount: Math.max(0, sampleRecords.length - (sampleInference?.hasHeaders === true ? 1 : 0)), // A header record names the columns and is not data.\n size,\n startedAt\n }),\n sampleConfig: {\n ...sampleDecoding,\n dataFormatId: sampleDataFormatId ?? 'unknown',\n hasHeaders: sampleInference?.hasHeaders,\n issues: sampleParse?.parsePreviewResult.issues ?? [], // Records the parser could not read. The text is still returned, so the user can see them.\n parsedRecords: sampleRecords,\n parserId: sampleParse?.parserId,\n recordDelimiterId: sampleParse?.parsePreviewResult.recordDelimiterId,\n size,\n structurePath: sampleParse?.structurePath,\n text,\n valueDelimiterId: sampleParse?.valueDelimiterId\n },\n readingConfig: {\n dataFormatId: detectedDataFormatId ?? 'unknown',\n dataFormatSourceId: declaredReadingConfig == null ? filePreview.dataFormatSourceId : undefined, // A declared format was not detected.\n ...detectedEncoding,\n fileType: filePreview.fileTypeConfig,\n hasHeaders: detectedInference?.hasHeaders,\n isDeclared,\n parserId: detectedParse?.parserId,\n recordDelimiterId: detectedParse?.parsePreviewResult.recordDelimiterId,\n structurePath: detectedStructureIndex?.suggestedStructurePath,\n valueDelimiterId: detectedParse?.valueDelimiterId\n },\n encodingCandidates,\n structureIndex: sampleStructureIndex\n };\n}\n\n// Reads every record of an item, with the tool that read its preview. The caller supplies the stream and owns the abort\n// signal, because only the connector knows how to reach its items.\nexport async function* retrieveRecordsWithParser(input: {\n options: RetrieveRecordsOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): AsyncGenerator<ParsedRecordsChunk, RetrieveRecordsSummary, undefined> {\n const { options, signal, stream, toolConfigs } = input;\n const { encodingId, valueDelimiterId } = establishFileReading(options);\n const { parser } = await loadParser(toolConfigs, options.dataFormatId, options.parserId);\n const timedSource = timeSourceWaits(stream);\n const countedSource = countBytes(timedSource.stream);\n const parsing: AsyncIterator<ParsedRecordsChunk, ParseStreamSummary> = parser.parseStream(countedSource.stream, {\n abortSignal: signal,\n chunkSize: options.chunkSize,\n dataFormatId: options.dataFormatId,\n encodingId,\n structurePath: options.structurePath,\n valueDelimiterId\n });\n // The time the receiver holds each chunk, such as a store writing it, is not the parser's, so it is not counted.\n const parserReads = timeParserReads(parsing);\n let isParsingDone = false;\n try {\n let parsed = await parserReads.readNext();\n while (parsed.done !== true) {\n yield { ...parsed.value, byteCount: countedSource.byteCount() }; // The parser may have read a little past these records, so the count runs slightly ahead.\n parsed = await parserReads.readNext();\n }\n isParsingDone = true;\n const sourceWaitDuration = timedSource.waitDuration();\n // The parser's counts of lines and bytes are for an audit, so they are not passed on.\n return { recordCount: parsed.value.recordCount, sourceWaitDuration, parseDuration: Math.max(0, parserReads.duration() - sourceWaitDuration) };\n } finally {\n if (!isParsingDone) await parsing.return?.(); // A receiver that stops early, or a failure, also stops the parser's read.\n }\n}\n\n// Reads an item's records from its start, to count them and describe their columns, up to 'options.byteLimit' or until\n// 'options.stopSignal' fires. Records are audited one chunk at a time, so the item is never held in memory. 'onProgress'\n// receives the number of records in each chunk as it is audited, and the bytes read so far. A source that states its\n// columns passes them on, so the audit takes their types rather than inferring them.\nexport async function auditObjectContentWithParser(input: {\n constructColumnAuditor: ConnectorUtilities['constructColumnAuditor'];\n declaredColumnConfigs?: DeclaredColumnConfig[] | undefined;\n onProgress: (recordCount: number, byteCount: number) => void;\n options: AuditObjectContentOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): Promise<AuditObjectContentResult> {\n const { constructColumnAuditor, declaredColumnConfigs, onProgress, options, signal, stream, toolConfigs } = input;\n const { encodingId, valueDelimiterId } = establishFileReading(options);\n const asAt = Date.now();\n const startedAt = performance.now();\n const columnAuditor = constructColumnAuditor(options.hasHeaders, declaredColumnConfigs);\n const { parser } = await loadParser(toolConfigs, options.dataFormatId, options.parserId);\n const timedSource = timeSourceWaits(stream);\n // Delimited text is cut at a record boundary here. A nested format can only be cut between its items, which only its\n // parser can find, so it is given the limit and the stop signal instead.\n const isStructured = STRUCTURED_DATA_FORMAT_IDS.has(options.dataFormatId);\n const auditSource = isStructured ? countBytes(timedSource.stream) : endAtRecordBoundary(timedSource.stream, { byteLimit: options.byteLimit, encodingId, stopSignal: options.stopSignal });\n const parsing = parser.parseStream(auditSource.stream, {\n abortSignal: signal,\n byteLimit: isStructured ? options.byteLimit : undefined,\n chunkSize: options.chunkSize,\n dataFormatId: options.dataFormatId,\n encodingId,\n stopSignal: isStructured ? options.stopSignal : undefined,\n structurePath: options.structurePath,\n valueDelimiterId\n });\n // The parser and the column auditor are timed apart, so the cost of each can be measured. Read with 'next' rather\n // than 'for await', which drops the summary the parser returns at the end.\n const parserReads = timeParserReads(parsing);\n let columnAuditDuration = 0;\n let parsed = await parserReads.readNext();\n while (parsed.done !== true) {\n try {\n const auditStartedAt = performance.now();\n columnAuditor.auditRecords(parsed.value.records);\n columnAuditDuration += performance.now() - auditStartedAt;\n onProgress(parsed.value.records.length, auditSource.byteCount());\n } catch (error) {\n await parsing.throw(error); // Lets the parser stop its read, then rethrows the error.\n throw error;\n }\n parsed = await parserReads.readNext();\n }\n const summary = parsed.value;\n const sourceWaitDuration = timedSource.waitDuration();\n const completeStartedAt = performance.now();\n const isComplete = summary.isComplete ?? auditSource.isComplete();\n const { columnConfigs, hasHeaders } = columnAuditor.completeAudit(isComplete);\n columnAuditDuration += performance.now() - completeStartedAt; // Settling each column's type is part of auditing its values.\n const contentAuditConfig: ContentAuditConfig = {\n asAt,\n byteCount: auditSource.byteCount(),\n columns: columnConfigs,\n commentLineCount: summary.commentLineCount,\n duration: performance.now() - startedAt,\n emptyLineCount: summary.emptyLineCount,\n invalidFieldLengthCount: summary.nonUniformRecordCount,\n isComplete,\n lineCount: summary.lineCount,\n recordCount: Math.max(0, summary.recordCount - (hasHeaders ? 1 : 0)), // A header record names the columns and is not data.\n sourceWaitDuration,\n parseDuration: Math.max(0, parserReads.duration() - sourceWaitDuration),\n columnAuditDuration\n };\n return { contentAuditConfig, hasHeaders };\n}\n\n// Maps the structure of a whole nested item, reporting the bytes read as it goes. A syntax error ends the map early and\n// is reported in it, with what was read before it kept.\nexport async function indexObjectStructureWithParser(input: {\n onProgress: (byteCount: number) => void;\n options: IndexObjectStructureOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): Promise<StructureIndex> {\n const { onProgress, options, signal, stream, toolConfigs } = input;\n const parser = await loadStructuredParser(toolConfigs, options.dataFormatId, options.parserId);\n const encodingId = options.encodingId ?? 'utf-8';\n return await parser.buildStructureIndex(stream, { abortSignal: signal, dataFormatId: options.dataFormatId, encodingId, isComplete: true, maxDepth: undefined, onProgress });\n}\n\n// Lists one page of a part of a nested item. The stream must start at the locator's start offset and may stop at its end\n// offset, so a connector that can read part of an item reads only those bytes.\nexport async function listObjectStructureEntriesWithParser(input: {\n options: ListObjectStructureEntriesOptions;\n signal: AbortSignal;\n stream: ReadableStream<Uint8Array>;\n toolConfigs: ToolConfig[];\n}): Promise<ListStructureEntriesResult> {\n const { options, signal, stream, toolConfigs } = input;\n const parser = await loadStructuredParser(toolConfigs, options.dataFormatId, options.parserId);\n return await parser.listStructureEntries(stream, {\n abortSignal: signal,\n dataFormatId: options.dataFormatId,\n entryCount: options.entryCount,\n locator: options.locator,\n maxValueLength: options.maxValueLength,\n path: options.structurePath\n });\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Only a file has an encoding and a value delimiter, and a parser needs both to read one. A nested format has no value\n// delimiter.\nfunction establishFileReading(options: { dataFormatId: DataFormatId; encodingId: string | undefined; path: string; valueDelimiterId: ValueDelimiterId | undefined }): {\n encodingId: string;\n valueDelimiterId: ValueDelimiterId;\n} {\n const valueDelimiterId = options.valueDelimiterId ?? (STRUCTURED_DATA_FORMAT_IDS.has(options.dataFormatId) ? '' : undefined);\n if (valueDelimiterId == null || options.encodingId == null) throw new Error(`'${options.path}' has no encoding or value delimiter, which a parser needs to read it.`);\n return { encodingId: options.encodingId, valueDelimiterId };\n}\n\n// The first audit of an item, from the records its preview parsed. The bytes were fetched before it started, so it has no\n// wait to report, and the parser's text mode does not count lines.\nfunction constructFirstAuditConfig(input: {\n asAt: number;\n columnAuditDuration?: number | undefined;\n columns: ContentAuditConfig['columns'];\n isComplete: boolean;\n parseDuration?: number | undefined;\n recordCount: number;\n size: number;\n startedAt: number;\n}): ContentAuditConfig {\n const { asAt, columnAuditDuration, columns, isComplete, parseDuration, recordCount, size, startedAt } = input;\n return {\n asAt,\n byteCount: size,\n columns,\n commentLineCount: undefined,\n duration: performance.now() - startedAt,\n emptyLineCount: undefined,\n invalidFieldLengthCount: undefined,\n isComplete,\n lineCount: undefined,\n recordCount,\n sourceWaitDuration: undefined,\n parseDuration,\n columnAuditDuration\n };\n}\n\n// Passes the stream through until the limit is reached or the stop signal fires, then ends it just after the next record.\n// Ending the stream, rather than aborting, lets the parser finish normally, so its counts are kept and no record is cut\n// in two. The limit is a minimum, because a record that runs past it is read to its end. Line breaks inside quotes do not\n// end a record, so every byte is checked for quotes, even while no limit is near. A large piece is handed over a part at a\n// time, the rest kept for the next read, so the byte count follows what the parser has taken.\nfunction endAtRecordBoundary(\n stream: ReadableStream<Uint8Array>,\n options: Pick<AuditObjectContentOptions, 'byteLimit' | 'stopSignal'> & { encodingId: string }\n): { byteCount: () => number; isComplete: () => boolean; stream: ReadableStream<Uint8Array> } {\n const reader = stream.getReader();\n const recordEndFinder = constructRecordEndFinder(options.encodingId);\n let byteCount = 0;\n let isComplete = false;\n let pendingBytes: Uint8Array | undefined; // What is left of the last piece read, not yet handed over.\n const boundedStream = new ReadableStream<Uint8Array>(\n {\n async pull(controller): Promise<void> {\n let pieceBytes = pendingBytes;\n if (pieceBytes == null) {\n const result = await reader.read();\n if (result.done) {\n isComplete = true;\n controller.close();\n return;\n }\n pieceBytes = result.value;\n }\n const bytes = pieceBytes.subarray(0, MAX_AUDIT_READ_BYTE_COUNT); // A view, not a copy.\n pendingBytes = pieceBytes.length > MAX_AUDIT_READ_BYTE_COUNT ? pieceBytes.subarray(MAX_AUDIT_READ_BYTE_COUNT) : undefined;\n const limit = options.stopSignal?.aborted === true ? byteCount : (options.byteLimit ?? Infinity);\n const recordEnd = recordEndFinder(bytes, byteCount, limit - byteCount);\n if (recordEnd == null) {\n byteCount += bytes.length;\n controller.enqueue(bytes);\n return;\n }\n byteCount += recordEnd;\n pendingBytes = undefined;\n controller.enqueue(bytes.subarray(0, recordEnd));\n controller.close();\n await reader.cancel();\n },\n cancel(reason): Promise<void> {\n return reader.cancel(reason);\n }\n },\n { highWaterMark: 0 }\n );\n return { byteCount: () => byteCount, isComplete: () => isComplete, stream: boundedStream };\n}\n\n// Finds where the first record to end at or after 'searchFrom' ends in a piece of the item, remembering across pieces\n// whether a quote is open. Doubled quotes inside a value close and reopen it, which leaves the answer right. UTF-8 never\n// uses these byte values inside a longer character. UTF-16 can, so it is read as two-byte units.\nfunction constructRecordEndFinder(encodingId: string): (bytes: Uint8Array, position: number, searchFrom: number) => number | undefined {\n const decoderId = resolveDecoderId(encodingId);\n const isUtf16 = decoderId.startsWith('utf-16');\n const unitByteCount = isUtf16 ? 2 : 1;\n const lowByteOffset = decoderId === 'utf-16be' ? 1 : 0;\n let quoteIsOpen = false;\n\n return (bytes, position, searchFrom): number | undefined => {\n for (let index = 0; index < bytes.length; index++) {\n const byte = bytes[index];\n if (byte !== QUOTE_BYTE && byte !== LINE_FEED_BYTE && byte !== CARRIAGE_RETURN_BYTE) continue;\n if (isUtf16 && ((position + index) % 2 !== lowByteOffset || bytes[index + 1 - 2 * lowByteOffset] !== 0)) continue;\n if (byte === QUOTE_BYTE) quoteIsOpen = !quoteIsOpen;\n else if (!quoteIsOpen && index >= searchFrom && (byte === LINE_FEED_BYTE || bytes[index + unitByteCount] !== LINE_FEED_BYTE))\n return index + unitByteCount - lowByteOffset;\n }\n };\n}\n\n// Passes the stream through, counting the bytes the parser has taken, for an audit's progress.\nfunction countBytes(stream: ReadableStream<Uint8Array>): { byteCount: () => number; isComplete: () => boolean; stream: ReadableStream<Uint8Array> } {\n const reader = stream.getReader();\n let byteCount = 0;\n let isComplete = false;\n const countedStream = new ReadableStream<Uint8Array>(\n {\n async pull(controller): Promise<void> {\n const result = await reader.read();\n if (result.done) {\n isComplete = true;\n controller.close();\n return;\n }\n byteCount += result.value.length;\n controller.enqueue(result.value);\n },\n cancel(reason): Promise<void> {\n return reader.cancel(reason);\n }\n },\n { highWaterMark: 0 }\n );\n return { byteCount: () => byteCount, isComplete: () => isComplete, stream: countedStream };\n}\n\n// Passes the stream through, adding up how long the parser waits for each chunk, so an audit can show how much of its\n// time went on fetching the item rather than reading it. A chunk is only asked for when the parser wants one, so the\n// wait is time the parser sat idle. The browser keeps receiving the item meanwhile, so this does not slow the fetch.\nfunction timeSourceWaits(stream: ReadableStream<Uint8Array>): { stream: ReadableStream<Uint8Array>; waitDuration: () => number } {\n const reader = stream.getReader();\n let waitDuration = 0;\n const timedStream = new ReadableStream<Uint8Array>(\n {\n async pull(controller): Promise<void> {\n const startedAt = performance.now();\n const result = await reader.read();\n waitDuration += performance.now() - startedAt;\n if (result.done) controller.close();\n else controller.enqueue(result.value);\n },\n cancel(reason): Promise<void> {\n return reader.cancel(reason);\n }\n },\n { highWaterMark: 0 }\n );\n return { stream: timedStream, waitDuration: () => waitDuration };\n}\n\n// Loads the tool the user chose for the format, or the format's default. Returns the id of the tool actually used.\n// Parses the preview's bytes in a data format, decoded as an audit and a load decode them, with the tool and value\n// delimiter given, or else the format's default tool and the delimiter detected. Returns undefined when there is no\n// text, or no tool reads the format yet. Delimited text\n// with no delimiter found is parsed again with the default delimiter, so the records match the delimiter reported. A\n// delimiter that was given is the only one tried. Whether the preview holds the whole item decides if a quote left open\n// at its end is an error, or a value the preview cut off.\n// A nested format whose structure was mapped is read from the part at 'structurePath'. With no part chosen or suggested,\n// there are no records until the user chooses one. When its structure could not be read at all, such as in an encoding\n// its parser does not read, the structure's issues are the sample's.\nasync function parsePreviewText(input: {\n bytes: Uint8Array;\n dataFormatId: DataFormatId | undefined;\n encodingId: string;\n isComplete: boolean;\n parserId: string | undefined;\n parseTiming: { duration: number };\n structureIndex: StructureIndex | undefined;\n structurePath: StructurePath | undefined;\n text: string | undefined;\n toolConfigs: ToolConfig[];\n valueDelimiterId: ValueDelimiterId | undefined;\n}): Promise<{ parserId: string; parsePreviewResult: ParsePreviewResult; structurePath: StructurePath | undefined; valueDelimiterId: ValueDelimiterId | undefined } | undefined> {\n const { bytes, dataFormatId, encodingId, isComplete, parserId, parseTiming, structureIndex, structurePath, text, toolConfigs, valueDelimiterId } = input;\n if (dataFormatId == null || text == null || listParserToolConfigs(toolConfigs, dataFormatId).length === 0) return undefined;\n\n const { parser, parserId: usedParserId } = await loadParser(toolConfigs, dataFormatId, parserId);\n if (structureIndex != null) {\n const isUnreadable = structureIndex.nodes.length === 0 && structureIndex.issues.length > 0;\n if (isUnreadable || structurePath == null) {\n const issues = isUnreadable ? structureIndex.issues : [];\n return { parserId: usedParserId, parsePreviewResult: { issues, parsedRecords: [], recordDelimiterId: '\\n', valueDelimiterId: undefined }, structurePath: undefined, valueDelimiterId: undefined };\n }\n const parsePreviewResult = await timeParse(parseTiming, () => parser.parsePreview(bytes, { dataFormatId, encodingId, isComplete, structurePath, valueDelimiterIds: [] }));\n return { parserId: usedParserId, parsePreviewResult, structurePath, valueDelimiterId: undefined };\n }\n const valueDelimiterIds = valueDelimiterId == null ? VALUE_DELIMITER_CONFIGS.map(({ id }) => id) : [valueDelimiterId];\n const firstParsePreviewResult = await timeParse(parseTiming, () => parser.parsePreview(bytes, { dataFormatId, encodingId, isComplete, valueDelimiterIds }));\n const isDelimitedText = dataFormatId === 'dtv';\n const parsePreviewResult =\n isDelimitedText && valueDelimiterId == null && firstParsePreviewResult.valueDelimiterId == null\n ? await timeParse(parseTiming, () => parser.parsePreview(bytes, { dataFormatId, encodingId, isComplete, valueDelimiterIds: [DEFAULT_VALUE_DELIMITER_ID] }))\n : firstParsePreviewResult;\n const reportedValueDelimiterId = isDelimitedText ? (valueDelimiterId ?? parsePreviewResult.valueDelimiterId ?? DEFAULT_VALUE_DELIMITER_ID) : parsePreviewResult.valueDelimiterId;\n return { parserId: usedParserId, parsePreviewResult, structurePath: undefined, valueDelimiterId: reportedValueDelimiterId };\n}\n\n// Maps the structure of a nested item from the preview's bytes, with the tool that reads its format. Undefined for a\n// format that does not nest, or when its tool does not map structure, which then reads the item its own way.\nasync function previewStructure(input: {\n dataFormatId: DataFormatId | undefined;\n filePreview: FilePreviewResult;\n parserId: string | undefined;\n parseTiming: { duration: number };\n toolConfigs: ToolConfig[];\n}): Promise<StructureIndex | undefined> {\n const { dataFormatId, filePreview, parserId, parseTiming, toolConfigs } = input;\n const isMapped =\n dataFormatId != null &&\n STRUCTURED_DATA_FORMAT_IDS.has(dataFormatId) &&\n listParserToolConfigs(toolConfigs, dataFormatId).length > 0 &&\n resolveParserToolConfig(toolConfigs, dataFormatId, parserId).actionNames?.includes('buildStructureIndex') === true;\n if (!isMapped) return undefined;\n const parser = await loadStructuredParser(toolConfigs, dataFormatId, parserId);\n const stream = new Blob([filePreview.bytes as Uint8Array<ArrayBuffer>]).stream();\n const encodingId = filePreview.decodedEncodingId ?? 'utf-8';\n return await timeParse(parseTiming, () =>\n parser.buildStructureIndex(stream, {\n abortSignal: new AbortController().signal, // The bytes are already in memory, so there is nothing to cancel.\n dataFormatId,\n encodingId,\n isComplete: filePreview.isComplete,\n maxDepth: undefined,\n onProgress: undefined\n })\n );\n}\n\n// Reads a parser's chunks one at a time and adds up how long each read takes, so the parser's time is kept apart from\n// what is done with each chunk once it is read. The total includes any wait for the item's bytes.\nfunction timeParserReads<T, TReturn>(parsing: AsyncIterator<T, TReturn>): { duration: () => number; readNext: () => Promise<IteratorResult<T, TReturn>> } {\n let duration = 0;\n return {\n duration: () => duration,\n async readNext(): Promise<IteratorResult<T, TReturn>> {\n const startedAt = performance.now();\n const result = await parsing.next();\n duration += performance.now() - startedAt;\n return result;\n }\n };\n}\n\n// Adds the time a parser call takes to 'parseTiming', so the parser's time is kept apart from loading its tool.\nasync function timeParse<T>(parseTiming: { duration: number }, parse: () => Promise<T>): Promise<T> {\n const startedAt = performance.now();\n try {\n return await parse();\n } finally {\n parseTiming.duration += performance.now() - startedAt;\n }\n}\n\nasync function loadParser(toolConfigs: ToolConfig[], dataFormatId: DataFormatId, parserId: string | undefined): Promise<{ parser: ParserInterface; parserId: string }> {\n const parserToolConfig = resolveParserToolConfig(toolConfigs, dataFormatId, parserId);\n const parser = await loadTool<ParserInterface>(toolConfigs, parserToolConfig.id.slice(TOOL_NAME_PREFIX.length));\n return { parser, parserId: parserToolConfig.id };\n}\n\n// The tool for a nested format, which must also map structure.\nasync function loadStructuredParser(toolConfigs: ToolConfig[], dataFormatId: DataFormatId, parserId: string | undefined): Promise<StructuredParserInterface> {\n const { parser, parserId: usedParserId } = await loadParser(toolConfigs, dataFormatId, parserId);\n if (!('buildStructureIndex' in parser)) {\n throw new AppError(`Tool '${usedParserId}' does not map the structure of '${dataFormatId}' items.`, 'dpuse-shared.component.module.connector.objectParsing.loadStructuredParser');\n }\n return parser as StructuredParserInterface;\n}\n","// ── DPUse Framework\nimport { ConnectorError } from '@/errors';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// 'heldElsewhere' means another tab or window has the store open, or has just taken it from this one. 'notLoaded' means\n// the store has no table at the path asked for, because it was never loaded or has since been removed.\nexport type StoreErrorId = 'heldElsewhere' | 'notLoaded';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The id travels in the error's data, which survives the trip from a connector through the engine to the app, so the\n// app can show the right state rather than a failure.\nexport function constructStoreError(storeErrorId: StoreErrorId, message: string, locator: string, options?: ErrorOptions): ConnectorError {\n return new ConnectorError(message, locator, { data: { storeErrorId }, ...options });\n}\n\n// Looks through the error and its causes, because the engine and the app each wrap a connector's error in their own.\nexport function findStoreErrorId(error: unknown): StoreErrorId | undefined {\n const seenErrors = new Set<unknown>();\n for (let cause: unknown = error; cause instanceof Error && !seenErrors.has(cause); cause = cause.cause) {\n seenErrors.add(cause);\n const storeErrorId = (cause as { data?: { storeErrorId?: unknown } }).data?.storeErrorId;\n if (storeErrorId === 'heldElsewhere' || storeErrorId === 'notLoaded') return storeErrorId;\n }\n return undefined;\n}\n","// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A database name becomes part of a file name, so it is kept to letters, digits, '_' and '-'.\nconst DATABASE_NAME_PATTERN = /^[\\w-]+$/u;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A store keeps its tables in one or more databases. A path '/database/table' names both. A path that is only a table's\n// name uses the store's default database, as every path did before a store could hold several.\nexport function resolveStorePath(path: string): { databaseName: string | undefined; tableName: string } {\n if (!path.startsWith('/')) return { databaseName: undefined, tableName: path };\n const [, databaseName, tableName, ...extraSegments] = path.split('/');\n if (databaseName == null || tableName == null || tableName === '' || extraSegments.length > 0 || !DATABASE_NAME_PATTERN.test(databaseName)) {\n throw new Error(`Encountered invalid store path '${path}'.`);\n }\n return { databaseName, tableName };\n}\n","// ── DPUse Framework\nimport type { ParsedRecord } from '@/component/dataView';\nimport type { StoreRecord, StoreValue } from '@/component/module/connector';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// A typed record as text, for the steps that read text: a preview's sample, the column auditor and a load's conversion\n// to a type the user chose. A date and time is written in ISO 8601, in UTC. A null stays null, and an empty string stays\n// empty, as in delimited text.\nexport function convertStoreRecordToParsedRecord(storeRecord: StoreRecord): ParsedRecord {\n return storeRecord.map((storeValue) => convertStoreValueToText(storeValue));\n}\n\nexport function convertStoreValueToText(storeValue: StoreValue): string | null {\n if (storeValue == null) return null;\n return storeValue instanceof Date ? storeValue.toISOString() : String(storeValue);\n}\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface AcquireWebLockOptions {\n onLost?: () => void; // Called when another tab takes the lock over while this one holds it.\n takeOver?: boolean; // Takes the lock even when another tab holds it, which that tab's 'onLost' then hears of.\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Takes a Web Lock without waiting, so a tab that cannot have it is told at once. Returns the function that releases it,\n// or undefined when another tab holds it. A request that fails, e.g. where Web Locks are blocked, rejects. The browser\n// frees a released lock a moment later, so the release resolves only once the lock is free. Otherwise a request made\n// straight after a release would find the lock still held.\n//\n// A takeover is the way out when a tab holds the lock but cannot be reached, such as one left open in another window.\n// The browser ends the holder's request with an 'AbortError', so the holder can close what the lock protects.\nexport async function acquireWebLock(name: string, options: AcquireWebLockOptions = {}): Promise<(() => Promise<void>) | undefined> {\n const acquisition = Promise.withResolvers<(() => void) | undefined>();\n const grant = { isGranted: false }; // An object, because the lock callback sets it where type narrowing cannot see.\n const lockRequest = navigator.locks.request(name, options.takeOver === true ? { steal: true } : { ifAvailable: true }, (lock) => {\n if (lock == null) {\n acquisition.resolve(undefined);\n return;\n }\n grant.isGranted = true;\n return new Promise<void>((release) => {\n acquisition.resolve(release);\n });\n });\n const endedRequest = (async (): Promise<void> => {\n try {\n await lockRequest;\n } catch (error) {\n if (!grant.isGranted) acquisition.reject(error instanceof Error ? error : new Error(String(error)));\n else if (error instanceof DOMException && error.name === 'AbortError') options.onLost?.();\n }\n })();\n const release = await acquisition.promise;\n if (release == null) return;\n return async (): Promise<void> => {\n release();\n await endedRequest; // Settles once the browser has freed the lock, or at once when it was taken over.\n };\n}\n","// ── External Dependencies & Registrations\nimport { array, boolean, looseObject, number, optional, safeParse, string } from 'valibot';\n\n// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport { VALUE_DELIMITER_CONFIGS } from '@/component/dataView';\nimport type { DataSubtypeId, DeclaredColumnConfig, DeclaredReadingConfig } from '@/component/dataView';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype DeclaredType = Pick<DeclaredColumnConfig, 'dataSubtypeId' | 'dataTypeId'>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Only the properties DPUse reads. Others, such as 'constraints', are allowed and left alone.\nconst TABLE_SCHEMA_FIELD_SCHEMA = looseObject({ format: optional(string()), name: string(), title: optional(string()), type: optional(string()) });\nconst TABLE_SCHEMA_SCHEMA = looseObject({ fields: array(TABLE_SCHEMA_FIELD_SCHEMA) });\nconst HEADER_ROWS_SCHEMA = optional(array(number()));\nconst TABLE_DIALECT_SCHEMA = looseObject({ delimiter: optional(string()), header: optional(boolean()), headerRows: HEADER_ROWS_SCHEMA });\n\n// Table Schema types DPUse has a type for. The rest, such as 'object', 'geopoint' and 'any', the default, are inferred.\n// A 'year' is a whole number, because DPUse has no year type.\nconst TABLE_SCHEMA_TYPES: Partial<Record<string, DeclaredType>> = {\n boolean: { dataSubtypeId: undefined, dataTypeId: 'boolean' },\n date: { dataSubtypeId: 'date', dataTypeId: 'temporal' },\n datetime: { dataSubtypeId: 'dateTime', dataTypeId: 'temporal' },\n integer: { dataSubtypeId: 'integer', dataTypeId: 'numeric' },\n number: { dataSubtypeId: 'decimal', dataTypeId: 'numeric' },\n string: { dataSubtypeId: 'plain', dataTypeId: 'string' },\n time: { dataSubtypeId: 'time', dataTypeId: 'temporal' },\n year: { dataSubtypeId: 'integer', dataTypeId: 'numeric' }\n};\n\n// The string formats that match a DPUse text subtype. Any other format is plain text.\nconst TABLE_SCHEMA_STRING_SUBTYPES: Partial<Record<string, DataSubtypeId>> = { email: 'email', uri: 'url', uuid: 'uuid' };\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Reads a Table Schema, with the Table Dialect and encoding of its data resource when given, into the columns and reading\n// an audit takes as declared (https://datapackage.org/standard/table-schema/). The input takes the property names of a\n// Data Package resource, so a resource can be passed as it is. Fields match the item's columns by position, the\n// standard's default. A dialect that is not given takes the standard's defaults: a header row and a comma.\nexport function readTableSchema(resource: { dialect?: unknown; encoding?: string | undefined; schema: unknown }): {\n declaredColumnConfigs: DeclaredColumnConfig[];\n declaredReadingConfig: DeclaredReadingConfig;\n} {\n const schemaResult = safeParse(TABLE_SCHEMA_SCHEMA, resource.schema);\n if (!schemaResult.success) throw new AppError('The table schema is not valid.', 'dpuse-shared.component.module.connector.tableSchema.readTableSchema');\n const dialectResult = safeParse(TABLE_DIALECT_SCHEMA, resource.dialect ?? {});\n if (!dialectResult.success) throw new AppError('The table dialect is not valid.', 'dpuse-shared.component.module.connector.tableSchema.readTableSchema');\n\n const declaredColumnConfigs = schemaResult.output.fields.map((field): DeclaredColumnConfig => {\n const declaredType = constructDeclaredType(field.type, field.format);\n return { name: field.name, label: field.title, dataTypeId: declaredType.dataTypeId, dataSubtypeId: declaredType.dataSubtypeId };\n });\n const { delimiter = ',', header = true, headerRows = [1] } = dialectResult.output;\n return {\n declaredColumnConfigs,\n declaredReadingConfig: {\n dataFormatId: 'dtv',\n encodingId: resource.encoding?.toLowerCase(), // Detected when the resource does not say, as the standard leaves it.\n hasHeaders: header && headerRows.length > 0,\n valueDelimiterId: VALUE_DELIMITER_CONFIGS.find(({ character }) => character === delimiter)?.id // A delimiter DPUse does not offer is detected.\n }\n };\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nfunction constructDeclaredType(type: string | undefined, format: string | undefined): DeclaredType {\n const declaredType = type == null ? undefined : TABLE_SCHEMA_TYPES[type];\n if (declaredType == null) return { dataSubtypeId: undefined, dataTypeId: undefined };\n if (format == null || declaredType.dataTypeId !== 'string') return declaredType;\n return { dataSubtypeId: TABLE_SCHEMA_STRING_SUBTYPES[format] ?? 'plain', dataTypeId: 'string' };\n}\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\n\n// ── DPUse Framework\nimport type { EncodingDetectionConfig } from '@/encoding';\nimport type { EngineConnectorActionOptions } from '@/component/module/engine';\nimport type { LocalisedConfig } from '@/locale';\nimport type { ToolConfig } from '@/component/module/tool';\nimport type {\n ColumnAuditConfig,\n ColumnReadingConfig,\n ContentAuditConfig,\n DataFormatId,\n DeclaredColumnConfig,\n ParsedRecord,\n ReadingConfig,\n SampleConfig,\n ValueDelimiterId\n} from '@/component/dataView';\nimport type { ConnectionConfig, ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '@/component/connection';\nimport type {\n connectorActionNameSchema,\n connectorCategoryConfigSchema,\n connectorConfigSchema,\n connectorItemTypeConfigSchema,\n connectorItemTypeIdSchema,\n connectorUsageConfigSchema,\n connectorUsageIdSchema\n} from './connectorConfig.schema';\nimport { createLabelMap, DEFAULT_LOCALE_ID, type LocaleLabel, resolveLabel } from '@/locale/label';\nimport type { ListStructureEntriesResult, StructureIndex, StructureLocator, StructurePath } from '@/component/module/tool';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { connectorConfigSchema } from './connectorConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Interface\nexport interface ConnectorInterface {\n // 'chunk' is called with the records and bytes just audited. A store connector also gives the object's total record\n // count, counted as the audit starts, so progress can be shown for an object that has no bytes to measure it by.\n auditObjectContent?(options: AuditObjectContentOptions, chunk: (recordCount: number, byteCount: number, totalRecordCount?: number) => void): Promise<AuditObjectContentResult>;\n closeStore?(options: CloseStoreOptions): Promise<void>; // Close a store connector's database and release its hold on it, so another tab can open it.\n createObject?(options: CreateObjectOptions): Promise<void>; // Create an object for a specified connection.\n describeConnection?(options: DescribeConnectionOptions): Promise<DescribeConnectionResult>; // Describe a specified connection.\n dropObject?(options: DropObjectOptions): Promise<void>; // Drop (delete) an object for a specified connection.\n findObject?(options: FindObjectOptions): Promise<FindObjectResult>; // Checks that an object exists, given its path as its id, and throws when it does not.\n getInfo?(options: GetInfoOptions): Promise<GetInfoResult>; // Get metadata/info for a node (at any hierarchy level) for a specified connection.\n getObject?(options: GetObjectOptions): Promise<GetObjectResult>; // Looks an object up by its id, wherever it is in the connection, and gives its path.\n getReadableStream?(options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>>; // Get a reader that can retrieve all records from an object for a specified connection.\n getRecord?(options: GetRecordOptions): Promise<GetRecordResult>; // Get a record for an object for a specified connection.\n indexObjectStructure?(options: IndexObjectStructureOptions, chunk: (byteCount: number) => void): Promise<StructureIndex>; // Map the structure of a whole nested item, such as JSON, reporting the bytes read as it goes.\n listNodes?(options: ListNodesOptions): Promise<ListNodesResult>; // List nodes in a folder for a specified connection.\n listObjectStructureEntries?(options: ListObjectStructureEntriesOptions): Promise<ListStructureEntriesResult>; // List one page of a part of a nested item, such as JSON.\n loadObjectRecords?(options: LoadObjectRecordsOptions, chunks: AsyncIterable<StoreChunk>): Promise<LoadObjectRecordsResult>; // Replace an object in a store connector with the records given.\n readonly storeChunkLayoutId?: StoreChunkLayoutId; // The layout a store connector takes a load's chunks in. Records, unless it asks for columns.\n openStore?(options: OpenStoreOptions): Promise<OpenStoreResult>; // Open a store connector's database, unless another tab holds it.\n previewObject?(options: PreviewObjectOptions): Promise<PreviewObjectResult>; // Preview an object for a specified connection.\n queryRecords?(options: QueryRecordsOptions): Promise<QueryRecordsResult>; // Query one page of an object in a store connector.\n removeRecords?(options: RemoveRecordsOptions): Promise<void>; // Remove one or more records from an object for a specified connection.\n retrieveRecords?(options: RetrieveRecordsOptions): AsyncGenerator<RetrieveRecordsChunk, RetrieveRecordsSummary, undefined>; // Retrieve all records from an object, a chunk at a time, then return the summary.\n upsertRecords?(options: UpsertRecordsOptions): Promise<void>; // Upsert one or more records into an object for a specified connection.\n}\n\nexport type ConnectorActionName = InferOutput<typeof connectorActionNameSchema>; // Names of the actions a connector may implement.\n\nexport type ConnectorConstructor = new (connectorUtilities: ConnectorUtilities, toolConfigs: ToolConfig[]) => ConnectorInterface;\n\n// 'declaredColumnConfigs' are the columns the item's source states, matched to the item's columns by position. Each\n// declared type is taken in place of the one the values suggest.\nexport interface ConnectorUtilities {\n constructColumnAuditor: (hasHeaders: boolean | undefined, declaredColumnConfigs?: DeclaredColumnConfig[]) => ColumnAuditor;\n hasReadableStreamTransferSupport(): boolean;\n inferDataTypes: (parsedRecords: ParsedRecord[], hasHeaders?: boolean, declaredColumnConfigs?: DeclaredColumnConfig[]) => InferenceSummary;\n isLogged: boolean; // Informational console messages. A connector is prebuilt, so it cannot tell a dev app from a prod one.\n}\n\n// Audits a whole object's columns one chunk of records at a time, so the object never has to be held in memory.\n// 'isComplete' says every record of the object was audited, so what no value showed, such as a unit, is known not to\n// be there. Without it the audit is taken to be of part of the object.\nexport interface ColumnAuditor {\n auditRecords: (parsedRecords: ParsedRecord[]) => void;\n completeAudit: (isComplete?: boolean) => InferenceSummary;\n}\n\n// The columns detected from a set of records, from a sample held in memory or from an audit.\nexport interface InferenceSummary {\n columnConfigs: ColumnAuditConfig[];\n hasHeaders: boolean; // Whether the first record is a header, detected unless the caller said.\n}\n\n// ── Configuration\nexport type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;\n\ntype ConnectorCategoryConfig = InferOutput<typeof connectorCategoryConfigSchema>;\n\ntype ConnectorItemTypeConfig = InferOutput<typeof connectorItemTypeConfigSchema>;\n\nexport type ConnectorItemTypeId = InferOutput<typeof connectorItemTypeIdSchema>;\n\ntype ConnectorUsageConfig = InferOutput<typeof connectorUsageConfigSchema>;\n\n// ── Audit Object Content\nexport interface AuditObjectContentOptions extends EngineConnectorActionOptions {\n byteLimit: number | undefined; // Stops at the first record to end after this many bytes. Reads the whole item when undefined.\n chunkSize: number | undefined;\n dataFormatId: DataFormatId; // From the preview.\n encodingId: string | undefined; // Only a file has one.\n hasHeaders: boolean | undefined; // From the preview. A header record names the columns and is not audited as data. Undefined when it was detected as absent, so the audit checks again with more records.\n parserId: string | undefined; // From the preview. The tool that read it, so the audit reads the item the same way.\n path: string;\n stopSignal: AbortSignal | undefined; // Stops at the end of the next record and keeps the result, unlike an abort. The engine adds it, because a signal cannot cross into the worker.\n structurePath?: StructurePath | undefined; // From the preview. The part of a nested item read as the table.\n supportsTransferableStreams: boolean;\n valueDelimiterId: ValueDelimiterId | undefined; // Only a file has one.\n}\nexport interface AuditObjectContentResult {\n contentAuditConfig: ContentAuditConfig;\n hasHeaders: boolean; // Whether the first record is a header. An audit can find one the sample missed, because it reads more records. It belongs to the reading configuration, not the audit.\n}\n\n// ── Close Store\nexport type CloseStoreOptions = EngineConnectorActionOptions;\n\n// ── Create Object\n// Columns are named by their position, because an audited column has a label but no id.\nexport interface CreateObjectOptions extends EngineConnectorActionOptions {\n columnConfigs: ObjectColumnConfig[]; // The object's columns, in order.\n indexedColumnIndexes: number[]; // Columns to index, so finding and sorting records by them is quick.\n keyColumnIndex: number | undefined; // The column whose value identifies each record. When undefined, records are numbered as they are added.\n path: string;\n}\n\n// ── Describe Connection\nexport type DescribeConnectionOptions = EngineConnectorActionOptions;\n\ninterface DescribeConnectionResult {\n descriptionConfig: ConnectionDescriptionConfig;\n}\n\n// ── Drop Object\nexport interface DropObjectOptions extends EngineConnectorActionOptions {\n path: string;\n}\n\n// ── Find Object\nexport interface FindObjectOptions extends EngineConnectorActionOptions {\n id: string; // The object's path, which is its id in a store.\n}\nexport interface FindObjectResult {\n path: string; // The object's path, the same as its id.\n}\n\n// ── Get Info\nexport interface GetInfoOptions extends EngineConnectorActionOptions {\n path: string;\n}\nexport interface GetInfoResult {\n info: Record<string, unknown>; // Raw, connector-specific metadata — not yet normalized to a common shape.\n}\n\n// ── Get Object\nexport interface GetObjectOptions extends EngineConnectorActionOptions {\n id: string; // The object's id, as 'listNodes' gives it.\n}\nexport interface GetObjectResult {\n path: string; // The object's path, as the other actions take it.\n}\n\n// ── Get Readable Stream\nexport interface GetReadableStreamOptions extends EngineConnectorActionOptions {\n path: string;\n}\n\n// ── Get Record\nexport interface GetRecordOptions extends EngineConnectorActionOptions {\n id: RecordKey;\n path: string;\n}\n\n// Identifies a record within its object. Records numbered as they were added have a number.\nexport type RecordKey = number | string;\nexport interface GetRecordResult {\n record: StoreRecord;\n}\n\n// ── Index Object Structure\nexport interface IndexObjectStructureOptions extends EngineConnectorActionOptions {\n dataFormatId: DataFormatId; // From the preview.\n encodingId: string | undefined; // From the preview.\n parserId: string | undefined; // From the preview. The tool that read it, so the structure is read the same way.\n path: string;\n}\n\n// ── List Nodes\nexport interface ListNodesOptions extends EngineConnectorActionOptions {\n folderPath: string;\n limit?: number;\n offset?: number;\n totalCount?: number;\n}\nexport interface ListNodesResult {\n cursor: string | number | undefined;\n connectionNodeConfigs: ConnectionNodeConfig[];\n isMore: boolean;\n totalCount: number;\n}\n\n// ── List Object Structure Entries\nexport interface ListObjectStructureEntriesOptions extends EngineConnectorActionOptions {\n dataFormatId: DataFormatId; // From the preview.\n entryCount: number; // The most entries to list.\n locator: StructureLocator; // From the parser: the node's own, a checkpoint's, or the next page's. The connector reads only the bytes it names.\n maxValueLength: number | undefined; // Longer text values are cut short. The parser's own default when undefined.\n parserId: string | undefined; // From the preview. The tool that read it, so the structure is read the same way.\n path: string;\n structurePath: StructurePath; // The node being listed.\n}\n\n// ── Load Object Records\nexport interface LoadObjectRecordsOptions extends EngineConnectorActionOptions {\n columnConfigs: ObjectColumnConfig[]; // The data view's columns, each with the type to load it as. The store creates the object's columns from these, in this order.\n path: string;\n}\nexport interface LoadObjectRecordsResult {\n recordCount: number;\n}\n\n// The engine's load reads the records from the source connection and passes them to the store connection, so they\n// never travel through the app.\nexport interface EngineLoadObjectRecordsOptions extends LoadObjectRecordsOptions {\n columnConfigs: ColumnReadingConfig[]; // As 'LoadObjectRecordsOptions' has them, with how each is read from the item's text. The store gets only the column itself.\n hasHeaders: boolean; // From the preview. A header record names the columns and is not loaded.\n ignoredColumnIndexes: number[]; // The columns the user chose to ignore, by position. The store gets no column for them.\n headerValues: (string | null)[] | undefined; // The preview's header record as it was read. A different header record means the columns have moved, so nothing is loaded.\n sourceConnectionConfig: ConnectionConfig | LocalisedConfig<ConnectionConfig>; // The app passes the localised one it holds.\n sourceOptions: RetrieveRecordsOptions; // Read the item the same way the audit did.\n}\n\nexport interface EngineLoadObjectRecordsResult extends LoadObjectRecordsResult {\n columnsHaveChanged: boolean; // The item's header record no longer matches 'headerValues'. Nothing was loaded, and any earlier load is kept.\n invalidValueCounts: number[]; // Per column, in the order of 'columnConfigs', the values that did not fit its type and so loaded as null.\n timing?: LoadTiming | undefined; // Undefined when nothing was loaded.\n}\n\n// ── Load Timing ─ In milliseconds, so the cost of each part of a load can be measured. The parts add up to 'duration'.\nexport interface LoadTiming {\n duration: number; // From the first record asked for to the last one stored.\n retrieveDuration: number; // The source connector's time to hand over the records, including the wait for bytes and the parser's time.\n sourceWaitDuration: number | undefined; // The part of 'retrieveDuration' spent waiting for the item's bytes. Undefined when the source connector does not time it.\n parseDuration: number | undefined; // The part of 'retrieveDuration' the parser took. Undefined when the source does not parse, such as a database, or does not time it.\n conversionDuration: number; // Reading each value as its column's type.\n storeDuration: number; // The store connector's time to write the records.\n}\n\n// A record's values in the order of the data view's columns. A value that is void, or does not fit its column's type, is\n// null.\nexport type StoreRecord = StoreValue[];\nexport type StoreValue = bigint | boolean | Date | number | string | null;\n\n// A chunk of a load as a store connector takes it: its records one by one, or the same values as one list for each\n// column, each as long as the chunk has records. A store that keeps its data by column, such as DuckDB, asks for\n// columns, which spares it turning records into them.\nexport type StoreChunk = StoreColumnChunk | StoreRecord[];\nexport type StoreChunkLayoutId = 'columns' | 'packedColumns' | 'records';\nexport interface StoreColumnChunk {\n columns: StoreColumn[]; // In the order of the data view's columns.\n recordCount: number;\n}\n\n// A column of a chunk: its values as a list, or, for a store that asks for packed columns, a column of decimal numbers\n// as one block of 64-bit numbers. A store that reads such blocks, as DuckDB does through Arrow, takes the block as it\n// is, with no value to copy.\nexport type StoreColumn = StorePackedNumberColumn | StoreValue[];\nexport interface StorePackedNumberColumn {\n nullCount: number;\n typeId: 'packedNumbers';\n validity: Uint8Array; // A bit for each value, lowest bit first, set when the value is present, as Arrow keeps them.\n values: Float64Array; // A value that is not present is 0.\n}\n\n// ── Open Store\nexport interface OpenStoreOptions extends EngineConnectorActionOptions {\n takeOver?: boolean; // Opens the store even when another tab holds it. That tab closes its store when it hears.\n}\nexport interface OpenStoreResult {\n storeStateId: StoreStateId;\n}\n\n// 'heldElsewhere' means another tab has the store open, as only one tab can open a database saved in the browser. Opening\n// with 'takeOver' takes it from that tab.\n// 'unavailable' means the browser gives no storage to keep it in, e.g. in some private windows.\nexport type StoreStateId = 'heldElsewhere' | 'ready' | 'unavailable';\n\n// ── Preview Object\nexport interface PreviewObjectOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n dataFormatId: DataFormatId | undefined; // A format the user chose, read in place of the one detected.\n encodingId: string | undefined; // An encoding the user chose, decoded in place of the one detected.\n extension: string | undefined;\n mimeType: string | undefined; // The type the connection's listing gave the item, if any.\n parserId: string | undefined; // A tool the user chose to read the item, used in place of the first that reads its format.\n path: string;\n structurePath?: StructurePath | undefined; // The part of a nested item the user chose to read as the table, used in place of the one suggested.\n valueDelimiterId: ValueDelimiterId | undefined; // A value delimiter the user chose, used in place of the one detected.\n}\nexport interface PreviewObjectResult {\n contentAuditConfig: ContentAuditConfig;\n sampleConfig: SampleConfig;\n readingConfig: ReadingConfig;\n encodingCandidates?: EncodingDetectionConfig[] | undefined; // For choosing another encoding. Not part of the reading, so not saved with the data view.\n structureIndex?: StructureIndex | undefined; // The structure of a nested item, as far as the preview read, for choosing the part read as the table. Not saved with the data view.\n}\n\n// ── Query Records\n// Columns are named by their position in the audit's columns, because an audited column has a label but no id. With\n// 'groupColumnIndexes', each result record holds the group's values, then one value for each aggregate.\nexport interface QueryRecordsOptions extends EngineConnectorActionOptions {\n aggregates: QueryAggregate[]; // Only read with 'groupColumnIndexes'.\n columnConfigs: ObjectColumnConfig[]; // The columns the object was loaded with, in its order, so the store reads each value back as its type.\n filters: QueryFilter[]; // A record must pass them all.\n groupColumnIndexes: number[]; // No grouping when empty.\n limit: number;\n offset: number;\n path: string;\n sorts: QuerySort[]; // Applied in order.\n}\nexport interface QueryAggregate {\n columnIndex: number | undefined; // Not given for 'count', which counts records.\n functionId: QueryAggregateFunctionId;\n}\nexport type QueryAggregateFunctionId = 'average' | 'count' | 'countDistinct' | 'maximum' | 'minimum' | 'sum';\nexport interface QueryFilter {\n columnIndex: number;\n operatorId: QueryFilterOperatorId;\n value: StoreValue; // Not read by 'isEmpty' and 'isNotEmpty'.\n}\nexport type QueryFilterOperatorId =\n 'contains' | 'endsWith' | 'equals' | 'greaterThan' | 'greaterThanOrEquals' | 'isEmpty' | 'isNotEmpty' | 'lessThan' | 'lessThanOrEquals' | 'notEquals' | 'startsWith';\nexport interface QuerySort {\n columnIndex: number; // A position in the result record, which differs from the audit's columns when grouped.\n directionId: 'ascending' | 'descending';\n}\nexport interface QueryRecordsResult {\n records: StoreRecord[];\n totalCount: number; // How many records, or groups, pass the filters in all, so a table can size itself.\n}\n\n// ── Recount Preview Columns\n// Counts a preview's columns again when the user says whether its first record is a header, so the item is not read again.\nexport interface RecountPreviewColumnsOptions extends EngineConnectorActionOptions {\n hasHeaders: boolean;\n parsedRecords: ParsedRecord[];\n}\n\n// Says what each value of the records shown is, so the table can mark the ones that do not fit their column.\nexport interface ClassifyPreviewValuesOptions extends EngineConnectorActionOptions {\n columnConfigs: ColumnReadingConfig[]; // Each column as the user wants it read.\n parsedRecords: ParsedRecord[]; // Data records only, with no header record.\n}\n\nexport type PreviewValueStateId = 'blank' | 'empty' | 'invalid' | 'null' | 'valid';\n\n// ── Remove Records\nexport interface RemoveRecordsOptions extends EngineConnectorActionOptions {\n keys: RecordKey[]; // Every record is removed when empty.\n path: string;\n}\n\n// ── Retrieve Records\nexport interface RetrieveRecordsOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n dataFormatId: DataFormatId; // From the preview.\n encodingId: string | undefined; // Only a file has one.\n parserId: string | undefined; // From the preview. The tool that read it, so the records are read the same way.\n path: string;\n structurePath?: StructurePath | undefined; // From the preview. The part of a nested item read as the table.\n valueDelimiterId: ValueDelimiterId | undefined; // Only a file has one.\n}\n// What every connector can say about a retrieval. A parser's counts of lines and bytes are in 'ParseStreamSummary'.\nexport interface RetrieveRecordsSummary {\n recordCount: number; // Records retrieved.\n sourceWaitDuration?: number | undefined; // In milliseconds, the time spent waiting for the item's bytes, such as while it downloads. Undefined when the connector does not time it.\n parseDuration?: number | undefined; // In milliseconds, the parser's time, without the wait for bytes. Undefined when the connector does not parse, or does not time it.\n}\n\nexport type RecordRetrievalTypeId = 'parsingRecordArray' | 'storeRecordArray';\n\n// One chunk of retrieved records. Nothing more is read until the next chunk is asked for, so a slow receiver, such as a\n// store being written to, holds the read back. A connector that reads text hands over its records still as text, to be\n// typed by the columns the user chooses. A connector that holds typed values hands them over typed.\nexport type RetrieveRecordsChunk = ParsedRecordsChunk | { records: StoreRecord[]; typeId: 'storeRecordArray' };\nexport interface ParsedRecordsChunk {\n byteCount?: number; // The bytes of the item read so far, so a load can show how far it has got. Undefined from a parser, which only counts its records.\n records: ParsedRecord[];\n typeId: 'parsingRecordArray';\n}\n\n// ── Upsert Records\nexport interface UpsertRecordsOptions extends EngineConnectorActionOptions {\n records: StoreRecord[];\n path: string;\n}\n\n// ── Usage\nexport type ConnectorUsageId = InferOutput<typeof connectorUsageIdSchema>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst CONNECTOR_CATEGORY_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'application', label: { en: 'Application', es: 'Aplicación' } },\n { id: 'curatedDataset', label: { en: 'Curated Dataset', es: 'Conjunto de Datos Curado' } },\n { id: 'database', label: { en: 'Database', es: 'Base de Datos' } },\n { id: 'fileStore', label: { en: 'File Store', es: 'Almacén de Archivos' } }\n];\n\nconst CONNECTOR_ITEM_TYPE_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'apiEndpoint', label: { en: 'API Endpoint', es: 'Endpoint de API' } },\n { id: 'file', label: { en: 'File', es: 'Archivo' } },\n { id: 'table', label: { en: 'Table', es: 'Tabla' } }\n];\n\nconst CONNECTOR_ACTION_NAME_MAP: Record<ConnectorActionName, string> = {\n auditObjectContent: 'Audit Object Content',\n closeStore: 'Close Store',\n createObject: 'Create Object',\n describeConnection: 'Describe Connection',\n dropObject: 'Drop Object',\n findObject: 'Find Object',\n getInfo: 'Get Info',\n getObject: 'Get Object',\n getReadableStream: 'Get Readable Stream',\n getRecord: 'Get Record',\n indexObjectStructure: 'Index Object Structure',\n listNodes: 'List Nodes',\n listObjectStructureEntries: 'List Object Structure Entries',\n loadObjectRecords: 'Load Object Records',\n openStore: 'Open Store',\n previewObject: 'Preview Object',\n queryRecords: 'Query Records',\n removeRecords: 'Remove Records',\n retrieveRecords: 'Retrieve Records',\n upsertRecords: 'Upsert Records'\n};\n\nconst CONNECTOR_USAGE_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'bidirectional', label: { en: 'Bidirectional', es: 'Bidireccional' } },\n { id: 'destination', label: { en: 'Destination', es: 'Destino' } },\n { id: 'source', label: { en: 'Source', es: 'Origen' } },\n { id: 'unknown', label: { en: 'Unknown', es: 'Desconocido' } }\n];\n\nconst CONNECTOR_DESTINATION_OPERATIONS = new Set<ConnectorActionName>(['createObject', 'dropObject', 'loadObjectRecords', 'removeRecords', 'upsertRecords']);\nconst CONNECTOR_SOURCE_OPERATIONS = new Set<ConnectorActionName>([\n 'auditObjectContent',\n 'findObject',\n 'getInfo',\n 'getObject',\n 'getReadableStream',\n 'getRecord',\n 'indexObjectStructure',\n 'listNodes',\n 'listObjectStructureEntries',\n 'previewObject',\n 'queryRecords',\n 'retrieveRecords'\n]);\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Object Fetching\nexport { type FetchObjectContentStreamOptions, fetchObjectContentStream } from './objectFetching';\n\n// ── Object Parsing\nexport { auditObjectContentWithParser, buildPreviewObjectResult, indexObjectStructureWithParser } from './objectParsing';\nexport { listObjectStructureEntriesWithParser, retrieveRecordsWithParser } from './objectParsing';\n\n// ── Store Errors\nexport { constructStoreError, findStoreErrorId, type StoreErrorId } from './storeErrors';\n\n// ── Store Paths\nexport { resolveStorePath } from './storePath';\n\n// ── Store Values\nexport { convertStoreRecordToParsedRecord, convertStoreValueToText } from './storeValues';\n\n// ── Web Locks\nexport { type AcquireWebLockOptions, acquireWebLock } from './webLock';\n\n// ── Table Schema\nexport { readTableSchema } from './tableSchema';\n\n// Determines whether a connector is a source, destination, or bidirectional connector, based on the actions it implements.\nexport function determineConnectorUsageId(actionNames: ConnectorActionName[]): ConnectorUsageId {\n let isSourceOperation = false;\n let isDestinationOperation = false;\n for (const actionName of actionNames) {\n if (CONNECTOR_SOURCE_OPERATIONS.has(actionName)) isSourceOperation = true;\n if (CONNECTOR_DESTINATION_OPERATIONS.has(actionName)) isDestinationOperation = true;\n }\n if (isSourceOperation && isDestinationOperation) return 'bidirectional';\n if (isSourceOperation) return 'source';\n return isDestinationOperation ? 'destination' : 'unknown'; // Neither reads nor writes data, e.g. only 'describeConnection'.\n}\n\nexport const constructConnectorCategoryConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorCategoryConfig> => {\n const connectorCategory = CONNECTOR_CATEGORY_CONFIGS.find((connectorCategory) => connectorCategory.id === id);\n if (connectorCategory) {\n const labelMap = createLabelMap(connectorCategory.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorCategory.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport const constructConnectorItemTypeConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorItemTypeConfig> => {\n const connectorItemType = CONNECTOR_ITEM_TYPE_CONFIGS.find((connectorItemType) => connectorItemType.id === id);\n if (connectorItemType) {\n const labelMap = createLabelMap(connectorItemType.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorItemType.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport const constructConnectorUsageConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorUsageConfig> => {\n const connectorUsage = CONNECTOR_USAGE_CONFIGS.find((connectorUsage) => connectorUsage.id === id);\n if (connectorUsage) {\n const labelMap = createLabelMap(connectorUsage.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorUsage.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport function getConnectorActionsTable(supported: ConnectorActionName[]): string {\n const supportedSet = new Set(supported);\n let md = '|Action|Supported|\\n';\n md += '|:----|:-------:|\\n';\n for (const id of Object.keys(CONNECTOR_ACTION_NAME_MAP) as ConnectorActionName[]) {\n md += `| ${CONNECTOR_ACTION_NAME_MAP[id]} | ${supportedSet.has(id) ? '✓' : ''} |\\n`;\n }\n return md;\n}\n","// ── External Dependencies & Registrations\nimport { array, literal, strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentReferenceConfigSchema } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Action Name\nexport const cookbookActionNameSchema = literalUnion(['list']);\n\n// ── Configuration\nexport const cookbookConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('cookbook'),\n actionNames: array(cookbookActionNameSchema),\n recipes: array(componentReferenceConfigSchema)\n});\n","// ── DPUse Framework\nimport type { ComponentInstanceConfig } from '@/component';\nimport type { EncodingTypeConfigLocalised } from '@/encoding';\nimport type { LocaleId } from '@/locale/label';\nimport type { LocalisedConfig } from '@/locale';\nimport type { ModuleConfig } from '@/component/module';\nimport type { ToolConfig } from '@/component/module/tool';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Runtime\n// TODO: Should this be interface?\nexport interface EngineRuntime {\n getEncodingTypeConfigs: (localeId: LocaleId) => EncodingTypeConfigLocalised[];\n // eslint-disable-next-line n/no-unsupported-features/node-builtins -- The browser's 'ErrorEvent', not Node's.\n invokeWorker(errorEventCallback: (errorEvent: ErrorEvent) => void): EngineWorker;\n}\n\n// ── Worker\nexport interface EngineWorker {\n initialise: (options: EngineInitialiseOptions) => Promise<void>;\n processRequest: (\n id: string,\n config: ComponentInstanceConfig | LocalisedConfig<ComponentInstanceConfig>,\n options: EngineAuthActionOptions | EngineConnectorActionOptions | EngineContextActionOptions,\n callback?: (callbackData: EngineCallbackData) => void\n ) => Promise<unknown>;\n}\n\nexport interface EngineInitialiseOptions {\n connectorStorageURLPrefix: string;\n isLogged: boolean; // Informational console messages. The engine is prebuilt, so it cannot tell a dev app from a prod one.\n toolConfigs: ToolConfig[];\n}\n\nexport interface EngineAuthActionOptions {\n accountId?: string;\n windowCenterX: number;\n windowCenterY: number;\n}\n\nexport interface EngineConnectorActionOptions {\n accountId?: string;\n appCheckToken?: string;\n requestId?: string; // Names the request, so the app can stop it with an 'abort' request naming the same id.\n sessionAccessToken?: string;\n signal?: AbortSignal | undefined; // Stops the action when the app aborts its request. The engine adds it, because a signal cannot cross into the worker.\n}\n\nexport interface EngineContextActionOptions {\n accountId?: string;\n appCheckToken?: string;\n sessionAccessToken?: string;\n}\n\nexport interface EngineCallbackData {\n typeId: string;\n properties: Record<string, unknown>;\n}\n\n// ── Configuration\nexport interface EngineConfig extends ModuleConfig {\n typeId: 'engine';\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The signal that stops an action. A request the app did not name has none, so its action gets one that never fires.\nexport function resolveRequestSignal(options: Pick<EngineConnectorActionOptions, 'signal'>): AbortSignal {\n return options.signal ?? new AbortController().signal;\n}\n","// ── External Dependencies & Registrations\nimport { array, literal, strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentReferenceConfigSchema } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Action Name\nexport const presenterActionNameSchema = literalUnion(['list', 'render', 'setColorMode']);\n\n// ── Configuration\nexport const presenterConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('presenter'),\n actionNames: array(presenterActionNameSchema),\n presentations: array(componentReferenceConfigSchema)\n});\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\n\n// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport { LocalisedReference } from '@/locale';\nimport type { ToolConfig } from '@/component/module/tool';\nimport type { Component, ComponentReferenceConfig } from '@/component';\nimport type { presenterActionNameSchema, presenterConfigSchema } from './presenterConfig.schema';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { presenterConfigSchema } from './presenterConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Interface\nexport interface PresenterInterface extends Component {\n readonly config: PresenterConfig;\n\n list(): ComponentReferenceConfig[]; // TODO: Do we need this? Configuration contains list.\n render(presentationReference: LocalisedReference<ComponentReferenceConfig>, renderTo: HTMLElement, data?: unknown): Promise<void>;\n setColorMode(colorModeId: string): void;\n}\n\nexport type PresenterActionName = InferOutput<typeof presenterActionNameSchema>; // Names of the actions a presenter may implement.\n\n// ── Configuration\nexport type PresenterConfig = InferOutput<typeof presenterConfigSchema>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst LOAD_URL_PREFIX = 'https://engine-eu.dpuse.app/presenters';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The upload folder is the presenter's id without its 'dpuse-presenter-' prefix, as dpuse-development publishes it.\n// The app passes its own HTML sanitiser, so a presenter does not bundle a second copy of DOMPurify, which would create a\n// second 'dompurify' Trusted Types policy.\nexport async function loadPresenter(\n presenterConfig: PresenterConfig,\n toolConfigs: ToolConfig[],\n colorModeId: string,\n sanitizeHTML: (html: string) => string\n): Promise<PresenterInterface> {\n const presenterName = presenterConfig.id;\n const presenterId = presenterName.split('-').slice(2).join('-');\n const url = `${LOAD_URL_PREFIX}/${presenterId}_v${presenterConfig.version}/${presenterName}.es.js`;\n try {\n const presenterModule = (await import(/* @vite-ignore */ url)) as {\n Presenter: new (toolConfigs: ToolConfig[], colorModeId: string, sanitizeHTML: (html: string) => string) => PresenterInterface;\n };\n return new presenterModule.Presenter(toolConfigs, colorModeId, sanitizeHTML);\n } catch (error) {\n // A bare import rejection names neither the presenter nor the version, so they are attached here.\n const data = { presenterName, url, version: presenterConfig.version };\n throw new AppError(`Failed to load presenter '${presenterName}' v${presenterConfig.version}.`, 'dpuse-shared.component.module.presenter.loadPresenter', { data, cause: error });\n }\n}\n","// ── DPUse Framework\nimport { DEFAULT_LOCALE_ID } from './label';\nimport type { LocaleDescription, LocaleId, LocaleLabel } from './label';\n\n// The label vocabulary is re-exported so that the published '@dpuse/dpuse-shared/locale' entry point stays one import\n// for consumers, while modules inside this package can depend on '@/locale/label' alone.\nexport * from './label';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type LocalisedConfig<T> = Omit<T, 'label' | 'description' | 'verb'> & { label: string; description: string; verb?: string | undefined };\n\ninterface UnlocalisedConfig {\n id: string;\n label: LocaleLabel;\n description: LocaleDescription;\n verb?: LocaleLabel | undefined;\n}\n\nexport type LocalisedReference<T> = Omit<T, 'label' | 'description'> & { label: string; description: string };\n\ninterface UnlocalisedReference {\n id: string;\n label: LocaleLabel;\n description: LocaleDescription;\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function localiseConfig<T extends UnlocalisedConfig>(config: T, localeId: LocaleId): LocalisedConfig<T> {\n return {\n ...config,\n label: config.label[localeId] ?? config.id,\n description: config.description[localeId] ?? config.description[DEFAULT_LOCALE_ID] ?? '',\n verb: config.verb?.[localeId] ?? undefined\n };\n}\n\nexport function localiseConfigs<T extends UnlocalisedConfig>(configs: T[], localeId: LocaleId, isResultSorted = false): LocalisedConfig<T>[] {\n const mapped = configs.map((config) => ({\n ...config,\n label: config.label[localeId] ?? config.id,\n description: config.description[localeId] ?? config.description[DEFAULT_LOCALE_ID] ?? '',\n verb: config.verb?.[localeId] ?? undefined\n }));\n return isResultSorted ? mapped.toSorted((a, b) => a.label.localeCompare(b.label) || a.id.localeCompare(b.id)) : mapped;\n}\n\nexport function localiseReference<T extends UnlocalisedReference>(reference: T, localeId: LocaleId): LocalisedReference<T> {\n return {\n ...reference,\n label: reference.label[localeId] ?? reference.id,\n description: reference.description[localeId] ?? reference.description[DEFAULT_LOCALE_ID] ?? ''\n };\n}\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type DurationUnit = 'day' | 'hour' | 'minute' | 'second' | 'millisecond';\nexport type UsageTypeId = 'boolean' | 'decimalNumber' | 'moment' | 'momentTime' | 'string' | 'unknown' | 'wholeNumber';\ntype StorageUnit = 'byte' | 'KiB' | 'MiB' | 'GiB' | 'TiB';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── MIME Types ─ Content types by file extension, for the connectors and the sample data upload alike, so a file is\n// described the same way everywhere. Never with a charset: many sample files are deliberately not UTF-8, and a charset\n// would tell browsers how to decode them. An extension missing here is 'application/octet-stream'.\nconst MIME_TYPES_BY_EXTENSION = new Map([\n ['arrow', 'application/vnd.apache.arrow.file'],\n ['avro', 'application/vnd.apache.avro'], // Not registered with IANA. Named as Apache's registered formats are.\n ['bin', 'application/octet-stream'],\n ['cfb', 'application/x-cfb'], // As 'file-type' reports a Compound File Binary container.\n ['csv', 'text/csv'],\n ['dat', 'application/octet-stream'], // The extension says nothing about the content.\n ['json', 'application/json'],\n ['jsonl', 'application/jsonl'], // Not registered with IANA. The type the JSON Lines site and OpenAPI use.\n ['md', 'text/markdown'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['parquet', 'application/vnd.apache.parquet'],\n ['sav', 'application/x-spss-sav'], // Not registered with IANA. The type Apache Tika uses.\n ['sqlite', 'application/vnd.sqlite3'],\n ['tab', 'text/tab-separated-values'],\n ['tsv', 'text/tab-separated-values'],\n ['txt', 'text/plain'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsm', 'application/vnd.ms-excel.sheet.macroEnabled.12'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml']\n]);\n\n// ── Locale\nconst NUMBER_FORMATTER_DEFAULT_LOCALE = 'en';\n\n// ── Units ─ Each unit with its size. Durations run largest first and storage smallest first, the order each formatter\n// searches. The duration names are 'Intl' unit identifiers, so 'Intl.NumberFormat' supplies the label in the requested\n// locale. Storage sizes are binary, so above bytes they take the IEC symbols, which are the same in every language.\nconst DURATION_UNITS: [DurationUnit, number][] = [\n ['day', 86_400_000],\n ['hour', 3_600_000],\n ['minute', 60_000],\n ['second', 1000],\n ['millisecond', 1]\n];\nconst STORAGE_UNITS: [StorageUnit, number][] = [\n ['byte', 1],\n ['KiB', 1024],\n ['MiB', 1_048_576],\n ['GiB', 1_073_741_824],\n ['TiB', 1_099_511_627_776]\n];\n\n// ── State ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst LIST_FORMATTER_MAP = new Map<string, Intl.ListFormat>();\nconst NUMBER_FORMATTER_MAP = new Map<string, Intl.NumberFormat>();\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// ── Number Formatting\nexport function formatNumberAsDecimalNumber(number?: number, decimalPlaces = 2, minimumFractionDigits = decimalPlaces, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n if (number == null) return '';\n return getNumberFormatter(locale, {\n localeMatcher: 'best fit',\n maximumFractionDigits: decimalPlaces,\n minimumFractionDigits: Math.min(minimumFractionDigits, decimalPlaces), // 'Intl.NumberFormat' throws a 'RangeError' when the minimum is above the maximum.\n minimumIntegerDigits: 1,\n style: 'decimal',\n useGrouping: true\n }).format(number);\n}\n\nexport function formatNumberAsWholeNumber(number?: number, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n return formatNumberAsDecimalNumber(number, 0, 0, locale);\n}\n\n// Compact notation chooses the unit after rounding, so 999,999 shows as '1M' rather than '1,000K'.\nexport function formatNumberAsSize(number?: number, decimalPlaces = 1, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n return number == null || !Number.isFinite(number) ? '' : getNumberFormatter(locale, { maximumFractionDigits: decimalPlaces, notation: 'compact' }).format(number);\n}\n\n// The unit is chosen after rounding, so 1,048,575 bytes shows as '1 MiB' rather than '1,024 KiB'. 'Intl.NumberFormat'\n// has no IEC units, so it formats only the number above bytes, and the symbol follows it.\nexport function formatNumberAsStorageSize(number?: number, decimalPlaces = 1, locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n if (number == null || !Number.isFinite(number)) return '';\n const [unit, size] = STORAGE_UNITS.find(([, unitSize]) => roundNumber(Math.abs(number) / unitSize, unitSize === 1 ? 0 : decimalPlaces) < 1024) ?? ['TiB', 1_099_511_627_776];\n return size === 1\n ? getNumberFormatter(locale, { maximumFractionDigits: 0, style: 'unit', unit: 'byte', unitDisplay: 'long' }).format(number) // Long, because the short English label, 'byte', has no plural.\n : `${getNumberFormatter(locale, { maximumFractionDigits: decimalPlaces }).format(number / size)} ${unit}`;\n}\n\nexport function formatNumberAsDuration(number?: number, stopAt: DurationUnit = 'millisecond', locale = NUMBER_FORMATTER_DEFAULT_LOCALE): string {\n if (number == null || !Number.isFinite(number)) return '';\n\n // Fractions are rounded away before the value is split into units, so the last unit cannot round up to '1,000 ms'.\n let remaining = Math.round(Math.abs(number));\n\n // Start at the largest unit the value actually fills, so a value below the requested level still reads sensibly\n // rather than as a run of zeroes.\n const startIndex = DURATION_UNITS.findIndex(([, unitSize]) => remaining >= unitSize);\n const firstIndex = startIndex === -1 ? DURATION_UNITS.length - 1 : startIndex;\n const stopIndex = DURATION_UNITS.findIndex(([unit]) => unit === stopAt);\n\n const durationUnits = DURATION_UNITS.slice(firstIndex, Math.max(stopIndex, firstIndex) + 1);\n const parts: string[] = [];\n for (const [unit, unitSize] of durationUnits) {\n const count = Math.floor(remaining / unitSize);\n if (count === 0 && parts.length > 0) continue;\n remaining -= count * unitSize;\n const signedCount = parts.length === 0 && number < 0 && count > 0 ? -count : count; // Only the first part carries the sign: '-1 min 30 sec'.\n parts.push(getNumberFormatter(locale, { style: 'unit', unit, unitDisplay: 'short' }).format(signedCount));\n }\n return getListFormatter(locale).format(parts);\n}\n\n// ── File Paths ─ A path splits into the part before its extension and the extension, and the two always rebuild the\n// path. Dots in folder names, the leading dot of a dotfile such as '.gitignore' and a trailing dot do not start an\n// extension.\nexport function extractPathWithoutExtension(itemPath: string): string | undefined {\n if (!itemPath) return undefined;\n const extensionSeparatorIndex = findExtensionSeparatorIndex(itemPath);\n return extensionSeparatorIndex === undefined ? itemPath : itemPath.slice(0, extensionSeparatorIndex);\n}\n\nexport function extractExtensionFromPath(itemPath: string): string | undefined {\n if (!itemPath) return undefined;\n const extensionSeparatorIndex = findExtensionSeparatorIndex(itemPath);\n return extensionSeparatorIndex === undefined ? undefined : itemPath.slice(extensionSeparatorIndex + 1);\n}\n\n// ── Lookup\n// Extensions arrive from file names as typed, so 'REPORT.PDF' must resolve the same as 'report.pdf'.\nexport function hasMimeTypeForExtension(extension?: string): boolean {\n return extension != null && MIME_TYPES_BY_EXTENSION.has(extension.toLowerCase());\n}\n\nexport function lookupMimeTypeForExtension(extension?: string): string {\n return (extension == null ? undefined : MIME_TYPES_BY_EXTENSION.get(extension.toLowerCase())) ?? 'application/octet-stream';\n}\n\n// ── Data Type Conversion ─ Covers the primitive types of OData v2 and v4.\n// See: https://www.odata.org/documentation/odata-version-2-0/overview/ and\n// https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html#sec_PrimitiveTypes.\nexport function convertODataTypeIdToUsageTypeId(oDataTypeId: string): UsageTypeId {\n switch (oDataTypeId) {\n case 'Edm.Boolean':\n return 'boolean';\n case 'Edm.Byte':\n case 'Edm.Int16':\n case 'Edm.Int32':\n case 'Edm.Int64':\n case 'Edm.SByte':\n return 'wholeNumber';\n case 'Edm.Decimal':\n case 'Edm.Double':\n case 'Edm.Single':\n return 'decimalNumber';\n case 'Edm.Date':\n case 'Edm.DateTime':\n case 'Edm.DateTimeOffset':\n return 'moment';\n case 'Edm.Time':\n case 'Edm.TimeOfDay':\n return 'momentTime';\n case 'Edm.Guid':\n case 'Edm.String':\n return 'string';\n default:\n return 'unknown'; // 'Edm.Binary', 'Edm.Duration', 'Edm.Stream' and the geography types have no usage type.\n }\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Returns undefined when the last segment of the path has no extension.\nfunction findExtensionSeparatorIndex(itemPath: string): number | undefined {\n const basenameStartIndex = itemPath.lastIndexOf('/') + 1;\n const extensionSeparatorIndex = itemPath.lastIndexOf('.');\n return extensionSeparatorIndex > basenameStartIndex && extensionSeparatorIndex < itemPath.length - 1 ? extensionSeparatorIndex : undefined;\n}\n\n// 'Intl' formatters are costly to create, so each one is created once per locale and set of options, then reused.\nfunction getListFormatter(locale: string): Intl.ListFormat {\n let listFormatter = LIST_FORMATTER_MAP.get(locale);\n if (!listFormatter) {\n listFormatter = new Intl.ListFormat(locale, { style: 'narrow', type: 'unit' });\n LIST_FORMATTER_MAP.set(locale, listFormatter);\n }\n return listFormatter;\n}\n\nfunction getNumberFormatter(locale: string, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const formatterId = `${locale}|${JSON.stringify(options)}`;\n let numberFormatter = NUMBER_FORMATTER_MAP.get(formatterId);\n if (!numberFormatter) {\n numberFormatter = new Intl.NumberFormat(locale, options);\n NUMBER_FORMATTER_MAP.set(formatterId, numberFormatter);\n }\n return numberFormatter;\n}\n\nfunction roundNumber(number: number, decimalPlaces: number): number {\n const factor = 10 ** decimalPlaces;\n return Math.round(number * factor) / factor;\n}\n\n// TODO: Do we need this?\n// // export const establishVendorAccessToken = async (item: Item, accountId: string, sessionAccessToken: string, vendorRefreshURI: string): Promise<string> => {\n// export const establishVendorAccessToken = async (connectionConfig: ConnectionConfig, settings: ReadSettings, vendorRefreshURI: string): Promise<string> => {\n// let accessToken;\n//\n// // If the current dropbox access token expires within 5 minutes then refresh it and return the new one, otherwise return the current one.\n// if (connectionConfig.authorisation[''].expires_at - Date.now() < 300000) {\n// // TODO: Above is WRONG 'item.authorization!['']'. We need to know what authorisation.\n// const headers: HeadersInit = {\n// 'Account-Id': settings.accountId || '',\n// Authorization: settings.sessionAccessToken || '',\n// 'Connection-Id': connectionConfig.id\n// };\n// const response = await fetch(vendorRefreshURI, { headers });\n// if (!response.ok) {\n// const data = {\n// body: {\n// context: 'establishVendorAccessToken',\n// message: await response.text()\n// },\n// statusCode: response.status,\n// statusText: response.statusText\n// };\n// throw new Error('Unable to establish access token.|' + JSON.stringify(data));\n// }\n// accessToken = await response.text();\n// } else {\n// accessToken = connectionConfig.authorisation[''].access_token; // TODO: This is WRONG 'item.authorization!['']'. We need to know what authorisation.\n// }\n//\n// return accessToken;\n// };\n"],"ignoreList":[1],"mappings":";AAcA,IAAaC,IAA8B,MAE9BC,IAAuE,CAChF;CAAE,IAAI;CAAM,MAAM;CAAM,OAAO;AAAU,GACzC;CAAE,IAAI;CAAM,MAAM;CAAM,OAAO;AAAU,CAC7C;AAIA,SAAgBC,EAAe,GAAgD;CAC3E,OAAO,IAAI,IAAI,OAAO,QAAQC,CAAM,CAAC;AACzC;AAEA,SAAgBC,EAAa,GAAwB,GAAkB,IAAA,MAA0D;CAC7H,IAAMC,IAAiBF,EAAO,IAAIG,CAAQ;CAE1C,OADID,MAAmB,KAAA,IAChBE,MAAqBD,IAAW,KAAA,IAAYH,EAAO,IAAII,CAAgB,IADrCF;AAE7C;;AC9BA,IACMG,IAAiB;CACtB,MAAM,KAAK;CACX,SAAS,KAAK;CACd,YAAY,KAAK;CACjB,gBAAgB,KAAK;AACtB;;AAoBA,SAASC,EAAgB,GAAU;CAElC,OADKC,IACE;EACN,MAAMA,GAAU,QAAQ;EACxB,SAASA,GAAU;EACnB,YAAYA,GAAU,cAAc;EACpC,gBAAgBA,GAAU,kBAAkB;CAC7C,IANkCF;AAOnC;;AA2HA,SAASG,EAAW,GAAO;CAC1B,IAAMC,IAAO,OAAOC;CAIpB,OAHID,MAAS,WAAiB,IAAIC,EAAM,KACpCD,MAAS,YAAYA,MAAS,YAAYA,MAAS,YAAkB,GAAGC,MACxED,MAAS,YAAYA,MAAS,cAAoBC,KAAS,OAAO,eAAeA,CAAK,CAAC,EAAE,aAAa,SAAS,SAC5GD;AACR;AAeA,SAASE,EAAU,GAAS,GAAO,GAAS,GAAU,GAAO;CAC5D,IAAMD,IAAQE,KAAS,WAAWA,IAAQA,EAAM,QAAQC,EAAQ,OAC1DC,IAAWF,G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