@prisma/client
Version:
Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.
4 lines • 762 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../node_modules/.pnpm/@prisma+engines-version@7.2.0-4.0c8ef2ce45c83248ab3df073180d5eda9e8be7a3/node_modules/@prisma/engines-version/package.json", "../../../node_modules/.pnpm/@prisma+engines-version@7.2.0-4.0c8ef2ce45c83248ab3df073180d5eda9e8be7a3/node_modules/@prisma/engines-version/index.js", "../../../node_modules/.pnpm/min-indent@1.0.1/node_modules/min-indent/index.js", "../../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js", "../../../node_modules/.pnpm/new-github-issue-url@0.2.1/node_modules/new-github-issue-url/index.js", "../../../node_modules/.pnpm/js-levenshtein@1.1.6/node_modules/js-levenshtein/index.js", "../../ts-builders/src/TypeBuilder.ts", "../../ts-builders/src/KeyType.ts", "../../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/src/_assert.ts", "../../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/src/_u64.ts", "../../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/src/cryptoNode.ts", "../../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/src/utils.ts", "../../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/src/sha3.ts", "../../../node_modules/.pnpm/@paralleldrive+cuid2@2.2.2/node_modules/@paralleldrive/cuid2/src/index.js", "../../../node_modules/.pnpm/@paralleldrive+cuid2@2.2.2/node_modules/@paralleldrive/cuid2/index.js", "../src/runtime/core/extensions/index.ts", "../src/runtime/core/extensions/defineExtension.ts", "../src/runtime/core/extensions/getExtensionContext.ts", "../src/runtime/core/public/index.ts", "../src/runtime/core/public/validator.ts", "../../client-common/src/Cache.ts", "../../client-common/src/casing.ts", "../../client-common/src/Dictionary.ts", "../../client-common/src/lazyProperty.ts", "../../client-common/src/runtimeDataModel.ts", "../src/runtime/core/jsonProtocol/serializeJsonQuery.ts", "../../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs", "../../debug/src/index.ts", "../../../node_modules/.pnpm/strip-indent@4.0.0/node_modules/strip-indent/index.js", "../../internals/src/utils/prismaPostgres.ts", "../../internals/src/logger.ts", "../../internals/src/utils/assertNever.ts", "../../../node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js", "../../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js", "../../internals/src/utils/path.ts", "../../internals/src/utils/hasOwnProperty.ts", "../../internals/src/utils/mapObjectValues.ts", "../../internals/src/utils/max.ts", "../../internals/src/utils/setClassName.ts", "../../internals/src/warnOnce.ts", "../src/runtime/utils/date.ts", "../src/runtime/utils/decimalJsLike.ts", "../src/runtime/core/errorRendering/throwValidationException.ts", "../../dmmf/src/index.ts", "../../dmmf/src/convert.ts", "../../dmmf/src/dmmf.ts", "../src/runtime/utils/createErrorMessageWithContext.ts", "../src/runtime/utils/SourceFileSlice.ts", "../src/runtime/highlight/theme.ts", "../src/runtime/highlight/prism.ts", "../src/runtime/highlight/highlight.ts", "../src/runtime/utils/dedent.ts", "../src/runtime/core/errorRendering/applyValidationError.ts", "../src/runtime/core/errorRendering/applyUnionError.ts", "../src/runtime/core/errorRendering/ObjectFieldSuggestion.ts", "../../ts-builders/src/index.ts", "../../ts-builders/src/Writer.ts", "../src/runtime/core/errorRendering/ArrayField.ts", "../src/runtime/core/errorRendering/base.ts", "../src/runtime/core/errorRendering/FormattedString.ts", "../src/runtime/core/errorRendering/Value.ts", "../src/runtime/core/errorRendering/ArrayValue.ts", "../src/runtime/core/errorRendering/ObjectValue.ts", "../src/runtime/core/errorRendering/ScalarValue.ts", "../src/runtime/core/errorRendering/SuggestionObjectValue.ts", "../src/runtime/core/errorRendering/ArgumentsRenderingTree.ts", "../src/runtime/core/model/FieldRef.ts", "../src/runtime/core/errorRendering/ObjectField.ts", "../src/runtime/core/model/utils/dmmfToJSModelName.ts", "../src/runtime/core/extensions/resultUtils.ts", "../src/runtime/core/extensions/MergedExtensionsList.ts", "../src/runtime/core/model/Param.ts", "../src/runtime/core/types/exported/Skip.ts", "../src/runtime/core/runtimeDataModel.ts", "../src/runtime/core/types/exported/TypedSql.ts", "../src/runtime/getPrismaClient.ts", "../src/runtime/core/compositeProxy/addObjectProperties.ts", "../src/runtime/core/compositeProxy/addProperty.ts", "../src/runtime/core/compositeProxy/cacheProperties.ts", "../src/runtime/core/model/utils/defaultProxyHandlers.ts", "../src/runtime/core/compositeProxy/createCompositeProxy.ts", "../src/runtime/core/compositeProxy/removeProperties.ts", "../src/runtime/core/errorRendering/prettyPrintArguments.ts", "../../../node_modules/.pnpm/stacktrace-parser@0.1.11/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js", "../src/runtime/utils/CallSite.ts", "../src/runtime/core/model/aggregates/utils/aggregateMap.ts", "../src/runtime/core/model/aggregates/aggregate.ts", "../src/runtime/core/model/aggregates/count.ts", "../src/runtime/core/model/aggregates/groupBy.ts", "../src/runtime/core/model/applyAggregates.ts", "../src/runtime/core/model/applyFieldsProxy.ts", "../src/runtime/utils/deep-set.ts", "../src/runtime/core/model/applyFluent.ts", "../src/runtime/core/model/applyModel.ts", "../src/runtime/core/model/utils/jsToDMMFModelName.ts", "../src/runtime/core/model/applyModelsAndClientExtensions.ts", "../src/runtime/core/extensions/$extends.ts", "../src/runtime/core/extensions/applyResultExtensions.ts", "../src/runtime/core/extensions/visitQueryResult.ts", "../src/runtime/core/extensions/applyAllResultExtensions.ts", "../src/runtime/utils/deepCloneArgs.ts", "../src/runtime/core/types/exported/itxClientDenyList.ts", "../src/runtime/core/extensions/applyQueryExtensions.ts", "../../client-engine-runtime/src/json-protocol.ts", "../../client-engine-runtime/src/utils.ts", "../../driver-adapter-utils/src/error.ts", "../../driver-adapter-utils/src/const.ts", "../../client-engine-runtime/src/user-facing-error.ts", "../../client-engine-runtime/src/batch.ts", "../../client-engine-runtime/src/interpreter/data-mapper.ts", "../../client-engine-runtime/src/sql-commenter.ts", "../../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/trace/span_kind.ts", "../../client-engine-runtime/src/tracing.ts", "../../../node_modules/.pnpm/@bugsnag+cuid@3.2.1/node_modules/@bugsnag/cuid/lib/pad.mjs", "../../../node_modules/.pnpm/@bugsnag+cuid@3.2.1/node_modules/@bugsnag/cuid/lib/fingerprint.mjs", "../../../node_modules/.pnpm/@bugsnag+cuid@3.2.1/node_modules/@bugsnag/cuid/lib/is-cuid.mjs", "../../../node_modules/.pnpm/@bugsnag+cuid@3.2.1/node_modules/@bugsnag/cuid/lib/cuid.mjs", "../../../node_modules/.pnpm/@bugsnag+cuid@3.2.1/node_modules/@bugsnag/cuid/index.esm.mjs", "../../client-engine-runtime/src/interpreter/generators.ts", "../../../node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/index.js", "../../../node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/url-alphabet/index.js", "../../../node_modules/.pnpm/ulid@3.0.0/node_modules/ulid/dist/node/index.js", "../../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/stringify.js", "../../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/rng.js", "../../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/native.js", "../../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/v4.js", "../../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/v7.js", "../../client-engine-runtime/src/interpreter/in-memory-processing.ts", "../../client-engine-runtime/src/query-plan.ts", "../../client-engine-runtime/src/interpreter/render-query.ts", "../../client-engine-runtime/src/interpreter/serialize-sql.ts", "../../client-engine-runtime/src/interpreter/validation.ts", "../../client-engine-runtime/src/interpreter/query-interpreter.ts", "../../client-engine-runtime/src/crypto.ts", "../../client-engine-runtime/src/web-platform.ts", "../../client-engine-runtime/src/transaction-manager/transaction-manager-error.ts", "../../client-engine-runtime/src/transaction-manager/transaction-manager.ts", "../src/runtime/core/engines/client/ClientEngine.ts", "../package.json", "../src/runtime/core/engines/common/utils/getBatchRequestPayload.ts", "../src/runtime/core/engines/common/utils/maskQuery.ts", "../src/runtime/core/engines/common/utils/normalizeLogs.ts", "../src/runtime/core/engines/common/utils/util.ts", "../src/runtime/core/engines/common/utils/getErrorMessageWithLink.ts", "../src/runtime/core/engines/client/LocalExecutor.ts", "../src/runtime/core/engines/client/RemoteExecutor.ts", "../../../node_modules/.pnpm/cookie-es@2.0.0/node_modules/cookie-es/dist/index.mjs", "../src/runtime/core/errors/PrismaClientError.ts", "../src/runtime/core/engines/accelerate/errors/accelerate-error.ts", "../src/runtime/core/engines/accelerate/errors/utils/set-retryable.ts", "../src/runtime/core/engines/accelerate/errors/invalid-datasource-error.ts", "../src/runtime/core/engines/accelerate/getUrlAndApiKey.ts", "../src/runtime/core/engines/accelerate/HeaderBuilder.ts", "../src/runtime/core/engines/client/utils/engine-timestamp.ts", "../src/runtime/core/engines/client/WasmQueryCompilerLoader.ts", "../src/runtime/core/init/getEngineInstance.ts", "../src/runtime/core/raw-query/rawCommandArgsMapper.ts", "../src/runtime/core/raw-query/rawQueryArgsMapper.ts", "../src/runtime/utils/mssqlPreparedStatement.ts", "../src/runtime/utils/serializeRawParameters.ts", "../src/runtime/core/request/createPrismaPromise.ts", "../../instrumentation-contract/package.json", "../../instrumentation-contract/src/global.ts", "../src/runtime/core/tracing/TracingHelper.ts", "../src/runtime/core/transaction/utils/createLockCountPromise.ts", "../src/runtime/getLogLevel.ts", "../src/runtime/RequestHandler.ts", "../src/runtime/core/jsonProtocol/getBatchId.ts", "../src/runtime/core/jsonProtocol/isWrite.ts", "../src/runtime/DataLoader.ts", "../src/runtime/utils/deserializeRawResults.ts", "../src/runtime/utils/clientVersion.ts", "../src/runtime/utils/validatePrismaClientOptions.ts", "../src/runtime/core/errors/PrismaClientConstructorValidationError.ts", "../src/runtime/utils/waitForBatch.ts", "../src/runtime/strictEnum.ts", "../src/runtime/utils/getRuntime.ts", "../src/runtime/index.ts"],
"sourcesContent": ["{\n \"name\": \"@prisma/engines-version\",\n \"version\": \"7.2.0-4.0c8ef2ce45c83248ab3df073180d5eda9e8be7a3\",\n \"main\": \"index.js\",\n \"types\": \"index.d.ts\",\n \"license\": \"Apache-2.0\",\n \"author\": \"Tim Suchanek <suchanek@prisma.io>\",\n \"prisma\": {\n \"enginesVersion\": \"0c8ef2ce45c83248ab3df073180d5eda9e8be7a3\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/prisma/engines-wrapper.git\",\n \"directory\": \"packages/engines-version\"\n },\n \"devDependencies\": {\n \"@types/node\": \"18.19.76\",\n \"typescript\": \"4.9.5\"\n },\n \"files\": [\n \"index.js\",\n \"index.d.ts\"\n ],\n \"scripts\": {\n \"build\": \"tsc -d\"\n }\n}", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enginesVersion = void 0;\nexports.enginesVersion = require('./package.json').prisma.enginesVersion;\n//# sourceMappingURL=index.js.map", "'use strict';\nmodule.exports = string => {\n\tconst match = string.match(/^[ \\t]*(?=\\S)/gm);\n\n\tif (!match) {\n\t\treturn 0;\n\t}\n\n\treturn match.reduce((r, a) => Math.min(r, a.length), Infinity);\n};\n", "'use strict';\n\nmodule.exports = (string, count = 1, options) => {\n\toptions = {\n\t\tindent: ' ',\n\t\tincludeEmptyLines: false,\n\t\t...options\n\t};\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (typeof options.indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof options.indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = options.includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, options.indent.repeat(count));\n};\n", "'use strict';\n\nmodule.exports = (options = {}) => {\n\tlet repoUrl;\n\tif (options.repoUrl) {\n\t\trepoUrl = options.repoUrl;\n\t} else if (options.user && options.repo) {\n\t\trepoUrl = `https://github.com/${options.user}/${options.repo}`;\n\t} else {\n\t\tthrow new Error('You need to specify either the `repoUrl` option or both the `user` and `repo` options');\n\t}\n\n\tconst url = new URL(`${repoUrl}/issues/new`);\n\n\tconst types = [\n\t\t'body',\n\t\t'title',\n\t\t'labels',\n\t\t'template',\n\t\t'milestone',\n\t\t'assignee',\n\t\t'projects'\n\t];\n\n\tfor (const type of types) {\n\t\tlet value = options[type];\n\t\tif (value === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (type === 'labels' || type === 'projects') {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthrow new TypeError(`The \\`${type}\\` option should be an array`);\n\t\t\t}\n\n\t\t\tvalue = value.join(',');\n\t\t}\n\n\t\turl.searchParams.set(type, value);\n\t}\n\n\treturn url.toString();\n};\n\n// TODO: Remove this for the next major release\nmodule.exports.default = module.exports;\n", "'use strict';\nmodule.exports = (function()\n{\n function _min(d0, d1, d2, bx, ay)\n {\n return d0 < d1 || d2 < d1\n ? d0 > d2\n ? d2 + 1\n : d0 + 1\n : bx === ay\n ? d1\n : d1 + 1;\n }\n\n return function(a, b)\n {\n if (a === b) {\n return 0;\n }\n\n if (a.length > b.length) {\n var tmp = a;\n a = b;\n b = tmp;\n }\n\n var la = a.length;\n var lb = b.length;\n\n while (la > 0 && (a.charCodeAt(la - 1) === b.charCodeAt(lb - 1))) {\n la--;\n lb--;\n }\n\n var offset = 0;\n\n while (offset < la && (a.charCodeAt(offset) === b.charCodeAt(offset))) {\n offset++;\n }\n\n la -= offset;\n lb -= offset;\n\n if (la === 0 || lb < 3) {\n return lb;\n }\n\n var x = 0;\n var y;\n var d0;\n var d1;\n var d2;\n var d3;\n var dd;\n var dy;\n var ay;\n var bx0;\n var bx1;\n var bx2;\n var bx3;\n\n var vector = [];\n\n for (y = 0; y < la; y++) {\n vector.push(y + 1);\n vector.push(a.charCodeAt(offset + y));\n }\n\n var len = vector.length - 1;\n\n for (; x < lb - 3;) {\n bx0 = b.charCodeAt(offset + (d0 = x));\n bx1 = b.charCodeAt(offset + (d1 = x + 1));\n bx2 = b.charCodeAt(offset + (d2 = x + 2));\n bx3 = b.charCodeAt(offset + (d3 = x + 3));\n dd = (x += 4);\n for (y = 0; y < len; y += 2) {\n dy = vector[y];\n ay = vector[y + 1];\n d0 = _min(dy, d0, d1, bx0, ay);\n d1 = _min(d0, d1, d2, bx1, ay);\n d2 = _min(d1, d2, d3, bx2, ay);\n dd = _min(d2, d3, dd, bx3, ay);\n vector[y] = dd;\n d3 = d2;\n d2 = d1;\n d1 = d0;\n d0 = dy;\n }\n }\n\n for (; x < lb;) {\n bx0 = b.charCodeAt(offset + (d0 = x));\n dd = ++x;\n for (y = 0; y < len; y += 2) {\n dy = vector[y];\n vector[y] = dd = _min(dy, d0, dd, bx0, vector[y + 1]);\n d0 = dy;\n }\n }\n\n return dd;\n };\n})();\n\n", "import { BasicBuilder } from './BasicBuilder'\nimport type { KeyType } from './KeyType'\nimport { Writer } from './Writer'\n\nexport abstract class TypeBuilder implements BasicBuilder {\n // TODO(@SevInf): this should be replaced with precedence system that would\n // automatically add parenthesis where they are needed\n needsParenthesisWhenIndexed = false\n needsParenthesisInKeyof = false\n needsParenthesisInUnion = false\n needsParenthesisInIntersection = false\n\n abstract write(writer: Writer): void\n\n subKey(key: string): KeyType {\n // TODO: since we translating ESM to CommonJS during bundling, we\n // can't handle circular dependencies the same way ESM does. We have to delay KeyType import\n // to resolve it. Once we stop doing this, we can move this import to top of the file.\n const { KeyType } = require('./KeyType')\n return new KeyType(this, key)\n }\n\n writeIndexed(writer: Writer) {\n if (this.needsParenthesisWhenIndexed) {\n writer.write('(')\n }\n\n writer.write(this)\n\n if (this.needsParenthesisWhenIndexed) {\n writer.write(')')\n }\n }\n}\n", "import { TypeBuilder } from './TypeBuilder'\nimport { Writer } from './Writer'\n\nexport class KeyType extends TypeBuilder {\n constructor(\n public baseType: TypeBuilder,\n public key: string,\n ) {\n super()\n }\n write(writer: Writer): void {\n this.baseType.writeIndexed(writer)\n\n writer.write('[').write(`\"${this.key}\"`).write(']')\n }\n}\n\nexport function keyType(baseType: TypeBuilder, key: string) {\n return new KeyType(baseType, key)\n}\n", "/**\n * Internal assertion helpers.\n * @module\n */\n\n/** Asserts something is positive integer. */\nfunction anumber(n: number): void {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n);\n}\n\n/** Is number an Uint8Array? Copied from utils for perf. */\nfunction isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\n/** Asserts something is Uint8Array. */\nfunction abytes(b: Uint8Array | undefined, ...lengths: number[]): void {\n if (!isBytes(b)) throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n\n/** Hash interface. */\nexport type Hash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\n\n/** Asserts something is hash */\nfunction ahash(h: Hash): void {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n\n/** Asserts a hash instance has not been destroyed / finished */\nfunction aexists(instance: any, checkFinished = true): void {\n if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');\n}\n\n/** Asserts output is properly-sized byte array */\nfunction aoutput(out: any, instance: any): void {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n\nexport { anumber, abytes, ahash, aexists, aoutput };\n", "/**\n * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.\n * @todo re-check https://issues.chromium.org/issues/42212588\n * @module\n */\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n\nfunction fromBig(\n n: bigint,\n le = false\n): {\n h: number;\n l: number;\n} {\n if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n\nfunction split(lst: bigint[], le = false): Uint32Array[] {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n\nconst toBig = (h: number, l: number): bigint => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h: number, _l: number, s: number): number => h >>> s;\nconst shrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h: number, l: number, s: number): number => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h: number, l: number, s: number): number => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h: number, l: number, s: number): number => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h: number, l: number): number => l;\nconst rotr32L = (h: number, _l: number): number => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h: number, l: number, s: number): number => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h: number, l: number, s: number): number => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h: number, l: number, s: number): number => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h: number, l: number, s: number): number => (h << (s - 32)) | (l >>> (64 - s));\n\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(\n Ah: number,\n Al: number,\n Bh: number,\n Bl: number\n): {\n h: number;\n l: number;\n} {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al: number, Bl: number, Cl: number): number => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low: number, Ah: number, Bh: number, Ch: number): number =>\n (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al: number, Bl: number, Cl: number, Dl: number): number =>\n (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number): number =>\n (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number): number =>\n (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number): number =>\n (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n\n// prettier-ignore\nexport {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\n// prettier-ignore\nconst u64: { fromBig: typeof fromBig; split: typeof split; toBig: (h: number, l: number) => bigint; shrSH: (h: number, _l: number, s: number) => number; shrSL: (h: number, l: number, s: number) => number; rotrSH: (h: number, l: number, s: number) => number; rotrSL: (h: number, l: number, s: number) => number; rotrBH: (h: number, l: number, s: number) => number; rotrBL: (h: number, l: number, s: number) => number; rotr32H: (_h: number, l: number) => number; rotr32L: (h: number, _l: number) => number; rotlSH: (h: number, l: number, s: number) => number; rotlSL: (h: number, l: number, s: number) => number; rotlBH: (h: number, l: number, s: number) => number; rotlBL: (h: number, l: number, s: number) => number; add: typeof add; add3L: (Al: number, Bl: number, Cl: number) => number; add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; } = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n", "/**\n * Internal webcrypto alias.\n * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.\n * Falls back to Node.js built-in crypto for Node.js <=v14.\n * See utils.ts for details.\n * @module\n */\n// @ts-ignore\nimport * as nc from 'node:crypto';\nexport const crypto: any =\n nc && typeof nc === 'object' && 'webcrypto' in nc\n ? (nc.webcrypto as any)\n : nc && typeof nc === 'object' && 'randomBytes' in nc\n ? nc\n : undefined;\n", "/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nimport { abytes } from './_assert.js';\n// export { isBytes } from './_assert.js';\n// We can't reuse isBytes from _assert, because somehow this causes huge perf issues\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n// Cast array to different type\nexport function u8(arr: TypedArray): Uint8Array {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\nexport function u32(arr: TypedArray): Uint32Array {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n\n// Cast array to view\nexport function createView(arr: TypedArray): DataView {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word: number, shift: number): number {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word: number, shift: number): number {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE: boolean = /* @__PURE__ */ (() =>\n new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n// The byte swap operation for uint32\nexport function byteSwap(word: number): number {\n return (\n ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff)\n );\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const byteSwapIfBE: (n: number) => number = isLE\n ? (n: number) => n\n : (n: number) => byteSwap(n);\n\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr: Uint32Array): void {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n}\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n/**\n * Convert byte array to hex string.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async (): Promise<void> => {};\n\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(\n iters: number,\n tick: number,\n cb: (i: number) => void\n): Promise<void> {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick) continue;\n await nextTick();\n ts += diff;\n }\n}\n\n// Global symbols in both browsers and Node.js since v11\n// See https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\n\n/**\n * Convert JS string to byte array.\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('utf8ToBytes expected string, got ' + typeof str);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n/** Accepted input of hash functions. Strings are converted to byte arrays. */\nexport type Input = Uint8Array | string;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data: Input): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\n/** For runtime check if class implements interface */\nexport abstract class Hash<T extends Hash<T>> {\n abstract blockLen: number; // Bytes per block\n abstract outputLen: number; // Bytes in output\n abstract update(buf: Input): this;\n // Writes digest into buf\n abstract digestInto(buf: Uint8Array): void;\n abstract digest(): Uint8Array;\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n abstract destroy(): void;\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n abstract _cloneInto(to?: T): T;\n // Safe version that clones internal state\n clone(): T {\n return this._cloneInto();\n }\n}\n\n/**\n * XOF: streaming API to read digest in chunks.\n * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.\n * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot\n * destroy state, next call can require more bytes.\n */\nexport type HashXOF<T extends Hash<T>> = Hash<T> & {\n xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream\n xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf\n};\n\ntype EmptyObj = {};\nexport function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged as T1 & T2;\n}\n\n/** Hash function */\nexport type CHash = ReturnType<typeof wrapConstructor>;\n/** Hash function with output */\nexport type CHashO = ReturnType<typeof wrapConstructorWithOpts>;\n/** XOF with output */\nexport type CHashXO = ReturnType<typeof wrapXOFConstructorWithOpts>;\n\n/** Wraps hash function, creating an interface on top of it */\nexport function wrapConstructor<T extends Hash<T>>(\n hashCons: () => Hash<T>\n): {\n (msg: Input): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(): Hash<T>;\n} {\n const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\nexport function wrapConstructorWithOpts<H extends Hash<H>, T extends Object>(\n hashCons: (opts?: T) => Hash<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts: T): Hash<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts: T) => hashCons(opts);\n return hashC;\n}\n\nexport function wrapXOFConstructorWithOpts<H extends HashXOF<H>, T extends Object>(\n hashCons: (opts?: T) => HashXOF<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts: T): HashXOF<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts: T) => hashCons(opts);\n return hashC;\n}\n\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32): Uint8Array {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return crypto.randomBytes(bytesLength);\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n", "/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf),\n * [Website](https://keccak.team/keccak.html),\n * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub).\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { abytes, aexists, anumber, aoutput } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport {\n byteSwap32,\n Hash,\n isLE,\n toBytes,\n u32,\n wrapConstructor,\n wrapXOFConstructorWithOpts,\n type CHash,\n type CHashXO,\n type HashXOF,\n type Input,\n} from './utils.js';\n\n// Various per round constants calculations\nconst SHA3_PI: number[] = [];\nconst SHA3_ROTL: number[] = [];\nconst _SHA3_IOTA: bigint[] = [];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n) t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h: number, l: number, s: number) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h: number, l: number, s: number) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n\n/** `keccakf1600` internal function, additionally allows to adjust round count. */\nexport function keccakP(s: Uint32Array, rounds: number = 24): void {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta \u03B8\n for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (\u03C1) and Pi (\u03C0)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (\u03C7)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++) B[x] = s[y + x];\n for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (\u03B9)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\n\n/** Keccak sponge function. */\nexport class Keccak extends Hash<Keccak> implements HashXOF<Keccak> {\n protected state: Uint8Array;\n protected pos = 0;\n protected posOut = 0;\n protected finished = false;\n protected state32: Uint32Array;\n protected destroyed = false;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(\n public blockLen: number,\n public suffix: number,\n public outputLen: number,\n protected enableXOF = false,\n protected rounds: number = 24\n ) {\n super();\n // Can be passed from user as dkLen\n anumber(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n // 0 < blockLen < 200\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n protected keccak(): void {\n if (!isLE) byteSwap32(this.state32);\n keccakP(this.state32, this.rounds);\n if (!isLE) byteSwap32(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data: Input): this {\n aexists(this);\n const { blockLen, state } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen) this.keccak();\n }\n return this;\n }\n protected finish(): void {\n if (this.finished) return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n protected writeInto(out: Uint8Array): Uint8Array {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len; ) {\n if (this.posOut >= blockLen) this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out: Uint8Array): Uint8Array {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF) throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes: number): Uint8Array {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out: Uint8Array): Uint8Array {\n aoutput(out, this);\n if (this.finished) throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest(): Uint8Array {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy(): void {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to?: Keccak): Keccak {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\n\nconst gen = (suffix: number, blockLen: number, outputLen: number) =>\n wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\n\n/** SHA3-224 hash function. */\nexport const sha3_224: CHash = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/** SHA3-256 hash function. Different from keccak-256. */\nexport const sha3_256: CHash = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\n/** SHA3-384 hash function. */\nexport const sha3_384: CHash = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\n/** SHA3-512 hash function. */\nexport const sha3_512: CHash = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\n\n/** keccak-224 hash function. */\nexport const keccak_224: CHash = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/** keccak-256 hash function. Different from SHA3-256. */\nexport const keccak_256: CHash = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\n/** keccak-384 hash function. */\nexport const keccak_384: CHash = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\n/** keccak-512 hash function. */\nexport const keccak_512: CHash = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\n\nexport type ShakeOpts = { dkLen?: number };\n\nconst genShake = (suffix: number, blockLen: number, outputLen: number) =>\n wrapXOFConstructorWithOpts<HashXOF<Keccak>, ShakeOpts>(\n (opts: ShakeOpts = {}) =>\n new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)\n );\n\n/** SHAKE128 XOF with 128-bit security. */\nexport const shake128: CHashXO = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\n/** SHAKE256 XOF with 256-bit security. */\nexport const shake256: CHashXO = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n", "/* global global, window, module */\nconst { sha3_512: sha3 } = require(\"@noble/hashes/sha3\");\n\nconst defaultLength = 24;\nconst bigLength = 32;\n\nconst createEntropy = (length = 4, random = Math.random) => {\n let entropy = \"\";\n\n while (entropy.length < length) {\n entropy = entropy + Math.floor(random() * 36).toString(36);\n }\n return entropy;\n};\n\n/*\n * Adapted from https://github.com/juanelas/bigint-conversion\n * MIT License Copyright (c) 2018 Juan Hern\u00E1ndez Serrano\n */\nfunction bufToBigInt(buf) {\n let bits = 8n;\n\n let value = 0n;\n for (const i of buf.values()) {\n const bi = BigInt(i);\n value = (value << bits) + bi;\n }\n return value;\n}\n\nconst hash = (input = \"\") => {\n // Drop the first character because it will bias the histogram\n // to the left.\n return bufToBigInt(sha3(input)).toString(36).slice(1);\n};\n\nconst alphabet = Array.from({ length: 26 }, (x, i) =>\n String.fromCharCode(i + 97)\n);\n\nconst randomLetter = (random) =>\n alphabet[Math.floor(random() * alphabet.length)];\n\n/*\nThis is a fingerprint of the host environment. It is used to help\nprevent collisions when generating ids in a distributed system.\nIf no global object is available, you can pass in your own, or fall back\non a random string.\n*/\nconst createFingerprint = ({\n globalObj = typeof global !== \"undefined\"\n ? global\n : typeof window !== \"undefined\"\n ? window\n : {},\n random = Math.random,\n} = {}) => {\n const globals = Object.keys(globalObj).toString();\n const sourceString = globals.length\n ? globals + createEntropy(bigLength, random)\n : createEntropy(bigLength, random);\n\n return hash(sourceString).substring(0, bigLength);\n};\n\nconst createCounter = (count) => () => {\n return count++;\n};\n\n// ~22k hosts before 50% chance of initial counter collision\n// with a remaining counter range of 9.0e+15 in JavaScript.\nconst initialCountMax = 476782367;\n\nconst init = ({\n // Fallback if the user does not pass in a CSPRNG. This should be OK\n // because we don't rely solely on the random number generator for entropy.\n // We also use the host fingerprint, current time, and a session counter.\n random = Math.random,\n counter = createCounter(Math.floor(random() * initialCountMax)),\n length = defaultLength,\n fingerprint = createFingerprint({ random }),\n} = {}) => {\n return function cuid2() {\n const firstLetter = randomLetter(random);\n\n // If we're lucky, the `.toString(36)` calls may reduce hashing rounds\n // by shortening the input to the hash function a little.\n const time = Date.now().toString(36);\n const count = counter().toString(36);\n\n // The salt should be long enough to be globally unique across the full\n // length of the hash. For simplicity, we use the same length as the\n // intended id output.\n const salt = createEntropy(length, random);\n const hashInput = `${time + salt + count + fingerprint}`;\n\n return `${firstLetter + hash(hashInput).substring(1, length)}`;\n };\n};\n\nconst createId = init();\n\nconst isCuid = (id, { minLength = 2, maxLength = bigLength } = {}) => {\n const length = id.length;\n const regex = /^[0-9a-z]+$/;\n\n try {\n if (\n typeof id === \"string\" &&\n length >= minLength &&\n length <= maxLength &&\n regex.test(id)\n )\n return true;\n } finally {\n }\n\n return false;\n};\n\nmodule.exports.getConstants = () => ({ defaultLength, bigLength });\nmodule.exports.init = init;\nmodule.exports.createId = createId;\nmodule.exports.bufToBigInt = bufToBigInt;\nmodule.exports.createCounter = createCounter;\nmodule.exports.createFingerprint = createFingerprint;\nmodule.exports.isCuid = isCuid;\n", "const { createId, init, getConstants, isCuid } = require(\"./src/index\");\n\nmodule.exports.createId = createId;\nmodule.exports.init = init;\nmodule.exports.getConstants = getConstants;\nmodule.exports.isCuid = isCuid;\n", "import { defineExtension } from './defineExtension'\nimport { getExtensionContext } from './getExtensionContext'\n\nexport { defineExtension }\nexport { getExtensionContext }\n", "import { Client } from '../../getPrismaClient'\nimport { ExtensionArgs } from '../types/exported/ExtensionArgs'\n\nexport function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)) {\n if (typeof ext === 'function') {\n return ext\n }\n\n return (client: Client) => client.$extends(ext)\n}\n", "/*\n * Because we use a symbol to store the context, we need to merge the context\n * with the original this type. We manage the context via `getExtensionContext`\n * to circumvent the limitations of `this` inference in TS, while also providing\n * a unified API for context management in generic and non-generic extensions.\n */\n\n/* eslint-disable prettier/prettier */\nexport type Context<T> = T extends { [K: symbol]: { ctx: infer C } }\n ? C &\n T & {\n /**\n * @deprecated Use `$name` instead.\n */\n name?: string\n $name?: string\n $parent?: unknown\n }\n : T & {\n /**\n * @deprecated Use `$name` instead.\n */\n name?: string\n $name?: string\n $parent?: unknown\n }\n\nexport function getExtensionContext<T>(that: T) {\n return that as any as Context<T>\n}\n", "import { validator } from './validator'\n\n/*\n * /!\\ These exports are exposed to the user. Proceed with caution.\n *\n * TODO: Move more hardcoded utils f