+ $transaction[]>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise>
+}
+
+export declare const dmmf: any
+export declare type dmmf = any
+
+/**
+ * Get the type of the value, that the Promise holds.
+ */
+export declare type PromiseType> = T extends PromiseLike ? U : T
+
+/**
+ * Get the return type of a function which returns a Promise.
+ */
+export declare type PromiseReturnType Promise> = PromiseType>
+
+export namespace Prisma {
+ export type TransactionClient = any
+
+ export function defineExtension<
+ R extends runtime.Types.Extensions.UserArgs['result'] = {},
+ M extends runtime.Types.Extensions.UserArgs['model'] = {},
+ Q extends runtime.Types.Extensions.UserArgs['query'] = {},
+ C extends runtime.Types.Extensions.UserArgs['client'] = {},
+ Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs,
+ >(
+ args:
+ | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
+ | { name?: string }
+ | { result?: R & runtime.Types.Extensions.UserArgs['result'] }
+ | { model?: M & runtime.Types.Extensions.UserArgs['model'] }
+ | { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
+ | { client?: C & runtime.Types.Extensions.UserArgs['client'] },
+ ): (client: any) => PrismaClientExtends
+
+ export type Extension = runtime.Types.Extensions.UserArgs
+ export import getExtensionContext = runtime.Extensions.getExtensionContext
+ export import Args = runtime.Types.Public.Args
+ export import Payload = runtime.Types.Public.Payload
+ export import Result = runtime.Types.Public.Result
+ export import Exact = runtime.Types.Public.Exact
+ export import PrismaPromise = runtime.Types.Public.PrismaPromise
+
+ export const prismaVersion: {
+ client: string
+ engine: string
+ }
+}
diff --git a/database/node_modules/.prisma/client/default.js b/database/node_modules/.prisma/client/default.js
new file mode 100644
index 00000000..1938e5cd
--- /dev/null
+++ b/database/node_modules/.prisma/client/default.js
@@ -0,0 +1,65 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/scripts/default-index.ts
+var default_index_exports = {};
+__export(default_index_exports, {
+ Prisma: () => Prisma,
+ PrismaClient: () => PrismaClient,
+ default: () => default_index_default
+});
+module.exports = __toCommonJS(default_index_exports);
+
+// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json
+var prisma = {
+ enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
+};
+
+// package.json
+var version = "5.22.0";
+
+// src/runtime/utils/clientVersion.ts
+var clientVersion = version;
+
+// src/scripts/default-index.ts
+var PrismaClient = class {
+ constructor() {
+ throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');
+ }
+};
+function defineExtension(ext) {
+ if (typeof ext === "function") {
+ return ext;
+ }
+ return (client) => client.$extends(ext);
+}
+function getExtensionContext(that) {
+ return that;
+}
+var Prisma = {
+ defineExtension,
+ getExtensionContext,
+ prismaVersion: { client: clientVersion, engine: prisma.enginesVersion }
+};
+var default_index_default = { Prisma };
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ Prisma,
+ PrismaClient
+});
diff --git a/database/node_modules/.prisma/client/deno/edge.d.ts b/database/node_modules/.prisma/client/deno/edge.d.ts
new file mode 100644
index 00000000..bca0a977
--- /dev/null
+++ b/database/node_modules/.prisma/client/deno/edge.d.ts
@@ -0,0 +1,9 @@
+class PrismaClient {
+ constructor() {
+ throw new Error(
+ '@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.',
+ )
+ }
+}
+
+export { PrismaClient }
diff --git a/database/node_modules/.prisma/client/edge.d.ts b/database/node_modules/.prisma/client/edge.d.ts
new file mode 100644
index 00000000..bac7a5cf
--- /dev/null
+++ b/database/node_modules/.prisma/client/edge.d.ts
@@ -0,0 +1,110 @@
+/* eslint-disable @typescript-eslint/no-unused-vars */
+
+import * as runtime from '@prisma/client/runtime/library'
+
+/**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new Prisma()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
+ */
+export declare const PrismaClient: any
+
+/**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new Prisma()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
+ */
+export declare type PrismaClient = any
+
+export declare class PrismaClientExtends<
+ ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
+> {
+ $extends: { extArgs: ExtArgs } & (<
+ R extends runtime.Types.Extensions.UserArgs['result'] = {},
+ M extends runtime.Types.Extensions.UserArgs['model'] = {},
+ Q extends runtime.Types.Extensions.UserArgs['query'] = {},
+ C extends runtime.Types.Extensions.UserArgs['client'] = {},
+ Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs,
+ >(
+ args:
+ | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
+ | { name?: string }
+ | { result?: R & runtime.Types.Extensions.UserArgs['result'] }
+ | { model?: M & runtime.Types.Extensions.UserArgs['model'] }
+ | { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
+ | { client?: C & runtime.Types.Extensions.UserArgs['client'] },
+ ) => PrismaClientExtends & Args['client'])
+
+ $transaction(
+ fn: (prisma: Omit) => Promise,
+ options?: { maxWait?: number; timeout?: number; isolationLevel?: string },
+ ): Promise
+ $transaction[]>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise>
+}
+
+export declare const dmmf: any
+export declare type dmmf = any
+
+/**
+ * Get the type of the value, that the Promise holds.
+ */
+export declare type PromiseType> = T extends PromiseLike ? U : T
+
+/**
+ * Get the return type of a function which returns a Promise.
+ */
+export declare type PromiseReturnType Promise> = PromiseType>
+
+export namespace Prisma {
+ export type TransactionClient = any
+
+ export function defineExtension<
+ R extends runtime.Types.Extensions.UserArgs['result'] = {},
+ M extends runtime.Types.Extensions.UserArgs['model'] = {},
+ Q extends runtime.Types.Extensions.UserArgs['query'] = {},
+ C extends runtime.Types.Extensions.UserArgs['client'] = {},
+ Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs,
+ >(
+ args:
+ | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
+ | { name?: string }
+ | { result?: R & runtime.Types.Extensions.UserArgs['result'] }
+ | { model?: M & runtime.Types.Extensions.UserArgs['model'] }
+ | { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
+ | { client?: C & runtime.Types.Extensions.UserArgs['client'] },
+ ): (client: any) => PrismaClientExtends
+
+ export type Extension = runtime.Types.Extensions.UserArgs
+ export import getExtensionContext = runtime.Extensions.getExtensionContext
+ export import Args = runtime.Types.Public.Args
+ export import Payload = runtime.Types.Public.Payload
+ export import Result = runtime.Types.Public.Result
+ export import Exact = runtime.Types.Public.Exact
+ export import PrismaPromise = runtime.Types.Public.PrismaPromise
+
+ export const prismaVersion: {
+ client: string
+ engine: string
+ }
+}
diff --git a/database/node_modules/.prisma/client/edge.js b/database/node_modules/.prisma/client/edge.js
new file mode 100644
index 00000000..1938e5cd
--- /dev/null
+++ b/database/node_modules/.prisma/client/edge.js
@@ -0,0 +1,65 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/scripts/default-index.ts
+var default_index_exports = {};
+__export(default_index_exports, {
+ Prisma: () => Prisma,
+ PrismaClient: () => PrismaClient,
+ default: () => default_index_default
+});
+module.exports = __toCommonJS(default_index_exports);
+
+// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json
+var prisma = {
+ enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
+};
+
+// package.json
+var version = "5.22.0";
+
+// src/runtime/utils/clientVersion.ts
+var clientVersion = version;
+
+// src/scripts/default-index.ts
+var PrismaClient = class {
+ constructor() {
+ throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');
+ }
+};
+function defineExtension(ext) {
+ if (typeof ext === "function") {
+ return ext;
+ }
+ return (client) => client.$extends(ext);
+}
+function getExtensionContext(that) {
+ return that;
+}
+var Prisma = {
+ defineExtension,
+ getExtensionContext,
+ prismaVersion: { client: clientVersion, engine: prisma.enginesVersion }
+};
+var default_index_default = { Prisma };
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ Prisma,
+ PrismaClient
+});
diff --git a/database/node_modules/.prisma/client/index-browser.js b/database/node_modules/.prisma/client/index-browser.js
new file mode 100644
index 00000000..1938e5cd
--- /dev/null
+++ b/database/node_modules/.prisma/client/index-browser.js
@@ -0,0 +1,65 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/scripts/default-index.ts
+var default_index_exports = {};
+__export(default_index_exports, {
+ Prisma: () => Prisma,
+ PrismaClient: () => PrismaClient,
+ default: () => default_index_default
+});
+module.exports = __toCommonJS(default_index_exports);
+
+// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json
+var prisma = {
+ enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
+};
+
+// package.json
+var version = "5.22.0";
+
+// src/runtime/utils/clientVersion.ts
+var clientVersion = version;
+
+// src/scripts/default-index.ts
+var PrismaClient = class {
+ constructor() {
+ throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');
+ }
+};
+function defineExtension(ext) {
+ if (typeof ext === "function") {
+ return ext;
+ }
+ return (client) => client.$extends(ext);
+}
+function getExtensionContext(that) {
+ return that;
+}
+var Prisma = {
+ defineExtension,
+ getExtensionContext,
+ prismaVersion: { client: clientVersion, engine: prisma.enginesVersion }
+};
+var default_index_default = { Prisma };
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ Prisma,
+ PrismaClient
+});
diff --git a/database/node_modules/.prisma/client/index.d.ts b/database/node_modules/.prisma/client/index.d.ts
new file mode 100644
index 00000000..bac7a5cf
--- /dev/null
+++ b/database/node_modules/.prisma/client/index.d.ts
@@ -0,0 +1,110 @@
+/* eslint-disable @typescript-eslint/no-unused-vars */
+
+import * as runtime from '@prisma/client/runtime/library'
+
+/**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new Prisma()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
+ */
+export declare const PrismaClient: any
+
+/**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new Prisma()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
+ */
+export declare type PrismaClient = any
+
+export declare class PrismaClientExtends<
+ ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
+> {
+ $extends: { extArgs: ExtArgs } & (<
+ R extends runtime.Types.Extensions.UserArgs['result'] = {},
+ M extends runtime.Types.Extensions.UserArgs['model'] = {},
+ Q extends runtime.Types.Extensions.UserArgs['query'] = {},
+ C extends runtime.Types.Extensions.UserArgs['client'] = {},
+ Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs,
+ >(
+ args:
+ | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
+ | { name?: string }
+ | { result?: R & runtime.Types.Extensions.UserArgs['result'] }
+ | { model?: M & runtime.Types.Extensions.UserArgs['model'] }
+ | { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
+ | { client?: C & runtime.Types.Extensions.UserArgs['client'] },
+ ) => PrismaClientExtends & Args['client'])
+
+ $transaction(
+ fn: (prisma: Omit) => Promise,
+ options?: { maxWait?: number; timeout?: number; isolationLevel?: string },
+ ): Promise
+ $transaction[]>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise>
+}
+
+export declare const dmmf: any
+export declare type dmmf = any
+
+/**
+ * Get the type of the value, that the Promise holds.
+ */
+export declare type PromiseType> = T extends PromiseLike ? U : T
+
+/**
+ * Get the return type of a function which returns a Promise.
+ */
+export declare type PromiseReturnType Promise> = PromiseType>
+
+export namespace Prisma {
+ export type TransactionClient = any
+
+ export function defineExtension<
+ R extends runtime.Types.Extensions.UserArgs['result'] = {},
+ M extends runtime.Types.Extensions.UserArgs['model'] = {},
+ Q extends runtime.Types.Extensions.UserArgs['query'] = {},
+ C extends runtime.Types.Extensions.UserArgs['client'] = {},
+ Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs,
+ >(
+ args:
+ | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
+ | { name?: string }
+ | { result?: R & runtime.Types.Extensions.UserArgs['result'] }
+ | { model?: M & runtime.Types.Extensions.UserArgs['model'] }
+ | { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
+ | { client?: C & runtime.Types.Extensions.UserArgs['client'] },
+ ): (client: any) => PrismaClientExtends
+
+ export type Extension = runtime.Types.Extensions.UserArgs
+ export import getExtensionContext = runtime.Extensions.getExtensionContext
+ export import Args = runtime.Types.Public.Args
+ export import Payload = runtime.Types.Public.Payload
+ export import Result = runtime.Types.Public.Result
+ export import Exact = runtime.Types.Public.Exact
+ export import PrismaPromise = runtime.Types.Public.PrismaPromise
+
+ export const prismaVersion: {
+ client: string
+ engine: string
+ }
+}
diff --git a/database/node_modules/.prisma/client/index.js b/database/node_modules/.prisma/client/index.js
new file mode 100644
index 00000000..1938e5cd
--- /dev/null
+++ b/database/node_modules/.prisma/client/index.js
@@ -0,0 +1,65 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/scripts/default-index.ts
+var default_index_exports = {};
+__export(default_index_exports, {
+ Prisma: () => Prisma,
+ PrismaClient: () => PrismaClient,
+ default: () => default_index_default
+});
+module.exports = __toCommonJS(default_index_exports);
+
+// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json
+var prisma = {
+ enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
+};
+
+// package.json
+var version = "5.22.0";
+
+// src/runtime/utils/clientVersion.ts
+var clientVersion = version;
+
+// src/scripts/default-index.ts
+var PrismaClient = class {
+ constructor() {
+ throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');
+ }
+};
+function defineExtension(ext) {
+ if (typeof ext === "function") {
+ return ext;
+ }
+ return (client) => client.$extends(ext);
+}
+function getExtensionContext(that) {
+ return that;
+}
+var Prisma = {
+ defineExtension,
+ getExtensionContext,
+ prismaVersion: { client: clientVersion, engine: prisma.enginesVersion }
+};
+var default_index_default = { Prisma };
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ Prisma,
+ PrismaClient
+});
diff --git a/database/node_modules/.prisma/client/wasm.d.ts b/database/node_modules/.prisma/client/wasm.d.ts
new file mode 100644
index 00000000..bac7a5cf
--- /dev/null
+++ b/database/node_modules/.prisma/client/wasm.d.ts
@@ -0,0 +1,110 @@
+/* eslint-disable @typescript-eslint/no-unused-vars */
+
+import * as runtime from '@prisma/client/runtime/library'
+
+/**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new Prisma()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
+ */
+export declare const PrismaClient: any
+
+/**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new Prisma()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
+ */
+export declare type PrismaClient = any
+
+export declare class PrismaClientExtends<
+ ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
+> {
+ $extends: { extArgs: ExtArgs } & (<
+ R extends runtime.Types.Extensions.UserArgs['result'] = {},
+ M extends runtime.Types.Extensions.UserArgs['model'] = {},
+ Q extends runtime.Types.Extensions.UserArgs['query'] = {},
+ C extends runtime.Types.Extensions.UserArgs['client'] = {},
+ Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs,
+ >(
+ args:
+ | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
+ | { name?: string }
+ | { result?: R & runtime.Types.Extensions.UserArgs['result'] }
+ | { model?: M & runtime.Types.Extensions.UserArgs['model'] }
+ | { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
+ | { client?: C & runtime.Types.Extensions.UserArgs['client'] },
+ ) => PrismaClientExtends & Args['client'])
+
+ $transaction(
+ fn: (prisma: Omit) => Promise,
+ options?: { maxWait?: number; timeout?: number; isolationLevel?: string },
+ ): Promise
+ $transaction[]>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise>
+}
+
+export declare const dmmf: any
+export declare type dmmf = any
+
+/**
+ * Get the type of the value, that the Promise holds.
+ */
+export declare type PromiseType> = T extends PromiseLike ? U : T
+
+/**
+ * Get the return type of a function which returns a Promise.
+ */
+export declare type PromiseReturnType Promise> = PromiseType>
+
+export namespace Prisma {
+ export type TransactionClient = any
+
+ export function defineExtension<
+ R extends runtime.Types.Extensions.UserArgs['result'] = {},
+ M extends runtime.Types.Extensions.UserArgs['model'] = {},
+ Q extends runtime.Types.Extensions.UserArgs['query'] = {},
+ C extends runtime.Types.Extensions.UserArgs['client'] = {},
+ Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs,
+ >(
+ args:
+ | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
+ | { name?: string }
+ | { result?: R & runtime.Types.Extensions.UserArgs['result'] }
+ | { model?: M & runtime.Types.Extensions.UserArgs['model'] }
+ | { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
+ | { client?: C & runtime.Types.Extensions.UserArgs['client'] },
+ ): (client: any) => PrismaClientExtends
+
+ export type Extension = runtime.Types.Extensions.UserArgs
+ export import getExtensionContext = runtime.Extensions.getExtensionContext
+ export import Args = runtime.Types.Public.Args
+ export import Payload = runtime.Types.Public.Payload
+ export import Result = runtime.Types.Public.Result
+ export import Exact = runtime.Types.Public.Exact
+ export import PrismaPromise = runtime.Types.Public.PrismaPromise
+
+ export const prismaVersion: {
+ client: string
+ engine: string
+ }
+}
diff --git a/database/node_modules/.prisma/client/wasm.js b/database/node_modules/.prisma/client/wasm.js
new file mode 100644
index 00000000..1938e5cd
--- /dev/null
+++ b/database/node_modules/.prisma/client/wasm.js
@@ -0,0 +1,65 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/scripts/default-index.ts
+var default_index_exports = {};
+__export(default_index_exports, {
+ Prisma: () => Prisma,
+ PrismaClient: () => PrismaClient,
+ default: () => default_index_default
+});
+module.exports = __toCommonJS(default_index_exports);
+
+// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json
+var prisma = {
+ enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
+};
+
+// package.json
+var version = "5.22.0";
+
+// src/runtime/utils/clientVersion.ts
+var clientVersion = version;
+
+// src/scripts/default-index.ts
+var PrismaClient = class {
+ constructor() {
+ throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');
+ }
+};
+function defineExtension(ext) {
+ if (typeof ext === "function") {
+ return ext;
+ }
+ return (client) => client.$extends(ext);
+}
+function getExtensionContext(that) {
+ return that;
+}
+var Prisma = {
+ defineExtension,
+ getExtensionContext,
+ prismaVersion: { client: clientVersion, engine: prisma.enginesVersion }
+};
+var default_index_default = { Prisma };
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ Prisma,
+ PrismaClient
+});
diff --git a/database/node_modules/@prisma/client/LICENSE b/database/node_modules/@prisma/client/LICENSE
new file mode 100644
index 00000000..261eeb9e
--- /dev/null
+++ b/database/node_modules/@prisma/client/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/database/node_modules/@prisma/client/README.md b/database/node_modules/@prisma/client/README.md
new file mode 100644
index 00000000..c67b83cb
--- /dev/null
+++ b/database/node_modules/@prisma/client/README.md
@@ -0,0 +1,27 @@
+# Prisma Client · [](https://www.npmjs.com/package/@prisma/client) [](https://github.com/prisma/prisma/blob/main/CONTRIBUTING.md) [](https://github.com/prisma/prisma/blob/main/LICENSE) [](https://pris.ly/discord)
+
+Prisma Client JS is an **auto-generated query builder** that enables **type-safe** database access and **reduces boilerplate**. You can use it as an alternative to traditional ORMs such as Sequelize, TypeORM or SQL query builders like knex.js.
+
+It is part of the [Prisma](https://www.prisma.io/) ecosystem. Prisma provides database tools for data access, declarative data modeling, schema migrations and visual data management. Learn more in the main [`prisma`](https://github.com/prisma/prisma/) repository or read the [documentation](https://www.prisma.io/docs/).
+
+## Getting started
+
+Follow one of these guides to get started with Prisma Client JS:
+
+- [Quickstart](https://www.prisma.io/docs/getting-started/quickstart) (5 min)
+- [Set up a new project with Prisma (SQL migrations)](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch-sql) (15 min)
+- [Set up a new project with Prisma (Prisma Migrate)](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate) (15 min)
+- [Add Prisma to an existing project](https://www.prisma.io/docs/getting-started/setup-prisma/add-to-existing-project) (15 min)
+
+Alternatively you can explore the ready-to-run [examples](https://github.com/prisma/prisma-examples/) (REST, GraphQL, gRPC, plain JavaScript and TypeScript demos, ...) or watch the [demo videos](https://www.youtube.com/watch?v=0RhtQgIs-TE&list=PLn2e1F9Rfr6k9PnR_figWOcSHgc_erDr5&index=1) (1-2 min per video).
+
+## Contributing
+
+Refer to our [contribution guidelines](https://github.com/prisma/prisma/blob/main/CONTRIBUTING.md) and [Code of Conduct for contributors](https://github.com/prisma/prisma/blob/main/CODE_OF_CONDUCT.md).
+
+## Tests Status
+
+- Prisma Tests Status:
+ [](https://github.com/prisma/prisma/actions/workflows/test.yml)
+- Ecosystem Tests Status:
+ [](https://github.com/prisma/ecosystem-tests/actions)
diff --git a/database/node_modules/@prisma/client/default.d.ts b/database/node_modules/@prisma/client/default.d.ts
new file mode 100644
index 00000000..bedfdce0
--- /dev/null
+++ b/database/node_modules/@prisma/client/default.d.ts
@@ -0,0 +1 @@
+export * from '.prisma/client/default'
diff --git a/database/node_modules/@prisma/client/default.js b/database/node_modules/@prisma/client/default.js
new file mode 100644
index 00000000..3c2dafb5
--- /dev/null
+++ b/database/node_modules/@prisma/client/default.js
@@ -0,0 +1,3 @@
+module.exports = {
+ ...require('.prisma/client/default'),
+}
diff --git a/database/node_modules/@prisma/client/edge.d.ts b/database/node_modules/@prisma/client/edge.d.ts
new file mode 100644
index 00000000..b8d190e2
--- /dev/null
+++ b/database/node_modules/@prisma/client/edge.d.ts
@@ -0,0 +1 @@
+export * from '.prisma/client/edge'
diff --git a/database/node_modules/@prisma/client/edge.js b/database/node_modules/@prisma/client/edge.js
new file mode 100644
index 00000000..c4925e82
--- /dev/null
+++ b/database/node_modules/@prisma/client/edge.js
@@ -0,0 +1,4 @@
+module.exports = {
+ // https://github.com/prisma/prisma/pull/12907
+ ...require('.prisma/client/edge'),
+}
diff --git a/database/node_modules/@prisma/client/extension.d.ts b/database/node_modules/@prisma/client/extension.d.ts
new file mode 100644
index 00000000..28e39683
--- /dev/null
+++ b/database/node_modules/@prisma/client/extension.d.ts
@@ -0,0 +1 @@
+export * from './scripts/default-index'
diff --git a/database/node_modules/@prisma/client/extension.js b/database/node_modules/@prisma/client/extension.js
new file mode 100644
index 00000000..3ab6e465
--- /dev/null
+++ b/database/node_modules/@prisma/client/extension.js
@@ -0,0 +1,4 @@
+module.exports = {
+ // https://github.com/prisma/prisma/pull/12907
+ ...require('./scripts/default-index'),
+}
diff --git a/database/node_modules/@prisma/client/generator-build/index.js b/database/node_modules/@prisma/client/generator-build/index.js
new file mode 100644
index 00000000..42eed629
--- /dev/null
+++ b/database/node_modules/@prisma/client/generator-build/index.js
@@ -0,0 +1,10344 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __esm = (fn, res) => function __init() {
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
+};
+var __commonJS = (cb, mod) => function __require() {
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
+};
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json
+var require_package = __commonJS({
+ "../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json"(exports2, module2) {
+ module2.exports = {
+ name: "@prisma/engines-version",
+ version: "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ main: "index.js",
+ types: "index.d.ts",
+ license: "Apache-2.0",
+ author: "Tim Suchanek ",
+ prisma: {
+ enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36"
+ },
+ repository: {
+ type: "git",
+ url: "https://github.com/prisma/engines-wrapper.git",
+ directory: "packages/engines-version"
+ },
+ devDependencies: {
+ "@types/node": "18.19.34",
+ typescript: "4.9.5"
+ },
+ files: [
+ "index.js",
+ "index.d.ts"
+ ],
+ scripts: {
+ build: "tsc -d"
+ }
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/index.js
+var require_engines_version = __commonJS({
+ "../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/index.js"(exports2) {
+ "use strict";
+ Object.defineProperty(exports2, "__esModule", { value: true });
+ exports2.enginesVersion = void 0;
+ exports2.enginesVersion = require_package().prisma.enginesVersion;
+ }
+});
+
+// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
+var require_universalify = __commonJS({
+ "../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports2) {
+ "use strict";
+ exports2.fromCallback = function(fn) {
+ return Object.defineProperty(function(...args) {
+ if (typeof args[args.length - 1] === "function") fn.apply(this, args);
+ else {
+ return new Promise((resolve, reject) => {
+ fn.call(
+ this,
+ ...args,
+ (err, res) => err != null ? reject(err) : resolve(res)
+ );
+ });
+ }
+ }, "name", { value: fn.name });
+ };
+ exports2.fromPromise = function(fn) {
+ return Object.defineProperty(function(...args) {
+ const cb = args[args.length - 1];
+ if (typeof cb !== "function") return fn.apply(this, args);
+ else fn.apply(this, args.slice(0, -1)).then((r) => cb(null, r), cb);
+ }, "name", { value: fn.name });
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js
+var require_polyfills = __commonJS({
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
+ "use strict";
+ var constants = require("constants");
+ var origCwd = process.cwd;
+ var cwd2 = null;
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
+ process.cwd = function() {
+ if (!cwd2)
+ cwd2 = origCwd.call(process);
+ return cwd2;
+ };
+ try {
+ process.cwd();
+ } catch (er) {
+ }
+ if (typeof process.chdir === "function") {
+ chdir = process.chdir;
+ process.chdir = function(d) {
+ cwd2 = null;
+ chdir.call(process, d);
+ };
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
+ }
+ var chdir;
+ module2.exports = patch;
+ function patch(fs3) {
+ if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
+ patchLchmod(fs3);
+ }
+ if (!fs3.lutimes) {
+ patchLutimes(fs3);
+ }
+ fs3.chown = chownFix(fs3.chown);
+ fs3.fchown = chownFix(fs3.fchown);
+ fs3.lchown = chownFix(fs3.lchown);
+ fs3.chmod = chmodFix(fs3.chmod);
+ fs3.fchmod = chmodFix(fs3.fchmod);
+ fs3.lchmod = chmodFix(fs3.lchmod);
+ fs3.chownSync = chownFixSync(fs3.chownSync);
+ fs3.fchownSync = chownFixSync(fs3.fchownSync);
+ fs3.lchownSync = chownFixSync(fs3.lchownSync);
+ fs3.chmodSync = chmodFixSync(fs3.chmodSync);
+ fs3.fchmodSync = chmodFixSync(fs3.fchmodSync);
+ fs3.lchmodSync = chmodFixSync(fs3.lchmodSync);
+ fs3.stat = statFix(fs3.stat);
+ fs3.fstat = statFix(fs3.fstat);
+ fs3.lstat = statFix(fs3.lstat);
+ fs3.statSync = statFixSync(fs3.statSync);
+ fs3.fstatSync = statFixSync(fs3.fstatSync);
+ fs3.lstatSync = statFixSync(fs3.lstatSync);
+ if (fs3.chmod && !fs3.lchmod) {
+ fs3.lchmod = function(path5, mode, cb) {
+ if (cb) process.nextTick(cb);
+ };
+ fs3.lchmodSync = function() {
+ };
+ }
+ if (fs3.chown && !fs3.lchown) {
+ fs3.lchown = function(path5, uid, gid, cb) {
+ if (cb) process.nextTick(cb);
+ };
+ fs3.lchownSync = function() {
+ };
+ }
+ if (platform === "win32") {
+ fs3.rename = typeof fs3.rename !== "function" ? fs3.rename : function(fs$rename) {
+ function rename(from, to, cb) {
+ var start = Date.now();
+ var backoff = 0;
+ fs$rename(from, to, function CB(er) {
+ if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
+ setTimeout(function() {
+ fs3.stat(to, function(stater, st) {
+ if (stater && stater.code === "ENOENT")
+ fs$rename(from, to, CB);
+ else
+ cb(er);
+ });
+ }, backoff);
+ if (backoff < 100)
+ backoff += 10;
+ return;
+ }
+ if (cb) cb(er);
+ });
+ }
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
+ return rename;
+ }(fs3.rename);
+ }
+ fs3.read = typeof fs3.read !== "function" ? fs3.read : function(fs$read) {
+ function read(fd, buffer2, offset, length, position, callback_) {
+ var callback;
+ if (callback_ && typeof callback_ === "function") {
+ var eagCounter = 0;
+ callback = function(er, _, __) {
+ if (er && er.code === "EAGAIN" && eagCounter < 10) {
+ eagCounter++;
+ return fs$read.call(fs3, fd, buffer2, offset, length, position, callback);
+ }
+ callback_.apply(this, arguments);
+ };
+ }
+ return fs$read.call(fs3, fd, buffer2, offset, length, position, callback);
+ }
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
+ return read;
+ }(fs3.read);
+ fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) {
+ return function(fd, buffer2, offset, length, position) {
+ var eagCounter = 0;
+ while (true) {
+ try {
+ return fs$readSync.call(fs3, fd, buffer2, offset, length, position);
+ } catch (er) {
+ if (er.code === "EAGAIN" && eagCounter < 10) {
+ eagCounter++;
+ continue;
+ }
+ throw er;
+ }
+ }
+ };
+ }(fs3.readSync);
+ function patchLchmod(fs4) {
+ fs4.lchmod = function(path5, mode, callback) {
+ fs4.open(
+ path5,
+ constants.O_WRONLY | constants.O_SYMLINK,
+ mode,
+ function(err, fd) {
+ if (err) {
+ if (callback) callback(err);
+ return;
+ }
+ fs4.fchmod(fd, mode, function(err2) {
+ fs4.close(fd, function(err22) {
+ if (callback) callback(err2 || err22);
+ });
+ });
+ }
+ );
+ };
+ fs4.lchmodSync = function(path5, mode) {
+ var fd = fs4.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
+ var threw = true;
+ var ret;
+ try {
+ ret = fs4.fchmodSync(fd, mode);
+ threw = false;
+ } finally {
+ if (threw) {
+ try {
+ fs4.closeSync(fd);
+ } catch (er) {
+ }
+ } else {
+ fs4.closeSync(fd);
+ }
+ }
+ return ret;
+ };
+ }
+ function patchLutimes(fs4) {
+ if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
+ fs4.lutimes = function(path5, at, mt, cb) {
+ fs4.open(path5, constants.O_SYMLINK, function(er, fd) {
+ if (er) {
+ if (cb) cb(er);
+ return;
+ }
+ fs4.futimes(fd, at, mt, function(er2) {
+ fs4.close(fd, function(er22) {
+ if (cb) cb(er2 || er22);
+ });
+ });
+ });
+ };
+ fs4.lutimesSync = function(path5, at, mt) {
+ var fd = fs4.openSync(path5, constants.O_SYMLINK);
+ var ret;
+ var threw = true;
+ try {
+ ret = fs4.futimesSync(fd, at, mt);
+ threw = false;
+ } finally {
+ if (threw) {
+ try {
+ fs4.closeSync(fd);
+ } catch (er) {
+ }
+ } else {
+ fs4.closeSync(fd);
+ }
+ }
+ return ret;
+ };
+ } else if (fs4.futimes) {
+ fs4.lutimes = function(_a, _b, _c, cb) {
+ if (cb) process.nextTick(cb);
+ };
+ fs4.lutimesSync = function() {
+ };
+ }
+ }
+ function chmodFix(orig) {
+ if (!orig) return orig;
+ return function(target, mode, cb) {
+ return orig.call(fs3, target, mode, function(er) {
+ if (chownErOk(er)) er = null;
+ if (cb) cb.apply(this, arguments);
+ });
+ };
+ }
+ function chmodFixSync(orig) {
+ if (!orig) return orig;
+ return function(target, mode) {
+ try {
+ return orig.call(fs3, target, mode);
+ } catch (er) {
+ if (!chownErOk(er)) throw er;
+ }
+ };
+ }
+ function chownFix(orig) {
+ if (!orig) return orig;
+ return function(target, uid, gid, cb) {
+ return orig.call(fs3, target, uid, gid, function(er) {
+ if (chownErOk(er)) er = null;
+ if (cb) cb.apply(this, arguments);
+ });
+ };
+ }
+ function chownFixSync(orig) {
+ if (!orig) return orig;
+ return function(target, uid, gid) {
+ try {
+ return orig.call(fs3, target, uid, gid);
+ } catch (er) {
+ if (!chownErOk(er)) throw er;
+ }
+ };
+ }
+ function statFix(orig) {
+ if (!orig) return orig;
+ return function(target, options, cb) {
+ if (typeof options === "function") {
+ cb = options;
+ options = null;
+ }
+ function callback(er, stats) {
+ if (stats) {
+ if (stats.uid < 0) stats.uid += 4294967296;
+ if (stats.gid < 0) stats.gid += 4294967296;
+ }
+ if (cb) cb.apply(this, arguments);
+ }
+ return options ? orig.call(fs3, target, options, callback) : orig.call(fs3, target, callback);
+ };
+ }
+ function statFixSync(orig) {
+ if (!orig) return orig;
+ return function(target, options) {
+ var stats = options ? orig.call(fs3, target, options) : orig.call(fs3, target);
+ if (stats) {
+ if (stats.uid < 0) stats.uid += 4294967296;
+ if (stats.gid < 0) stats.gid += 4294967296;
+ }
+ return stats;
+ };
+ }
+ function chownErOk(er) {
+ if (!er)
+ return true;
+ if (er.code === "ENOSYS")
+ return true;
+ var nonroot = !process.getuid || process.getuid() !== 0;
+ if (nonroot) {
+ if (er.code === "EINVAL" || er.code === "EPERM")
+ return true;
+ }
+ return false;
+ }
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/legacy-streams.js
+var require_legacy_streams = __commonJS({
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
+ "use strict";
+ var Stream = require("stream").Stream;
+ module2.exports = legacy;
+ function legacy(fs3) {
+ return {
+ ReadStream,
+ WriteStream
+ };
+ function ReadStream(path5, options) {
+ if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
+ Stream.call(this);
+ var self = this;
+ this.path = path5;
+ this.fd = null;
+ this.readable = true;
+ this.paused = false;
+ this.flags = "r";
+ this.mode = 438;
+ this.bufferSize = 64 * 1024;
+ options = options || {};
+ var keys = Object.keys(options);
+ for (var index = 0, length = keys.length; index < length; index++) {
+ var key = keys[index];
+ this[key] = options[key];
+ }
+ if (this.encoding) this.setEncoding(this.encoding);
+ if (this.start !== void 0) {
+ if ("number" !== typeof this.start) {
+ throw TypeError("start must be a Number");
+ }
+ if (this.end === void 0) {
+ this.end = Infinity;
+ } else if ("number" !== typeof this.end) {
+ throw TypeError("end must be a Number");
+ }
+ if (this.start > this.end) {
+ throw new Error("start must be <= end");
+ }
+ this.pos = this.start;
+ }
+ if (this.fd !== null) {
+ process.nextTick(function() {
+ self._read();
+ });
+ return;
+ }
+ fs3.open(this.path, this.flags, this.mode, function(err, fd) {
+ if (err) {
+ self.emit("error", err);
+ self.readable = false;
+ return;
+ }
+ self.fd = fd;
+ self.emit("open", fd);
+ self._read();
+ });
+ }
+ function WriteStream(path5, options) {
+ if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
+ Stream.call(this);
+ this.path = path5;
+ this.fd = null;
+ this.writable = true;
+ this.flags = "w";
+ this.encoding = "binary";
+ this.mode = 438;
+ this.bytesWritten = 0;
+ options = options || {};
+ var keys = Object.keys(options);
+ for (var index = 0, length = keys.length; index < length; index++) {
+ var key = keys[index];
+ this[key] = options[key];
+ }
+ if (this.start !== void 0) {
+ if ("number" !== typeof this.start) {
+ throw TypeError("start must be a Number");
+ }
+ if (this.start < 0) {
+ throw new Error("start must be >= zero");
+ }
+ this.pos = this.start;
+ }
+ this.busy = false;
+ this._queue = [];
+ if (this.fd === null) {
+ this._open = fs3.open;
+ this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
+ this.flush();
+ }
+ }
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/clone.js
+var require_clone = __commonJS({
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/clone.js"(exports2, module2) {
+ "use strict";
+ module2.exports = clone;
+ var getPrototypeOf = Object.getPrototypeOf || function(obj) {
+ return obj.__proto__;
+ };
+ function clone(obj) {
+ if (obj === null || typeof obj !== "object")
+ return obj;
+ if (obj instanceof Object)
+ var copy = { __proto__: getPrototypeOf(obj) };
+ else
+ var copy = /* @__PURE__ */ Object.create(null);
+ Object.getOwnPropertyNames(obj).forEach(function(key) {
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
+ });
+ return copy;
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js
+var require_graceful_fs = __commonJS({
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require("fs");
+ var polyfills = require_polyfills();
+ var legacy = require_legacy_streams();
+ var clone = require_clone();
+ var util2 = require("util");
+ var gracefulQueue;
+ var previousSymbol;
+ if (typeof Symbol === "function" && typeof Symbol.for === "function") {
+ gracefulQueue = Symbol.for("graceful-fs.queue");
+ previousSymbol = Symbol.for("graceful-fs.previous");
+ } else {
+ gracefulQueue = "___graceful-fs.queue";
+ previousSymbol = "___graceful-fs.previous";
+ }
+ function noop() {
+ }
+ function publishQueue(context, queue2) {
+ Object.defineProperty(context, gracefulQueue, {
+ get: function() {
+ return queue2;
+ }
+ });
+ }
+ var debug4 = noop;
+ if (util2.debuglog)
+ debug4 = util2.debuglog("gfs4");
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
+ debug4 = function() {
+ var m = util2.format.apply(util2, arguments);
+ m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
+ console.error(m);
+ };
+ if (!fs3[gracefulQueue]) {
+ queue = global[gracefulQueue] || [];
+ publishQueue(fs3, queue);
+ fs3.close = function(fs$close) {
+ function close(fd, cb) {
+ return fs$close.call(fs3, fd, function(err) {
+ if (!err) {
+ resetQueue();
+ }
+ if (typeof cb === "function")
+ cb.apply(this, arguments);
+ });
+ }
+ Object.defineProperty(close, previousSymbol, {
+ value: fs$close
+ });
+ return close;
+ }(fs3.close);
+ fs3.closeSync = function(fs$closeSync) {
+ function closeSync(fd) {
+ fs$closeSync.apply(fs3, arguments);
+ resetQueue();
+ }
+ Object.defineProperty(closeSync, previousSymbol, {
+ value: fs$closeSync
+ });
+ return closeSync;
+ }(fs3.closeSync);
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
+ process.on("exit", function() {
+ debug4(fs3[gracefulQueue]);
+ require("assert").equal(fs3[gracefulQueue].length, 0);
+ });
+ }
+ }
+ var queue;
+ if (!global[gracefulQueue]) {
+ publishQueue(global, fs3[gracefulQueue]);
+ }
+ module2.exports = patch(clone(fs3));
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) {
+ module2.exports = patch(fs3);
+ fs3.__patched = true;
+ }
+ function patch(fs4) {
+ polyfills(fs4);
+ fs4.gracefulify = patch;
+ fs4.createReadStream = createReadStream;
+ fs4.createWriteStream = createWriteStream;
+ var fs$readFile = fs4.readFile;
+ fs4.readFile = readFile;
+ function readFile(path5, options, cb) {
+ if (typeof options === "function")
+ cb = options, options = null;
+ return go$readFile(path5, options, cb);
+ function go$readFile(path6, options2, cb2, startTime) {
+ return fs$readFile(path6, options2, function(err) {
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+ enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
+ else {
+ if (typeof cb2 === "function")
+ cb2.apply(this, arguments);
+ }
+ });
+ }
+ }
+ var fs$writeFile = fs4.writeFile;
+ fs4.writeFile = writeFile;
+ function writeFile(path5, data, options, cb) {
+ if (typeof options === "function")
+ cb = options, options = null;
+ return go$writeFile(path5, data, options, cb);
+ function go$writeFile(path6, data2, options2, cb2, startTime) {
+ return fs$writeFile(path6, data2, options2, function(err) {
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+ enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
+ else {
+ if (typeof cb2 === "function")
+ cb2.apply(this, arguments);
+ }
+ });
+ }
+ }
+ var fs$appendFile = fs4.appendFile;
+ if (fs$appendFile)
+ fs4.appendFile = appendFile;
+ function appendFile(path5, data, options, cb) {
+ if (typeof options === "function")
+ cb = options, options = null;
+ return go$appendFile(path5, data, options, cb);
+ function go$appendFile(path6, data2, options2, cb2, startTime) {
+ return fs$appendFile(path6, data2, options2, function(err) {
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+ enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
+ else {
+ if (typeof cb2 === "function")
+ cb2.apply(this, arguments);
+ }
+ });
+ }
+ }
+ var fs$copyFile = fs4.copyFile;
+ if (fs$copyFile)
+ fs4.copyFile = copyFile;
+ function copyFile(src, dest, flags, cb) {
+ if (typeof flags === "function") {
+ cb = flags;
+ flags = 0;
+ }
+ return go$copyFile(src, dest, flags, cb);
+ function go$copyFile(src2, dest2, flags2, cb2, startTime) {
+ return fs$copyFile(src2, dest2, flags2, function(err) {
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+ enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
+ else {
+ if (typeof cb2 === "function")
+ cb2.apply(this, arguments);
+ }
+ });
+ }
+ }
+ var fs$readdir = fs4.readdir;
+ fs4.readdir = readdir;
+ var noReaddirOptionVersions = /^v[0-5]\./;
+ function readdir(path5, options, cb) {
+ if (typeof options === "function")
+ cb = options, options = null;
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
+ return fs$readdir(path6, fs$readdirCallback(
+ path6,
+ options2,
+ cb2,
+ startTime
+ ));
+ } : function go$readdir2(path6, options2, cb2, startTime) {
+ return fs$readdir(path6, options2, fs$readdirCallback(
+ path6,
+ options2,
+ cb2,
+ startTime
+ ));
+ };
+ return go$readdir(path5, options, cb);
+ function fs$readdirCallback(path6, options2, cb2, startTime) {
+ return function(err, files) {
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+ enqueue([
+ go$readdir,
+ [path6, options2, cb2],
+ err,
+ startTime || Date.now(),
+ Date.now()
+ ]);
+ else {
+ if (files && files.sort)
+ files.sort();
+ if (typeof cb2 === "function")
+ cb2.call(this, err, files);
+ }
+ };
+ }
+ }
+ if (process.version.substr(0, 4) === "v0.8") {
+ var legStreams = legacy(fs4);
+ ReadStream = legStreams.ReadStream;
+ WriteStream = legStreams.WriteStream;
+ }
+ var fs$ReadStream = fs4.ReadStream;
+ if (fs$ReadStream) {
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype);
+ ReadStream.prototype.open = ReadStream$open;
+ }
+ var fs$WriteStream = fs4.WriteStream;
+ if (fs$WriteStream) {
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype);
+ WriteStream.prototype.open = WriteStream$open;
+ }
+ Object.defineProperty(fs4, "ReadStream", {
+ get: function() {
+ return ReadStream;
+ },
+ set: function(val) {
+ ReadStream = val;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ Object.defineProperty(fs4, "WriteStream", {
+ get: function() {
+ return WriteStream;
+ },
+ set: function(val) {
+ WriteStream = val;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ var FileReadStream = ReadStream;
+ Object.defineProperty(fs4, "FileReadStream", {
+ get: function() {
+ return FileReadStream;
+ },
+ set: function(val) {
+ FileReadStream = val;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ var FileWriteStream = WriteStream;
+ Object.defineProperty(fs4, "FileWriteStream", {
+ get: function() {
+ return FileWriteStream;
+ },
+ set: function(val) {
+ FileWriteStream = val;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ function ReadStream(path5, options) {
+ if (this instanceof ReadStream)
+ return fs$ReadStream.apply(this, arguments), this;
+ else
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
+ }
+ function ReadStream$open() {
+ var that = this;
+ open(that.path, that.flags, that.mode, function(err, fd) {
+ if (err) {
+ if (that.autoClose)
+ that.destroy();
+ that.emit("error", err);
+ } else {
+ that.fd = fd;
+ that.emit("open", fd);
+ that.read();
+ }
+ });
+ }
+ function WriteStream(path5, options) {
+ if (this instanceof WriteStream)
+ return fs$WriteStream.apply(this, arguments), this;
+ else
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
+ }
+ function WriteStream$open() {
+ var that = this;
+ open(that.path, that.flags, that.mode, function(err, fd) {
+ if (err) {
+ that.destroy();
+ that.emit("error", err);
+ } else {
+ that.fd = fd;
+ that.emit("open", fd);
+ }
+ });
+ }
+ function createReadStream(path5, options) {
+ return new fs4.ReadStream(path5, options);
+ }
+ function createWriteStream(path5, options) {
+ return new fs4.WriteStream(path5, options);
+ }
+ var fs$open = fs4.open;
+ fs4.open = open;
+ function open(path5, flags, mode, cb) {
+ if (typeof mode === "function")
+ cb = mode, mode = null;
+ return go$open(path5, flags, mode, cb);
+ function go$open(path6, flags2, mode2, cb2, startTime) {
+ return fs$open(path6, flags2, mode2, function(err, fd) {
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+ enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
+ else {
+ if (typeof cb2 === "function")
+ cb2.apply(this, arguments);
+ }
+ });
+ }
+ }
+ return fs4;
+ }
+ function enqueue(elem) {
+ debug4("ENQUEUE", elem[0].name, elem[1]);
+ fs3[gracefulQueue].push(elem);
+ retry();
+ }
+ var retryTimer;
+ function resetQueue() {
+ var now = Date.now();
+ for (var i = 0; i < fs3[gracefulQueue].length; ++i) {
+ if (fs3[gracefulQueue][i].length > 2) {
+ fs3[gracefulQueue][i][3] = now;
+ fs3[gracefulQueue][i][4] = now;
+ }
+ }
+ retry();
+ }
+ function retry() {
+ clearTimeout(retryTimer);
+ retryTimer = void 0;
+ if (fs3[gracefulQueue].length === 0)
+ return;
+ var elem = fs3[gracefulQueue].shift();
+ var fn = elem[0];
+ var args = elem[1];
+ var err = elem[2];
+ var startTime = elem[3];
+ var lastTime = elem[4];
+ if (startTime === void 0) {
+ debug4("RETRY", fn.name, args);
+ fn.apply(null, args);
+ } else if (Date.now() - startTime >= 6e4) {
+ debug4("TIMEOUT", fn.name, args);
+ var cb = args.pop();
+ if (typeof cb === "function")
+ cb.call(null, err);
+ } else {
+ var sinceAttempt = Date.now() - lastTime;
+ var sinceStart = Math.max(lastTime - startTime, 1);
+ var desiredDelay = Math.min(sinceStart * 1.2, 100);
+ if (sinceAttempt >= desiredDelay) {
+ debug4("RETRY", fn.name, args);
+ fn.apply(null, args.concat([startTime]));
+ } else {
+ fs3[gracefulQueue].push(elem);
+ }
+ }
+ if (retryTimer === void 0) {
+ retryTimer = setTimeout(retry, 0);
+ }
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js
+var require_fs = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js"(exports2) {
+ "use strict";
+ var u = require_universalify().fromCallback;
+ var fs3 = require_graceful_fs();
+ var api = [
+ "access",
+ "appendFile",
+ "chmod",
+ "chown",
+ "close",
+ "copyFile",
+ "fchmod",
+ "fchown",
+ "fdatasync",
+ "fstat",
+ "fsync",
+ "ftruncate",
+ "futimes",
+ "lchmod",
+ "lchown",
+ "link",
+ "lstat",
+ "mkdir",
+ "mkdtemp",
+ "open",
+ "opendir",
+ "readdir",
+ "readFile",
+ "readlink",
+ "realpath",
+ "rename",
+ "rm",
+ "rmdir",
+ "stat",
+ "symlink",
+ "truncate",
+ "unlink",
+ "utimes",
+ "writeFile"
+ ].filter((key) => {
+ return typeof fs3[key] === "function";
+ });
+ Object.assign(exports2, fs3);
+ api.forEach((method2) => {
+ exports2[method2] = u(fs3[method2]);
+ });
+ exports2.exists = function(filename, callback) {
+ if (typeof callback === "function") {
+ return fs3.exists(filename, callback);
+ }
+ return new Promise((resolve) => {
+ return fs3.exists(filename, resolve);
+ });
+ };
+ exports2.read = function(fd, buffer2, offset, length, position, callback) {
+ if (typeof callback === "function") {
+ return fs3.read(fd, buffer2, offset, length, position, callback);
+ }
+ return new Promise((resolve, reject) => {
+ fs3.read(fd, buffer2, offset, length, position, (err, bytesRead, buffer3) => {
+ if (err) return reject(err);
+ resolve({ bytesRead, buffer: buffer3 });
+ });
+ });
+ };
+ exports2.write = function(fd, buffer2, ...args) {
+ if (typeof args[args.length - 1] === "function") {
+ return fs3.write(fd, buffer2, ...args);
+ }
+ return new Promise((resolve, reject) => {
+ fs3.write(fd, buffer2, ...args, (err, bytesWritten, buffer3) => {
+ if (err) return reject(err);
+ resolve({ bytesWritten, buffer: buffer3 });
+ });
+ });
+ };
+ exports2.readv = function(fd, buffers, ...args) {
+ if (typeof args[args.length - 1] === "function") {
+ return fs3.readv(fd, buffers, ...args);
+ }
+ return new Promise((resolve, reject) => {
+ fs3.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
+ if (err) return reject(err);
+ resolve({ bytesRead, buffers: buffers2 });
+ });
+ });
+ };
+ exports2.writev = function(fd, buffers, ...args) {
+ if (typeof args[args.length - 1] === "function") {
+ return fs3.writev(fd, buffers, ...args);
+ }
+ return new Promise((resolve, reject) => {
+ fs3.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
+ if (err) return reject(err);
+ resolve({ bytesWritten, buffers: buffers2 });
+ });
+ });
+ };
+ if (typeof fs3.realpath.native === "function") {
+ exports2.realpath.native = u(fs3.realpath.native);
+ } else {
+ process.emitWarning(
+ "fs.realpath.native is not a function. Is fs being monkey-patched?",
+ "Warning",
+ "fs-extra-WARN0003"
+ );
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js
+var require_utils = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
+ "use strict";
+ var path5 = require("path");
+ module2.exports.checkPath = function checkPath(pth) {
+ if (process.platform === "win32") {
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
+ if (pathHasInvalidWinCharacters) {
+ const error = new Error(`Path contains invalid characters: ${pth}`);
+ error.code = "EINVAL";
+ throw error;
+ }
+ }
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js
+var require_make_dir = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_fs();
+ var { checkPath } = require_utils();
+ var getMode = (options) => {
+ const defaults = { mode: 511 };
+ if (typeof options === "number") return options;
+ return { ...defaults, ...options }.mode;
+ };
+ module2.exports.makeDir = async (dir, options) => {
+ checkPath(dir);
+ return fs3.mkdir(dir, {
+ mode: getMode(options),
+ recursive: true
+ });
+ };
+ module2.exports.makeDirSync = (dir, options) => {
+ checkPath(dir);
+ return fs3.mkdirSync(dir, {
+ mode: getMode(options),
+ recursive: true
+ });
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js
+var require_mkdirs = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromPromise;
+ var { makeDir: _makeDir, makeDirSync } = require_make_dir();
+ var makeDir = u(_makeDir);
+ module2.exports = {
+ mkdirs: makeDir,
+ mkdirsSync: makeDirSync,
+ // alias
+ mkdirp: makeDir,
+ mkdirpSync: makeDirSync,
+ ensureDir: makeDir,
+ ensureDirSync: makeDirSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js
+var require_path_exists = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromPromise;
+ var fs3 = require_fs();
+ function pathExists2(path5) {
+ return fs3.access(path5).then(() => true).catch(() => false);
+ }
+ module2.exports = {
+ pathExists: u(pathExists2),
+ pathExistsSync: fs3.existsSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js
+var require_utimes = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_graceful_fs();
+ function utimesMillis(path5, atime, mtime, callback) {
+ fs3.open(path5, "r+", (err, fd) => {
+ if (err) return callback(err);
+ fs3.futimes(fd, atime, mtime, (futimesErr) => {
+ fs3.close(fd, (closeErr) => {
+ if (callback) callback(futimesErr || closeErr);
+ });
+ });
+ });
+ }
+ function utimesMillisSync(path5, atime, mtime) {
+ const fd = fs3.openSync(path5, "r+");
+ fs3.futimesSync(fd, atime, mtime);
+ return fs3.closeSync(fd);
+ }
+ module2.exports = {
+ utimesMillis,
+ utimesMillisSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js
+var require_stat = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_fs();
+ var path5 = require("path");
+ var util2 = require("util");
+ function getStats(src, dest, opts) {
+ const statFunc = opts.dereference ? (file2) => fs3.stat(file2, { bigint: true }) : (file2) => fs3.lstat(file2, { bigint: true });
+ return Promise.all([
+ statFunc(src),
+ statFunc(dest).catch((err) => {
+ if (err.code === "ENOENT") return null;
+ throw err;
+ })
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
+ }
+ function getStatsSync(src, dest, opts) {
+ let destStat;
+ const statFunc = opts.dereference ? (file2) => fs3.statSync(file2, { bigint: true }) : (file2) => fs3.lstatSync(file2, { bigint: true });
+ const srcStat = statFunc(src);
+ try {
+ destStat = statFunc(dest);
+ } catch (err) {
+ if (err.code === "ENOENT") return { srcStat, destStat: null };
+ throw err;
+ }
+ return { srcStat, destStat };
+ }
+ function checkPaths(src, dest, funcName, opts, cb) {
+ util2.callbackify(getStats)(src, dest, opts, (err, stats) => {
+ if (err) return cb(err);
+ const { srcStat, destStat } = stats;
+ if (destStat) {
+ if (areIdentical(srcStat, destStat)) {
+ const srcBaseName = path5.basename(src);
+ const destBaseName = path5.basename(dest);
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+ return cb(null, { srcStat, destStat, isChangingCase: true });
+ }
+ return cb(new Error("Source and destination must not be the same."));
+ }
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
+ return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));
+ }
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
+ return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`));
+ }
+ }
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
+ return cb(new Error(errMsg(src, dest, funcName)));
+ }
+ return cb(null, { srcStat, destStat });
+ });
+ }
+ function checkPathsSync(src, dest, funcName, opts) {
+ const { srcStat, destStat } = getStatsSync(src, dest, opts);
+ if (destStat) {
+ if (areIdentical(srcStat, destStat)) {
+ const srcBaseName = path5.basename(src);
+ const destBaseName = path5.basename(dest);
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+ return { srcStat, destStat, isChangingCase: true };
+ }
+ throw new Error("Source and destination must not be the same.");
+ }
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
+ }
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
+ }
+ }
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
+ throw new Error(errMsg(src, dest, funcName));
+ }
+ return { srcStat, destStat };
+ }
+ function checkParentPaths(src, srcStat, dest, funcName, cb) {
+ const srcParent = path5.resolve(path5.dirname(src));
+ const destParent = path5.resolve(path5.dirname(dest));
+ if (destParent === srcParent || destParent === path5.parse(destParent).root) return cb();
+ fs3.stat(destParent, { bigint: true }, (err, destStat) => {
+ if (err) {
+ if (err.code === "ENOENT") return cb();
+ return cb(err);
+ }
+ if (areIdentical(srcStat, destStat)) {
+ return cb(new Error(errMsg(src, dest, funcName)));
+ }
+ return checkParentPaths(src, srcStat, destParent, funcName, cb);
+ });
+ }
+ function checkParentPathsSync(src, srcStat, dest, funcName) {
+ const srcParent = path5.resolve(path5.dirname(src));
+ const destParent = path5.resolve(path5.dirname(dest));
+ if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
+ let destStat;
+ try {
+ destStat = fs3.statSync(destParent, { bigint: true });
+ } catch (err) {
+ if (err.code === "ENOENT") return;
+ throw err;
+ }
+ if (areIdentical(srcStat, destStat)) {
+ throw new Error(errMsg(src, dest, funcName));
+ }
+ return checkParentPathsSync(src, srcStat, destParent, funcName);
+ }
+ function areIdentical(srcStat, destStat) {
+ return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
+ }
+ function isSrcSubdir(src, dest) {
+ const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
+ const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
+ return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true);
+ }
+ function errMsg(src, dest, funcName) {
+ return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
+ }
+ module2.exports = {
+ checkPaths,
+ checkPathsSync,
+ checkParentPaths,
+ checkParentPathsSync,
+ isSrcSubdir,
+ areIdentical
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js
+var require_copy = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_graceful_fs();
+ var path5 = require("path");
+ var mkdirs = require_mkdirs().mkdirs;
+ var pathExists2 = require_path_exists().pathExists;
+ var utimesMillis = require_utimes().utimesMillis;
+ var stat = require_stat();
+ function copy(src, dest, opts, cb) {
+ if (typeof opts === "function" && !cb) {
+ cb = opts;
+ opts = {};
+ } else if (typeof opts === "function") {
+ opts = { filter: opts };
+ }
+ cb = cb || function() {
+ };
+ opts = opts || {};
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
+ if (opts.preserveTimestamps && process.arch === "ia32") {
+ process.emitWarning(
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
+ "Warning",
+ "fs-extra-WARN0001"
+ );
+ }
+ stat.checkPaths(src, dest, "copy", opts, (err, stats) => {
+ if (err) return cb(err);
+ const { srcStat, destStat } = stats;
+ stat.checkParentPaths(src, srcStat, dest, "copy", (err2) => {
+ if (err2) return cb(err2);
+ runFilter(src, dest, opts, (err3, include) => {
+ if (err3) return cb(err3);
+ if (!include) return cb();
+ checkParentDir(destStat, src, dest, opts, cb);
+ });
+ });
+ });
+ }
+ function checkParentDir(destStat, src, dest, opts, cb) {
+ const destParent = path5.dirname(dest);
+ pathExists2(destParent, (err, dirExists) => {
+ if (err) return cb(err);
+ if (dirExists) return getStats(destStat, src, dest, opts, cb);
+ mkdirs(destParent, (err2) => {
+ if (err2) return cb(err2);
+ return getStats(destStat, src, dest, opts, cb);
+ });
+ });
+ }
+ function runFilter(src, dest, opts, cb) {
+ if (!opts.filter) return cb(null, true);
+ Promise.resolve(opts.filter(src, dest)).then((include) => cb(null, include), (error) => cb(error));
+ }
+ function getStats(destStat, src, dest, opts, cb) {
+ const stat2 = opts.dereference ? fs3.stat : fs3.lstat;
+ stat2(src, (err, srcStat) => {
+ if (err) return cb(err);
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb);
+ else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb);
+ else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb);
+ else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`));
+ else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`));
+ return cb(new Error(`Unknown file: ${src}`));
+ });
+ }
+ function onFile(srcStat, destStat, src, dest, opts, cb) {
+ if (!destStat) return copyFile(srcStat, src, dest, opts, cb);
+ return mayCopyFile(srcStat, src, dest, opts, cb);
+ }
+ function mayCopyFile(srcStat, src, dest, opts, cb) {
+ if (opts.overwrite) {
+ fs3.unlink(dest, (err) => {
+ if (err) return cb(err);
+ return copyFile(srcStat, src, dest, opts, cb);
+ });
+ } else if (opts.errorOnExist) {
+ return cb(new Error(`'${dest}' already exists`));
+ } else return cb();
+ }
+ function copyFile(srcStat, src, dest, opts, cb) {
+ fs3.copyFile(src, dest, (err) => {
+ if (err) return cb(err);
+ if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb);
+ return setDestMode(dest, srcStat.mode, cb);
+ });
+ }
+ function handleTimestampsAndMode(srcMode, src, dest, cb) {
+ if (fileIsNotWritable(srcMode)) {
+ return makeFileWritable(dest, srcMode, (err) => {
+ if (err) return cb(err);
+ return setDestTimestampsAndMode(srcMode, src, dest, cb);
+ });
+ }
+ return setDestTimestampsAndMode(srcMode, src, dest, cb);
+ }
+ function fileIsNotWritable(srcMode) {
+ return (srcMode & 128) === 0;
+ }
+ function makeFileWritable(dest, srcMode, cb) {
+ return setDestMode(dest, srcMode | 128, cb);
+ }
+ function setDestTimestampsAndMode(srcMode, src, dest, cb) {
+ setDestTimestamps(src, dest, (err) => {
+ if (err) return cb(err);
+ return setDestMode(dest, srcMode, cb);
+ });
+ }
+ function setDestMode(dest, srcMode, cb) {
+ return fs3.chmod(dest, srcMode, cb);
+ }
+ function setDestTimestamps(src, dest, cb) {
+ fs3.stat(src, (err, updatedSrcStat) => {
+ if (err) return cb(err);
+ return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
+ });
+ }
+ function onDir(srcStat, destStat, src, dest, opts, cb) {
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb);
+ return copyDir(src, dest, opts, cb);
+ }
+ function mkDirAndCopy(srcMode, src, dest, opts, cb) {
+ fs3.mkdir(dest, (err) => {
+ if (err) return cb(err);
+ copyDir(src, dest, opts, (err2) => {
+ if (err2) return cb(err2);
+ return setDestMode(dest, srcMode, cb);
+ });
+ });
+ }
+ function copyDir(src, dest, opts, cb) {
+ fs3.readdir(src, (err, items) => {
+ if (err) return cb(err);
+ return copyDirItems(items, src, dest, opts, cb);
+ });
+ }
+ function copyDirItems(items, src, dest, opts, cb) {
+ const item = items.pop();
+ if (!item) return cb();
+ return copyDirItem(items, item, src, dest, opts, cb);
+ }
+ function copyDirItem(items, item, src, dest, opts, cb) {
+ const srcItem = path5.join(src, item);
+ const destItem = path5.join(dest, item);
+ runFilter(srcItem, destItem, opts, (err, include) => {
+ if (err) return cb(err);
+ if (!include) return copyDirItems(items, src, dest, opts, cb);
+ stat.checkPaths(srcItem, destItem, "copy", opts, (err2, stats) => {
+ if (err2) return cb(err2);
+ const { destStat } = stats;
+ getStats(destStat, srcItem, destItem, opts, (err3) => {
+ if (err3) return cb(err3);
+ return copyDirItems(items, src, dest, opts, cb);
+ });
+ });
+ });
+ }
+ function onLink(destStat, src, dest, opts, cb) {
+ fs3.readlink(src, (err, resolvedSrc) => {
+ if (err) return cb(err);
+ if (opts.dereference) {
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
+ }
+ if (!destStat) {
+ return fs3.symlink(resolvedSrc, dest, cb);
+ } else {
+ fs3.readlink(dest, (err2, resolvedDest) => {
+ if (err2) {
+ if (err2.code === "EINVAL" || err2.code === "UNKNOWN") return fs3.symlink(resolvedSrc, dest, cb);
+ return cb(err2);
+ }
+ if (opts.dereference) {
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
+ }
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
+ return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
+ }
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
+ return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
+ }
+ return copyLink(resolvedSrc, dest, cb);
+ });
+ }
+ });
+ }
+ function copyLink(resolvedSrc, dest, cb) {
+ fs3.unlink(dest, (err) => {
+ if (err) return cb(err);
+ return fs3.symlink(resolvedSrc, dest, cb);
+ });
+ }
+ module2.exports = copy;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js
+var require_copy_sync = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_graceful_fs();
+ var path5 = require("path");
+ var mkdirsSync = require_mkdirs().mkdirsSync;
+ var utimesMillisSync = require_utimes().utimesMillisSync;
+ var stat = require_stat();
+ function copySync(src, dest, opts) {
+ if (typeof opts === "function") {
+ opts = { filter: opts };
+ }
+ opts = opts || {};
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
+ if (opts.preserveTimestamps && process.arch === "ia32") {
+ process.emitWarning(
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
+ "Warning",
+ "fs-extra-WARN0002"
+ );
+ }
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
+ stat.checkParentPathsSync(src, srcStat, dest, "copy");
+ if (opts.filter && !opts.filter(src, dest)) return;
+ const destParent = path5.dirname(dest);
+ if (!fs3.existsSync(destParent)) mkdirsSync(destParent);
+ return getStats(destStat, src, dest, opts);
+ }
+ function getStats(destStat, src, dest, opts) {
+ const statSync = opts.dereference ? fs3.statSync : fs3.lstatSync;
+ const srcStat = statSync(src);
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
+ else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
+ else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
+ else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
+ else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
+ throw new Error(`Unknown file: ${src}`);
+ }
+ function onFile(srcStat, destStat, src, dest, opts) {
+ if (!destStat) return copyFile(srcStat, src, dest, opts);
+ return mayCopyFile(srcStat, src, dest, opts);
+ }
+ function mayCopyFile(srcStat, src, dest, opts) {
+ if (opts.overwrite) {
+ fs3.unlinkSync(dest);
+ return copyFile(srcStat, src, dest, opts);
+ } else if (opts.errorOnExist) {
+ throw new Error(`'${dest}' already exists`);
+ }
+ }
+ function copyFile(srcStat, src, dest, opts) {
+ fs3.copyFileSync(src, dest);
+ if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
+ return setDestMode(dest, srcStat.mode);
+ }
+ function handleTimestamps(srcMode, src, dest) {
+ if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
+ return setDestTimestamps(src, dest);
+ }
+ function fileIsNotWritable(srcMode) {
+ return (srcMode & 128) === 0;
+ }
+ function makeFileWritable(dest, srcMode) {
+ return setDestMode(dest, srcMode | 128);
+ }
+ function setDestMode(dest, srcMode) {
+ return fs3.chmodSync(dest, srcMode);
+ }
+ function setDestTimestamps(src, dest) {
+ const updatedSrcStat = fs3.statSync(src);
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
+ }
+ function onDir(srcStat, destStat, src, dest, opts) {
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
+ return copyDir(src, dest, opts);
+ }
+ function mkDirAndCopy(srcMode, src, dest, opts) {
+ fs3.mkdirSync(dest);
+ copyDir(src, dest, opts);
+ return setDestMode(dest, srcMode);
+ }
+ function copyDir(src, dest, opts) {
+ fs3.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
+ }
+ function copyDirItem(item, src, dest, opts) {
+ const srcItem = path5.join(src, item);
+ const destItem = path5.join(dest, item);
+ if (opts.filter && !opts.filter(srcItem, destItem)) return;
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
+ return getStats(destStat, srcItem, destItem, opts);
+ }
+ function onLink(destStat, src, dest, opts) {
+ let resolvedSrc = fs3.readlinkSync(src);
+ if (opts.dereference) {
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
+ }
+ if (!destStat) {
+ return fs3.symlinkSync(resolvedSrc, dest);
+ } else {
+ let resolvedDest;
+ try {
+ resolvedDest = fs3.readlinkSync(dest);
+ } catch (err) {
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs3.symlinkSync(resolvedSrc, dest);
+ throw err;
+ }
+ if (opts.dereference) {
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
+ }
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
+ }
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
+ }
+ return copyLink(resolvedSrc, dest);
+ }
+ }
+ function copyLink(resolvedSrc, dest) {
+ fs3.unlinkSync(dest);
+ return fs3.symlinkSync(resolvedSrc, dest);
+ }
+ module2.exports = copySync;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js
+var require_copy2 = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromCallback;
+ module2.exports = {
+ copy: u(require_copy()),
+ copySync: require_copy_sync()
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js
+var require_remove = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_graceful_fs();
+ var u = require_universalify().fromCallback;
+ function remove(path5, callback) {
+ fs3.rm(path5, { recursive: true, force: true }, callback);
+ }
+ function removeSync(path5) {
+ fs3.rmSync(path5, { recursive: true, force: true });
+ }
+ module2.exports = {
+ remove: u(remove),
+ removeSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js
+var require_empty = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromPromise;
+ var fs3 = require_fs();
+ var path5 = require("path");
+ var mkdir = require_mkdirs();
+ var remove = require_remove();
+ var emptyDir = u(async function emptyDir2(dir) {
+ let items;
+ try {
+ items = await fs3.readdir(dir);
+ } catch {
+ return mkdir.mkdirs(dir);
+ }
+ return Promise.all(items.map((item) => remove.remove(path5.join(dir, item))));
+ });
+ function emptyDirSync(dir) {
+ let items;
+ try {
+ items = fs3.readdirSync(dir);
+ } catch {
+ return mkdir.mkdirsSync(dir);
+ }
+ items.forEach((item) => {
+ item = path5.join(dir, item);
+ remove.removeSync(item);
+ });
+ }
+ module2.exports = {
+ emptyDirSync,
+ emptydirSync: emptyDirSync,
+ emptyDir,
+ emptydir: emptyDir
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js
+var require_file = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromCallback;
+ var path5 = require("path");
+ var fs3 = require_graceful_fs();
+ var mkdir = require_mkdirs();
+ function createFile(file2, callback) {
+ function makeFile() {
+ fs3.writeFile(file2, "", (err) => {
+ if (err) return callback(err);
+ callback();
+ });
+ }
+ fs3.stat(file2, (err, stats) => {
+ if (!err && stats.isFile()) return callback();
+ const dir = path5.dirname(file2);
+ fs3.stat(dir, (err2, stats2) => {
+ if (err2) {
+ if (err2.code === "ENOENT") {
+ return mkdir.mkdirs(dir, (err3) => {
+ if (err3) return callback(err3);
+ makeFile();
+ });
+ }
+ return callback(err2);
+ }
+ if (stats2.isDirectory()) makeFile();
+ else {
+ fs3.readdir(dir, (err3) => {
+ if (err3) return callback(err3);
+ });
+ }
+ });
+ });
+ }
+ function createFileSync(file2) {
+ let stats;
+ try {
+ stats = fs3.statSync(file2);
+ } catch {
+ }
+ if (stats && stats.isFile()) return;
+ const dir = path5.dirname(file2);
+ try {
+ if (!fs3.statSync(dir).isDirectory()) {
+ fs3.readdirSync(dir);
+ }
+ } catch (err) {
+ if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
+ else throw err;
+ }
+ fs3.writeFileSync(file2, "");
+ }
+ module2.exports = {
+ createFile: u(createFile),
+ createFileSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js
+var require_link = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromCallback;
+ var path5 = require("path");
+ var fs3 = require_graceful_fs();
+ var mkdir = require_mkdirs();
+ var pathExists2 = require_path_exists().pathExists;
+ var { areIdentical } = require_stat();
+ function createLink(srcpath, dstpath, callback) {
+ function makeLink(srcpath2, dstpath2) {
+ fs3.link(srcpath2, dstpath2, (err) => {
+ if (err) return callback(err);
+ callback(null);
+ });
+ }
+ fs3.lstat(dstpath, (_, dstStat) => {
+ fs3.lstat(srcpath, (err, srcStat) => {
+ if (err) {
+ err.message = err.message.replace("lstat", "ensureLink");
+ return callback(err);
+ }
+ if (dstStat && areIdentical(srcStat, dstStat)) return callback(null);
+ const dir = path5.dirname(dstpath);
+ pathExists2(dir, (err2, dirExists) => {
+ if (err2) return callback(err2);
+ if (dirExists) return makeLink(srcpath, dstpath);
+ mkdir.mkdirs(dir, (err3) => {
+ if (err3) return callback(err3);
+ makeLink(srcpath, dstpath);
+ });
+ });
+ });
+ });
+ }
+ function createLinkSync(srcpath, dstpath) {
+ let dstStat;
+ try {
+ dstStat = fs3.lstatSync(dstpath);
+ } catch {
+ }
+ try {
+ const srcStat = fs3.lstatSync(srcpath);
+ if (dstStat && areIdentical(srcStat, dstStat)) return;
+ } catch (err) {
+ err.message = err.message.replace("lstat", "ensureLink");
+ throw err;
+ }
+ const dir = path5.dirname(dstpath);
+ const dirExists = fs3.existsSync(dir);
+ if (dirExists) return fs3.linkSync(srcpath, dstpath);
+ mkdir.mkdirsSync(dir);
+ return fs3.linkSync(srcpath, dstpath);
+ }
+ module2.exports = {
+ createLink: u(createLink),
+ createLinkSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js
+var require_symlink_paths = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
+ "use strict";
+ var path5 = require("path");
+ var fs3 = require_graceful_fs();
+ var pathExists2 = require_path_exists().pathExists;
+ function symlinkPaths(srcpath, dstpath, callback) {
+ if (path5.isAbsolute(srcpath)) {
+ return fs3.lstat(srcpath, (err) => {
+ if (err) {
+ err.message = err.message.replace("lstat", "ensureSymlink");
+ return callback(err);
+ }
+ return callback(null, {
+ toCwd: srcpath,
+ toDst: srcpath
+ });
+ });
+ } else {
+ const dstdir = path5.dirname(dstpath);
+ const relativeToDst = path5.join(dstdir, srcpath);
+ return pathExists2(relativeToDst, (err, exists) => {
+ if (err) return callback(err);
+ if (exists) {
+ return callback(null, {
+ toCwd: relativeToDst,
+ toDst: srcpath
+ });
+ } else {
+ return fs3.lstat(srcpath, (err2) => {
+ if (err2) {
+ err2.message = err2.message.replace("lstat", "ensureSymlink");
+ return callback(err2);
+ }
+ return callback(null, {
+ toCwd: srcpath,
+ toDst: path5.relative(dstdir, srcpath)
+ });
+ });
+ }
+ });
+ }
+ }
+ function symlinkPathsSync(srcpath, dstpath) {
+ let exists;
+ if (path5.isAbsolute(srcpath)) {
+ exists = fs3.existsSync(srcpath);
+ if (!exists) throw new Error("absolute srcpath does not exist");
+ return {
+ toCwd: srcpath,
+ toDst: srcpath
+ };
+ } else {
+ const dstdir = path5.dirname(dstpath);
+ const relativeToDst = path5.join(dstdir, srcpath);
+ exists = fs3.existsSync(relativeToDst);
+ if (exists) {
+ return {
+ toCwd: relativeToDst,
+ toDst: srcpath
+ };
+ } else {
+ exists = fs3.existsSync(srcpath);
+ if (!exists) throw new Error("relative srcpath does not exist");
+ return {
+ toCwd: srcpath,
+ toDst: path5.relative(dstdir, srcpath)
+ };
+ }
+ }
+ }
+ module2.exports = {
+ symlinkPaths,
+ symlinkPathsSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js
+var require_symlink_type = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_graceful_fs();
+ function symlinkType(srcpath, type, callback) {
+ callback = typeof type === "function" ? type : callback;
+ type = typeof type === "function" ? false : type;
+ if (type) return callback(null, type);
+ fs3.lstat(srcpath, (err, stats) => {
+ if (err) return callback(null, "file");
+ type = stats && stats.isDirectory() ? "dir" : "file";
+ callback(null, type);
+ });
+ }
+ function symlinkTypeSync(srcpath, type) {
+ let stats;
+ if (type) return type;
+ try {
+ stats = fs3.lstatSync(srcpath);
+ } catch {
+ return "file";
+ }
+ return stats && stats.isDirectory() ? "dir" : "file";
+ }
+ module2.exports = {
+ symlinkType,
+ symlinkTypeSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js
+var require_symlink = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromCallback;
+ var path5 = require("path");
+ var fs3 = require_fs();
+ var _mkdirs = require_mkdirs();
+ var mkdirs = _mkdirs.mkdirs;
+ var mkdirsSync = _mkdirs.mkdirsSync;
+ var _symlinkPaths = require_symlink_paths();
+ var symlinkPaths = _symlinkPaths.symlinkPaths;
+ var symlinkPathsSync = _symlinkPaths.symlinkPathsSync;
+ var _symlinkType = require_symlink_type();
+ var symlinkType = _symlinkType.symlinkType;
+ var symlinkTypeSync = _symlinkType.symlinkTypeSync;
+ var pathExists2 = require_path_exists().pathExists;
+ var { areIdentical } = require_stat();
+ function createSymlink(srcpath, dstpath, type, callback) {
+ callback = typeof type === "function" ? type : callback;
+ type = typeof type === "function" ? false : type;
+ fs3.lstat(dstpath, (err, stats) => {
+ if (!err && stats.isSymbolicLink()) {
+ Promise.all([
+ fs3.stat(srcpath),
+ fs3.stat(dstpath)
+ ]).then(([srcStat, dstStat]) => {
+ if (areIdentical(srcStat, dstStat)) return callback(null);
+ _createSymlink(srcpath, dstpath, type, callback);
+ });
+ } else _createSymlink(srcpath, dstpath, type, callback);
+ });
+ }
+ function _createSymlink(srcpath, dstpath, type, callback) {
+ symlinkPaths(srcpath, dstpath, (err, relative) => {
+ if (err) return callback(err);
+ srcpath = relative.toDst;
+ symlinkType(relative.toCwd, type, (err2, type2) => {
+ if (err2) return callback(err2);
+ const dir = path5.dirname(dstpath);
+ pathExists2(dir, (err3, dirExists) => {
+ if (err3) return callback(err3);
+ if (dirExists) return fs3.symlink(srcpath, dstpath, type2, callback);
+ mkdirs(dir, (err4) => {
+ if (err4) return callback(err4);
+ fs3.symlink(srcpath, dstpath, type2, callback);
+ });
+ });
+ });
+ });
+ }
+ function createSymlinkSync(srcpath, dstpath, type) {
+ let stats;
+ try {
+ stats = fs3.lstatSync(dstpath);
+ } catch {
+ }
+ if (stats && stats.isSymbolicLink()) {
+ const srcStat = fs3.statSync(srcpath);
+ const dstStat = fs3.statSync(dstpath);
+ if (areIdentical(srcStat, dstStat)) return;
+ }
+ const relative = symlinkPathsSync(srcpath, dstpath);
+ srcpath = relative.toDst;
+ type = symlinkTypeSync(relative.toCwd, type);
+ const dir = path5.dirname(dstpath);
+ const exists = fs3.existsSync(dir);
+ if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
+ mkdirsSync(dir);
+ return fs3.symlinkSync(srcpath, dstpath, type);
+ }
+ module2.exports = {
+ createSymlink: u(createSymlink),
+ createSymlinkSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js
+var require_ensure = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) {
+ "use strict";
+ var { createFile, createFileSync } = require_file();
+ var { createLink, createLinkSync } = require_link();
+ var { createSymlink, createSymlinkSync } = require_symlink();
+ module2.exports = {
+ // file
+ createFile,
+ createFileSync,
+ ensureFile: createFile,
+ ensureFileSync: createFileSync,
+ // link
+ createLink,
+ createLinkSync,
+ ensureLink: createLink,
+ ensureLinkSync: createLinkSync,
+ // symlink
+ createSymlink,
+ createSymlinkSync,
+ ensureSymlink: createSymlink,
+ ensureSymlinkSync: createSymlinkSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
+var require_utils2 = __commonJS({
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports2, module2) {
+ "use strict";
+ function stringify2(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
+ const EOF = finalEOL ? EOL : "";
+ const str = JSON.stringify(obj, replacer, spaces);
+ return str.replace(/\n/g, EOL) + EOF;
+ }
+ function stripBom(content) {
+ if (Buffer.isBuffer(content)) content = content.toString("utf8");
+ return content.replace(/^\uFEFF/, "");
+ }
+ module2.exports = { stringify: stringify2, stripBom };
+ }
+});
+
+// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
+var require_jsonfile = __commonJS({
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports2, module2) {
+ "use strict";
+ var _fs;
+ try {
+ _fs = require_graceful_fs();
+ } catch (_) {
+ _fs = require("fs");
+ }
+ var universalify = require_universalify();
+ var { stringify: stringify2, stripBom } = require_utils2();
+ async function _readFile(file2, options = {}) {
+ if (typeof options === "string") {
+ options = { encoding: options };
+ }
+ const fs3 = options.fs || _fs;
+ const shouldThrow = "throws" in options ? options.throws : true;
+ let data = await universalify.fromCallback(fs3.readFile)(file2, options);
+ data = stripBom(data);
+ let obj;
+ try {
+ obj = JSON.parse(data, options ? options.reviver : null);
+ } catch (err) {
+ if (shouldThrow) {
+ err.message = `${file2}: ${err.message}`;
+ throw err;
+ } else {
+ return null;
+ }
+ }
+ return obj;
+ }
+ var readFile = universalify.fromPromise(_readFile);
+ function readFileSync(file2, options = {}) {
+ if (typeof options === "string") {
+ options = { encoding: options };
+ }
+ const fs3 = options.fs || _fs;
+ const shouldThrow = "throws" in options ? options.throws : true;
+ try {
+ let content = fs3.readFileSync(file2, options);
+ content = stripBom(content);
+ return JSON.parse(content, options.reviver);
+ } catch (err) {
+ if (shouldThrow) {
+ err.message = `${file2}: ${err.message}`;
+ throw err;
+ } else {
+ return null;
+ }
+ }
+ }
+ async function _writeFile(file2, obj, options = {}) {
+ const fs3 = options.fs || _fs;
+ const str = stringify2(obj, options);
+ await universalify.fromCallback(fs3.writeFile)(file2, str, options);
+ }
+ var writeFile = universalify.fromPromise(_writeFile);
+ function writeFileSync(file2, obj, options = {}) {
+ const fs3 = options.fs || _fs;
+ const str = stringify2(obj, options);
+ return fs3.writeFileSync(file2, str, options);
+ }
+ var jsonfile = {
+ readFile,
+ readFileSync,
+ writeFile,
+ writeFileSync
+ };
+ module2.exports = jsonfile;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js
+var require_jsonfile2 = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) {
+ "use strict";
+ var jsonFile = require_jsonfile();
+ module2.exports = {
+ // jsonfile exports
+ readJson: jsonFile.readFile,
+ readJsonSync: jsonFile.readFileSync,
+ writeJson: jsonFile.writeFile,
+ writeJsonSync: jsonFile.writeFileSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js
+var require_output_file = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromCallback;
+ var fs3 = require_graceful_fs();
+ var path5 = require("path");
+ var mkdir = require_mkdirs();
+ var pathExists2 = require_path_exists().pathExists;
+ function outputFile(file2, data, encoding, callback) {
+ if (typeof encoding === "function") {
+ callback = encoding;
+ encoding = "utf8";
+ }
+ const dir = path5.dirname(file2);
+ pathExists2(dir, (err, itDoes) => {
+ if (err) return callback(err);
+ if (itDoes) return fs3.writeFile(file2, data, encoding, callback);
+ mkdir.mkdirs(dir, (err2) => {
+ if (err2) return callback(err2);
+ fs3.writeFile(file2, data, encoding, callback);
+ });
+ });
+ }
+ function outputFileSync(file2, ...args) {
+ const dir = path5.dirname(file2);
+ if (fs3.existsSync(dir)) {
+ return fs3.writeFileSync(file2, ...args);
+ }
+ mkdir.mkdirsSync(dir);
+ fs3.writeFileSync(file2, ...args);
+ }
+ module2.exports = {
+ outputFile: u(outputFile),
+ outputFileSync
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js
+var require_output_json = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) {
+ "use strict";
+ var { stringify: stringify2 } = require_utils2();
+ var { outputFile } = require_output_file();
+ async function outputJson(file2, data, options = {}) {
+ const str = stringify2(data, options);
+ await outputFile(file2, str, options);
+ }
+ module2.exports = outputJson;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js
+var require_output_json_sync = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) {
+ "use strict";
+ var { stringify: stringify2 } = require_utils2();
+ var { outputFileSync } = require_output_file();
+ function outputJsonSync(file2, data, options) {
+ const str = stringify2(data, options);
+ outputFileSync(file2, str, options);
+ }
+ module2.exports = outputJsonSync;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js
+var require_json = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromPromise;
+ var jsonFile = require_jsonfile2();
+ jsonFile.outputJson = u(require_output_json());
+ jsonFile.outputJsonSync = require_output_json_sync();
+ jsonFile.outputJSON = jsonFile.outputJson;
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync;
+ jsonFile.writeJSON = jsonFile.writeJson;
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync;
+ jsonFile.readJSON = jsonFile.readJson;
+ jsonFile.readJSONSync = jsonFile.readJsonSync;
+ module2.exports = jsonFile;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js
+var require_move = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_graceful_fs();
+ var path5 = require("path");
+ var copy = require_copy2().copy;
+ var remove = require_remove().remove;
+ var mkdirp = require_mkdirs().mkdirp;
+ var pathExists2 = require_path_exists().pathExists;
+ var stat = require_stat();
+ function move(src, dest, opts, cb) {
+ if (typeof opts === "function") {
+ cb = opts;
+ opts = {};
+ }
+ opts = opts || {};
+ const overwrite = opts.overwrite || opts.clobber || false;
+ stat.checkPaths(src, dest, "move", opts, (err, stats) => {
+ if (err) return cb(err);
+ const { srcStat, isChangingCase = false } = stats;
+ stat.checkParentPaths(src, srcStat, dest, "move", (err2) => {
+ if (err2) return cb(err2);
+ if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb);
+ mkdirp(path5.dirname(dest), (err3) => {
+ if (err3) return cb(err3);
+ return doRename(src, dest, overwrite, isChangingCase, cb);
+ });
+ });
+ });
+ }
+ function isParentRoot(dest) {
+ const parent = path5.dirname(dest);
+ const parsedPath = path5.parse(parent);
+ return parsedPath.root === parent;
+ }
+ function doRename(src, dest, overwrite, isChangingCase, cb) {
+ if (isChangingCase) return rename(src, dest, overwrite, cb);
+ if (overwrite) {
+ return remove(dest, (err) => {
+ if (err) return cb(err);
+ return rename(src, dest, overwrite, cb);
+ });
+ }
+ pathExists2(dest, (err, destExists) => {
+ if (err) return cb(err);
+ if (destExists) return cb(new Error("dest already exists."));
+ return rename(src, dest, overwrite, cb);
+ });
+ }
+ function rename(src, dest, overwrite, cb) {
+ fs3.rename(src, dest, (err) => {
+ if (!err) return cb();
+ if (err.code !== "EXDEV") return cb(err);
+ return moveAcrossDevice(src, dest, overwrite, cb);
+ });
+ }
+ function moveAcrossDevice(src, dest, overwrite, cb) {
+ const opts = {
+ overwrite,
+ errorOnExist: true,
+ preserveTimestamps: true
+ };
+ copy(src, dest, opts, (err) => {
+ if (err) return cb(err);
+ return remove(src, cb);
+ });
+ }
+ module2.exports = move;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js
+var require_move_sync = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require_graceful_fs();
+ var path5 = require("path");
+ var copySync = require_copy2().copySync;
+ var removeSync = require_remove().removeSync;
+ var mkdirpSync = require_mkdirs().mkdirpSync;
+ var stat = require_stat();
+ function moveSync(src, dest, opts) {
+ opts = opts || {};
+ const overwrite = opts.overwrite || opts.clobber || false;
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
+ stat.checkParentPathsSync(src, srcStat, dest, "move");
+ if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest));
+ return doRename(src, dest, overwrite, isChangingCase);
+ }
+ function isParentRoot(dest) {
+ const parent = path5.dirname(dest);
+ const parsedPath = path5.parse(parent);
+ return parsedPath.root === parent;
+ }
+ function doRename(src, dest, overwrite, isChangingCase) {
+ if (isChangingCase) return rename(src, dest, overwrite);
+ if (overwrite) {
+ removeSync(dest);
+ return rename(src, dest, overwrite);
+ }
+ if (fs3.existsSync(dest)) throw new Error("dest already exists.");
+ return rename(src, dest, overwrite);
+ }
+ function rename(src, dest, overwrite) {
+ try {
+ fs3.renameSync(src, dest);
+ } catch (err) {
+ if (err.code !== "EXDEV") throw err;
+ return moveAcrossDevice(src, dest, overwrite);
+ }
+ }
+ function moveAcrossDevice(src, dest, overwrite) {
+ const opts = {
+ overwrite,
+ errorOnExist: true,
+ preserveTimestamps: true
+ };
+ copySync(src, dest, opts);
+ return removeSync(src);
+ }
+ module2.exports = moveSync;
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js
+var require_move2 = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js"(exports2, module2) {
+ "use strict";
+ var u = require_universalify().fromCallback;
+ module2.exports = {
+ move: u(require_move()),
+ moveSync: require_move_sync()
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js
+var require_lib = __commonJS({
+ "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js"(exports2, module2) {
+ "use strict";
+ module2.exports = {
+ // Export promiseified graceful-fs:
+ ...require_fs(),
+ // Export extra methods:
+ ...require_copy2(),
+ ...require_empty(),
+ ...require_ensure(),
+ ...require_json(),
+ ...require_mkdirs(),
+ ...require_move2(),
+ ...require_output_file(),
+ ...require_path_exists(),
+ ...require_remove()
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/common-path-prefix@3.0.0/node_modules/common-path-prefix/index.js
+var require_common_path_prefix = __commonJS({
+ "../../node_modules/.pnpm/common-path-prefix@3.0.0/node_modules/common-path-prefix/index.js"(exports2, module2) {
+ "use strict";
+ var { sep: DEFAULT_SEPARATOR } = require("path");
+ var determineSeparator = (paths2) => {
+ for (const path5 of paths2) {
+ const match = /(\/|\\)/.exec(path5);
+ if (match !== null) return match[0];
+ }
+ return DEFAULT_SEPARATOR;
+ };
+ module2.exports = function commonPathPrefix2(paths2, sep = determineSeparator(paths2)) {
+ const [first = "", ...remaining] = paths2;
+ if (first === "" || remaining.length === 0) return "";
+ const parts = first.split(sep);
+ let endOfPrefix = parts.length;
+ for (const path5 of remaining) {
+ const compare = path5.split(sep);
+ for (let i = 0; i < endOfPrefix; i++) {
+ if (compare[i] !== parts[i]) {
+ endOfPrefix = i;
+ }
+ }
+ if (endOfPrefix === 0) return "";
+ }
+ const prefix = parts.slice(0, endOfPrefix).join(sep);
+ return prefix.endsWith(sep) ? prefix : prefix + sep;
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js
+var require_indent_string = __commonJS({
+ "../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports2, module2) {
+ "use strict";
+ module2.exports = (string, count = 1, options) => {
+ options = {
+ indent: " ",
+ includeEmptyLines: false,
+ ...options
+ };
+ if (typeof string !== "string") {
+ throw new TypeError(
+ `Expected \`input\` to be a \`string\`, got \`${typeof string}\``
+ );
+ }
+ if (typeof count !== "number") {
+ throw new TypeError(
+ `Expected \`count\` to be a \`number\`, got \`${typeof count}\``
+ );
+ }
+ if (typeof options.indent !== "string") {
+ throw new TypeError(
+ `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
+ );
+ }
+ if (count === 0) {
+ return string;
+ }
+ const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
+ return string.replace(regex, options.indent.repeat(count));
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js
+var require_identifier = __commonJS({
+ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports2) {
+ "use strict";
+ Object.defineProperty(exports2, "__esModule", {
+ value: true
+ });
+ exports2.isIdentifierChar = isIdentifierChar;
+ exports2.isIdentifierName = isIdentifierName2;
+ exports2.isIdentifierStart = isIdentifierStart;
+ var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
+ var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
+ var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+ var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+ var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
+ var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+ function isInAstralSet(code, set) {
+ let pos = 65536;
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+ return false;
+ }
+ function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+ if (code <= 65535) {
+ return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+ return isInAstralSet(code, astralIdentifierStartCodes);
+ }
+ function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+ if (code <= 65535) {
+ return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+ }
+ function isIdentifierName2(name) {
+ let isFirst = true;
+ for (let i = 0; i < name.length; i++) {
+ let cp = name.charCodeAt(i);
+ if ((cp & 64512) === 55296 && i + 1 < name.length) {
+ const trail = name.charCodeAt(++i);
+ if ((trail & 64512) === 56320) {
+ cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
+ }
+ }
+ if (isFirst) {
+ isFirst = false;
+ if (!isIdentifierStart(cp)) {
+ return false;
+ }
+ } else if (!isIdentifierChar(cp)) {
+ return false;
+ }
+ }
+ return !isFirst;
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js
+var require_keyword = __commonJS({
+ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports2) {
+ "use strict";
+ Object.defineProperty(exports2, "__esModule", {
+ value: true
+ });
+ exports2.isKeyword = isKeyword;
+ exports2.isReservedWord = isReservedWord;
+ exports2.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
+ exports2.isStrictBindReservedWord = isStrictBindReservedWord;
+ exports2.isStrictReservedWord = isStrictReservedWord;
+ var reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+ };
+ var keywords = new Set(reservedWords.keyword);
+ var reservedWordsStrictSet = new Set(reservedWords.strict);
+ var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+ function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+ }
+ function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+ }
+ function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+ }
+ function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+ }
+ function isKeyword(word) {
+ return keywords.has(word);
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/index.js
+var require_lib2 = __commonJS({
+ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/index.js"(exports2) {
+ "use strict";
+ Object.defineProperty(exports2, "__esModule", {
+ value: true
+ });
+ Object.defineProperty(exports2, "isIdentifierChar", {
+ enumerable: true,
+ get: function() {
+ return _identifier.isIdentifierChar;
+ }
+ });
+ Object.defineProperty(exports2, "isIdentifierName", {
+ enumerable: true,
+ get: function() {
+ return _identifier.isIdentifierName;
+ }
+ });
+ Object.defineProperty(exports2, "isIdentifierStart", {
+ enumerable: true,
+ get: function() {
+ return _identifier.isIdentifierStart;
+ }
+ });
+ Object.defineProperty(exports2, "isKeyword", {
+ enumerable: true,
+ get: function() {
+ return _keyword.isKeyword;
+ }
+ });
+ Object.defineProperty(exports2, "isReservedWord", {
+ enumerable: true,
+ get: function() {
+ return _keyword.isReservedWord;
+ }
+ });
+ Object.defineProperty(exports2, "isStrictBindOnlyReservedWord", {
+ enumerable: true,
+ get: function() {
+ return _keyword.isStrictBindOnlyReservedWord;
+ }
+ });
+ Object.defineProperty(exports2, "isStrictBindReservedWord", {
+ enumerable: true,
+ get: function() {
+ return _keyword.isStrictBindReservedWord;
+ }
+ });
+ Object.defineProperty(exports2, "isStrictReservedWord", {
+ enumerable: true,
+ get: function() {
+ return _keyword.isStrictReservedWord;
+ }
+ });
+ var _identifier = require_identifier();
+ var _keyword = require_keyword();
+ }
+});
+
+// ../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js
+var require_pluralize = __commonJS({
+ "../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js"(exports2, module2) {
+ "use strict";
+ (function(root, pluralize3) {
+ if (typeof require === "function" && typeof exports2 === "object" && typeof module2 === "object") {
+ module2.exports = pluralize3();
+ } else if (typeof define === "function" && define.amd) {
+ define(function() {
+ return pluralize3();
+ });
+ } else {
+ root.pluralize = pluralize3();
+ }
+ })(exports2, function() {
+ var pluralRules = [];
+ var singularRules = [];
+ var uncountables = {};
+ var irregularPlurals = {};
+ var irregularSingles = {};
+ function sanitizeRule(rule) {
+ if (typeof rule === "string") {
+ return new RegExp("^" + rule + "$", "i");
+ }
+ return rule;
+ }
+ function restoreCase(word, token) {
+ if (word === token) return token;
+ if (word === word.toLowerCase()) return token.toLowerCase();
+ if (word === word.toUpperCase()) return token.toUpperCase();
+ if (word[0] === word[0].toUpperCase()) {
+ return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
+ }
+ return token.toLowerCase();
+ }
+ function interpolate(str, args) {
+ return str.replace(/\$(\d{1,2})/g, function(match, index) {
+ return args[index] || "";
+ });
+ }
+ function replace(word, rule) {
+ return word.replace(rule[0], function(match, index) {
+ var result = interpolate(rule[1], arguments);
+ if (match === "") {
+ return restoreCase(word[index - 1], result);
+ }
+ return restoreCase(match, result);
+ });
+ }
+ function sanitizeWord(token, word, rules) {
+ if (!token.length || uncountables.hasOwnProperty(token)) {
+ return word;
+ }
+ var len = rules.length;
+ while (len--) {
+ var rule = rules[len];
+ if (rule[0].test(word)) return replace(word, rule);
+ }
+ return word;
+ }
+ function replaceWord(replaceMap, keepMap, rules) {
+ return function(word) {
+ var token = word.toLowerCase();
+ if (keepMap.hasOwnProperty(token)) {
+ return restoreCase(word, token);
+ }
+ if (replaceMap.hasOwnProperty(token)) {
+ return restoreCase(word, replaceMap[token]);
+ }
+ return sanitizeWord(token, word, rules);
+ };
+ }
+ function checkWord(replaceMap, keepMap, rules, bool) {
+ return function(word) {
+ var token = word.toLowerCase();
+ if (keepMap.hasOwnProperty(token)) return true;
+ if (replaceMap.hasOwnProperty(token)) return false;
+ return sanitizeWord(token, token, rules) === token;
+ };
+ }
+ function pluralize3(word, count, inclusive) {
+ var pluralized = count === 1 ? pluralize3.singular(word) : pluralize3.plural(word);
+ return (inclusive ? count + " " : "") + pluralized;
+ }
+ pluralize3.plural = replaceWord(
+ irregularSingles,
+ irregularPlurals,
+ pluralRules
+ );
+ pluralize3.isPlural = checkWord(
+ irregularSingles,
+ irregularPlurals,
+ pluralRules
+ );
+ pluralize3.singular = replaceWord(
+ irregularPlurals,
+ irregularSingles,
+ singularRules
+ );
+ pluralize3.isSingular = checkWord(
+ irregularPlurals,
+ irregularSingles,
+ singularRules
+ );
+ pluralize3.addPluralRule = function(rule, replacement) {
+ pluralRules.push([sanitizeRule(rule), replacement]);
+ };
+ pluralize3.addSingularRule = function(rule, replacement) {
+ singularRules.push([sanitizeRule(rule), replacement]);
+ };
+ pluralize3.addUncountableRule = function(word) {
+ if (typeof word === "string") {
+ uncountables[word.toLowerCase()] = true;
+ return;
+ }
+ pluralize3.addPluralRule(word, "$0");
+ pluralize3.addSingularRule(word, "$0");
+ };
+ pluralize3.addIrregularRule = function(single, plural) {
+ plural = plural.toLowerCase();
+ single = single.toLowerCase();
+ irregularSingles[single] = plural;
+ irregularPlurals[plural] = single;
+ };
+ [
+ // Pronouns.
+ ["I", "we"],
+ ["me", "us"],
+ ["he", "they"],
+ ["she", "they"],
+ ["them", "them"],
+ ["myself", "ourselves"],
+ ["yourself", "yourselves"],
+ ["itself", "themselves"],
+ ["herself", "themselves"],
+ ["himself", "themselves"],
+ ["themself", "themselves"],
+ ["is", "are"],
+ ["was", "were"],
+ ["has", "have"],
+ ["this", "these"],
+ ["that", "those"],
+ // Words ending in with a consonant and `o`.
+ ["echo", "echoes"],
+ ["dingo", "dingoes"],
+ ["volcano", "volcanoes"],
+ ["tornado", "tornadoes"],
+ ["torpedo", "torpedoes"],
+ // Ends with `us`.
+ ["genus", "genera"],
+ ["viscus", "viscera"],
+ // Ends with `ma`.
+ ["stigma", "stigmata"],
+ ["stoma", "stomata"],
+ ["dogma", "dogmata"],
+ ["lemma", "lemmata"],
+ ["schema", "schemata"],
+ ["anathema", "anathemata"],
+ // Other irregular rules.
+ ["ox", "oxen"],
+ ["axe", "axes"],
+ ["die", "dice"],
+ ["yes", "yeses"],
+ ["foot", "feet"],
+ ["eave", "eaves"],
+ ["goose", "geese"],
+ ["tooth", "teeth"],
+ ["quiz", "quizzes"],
+ ["human", "humans"],
+ ["proof", "proofs"],
+ ["carve", "carves"],
+ ["valve", "valves"],
+ ["looey", "looies"],
+ ["thief", "thieves"],
+ ["groove", "grooves"],
+ ["pickaxe", "pickaxes"],
+ ["passerby", "passersby"]
+ ].forEach(function(rule) {
+ return pluralize3.addIrregularRule(rule[0], rule[1]);
+ });
+ [
+ [/s?$/i, "s"],
+ [/[^\u0000-\u007F]$/i, "$0"],
+ [/([^aeiou]ese)$/i, "$1"],
+ [/(ax|test)is$/i, "$1es"],
+ [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"],
+ [/(e[mn]u)s?$/i, "$1s"],
+ [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"],
+ [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"],
+ [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"],
+ [/(seraph|cherub)(?:im)?$/i, "$1im"],
+ [/(her|at|gr)o$/i, "$1oes"],
+ [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"],
+ [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"],
+ [/sis$/i, "ses"],
+ [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"],
+ [/([^aeiouy]|qu)y$/i, "$1ies"],
+ [/([^ch][ieo][ln])ey$/i, "$1ies"],
+ [/(x|ch|ss|sh|zz)$/i, "$1es"],
+ [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"],
+ [/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"],
+ [/(pe)(?:rson|ople)$/i, "$1ople"],
+ [/(child)(?:ren)?$/i, "$1ren"],
+ [/eaux$/i, "$0"],
+ [/m[ae]n$/i, "men"],
+ ["thou", "you"]
+ ].forEach(function(rule) {
+ return pluralize3.addPluralRule(rule[0], rule[1]);
+ });
+ [
+ [/s$/i, ""],
+ [/(ss)$/i, "$1"],
+ [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"],
+ [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"],
+ [/ies$/i, "y"],
+ [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"],
+ [/\b(mon|smil)ies$/i, "$1ey"],
+ [/\b((?:tit)?m|l)ice$/i, "$1ouse"],
+ [/(seraph|cherub)im$/i, "$1"],
+ [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"],
+ [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"],
+ [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"],
+ [/(test)(?:is|es)$/i, "$1is"],
+ [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"],
+ [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"],
+ [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"],
+ [/(alumn|alg|vertebr)ae$/i, "$1a"],
+ [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"],
+ [/(matr|append)ices$/i, "$1ix"],
+ [/(pe)(rson|ople)$/i, "$1rson"],
+ [/(child)ren$/i, "$1"],
+ [/(eau)x?$/i, "$1"],
+ [/men$/i, "man"]
+ ].forEach(function(rule) {
+ return pluralize3.addSingularRule(rule[0], rule[1]);
+ });
+ [
+ // Singular words with no plurals.
+ "adulthood",
+ "advice",
+ "agenda",
+ "aid",
+ "aircraft",
+ "alcohol",
+ "ammo",
+ "analytics",
+ "anime",
+ "athletics",
+ "audio",
+ "bison",
+ "blood",
+ "bream",
+ "buffalo",
+ "butter",
+ "carp",
+ "cash",
+ "chassis",
+ "chess",
+ "clothing",
+ "cod",
+ "commerce",
+ "cooperation",
+ "corps",
+ "debris",
+ "diabetes",
+ "digestion",
+ "elk",
+ "energy",
+ "equipment",
+ "excretion",
+ "expertise",
+ "firmware",
+ "flounder",
+ "fun",
+ "gallows",
+ "garbage",
+ "graffiti",
+ "hardware",
+ "headquarters",
+ "health",
+ "herpes",
+ "highjinks",
+ "homework",
+ "housework",
+ "information",
+ "jeans",
+ "justice",
+ "kudos",
+ "labour",
+ "literature",
+ "machinery",
+ "mackerel",
+ "mail",
+ "media",
+ "mews",
+ "moose",
+ "music",
+ "mud",
+ "manga",
+ "news",
+ "only",
+ "personnel",
+ "pike",
+ "plankton",
+ "pliers",
+ "police",
+ "pollution",
+ "premises",
+ "rain",
+ "research",
+ "rice",
+ "salmon",
+ "scissors",
+ "series",
+ "sewage",
+ "shambles",
+ "shrimp",
+ "software",
+ "species",
+ "staff",
+ "swine",
+ "tennis",
+ "traffic",
+ "transportation",
+ "trout",
+ "tuna",
+ "wealth",
+ "welfare",
+ "whiting",
+ "wildebeest",
+ "wildlife",
+ "you",
+ /pok[eé]mon$/i,
+ // Regexes.
+ /[^aeiou]ese$/i,
+ // "chinese", "japanese"
+ /deer$/i,
+ // "deer", "reindeer"
+ /fish$/i,
+ // "fish", "blowfish", "angelfish"
+ /measles$/i,
+ /o[iu]s$/i,
+ // "carnivorous"
+ /pox$/i,
+ // "chickpox", "smallpox"
+ /sheep$/i
+ ].forEach(pluralize3.addUncountableRule);
+ return pluralize3;
+ });
+ }
+});
+
+// ../../node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js
+var require_env_paths = __commonJS({
+ "../../node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module2) {
+ "use strict";
+ var path5 = require("path");
+ var os = require("os");
+ var homedir = os.homedir();
+ var tmpdir = os.tmpdir();
+ var { env: env2 } = process;
+ var macos = (name) => {
+ const library = path5.join(homedir, "Library");
+ return {
+ data: path5.join(library, "Application Support", name),
+ config: path5.join(library, "Preferences", name),
+ cache: path5.join(library, "Caches", name),
+ log: path5.join(library, "Logs", name),
+ temp: path5.join(tmpdir, name)
+ };
+ };
+ var windows = (name) => {
+ const appData = env2.APPDATA || path5.join(homedir, "AppData", "Roaming");
+ const localAppData = env2.LOCALAPPDATA || path5.join(homedir, "AppData", "Local");
+ return {
+ // Data/config/cache/log are invented by me as Windows isn't opinionated about this
+ data: path5.join(localAppData, name, "Data"),
+ config: path5.join(appData, name, "Config"),
+ cache: path5.join(localAppData, name, "Cache"),
+ log: path5.join(localAppData, name, "Log"),
+ temp: path5.join(tmpdir, name)
+ };
+ };
+ var linux = (name) => {
+ const username = path5.basename(homedir);
+ return {
+ data: path5.join(env2.XDG_DATA_HOME || path5.join(homedir, ".local", "share"), name),
+ config: path5.join(env2.XDG_CONFIG_HOME || path5.join(homedir, ".config"), name),
+ cache: path5.join(env2.XDG_CACHE_HOME || path5.join(homedir, ".cache"), name),
+ // https://wiki.debian.org/XDGBaseDirectorySpecification#state
+ log: path5.join(env2.XDG_STATE_HOME || path5.join(homedir, ".local", "state"), name),
+ temp: path5.join(tmpdir, username, name)
+ };
+ };
+ var envPaths = (name, options) => {
+ if (typeof name !== "string") {
+ throw new TypeError(`Expected string, got ${typeof name}`);
+ }
+ options = Object.assign({ suffix: "nodejs" }, options);
+ if (options.suffix) {
+ name += `-${options.suffix}`;
+ }
+ if (process.platform === "darwin") {
+ return macos(name);
+ }
+ if (process.platform === "win32") {
+ return windows(name);
+ }
+ return linux(name);
+ };
+ module2.exports = envPaths;
+ module2.exports.default = envPaths;
+ }
+});
+
+// ../../node_modules/.pnpm/path-exists@3.0.0/node_modules/path-exists/index.js
+var require_path_exists2 = __commonJS({
+ "../../node_modules/.pnpm/path-exists@3.0.0/node_modules/path-exists/index.js"(exports2, module2) {
+ "use strict";
+ var fs3 = require("fs");
+ module2.exports = (fp) => new Promise((resolve) => {
+ fs3.access(fp, (err) => {
+ resolve(!err);
+ });
+ });
+ module2.exports.sync = (fp) => {
+ try {
+ fs3.accessSync(fp);
+ return true;
+ } catch (err) {
+ return false;
+ }
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/p-try@2.2.0/node_modules/p-try/index.js
+var require_p_try = __commonJS({
+ "../../node_modules/.pnpm/p-try@2.2.0/node_modules/p-try/index.js"(exports2, module2) {
+ "use strict";
+ var pTry = (fn, ...arguments_) => new Promise((resolve) => {
+ resolve(fn(...arguments_));
+ });
+ module2.exports = pTry;
+ module2.exports.default = pTry;
+ }
+});
+
+// ../../node_modules/.pnpm/p-limit@2.3.0/node_modules/p-limit/index.js
+var require_p_limit = __commonJS({
+ "../../node_modules/.pnpm/p-limit@2.3.0/node_modules/p-limit/index.js"(exports2, module2) {
+ "use strict";
+ var pTry = require_p_try();
+ var pLimit2 = (concurrency) => {
+ if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
+ return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
+ }
+ const queue = [];
+ let activeCount = 0;
+ const next = () => {
+ activeCount--;
+ if (queue.length > 0) {
+ queue.shift()();
+ }
+ };
+ const run = (fn, resolve, ...args) => {
+ activeCount++;
+ const result = pTry(fn, ...args);
+ resolve(result);
+ result.then(next, next);
+ };
+ const enqueue = (fn, resolve, ...args) => {
+ if (activeCount < concurrency) {
+ run(fn, resolve, ...args);
+ } else {
+ queue.push(run.bind(null, fn, resolve, ...args));
+ }
+ };
+ const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
+ Object.defineProperties(generator, {
+ activeCount: {
+ get: () => activeCount
+ },
+ pendingCount: {
+ get: () => queue.length
+ },
+ clearQueue: {
+ value: () => {
+ queue.length = 0;
+ }
+ }
+ });
+ return generator;
+ };
+ module2.exports = pLimit2;
+ module2.exports.default = pLimit2;
+ }
+});
+
+// ../../node_modules/.pnpm/p-locate@3.0.0/node_modules/p-locate/index.js
+var require_p_locate = __commonJS({
+ "../../node_modules/.pnpm/p-locate@3.0.0/node_modules/p-locate/index.js"(exports2, module2) {
+ "use strict";
+ var pLimit2 = require_p_limit();
+ var EndError = class extends Error {
+ constructor(value) {
+ super();
+ this.value = value;
+ }
+ };
+ var testElement = (el, tester) => Promise.resolve(el).then(tester);
+ var finder = (el) => Promise.all(el).then((val) => val[1] === true && Promise.reject(new EndError(val[0])));
+ module2.exports = (iterable, tester, opts) => {
+ opts = Object.assign({
+ concurrency: Infinity,
+ preserveOrder: true
+ }, opts);
+ const limit = pLimit2(opts.concurrency);
+ const items = [...iterable].map((el) => [el, limit(testElement, el, tester)]);
+ const checkLimit = pLimit2(opts.preserveOrder ? 1 : Infinity);
+ return Promise.all(items.map((el) => checkLimit(finder, el))).then(() => {
+ }).catch((err) => err instanceof EndError ? err.value : Promise.reject(err));
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/locate-path@3.0.0/node_modules/locate-path/index.js
+var require_locate_path = __commonJS({
+ "../../node_modules/.pnpm/locate-path@3.0.0/node_modules/locate-path/index.js"(exports2, module2) {
+ "use strict";
+ var path5 = require("path");
+ var pathExists2 = require_path_exists2();
+ var pLocate2 = require_p_locate();
+ module2.exports = (iterable, options) => {
+ options = Object.assign({
+ cwd: process.cwd()
+ }, options);
+ return pLocate2(iterable, (el) => pathExists2(path5.resolve(options.cwd, el)), options);
+ };
+ module2.exports.sync = (iterable, options) => {
+ options = Object.assign({
+ cwd: process.cwd()
+ }, options);
+ for (const el of iterable) {
+ if (pathExists2.sync(path5.resolve(options.cwd, el))) {
+ return el;
+ }
+ }
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/find-up@3.0.0/node_modules/find-up/index.js
+var require_find_up = __commonJS({
+ "../../node_modules/.pnpm/find-up@3.0.0/node_modules/find-up/index.js"(exports2, module2) {
+ "use strict";
+ var path5 = require("path");
+ var locatePath2 = require_locate_path();
+ module2.exports = (filename, opts = {}) => {
+ const startDir = path5.resolve(opts.cwd || "");
+ const { root } = path5.parse(startDir);
+ const filenames = [].concat(filename);
+ return new Promise((resolve) => {
+ (function find(dir) {
+ locatePath2(filenames, { cwd: dir }).then((file2) => {
+ if (file2) {
+ resolve(path5.join(dir, file2));
+ } else if (dir === root) {
+ resolve(null);
+ } else {
+ find(path5.dirname(dir));
+ }
+ });
+ })(startDir);
+ });
+ };
+ module2.exports.sync = (filename, opts = {}) => {
+ let dir = path5.resolve(opts.cwd || "");
+ const { root } = path5.parse(dir);
+ const filenames = [].concat(filename);
+ while (true) {
+ const file2 = locatePath2.sync(filenames, { cwd: dir });
+ if (file2) {
+ return path5.join(dir, file2);
+ }
+ if (dir === root) {
+ return null;
+ }
+ dir = path5.dirname(dir);
+ }
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/pkg-up@3.1.0/node_modules/pkg-up/index.js
+var require_pkg_up = __commonJS({
+ "../../node_modules/.pnpm/pkg-up@3.1.0/node_modules/pkg-up/index.js"(exports2, module2) {
+ "use strict";
+ var findUp2 = require_find_up();
+ module2.exports = async ({ cwd: cwd2 } = {}) => findUp2("package.json", { cwd: cwd2 });
+ module2.exports.sync = ({ cwd: cwd2 } = {}) => findUp2.sync("package.json", { cwd: cwd2 });
+ }
+});
+
+// package.json
+var require_package2 = __commonJS({
+ "package.json"(exports2, module2) {
+ module2.exports = {
+ name: "@prisma/client",
+ version: "5.21.1",
+ description: "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.",
+ keywords: [
+ "ORM",
+ "Prisma",
+ "prisma2",
+ "Prisma Client",
+ "client",
+ "query",
+ "query-builder",
+ "database",
+ "db",
+ "JavaScript",
+ "JS",
+ "TypeScript",
+ "TS",
+ "SQL",
+ "SQLite",
+ "pg",
+ "Postgres",
+ "PostgreSQL",
+ "CockroachDB",
+ "MySQL",
+ "MariaDB",
+ "MSSQL",
+ "SQL Server",
+ "SQLServer",
+ "MongoDB",
+ "react-native"
+ ],
+ main: "default.js",
+ types: "default.d.ts",
+ browser: "index-browser.js",
+ exports: {
+ "./package.json": "./package.json",
+ ".": {
+ require: {
+ types: "./default.d.ts",
+ node: "./default.js",
+ "edge-light": "./default.js",
+ workerd: "./default.js",
+ worker: "./default.js",
+ browser: "./index-browser.js"
+ },
+ import: {
+ types: "./default.d.ts",
+ node: "./default.js",
+ "edge-light": "./default.js",
+ workerd: "./default.js",
+ worker: "./default.js",
+ browser: "./index-browser.js"
+ },
+ default: "./default.js"
+ },
+ "./edge": {
+ types: "./edge.d.ts",
+ require: "./edge.js",
+ import: "./edge.js",
+ default: "./edge.js"
+ },
+ "./react-native": {
+ types: "./react-native.d.ts",
+ require: "./react-native.js",
+ import: "./react-native.js",
+ default: "./react-native.js"
+ },
+ "./extension": {
+ types: "./extension.d.ts",
+ require: "./extension.js",
+ import: "./extension.js",
+ default: "./extension.js"
+ },
+ "./index-browser": {
+ types: "./index.d.ts",
+ require: "./index-browser.js",
+ import: "./index-browser.js",
+ default: "./index-browser.js"
+ },
+ "./index": {
+ types: "./index.d.ts",
+ require: "./index.js",
+ import: "./index.js",
+ default: "./index.js"
+ },
+ "./wasm": {
+ types: "./wasm.d.ts",
+ require: "./wasm.js",
+ import: "./wasm.js",
+ default: "./wasm.js"
+ },
+ "./runtime/library": {
+ types: "./runtime/library.d.ts",
+ require: "./runtime/library.js",
+ import: "./runtime/library.js",
+ default: "./runtime/library.js"
+ },
+ "./runtime/binary": {
+ types: "./runtime/binary.d.ts",
+ require: "./runtime/binary.js",
+ import: "./runtime/binary.js",
+ default: "./runtime/binary.js"
+ },
+ "./generator-build": {
+ require: "./generator-build/index.js",
+ import: "./generator-build/index.js",
+ default: "./generator-build/index.js"
+ },
+ "./sql": {
+ require: {
+ types: "./sql.d.ts",
+ node: "./sql.js",
+ default: "./sql.js"
+ },
+ import: {
+ types: "./sql.d.ts",
+ node: "./sql.mjs",
+ default: "./sql.mjs"
+ },
+ default: "./sql.js"
+ },
+ "./*": "./*"
+ },
+ license: "Apache-2.0",
+ engines: {
+ node: ">=16.13"
+ },
+ homepage: "https://www.prisma.io",
+ repository: {
+ type: "git",
+ url: "https://github.com/prisma/prisma.git",
+ directory: "packages/client"
+ },
+ author: "Tim Suchanek ",
+ bugs: "https://github.com/prisma/prisma/issues",
+ scripts: {
+ dev: "DEV=true tsx helpers/build.ts",
+ build: "tsx helpers/build.ts",
+ test: "dotenv -e ../../.db.env -- jest --silent",
+ "test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts",
+ "test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts",
+ "test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts",
+ "test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types",
+ "test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only",
+ "test-notypes": "dotenv -e ../../.db.env -- jest --testPathIgnorePatterns src/__tests__/types/types.test.ts",
+ generate: "node scripts/postinstall.js",
+ postinstall: "node scripts/postinstall.js",
+ prepublishOnly: "pnpm run build",
+ "new-test": "tsx ./helpers/new-test/new-test.ts"
+ },
+ files: [
+ "README.md",
+ "runtime",
+ "!runtime/*.map",
+ "scripts",
+ "generator-build",
+ "edge.js",
+ "edge.d.ts",
+ "wasm.js",
+ "wasm.d.ts",
+ "index.js",
+ "index.d.ts",
+ "react-native.js",
+ "react-native.d.ts",
+ "default.js",
+ "default.d.ts",
+ "index-browser.js",
+ "extension.js",
+ "extension.d.ts",
+ "sql.d.ts",
+ "sql.js",
+ "sql.mjs"
+ ],
+ devDependencies: {
+ "@cloudflare/workers-types": "4.20240614.0",
+ "@codspeed/benchmark.js-plugin": "3.1.1",
+ "@faker-js/faker": "8.4.1",
+ "@fast-check/jest": "1.8.2",
+ "@inquirer/prompts": "5.0.5",
+ "@jest/create-cache-key-function": "29.7.0",
+ "@jest/globals": "29.7.0",
+ "@jest/test-sequencer": "29.7.0",
+ "@libsql/client": "0.8.0",
+ "@neondatabase/serverless": "0.9.3",
+ "@opentelemetry/api": "1.9.0",
+ "@opentelemetry/context-async-hooks": "1.25.1",
+ "@opentelemetry/instrumentation": "0.52.1",
+ "@opentelemetry/resources": "1.25.1",
+ "@opentelemetry/sdk-trace-base": "1.25.1",
+ "@opentelemetry/semantic-conventions": "1.25.1",
+ "@planetscale/database": "1.18.0",
+ "@prisma/adapter-d1": "workspace:*",
+ "@prisma/adapter-libsql": "workspace:*",
+ "@prisma/adapter-neon": "workspace:*",
+ "@prisma/adapter-pg": "workspace:*",
+ "@prisma/adapter-pg-worker": "workspace:*",
+ "@prisma/adapter-planetscale": "workspace:*",
+ "@prisma/debug": "workspace:*",
+ "@prisma/driver-adapter-utils": "workspace:*",
+ "@prisma/engines": "workspace:*",
+ "@prisma/engines-version": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ "@prisma/fetch-engine": "workspace:*",
+ "@prisma/generator-helper": "workspace:*",
+ "@prisma/get-platform": "workspace:*",
+ "@prisma/instrumentation": "workspace:*",
+ "@prisma/internals": "workspace:*",
+ "@prisma/migrate": "workspace:*",
+ "@prisma/mini-proxy": "0.9.5",
+ "@prisma/pg-worker": "workspace:*",
+ "@prisma/query-engine-wasm": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ "@snaplet/copycat": "0.17.3",
+ "@swc-node/register": "1.10.9",
+ "@swc/core": "1.6.13",
+ "@swc/jest": "0.2.36",
+ "@timsuchanek/copy": "1.4.5",
+ "@types/debug": "4.1.12",
+ "@types/fs-extra": "9.0.13",
+ "@types/jest": "29.5.12",
+ "@types/js-levenshtein": "1.1.3",
+ "@types/mssql": "9.1.5",
+ "@types/node": "18.19.31",
+ "@types/pg": "8.11.6",
+ arg: "5.0.2",
+ benchmark: "2.1.4",
+ "ci-info": "4.0.0",
+ "decimal.js": "10.4.3",
+ "detect-runtime": "1.0.4",
+ "env-paths": "2.2.1",
+ esbuild: "0.23.0",
+ execa: "5.1.1",
+ "expect-type": "0.19.0",
+ "flat-map-polyfill": "0.3.8",
+ "fs-extra": "11.1.1",
+ "get-stream": "6.0.1",
+ globby: "11.1.0",
+ "indent-string": "4.0.0",
+ jest: "29.7.0",
+ "jest-extended": "4.0.2",
+ "jest-junit": "16.0.0",
+ "jest-serializer-ansi-escapes": "3.0.0",
+ "jest-snapshot": "29.7.0",
+ "js-levenshtein": "1.1.6",
+ kleur: "4.1.5",
+ klona: "2.0.6",
+ mariadb: "3.3.1",
+ memfs: "4.9.3",
+ mssql: "11.0.1",
+ "new-github-issue-url": "0.2.1",
+ "node-fetch": "3.3.2",
+ "p-retry": "4.6.2",
+ pg: "8.11.5",
+ "pkg-up": "3.1.0",
+ pluralize: "8.0.0",
+ resolve: "1.22.8",
+ rimraf: "3.0.2",
+ "simple-statistics": "7.8.5",
+ "sort-keys": "4.2.0",
+ "source-map-support": "0.5.21",
+ "sql-template-tag": "5.2.1",
+ "stacktrace-parser": "0.1.10",
+ "strip-ansi": "6.0.1",
+ "strip-indent": "3.0.0",
+ "ts-node": "10.9.2",
+ "ts-pattern": "5.2.0",
+ tsd: "0.31.1",
+ typescript: "5.4.5",
+ undici: "5.28.4",
+ wrangler: "3.62.0",
+ zx: "7.2.3"
+ },
+ peerDependencies: {
+ prisma: "*"
+ },
+ peerDependenciesMeta: {
+ prisma: {
+ optional: true
+ }
+ },
+ sideEffects: false
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/array-species-create.js
+var require_array_species_create = __commonJS({
+ "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/array-species-create.js"(exports2) {
+ "use strict";
+ Object.defineProperty(exports2, "__esModule", {
+ value: true
+ });
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
+ return typeof obj;
+ } : function(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ exports2.default = arraySpeciesCreate;
+ function arraySpeciesCreate(originalArray, length) {
+ var isArray = Array.isArray(originalArray);
+ if (!isArray) {
+ return Array(length);
+ }
+ var C = Object.getPrototypeOf(originalArray).constructor;
+ if (C) {
+ if ((typeof C === "undefined" ? "undefined" : _typeof(C)) === "object" || typeof C === "function") {
+ C = C[Symbol.species.toString()];
+ C = C !== null ? C : void 0;
+ }
+ if (C === void 0) {
+ return Array(length);
+ }
+ if (typeof C !== "function") {
+ throw TypeError("invalid constructor");
+ }
+ var result = new C(length);
+ return result;
+ }
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten-into-array.js
+var require_flatten_into_array = __commonJS({
+ "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten-into-array.js"(exports2) {
+ "use strict";
+ Object.defineProperty(exports2, "__esModule", {
+ value: true
+ });
+ exports2.default = flattenIntoArray;
+ function flattenIntoArray(target, source, start, depth, mapperFunction, thisArg) {
+ var mapperFunctionProvied = mapperFunction !== void 0;
+ var targetIndex = start;
+ var sourceIndex = 0;
+ var sourceLen = source.length;
+ while (sourceIndex < sourceLen) {
+ var p = sourceIndex;
+ var exists = !!source[p];
+ if (exists === true) {
+ var element = source[p];
+ if (element) {
+ if (mapperFunctionProvied) {
+ element = mapperFunction.call(thisArg, element, sourceIndex, target);
+ }
+ var spreadable = Object.getOwnPropertySymbols(element).includes(Symbol.isConcatSpreadable) || Array.isArray(element);
+ if (spreadable === true && depth > 0) {
+ var nextIndex = flattenIntoArray(target, element, targetIndex, depth - 1);
+ targetIndex = nextIndex;
+ } else {
+ if (!Number.isSafeInteger(targetIndex)) {
+ throw TypeError();
+ }
+ target[targetIndex] = element;
+ }
+ }
+ }
+ targetIndex += 1;
+ sourceIndex += 1;
+ }
+ return targetIndex;
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten.js
+var require_flatten = __commonJS({
+ "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten.js"() {
+ "use strict";
+ var _arraySpeciesCreate = require_array_species_create();
+ var _arraySpeciesCreate2 = _interopRequireDefault(_arraySpeciesCreate);
+ var _flattenIntoArray = require_flatten_into_array();
+ var _flattenIntoArray2 = _interopRequireDefault(_flattenIntoArray);
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+ }
+ if (!Object.prototype.hasOwnProperty.call(Array.prototype, "flatten")) {
+ Array.prototype.flatten = function flatten(depth) {
+ var o = Object(this);
+ var a = (0, _arraySpeciesCreate2.default)(o, this.length);
+ var depthNum = depth !== void 0 ? Number(depth) : Infinity;
+ (0, _flattenIntoArray2.default)(a, o, 0, depthNum);
+ return a.filter(function(e) {
+ return e !== void 0;
+ });
+ };
+ }
+ }
+});
+
+// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flat-map.js
+var require_flat_map = __commonJS({
+ "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flat-map.js"() {
+ "use strict";
+ var _flattenIntoArray = require_flatten_into_array();
+ var _flattenIntoArray2 = _interopRequireDefault(_flattenIntoArray);
+ var _arraySpeciesCreate = require_array_species_create();
+ var _arraySpeciesCreate2 = _interopRequireDefault(_arraySpeciesCreate);
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+ }
+ if (!Object.prototype.hasOwnProperty.call(Array.prototype, "flatMap")) {
+ Array.prototype.flatMap = function flatMap(callbackFn, thisArg) {
+ var o = Object(this);
+ if (!callbackFn || typeof callbackFn.call !== "function") {
+ throw TypeError("callbackFn must be callable.");
+ }
+ var t = thisArg !== void 0 ? thisArg : void 0;
+ var a = (0, _arraySpeciesCreate2.default)(o, o.length);
+ (0, _flattenIntoArray2.default)(
+ a,
+ o,
+ /*start*/
+ 0,
+ /*depth*/
+ 1,
+ callbackFn,
+ t
+ );
+ return a.filter(function(x) {
+ return x !== void 0;
+ }, a);
+ };
+ }
+ }
+});
+
+// src/generation/ts-builders/KeyType.ts
+var KeyType_exports = {};
+__export(KeyType_exports, {
+ KeyType: () => KeyType,
+ keyType: () => keyType
+});
+function keyType(baseType, key) {
+ return new KeyType(baseType, key);
+}
+var KeyType;
+var init_KeyType = __esm({
+ "src/generation/ts-builders/KeyType.ts"() {
+ "use strict";
+ init_TypeBuilder();
+ KeyType = class extends TypeBuilder {
+ constructor(baseType, key) {
+ super();
+ this.baseType = baseType;
+ this.key = key;
+ }
+ write(writer) {
+ this.baseType.writeIndexed(writer);
+ writer.write("[").write(`"${this.key}"`).write("]");
+ }
+ };
+ }
+});
+
+// src/generation/ts-builders/TypeBuilder.ts
+var TypeBuilder;
+var init_TypeBuilder = __esm({
+ "src/generation/ts-builders/TypeBuilder.ts"() {
+ "use strict";
+ TypeBuilder = class {
+ constructor() {
+ // TODO(@SevInf): this should be replaced with precedence system that would
+ // automatically add parenthesis where they are needed
+ this.needsParenthesisWhenIndexed = false;
+ this.needsParenthesisInKeyof = false;
+ this.needsParenthesisInUnion = false;
+ }
+ subKey(key) {
+ const { KeyType: KeyType2 } = (init_KeyType(), __toCommonJS(KeyType_exports));
+ return new KeyType2(this, key);
+ }
+ writeIndexed(writer) {
+ if (this.needsParenthesisWhenIndexed) {
+ writer.write("(");
+ }
+ writer.write(this);
+ if (this.needsParenthesisWhenIndexed) {
+ writer.write(")");
+ }
+ }
+ };
+ }
+});
+
+// ../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/vendors.json
+var require_vendors = __commonJS({
+ "../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/vendors.json"(exports2, module2) {
+ module2.exports = [
+ {
+ name: "Agola CI",
+ constant: "AGOLA",
+ env: "AGOLA_GIT_REF",
+ pr: "AGOLA_PULL_REQUEST_ID"
+ },
+ {
+ name: "Appcircle",
+ constant: "APPCIRCLE",
+ env: "AC_APPCIRCLE"
+ },
+ {
+ name: "AppVeyor",
+ constant: "APPVEYOR",
+ env: "APPVEYOR",
+ pr: "APPVEYOR_PULL_REQUEST_NUMBER"
+ },
+ {
+ name: "AWS CodeBuild",
+ constant: "CODEBUILD",
+ env: "CODEBUILD_BUILD_ARN"
+ },
+ {
+ name: "Azure Pipelines",
+ constant: "AZURE_PIPELINES",
+ env: "TF_BUILD",
+ pr: {
+ BUILD_REASON: "PullRequest"
+ }
+ },
+ {
+ name: "Bamboo",
+ constant: "BAMBOO",
+ env: "bamboo_planKey"
+ },
+ {
+ name: "Bitbucket Pipelines",
+ constant: "BITBUCKET",
+ env: "BITBUCKET_COMMIT",
+ pr: "BITBUCKET_PR_ID"
+ },
+ {
+ name: "Bitrise",
+ constant: "BITRISE",
+ env: "BITRISE_IO",
+ pr: "BITRISE_PULL_REQUEST"
+ },
+ {
+ name: "Buddy",
+ constant: "BUDDY",
+ env: "BUDDY_WORKSPACE_ID",
+ pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
+ },
+ {
+ name: "Buildkite",
+ constant: "BUILDKITE",
+ env: "BUILDKITE",
+ pr: {
+ env: "BUILDKITE_PULL_REQUEST",
+ ne: "false"
+ }
+ },
+ {
+ name: "CircleCI",
+ constant: "CIRCLE",
+ env: "CIRCLECI",
+ pr: "CIRCLE_PULL_REQUEST"
+ },
+ {
+ name: "Cirrus CI",
+ constant: "CIRRUS",
+ env: "CIRRUS_CI",
+ pr: "CIRRUS_PR"
+ },
+ {
+ name: "Codefresh",
+ constant: "CODEFRESH",
+ env: "CF_BUILD_ID",
+ pr: {
+ any: [
+ "CF_PULL_REQUEST_NUMBER",
+ "CF_PULL_REQUEST_ID"
+ ]
+ }
+ },
+ {
+ name: "Codemagic",
+ constant: "CODEMAGIC",
+ env: "CM_BUILD_ID",
+ pr: "CM_PULL_REQUEST"
+ },
+ {
+ name: "Codeship",
+ constant: "CODESHIP",
+ env: {
+ CI_NAME: "codeship"
+ }
+ },
+ {
+ name: "Drone",
+ constant: "DRONE",
+ env: "DRONE",
+ pr: {
+ DRONE_BUILD_EVENT: "pull_request"
+ }
+ },
+ {
+ name: "dsari",
+ constant: "DSARI",
+ env: "DSARI"
+ },
+ {
+ name: "Earthly",
+ constant: "EARTHLY",
+ env: "EARTHLY_CI"
+ },
+ {
+ name: "Expo Application Services",
+ constant: "EAS",
+ env: "EAS_BUILD"
+ },
+ {
+ name: "Gerrit",
+ constant: "GERRIT",
+ env: "GERRIT_PROJECT"
+ },
+ {
+ name: "Gitea Actions",
+ constant: "GITEA_ACTIONS",
+ env: "GITEA_ACTIONS"
+ },
+ {
+ name: "GitHub Actions",
+ constant: "GITHUB_ACTIONS",
+ env: "GITHUB_ACTIONS",
+ pr: {
+ GITHUB_EVENT_NAME: "pull_request"
+ }
+ },
+ {
+ name: "GitLab CI",
+ constant: "GITLAB",
+ env: "GITLAB_CI",
+ pr: "CI_MERGE_REQUEST_ID"
+ },
+ {
+ name: "GoCD",
+ constant: "GOCD",
+ env: "GO_PIPELINE_LABEL"
+ },
+ {
+ name: "Google Cloud Build",
+ constant: "GOOGLE_CLOUD_BUILD",
+ env: "BUILDER_OUTPUT"
+ },
+ {
+ name: "Harness CI",
+ constant: "HARNESS",
+ env: "HARNESS_BUILD_ID"
+ },
+ {
+ name: "Heroku",
+ constant: "HEROKU",
+ env: {
+ env: "NODE",
+ includes: "/app/.heroku/node/bin/node"
+ }
+ },
+ {
+ name: "Hudson",
+ constant: "HUDSON",
+ env: "HUDSON_URL"
+ },
+ {
+ name: "Jenkins",
+ constant: "JENKINS",
+ env: [
+ "JENKINS_URL",
+ "BUILD_ID"
+ ],
+ pr: {
+ any: [
+ "ghprbPullId",
+ "CHANGE_ID"
+ ]
+ }
+ },
+ {
+ name: "LayerCI",
+ constant: "LAYERCI",
+ env: "LAYERCI",
+ pr: "LAYERCI_PULL_REQUEST"
+ },
+ {
+ name: "Magnum CI",
+ constant: "MAGNUM",
+ env: "MAGNUM"
+ },
+ {
+ name: "Netlify CI",
+ constant: "NETLIFY",
+ env: "NETLIFY",
+ pr: {
+ env: "PULL_REQUEST",
+ ne: "false"
+ }
+ },
+ {
+ name: "Nevercode",
+ constant: "NEVERCODE",
+ env: "NEVERCODE",
+ pr: {
+ env: "NEVERCODE_PULL_REQUEST",
+ ne: "false"
+ }
+ },
+ {
+ name: "Prow",
+ constant: "PROW",
+ env: "PROW_JOB_ID"
+ },
+ {
+ name: "ReleaseHub",
+ constant: "RELEASEHUB",
+ env: "RELEASE_BUILD_ID"
+ },
+ {
+ name: "Render",
+ constant: "RENDER",
+ env: "RENDER",
+ pr: {
+ IS_PULL_REQUEST: "true"
+ }
+ },
+ {
+ name: "Sail CI",
+ constant: "SAIL",
+ env: "SAILCI",
+ pr: "SAIL_PULL_REQUEST_NUMBER"
+ },
+ {
+ name: "Screwdriver",
+ constant: "SCREWDRIVER",
+ env: "SCREWDRIVER",
+ pr: {
+ env: "SD_PULL_REQUEST",
+ ne: "false"
+ }
+ },
+ {
+ name: "Semaphore",
+ constant: "SEMAPHORE",
+ env: "SEMAPHORE",
+ pr: "PULL_REQUEST_NUMBER"
+ },
+ {
+ name: "Sourcehut",
+ constant: "SOURCEHUT",
+ env: {
+ CI_NAME: "sourcehut"
+ }
+ },
+ {
+ name: "Strider CD",
+ constant: "STRIDER",
+ env: "STRIDER"
+ },
+ {
+ name: "TaskCluster",
+ constant: "TASKCLUSTER",
+ env: [
+ "TASK_ID",
+ "RUN_ID"
+ ]
+ },
+ {
+ name: "TeamCity",
+ constant: "TEAMCITY",
+ env: "TEAMCITY_VERSION"
+ },
+ {
+ name: "Travis CI",
+ constant: "TRAVIS",
+ env: "TRAVIS",
+ pr: {
+ env: "TRAVIS_PULL_REQUEST",
+ ne: "false"
+ }
+ },
+ {
+ name: "Vela",
+ constant: "VELA",
+ env: "VELA",
+ pr: {
+ VELA_PULL_REQUEST: "1"
+ }
+ },
+ {
+ name: "Vercel",
+ constant: "VERCEL",
+ env: {
+ any: [
+ "NOW_BUILDER",
+ "VERCEL"
+ ]
+ },
+ pr: "VERCEL_GIT_PULL_REQUEST_ID"
+ },
+ {
+ name: "Visual Studio App Center",
+ constant: "APPCENTER",
+ env: "APPCENTER_BUILD_ID"
+ },
+ {
+ name: "Woodpecker",
+ constant: "WOODPECKER",
+ env: {
+ CI: "woodpecker"
+ },
+ pr: {
+ CI_BUILD_EVENT: "pull_request"
+ }
+ },
+ {
+ name: "Xcode Cloud",
+ constant: "XCODE_CLOUD",
+ env: "CI_XCODE_PROJECT",
+ pr: "CI_PULL_REQUEST_NUMBER"
+ },
+ {
+ name: "Xcode Server",
+ constant: "XCODE_SERVER",
+ env: "XCS"
+ }
+ ];
+ }
+});
+
+// ../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/index.js
+var require_ci_info = __commonJS({
+ "../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/index.js"(exports2) {
+ "use strict";
+ var vendors = require_vendors();
+ var env2 = process.env;
+ Object.defineProperty(exports2, "_vendors", {
+ value: vendors.map(function(v) {
+ return v.constant;
+ })
+ });
+ exports2.name = null;
+ exports2.isPR = null;
+ vendors.forEach(function(vendor) {
+ const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
+ const isCI = envs.every(function(obj) {
+ return checkEnv(obj);
+ });
+ exports2[vendor.constant] = isCI;
+ if (!isCI) {
+ return;
+ }
+ exports2.name = vendor.name;
+ switch (typeof vendor.pr) {
+ case "string":
+ exports2.isPR = !!env2[vendor.pr];
+ break;
+ case "object":
+ if ("env" in vendor.pr) {
+ exports2.isPR = vendor.pr.env in env2 && env2[vendor.pr.env] !== vendor.pr.ne;
+ } else if ("any" in vendor.pr) {
+ exports2.isPR = vendor.pr.any.some(function(key) {
+ return !!env2[key];
+ });
+ } else {
+ exports2.isPR = checkEnv(vendor.pr);
+ }
+ break;
+ default:
+ exports2.isPR = null;
+ }
+ });
+ exports2.isCI = !!(env2.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
+ (env2.BUILD_ID || // Jenkins, Cloudbees
+ env2.BUILD_NUMBER || // Jenkins, TeamCity
+ env2.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
+ env2.CI_APP_ID || // Appflow
+ env2.CI_BUILD_ID || // Appflow
+ env2.CI_BUILD_NUMBER || // Appflow
+ env2.CI_NAME || // Codeship and others
+ env2.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
+ env2.RUN_ID || // TaskCluster, dsari
+ exports2.name || false));
+ function checkEnv(obj) {
+ if (typeof obj === "string") return !!env2[obj];
+ if ("env" in obj) {
+ return env2[obj.env] && env2[obj.env].includes(obj.includes);
+ }
+ if ("any" in obj) {
+ return obj.any.some(function(k) {
+ return !!env2[k];
+ });
+ }
+ return Object.keys(obj).every(function(k) {
+ return env2[k] === obj[k];
+ });
+ }
+ }
+});
+
+// src/generation/generator.ts
+var generator_exports = {};
+__export(generator_exports, {
+ dmmfToTypes: () => dmmfToTypes,
+ externalToInternalDmmf: () => externalToInternalDmmf
+});
+module.exports = __toCommonJS(generator_exports);
+
+// ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
+var colors_exports = {};
+__export(colors_exports, {
+ $: () => $,
+ bgBlack: () => bgBlack,
+ bgBlue: () => bgBlue,
+ bgCyan: () => bgCyan,
+ bgGreen: () => bgGreen,
+ bgMagenta: () => bgMagenta,
+ bgRed: () => bgRed,
+ bgWhite: () => bgWhite,
+ bgYellow: () => bgYellow,
+ black: () => black,
+ blue: () => blue,
+ bold: () => bold,
+ cyan: () => cyan,
+ dim: () => dim,
+ gray: () => gray,
+ green: () => green,
+ grey: () => grey,
+ hidden: () => hidden,
+ inverse: () => inverse,
+ italic: () => italic,
+ magenta: () => magenta,
+ red: () => red,
+ reset: () => reset,
+ strikethrough: () => strikethrough,
+ underline: () => underline,
+ white: () => white,
+ yellow: () => yellow
+});
+var FORCE_COLOR;
+var NODE_DISABLE_COLORS;
+var NO_COLOR;
+var TERM;
+var isTTY = true;
+if (typeof process !== "undefined") {
+ ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
+ isTTY = process.stdout && process.stdout.isTTY;
+}
+var $ = {
+ enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
+};
+function init(x, y) {
+ let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
+ let open = `\x1B[${x}m`, close = `\x1B[${y}m`;
+ return function(txt) {
+ if (!$.enabled || txt == null) return txt;
+ return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
+ };
+}
+var reset = init(0, 0);
+var bold = init(1, 22);
+var dim = init(2, 22);
+var italic = init(3, 23);
+var underline = init(4, 24);
+var inverse = init(7, 27);
+var hidden = init(8, 28);
+var strikethrough = init(9, 29);
+var black = init(30, 39);
+var red = init(31, 39);
+var green = init(32, 39);
+var yellow = init(33, 39);
+var blue = init(34, 39);
+var magenta = init(35, 39);
+var cyan = init(36, 39);
+var white = init(37, 39);
+var gray = init(90, 39);
+var grey = init(90, 39);
+var bgBlack = init(40, 49);
+var bgRed = init(41, 49);
+var bgGreen = init(42, 49);
+var bgYellow = init(43, 49);
+var bgBlue = init(44, 49);
+var bgMagenta = init(45, 49);
+var bgCyan = init(46, 49);
+var bgWhite = init(47, 49);
+
+// ../debug/src/index.ts
+var MAX_ARGS_HISTORY = 100;
+var COLORS = ["green", "yellow", "blue", "magenta", "cyan", "red"];
+var argsHistory = [];
+var lastTimestamp = Date.now();
+var lastColor = 0;
+var processEnv = typeof process !== "undefined" ? process.env : {};
+globalThis.DEBUG ??= processEnv.DEBUG ?? "";
+globalThis.DEBUG_COLORS ??= processEnv.DEBUG_COLORS ? processEnv.DEBUG_COLORS === "true" : true;
+var topProps = {
+ enable(namespace2) {
+ if (typeof namespace2 === "string") {
+ globalThis.DEBUG = namespace2;
+ }
+ },
+ disable() {
+ const prev = globalThis.DEBUG;
+ globalThis.DEBUG = "";
+ return prev;
+ },
+ // this is the core logic to check if logging should happen or not
+ enabled(namespace2) {
+ const listenedNamespaces = globalThis.DEBUG.split(",").map((s) => {
+ return s.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
+ });
+ const isListened = listenedNamespaces.some((listenedNamespace) => {
+ if (listenedNamespace === "" || listenedNamespace[0] === "-") return false;
+ return namespace2.match(RegExp(listenedNamespace.split("*").join(".*") + "$"));
+ });
+ const isExcluded = listenedNamespaces.some((listenedNamespace) => {
+ if (listenedNamespace === "" || listenedNamespace[0] !== "-") return false;
+ return namespace2.match(RegExp(listenedNamespace.slice(1).split("*").join(".*") + "$"));
+ });
+ return isListened && !isExcluded;
+ },
+ log: (...args) => {
+ const [namespace2, format, ...rest] = args;
+ const logWithFormatting = console.warn ?? console.log;
+ logWithFormatting(`${namespace2} ${format}`, ...rest);
+ },
+ formatters: {}
+ // not implemented
+};
+function debugCreate(namespace2) {
+ const instanceProps = {
+ color: COLORS[lastColor++ % COLORS.length],
+ enabled: topProps.enabled(namespace2),
+ namespace: namespace2,
+ log: topProps.log,
+ extend: () => {
+ }
+ // not implemented
+ };
+ const debugCall = (...args) => {
+ const { enabled, namespace: namespace3, color, log } = instanceProps;
+ if (args.length !== 0) {
+ argsHistory.push([namespace3, ...args]);
+ }
+ if (argsHistory.length > MAX_ARGS_HISTORY) {
+ argsHistory.shift();
+ }
+ if (topProps.enabled(namespace3) || enabled) {
+ const stringArgs = args.map((arg) => {
+ if (typeof arg === "string") {
+ return arg;
+ }
+ return safeStringify(arg);
+ });
+ const ms = `+${Date.now() - lastTimestamp}ms`;
+ lastTimestamp = Date.now();
+ if (globalThis.DEBUG_COLORS) {
+ log(colors_exports[color](bold(namespace3)), ...stringArgs, colors_exports[color](ms));
+ } else {
+ log(namespace3, ...stringArgs, ms);
+ }
+ }
+ };
+ return new Proxy(debugCall, {
+ get: (_, prop) => instanceProps[prop],
+ set: (_, prop, value) => instanceProps[prop] = value
+ });
+}
+var Debug = new Proxy(debugCreate, {
+ get: (_, prop) => topProps[prop],
+ set: (_, prop, value) => topProps[prop] = value
+});
+function safeStringify(value, indent9 = 2) {
+ const cache = /* @__PURE__ */ new Set();
+ return JSON.stringify(
+ value,
+ (key, value2) => {
+ if (typeof value2 === "object" && value2 !== null) {
+ if (cache.has(value2)) {
+ return `[Circular *]`;
+ }
+ cache.add(value2);
+ } else if (typeof value2 === "bigint") {
+ return value2.toString();
+ }
+ return value2;
+ },
+ indent9
+ );
+}
+var src_default = Debug;
+
+// src/generation/generator.ts
+var import_engines_version = __toESM(require_engines_version());
+
+// ../generator-helper/src/dmmf.ts
+var DMMF;
+((DMMF2) => {
+ let ModelAction;
+ ((ModelAction2) => {
+ ModelAction2["findUnique"] = "findUnique";
+ ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
+ ModelAction2["findFirst"] = "findFirst";
+ ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
+ ModelAction2["findMany"] = "findMany";
+ ModelAction2["create"] = "create";
+ ModelAction2["createMany"] = "createMany";
+ ModelAction2["createManyAndReturn"] = "createManyAndReturn";
+ ModelAction2["update"] = "update";
+ ModelAction2["updateMany"] = "updateMany";
+ ModelAction2["upsert"] = "upsert";
+ ModelAction2["delete"] = "delete";
+ ModelAction2["deleteMany"] = "deleteMany";
+ ModelAction2["groupBy"] = "groupBy";
+ ModelAction2["count"] = "count";
+ ModelAction2["aggregate"] = "aggregate";
+ ModelAction2["findRaw"] = "findRaw";
+ ModelAction2["aggregateRaw"] = "aggregateRaw";
+ })(ModelAction = DMMF2.ModelAction || (DMMF2.ModelAction = {}));
+})(DMMF || (DMMF = {}));
+
+// ../generator-helper/src/byline.ts
+var import_stream = __toESM(require("stream"));
+var import_util = __toESM(require("util"));
+function byline(readStream, options) {
+ return createStream(readStream, options);
+}
+function createStream(readStream, options) {
+ if (readStream) {
+ return createLineStream(readStream, options);
+ } else {
+ return new LineStream(options);
+ }
+}
+function createLineStream(readStream, options) {
+ if (!readStream) {
+ throw new Error("expected readStream");
+ }
+ if (!readStream.readable) {
+ throw new Error("readStream must be readable");
+ }
+ const ls = new LineStream(options);
+ readStream.pipe(ls);
+ return ls;
+}
+function LineStream(options) {
+ import_stream.default.Transform.call(this, options);
+ options = options || {};
+ this._readableState.objectMode = true;
+ this._lineBuffer = [];
+ this._keepEmptyLines = options.keepEmptyLines || false;
+ this._lastChunkEndedWithCR = false;
+ this.on("pipe", function(src) {
+ if (!this.encoding) {
+ if (src instanceof import_stream.default.Readable) {
+ this.encoding = src._readableState.encoding;
+ }
+ }
+ });
+}
+import_util.default.inherits(LineStream, import_stream.default.Transform);
+LineStream.prototype._transform = function(chunk, encoding, done) {
+ encoding = encoding || "utf8";
+ if (Buffer.isBuffer(chunk)) {
+ if (encoding == "buffer") {
+ chunk = chunk.toString();
+ encoding = "utf8";
+ } else {
+ chunk = chunk.toString(encoding);
+ }
+ }
+ this._chunkEncoding = encoding;
+ const lines = chunk.split(/\r\n|\r|\n/g);
+ if (this._lastChunkEndedWithCR && chunk[0] == "\n") {
+ lines.shift();
+ }
+ if (this._lineBuffer.length > 0) {
+ this._lineBuffer[this._lineBuffer.length - 1] += lines[0];
+ lines.shift();
+ }
+ this._lastChunkEndedWithCR = chunk[chunk.length - 1] == "\r";
+ this._lineBuffer = this._lineBuffer.concat(lines);
+ this._pushBuffer(encoding, 1, done);
+};
+LineStream.prototype._pushBuffer = function(encoding, keep, done) {
+ while (this._lineBuffer.length > keep) {
+ const line = this._lineBuffer.shift();
+ if (this._keepEmptyLines || line.length > 0) {
+ if (!this.push(this._reencode(line, encoding))) {
+ const self = this;
+ setImmediate(function() {
+ self._pushBuffer(encoding, keep, done);
+ });
+ return;
+ }
+ }
+ }
+ done();
+};
+LineStream.prototype._flush = function(done) {
+ this._pushBuffer(this._chunkEncoding, 0, done);
+};
+LineStream.prototype._reencode = function(line, chunkEncoding) {
+ if (this.encoding && this.encoding != chunkEncoding) {
+ return Buffer.from(line, chunkEncoding).toString(this.encoding);
+ } else if (this.encoding) {
+ return line;
+ } else {
+ return Buffer.from(line, chunkEncoding);
+ }
+};
+
+// ../generator-helper/src/generatorHandler.ts
+function generatorHandler(handler) {
+ byline(process.stdin).on("data", async (line) => {
+ const json = JSON.parse(String(line));
+ if (json.method === "generate" && json.params) {
+ try {
+ const result = await handler.onGenerate(json.params);
+ respond({
+ jsonrpc: "2.0",
+ result,
+ id: json.id
+ });
+ } catch (_e) {
+ const e = _e;
+ respond({
+ jsonrpc: "2.0",
+ error: {
+ code: -32e3,
+ message: e.message,
+ data: {
+ stack: e.stack
+ }
+ },
+ id: json.id
+ });
+ }
+ }
+ if (json.method === "getManifest") {
+ if (handler.onManifest) {
+ try {
+ const manifest = handler.onManifest(json.params);
+ respond({
+ jsonrpc: "2.0",
+ result: {
+ manifest
+ },
+ id: json.id
+ });
+ } catch (_e) {
+ const e = _e;
+ respond({
+ jsonrpc: "2.0",
+ error: {
+ code: -32e3,
+ message: e.message,
+ data: {
+ stack: e.stack
+ }
+ },
+ id: json.id
+ });
+ }
+ } else {
+ respond({
+ jsonrpc: "2.0",
+ result: {
+ manifest: null
+ },
+ id: json.id
+ });
+ }
+ }
+ });
+ process.stdin.resume();
+}
+function respond(response) {
+ console.error(JSON.stringify(response));
+}
+
+// ../get-platform/src/getNodeAPIName.ts
+var NODE_API_QUERY_ENGINE_URL_BASE = "libquery_engine";
+function getNodeAPIName(binaryTarget, type) {
+ const isUrl = type === "url";
+ if (binaryTarget.includes("windows")) {
+ return isUrl ? `query_engine.dll.node` : `query_engine-${binaryTarget}.dll.node`;
+ } else if (binaryTarget.includes("darwin")) {
+ return isUrl ? `${NODE_API_QUERY_ENGINE_URL_BASE}.dylib.node` : `${NODE_API_QUERY_ENGINE_URL_BASE}-${binaryTarget}.dylib.node`;
+ } else {
+ return isUrl ? `${NODE_API_QUERY_ENGINE_URL_BASE}.so.node` : `${NODE_API_QUERY_ENGINE_URL_BASE}-${binaryTarget}.so.node`;
+ }
+}
+
+// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js
+var import_node_process = __toESM(require("process"), 1);
+var import_common_path_prefix = __toESM(require_common_path_prefix(), 1);
+
+// ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
+var findUpStop = Symbol("findUpStop");
+
+// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js
+var { env, cwd } = import_node_process.default;
+
+// ../fetch-engine/src/utils.ts
+var import_fs = __toESM(require("fs"));
+var debug = src_default("prisma:fetch-engine:cache-dir");
+async function overwriteFile(sourcePath, targetPath) {
+ await removeFileIfExists(targetPath);
+ await import_fs.default.promises.copyFile(sourcePath, targetPath);
+}
+async function removeFileIfExists(filePath) {
+ try {
+ await import_fs.default.promises.unlink(filePath);
+ } catch (e) {
+ if (e.code !== "ENOENT") {
+ throw e;
+ }
+ }
+}
+
+// ../internals/src/client/getClientEngineType.ts
+var DEFAULT_CLIENT_ENGINE_TYPE = "library" /* Library */;
+function getClientEngineType(generatorConfig) {
+ const engineTypeFromEnvVar = getEngineTypeFromEnvVar();
+ if (engineTypeFromEnvVar) return engineTypeFromEnvVar;
+ if (generatorConfig?.config.engineType === "library" /* Library */) {
+ return "library" /* Library */;
+ } else if (generatorConfig?.config.engineType === "binary" /* Binary */) {
+ return "binary" /* Binary */;
+ } else {
+ return DEFAULT_CLIENT_ENGINE_TYPE;
+ }
+}
+function getEngineTypeFromEnvVar() {
+ const engineType = process.env.PRISMA_CLIENT_ENGINE_TYPE;
+ if (engineType === "library" /* Library */) {
+ return "library" /* Library */;
+ } else if (engineType === "binary" /* Binary */) {
+ return "binary" /* Binary */;
+ } else {
+ return void 0;
+ }
+}
+
+// ../internals/src/utils/parseEnvValue.ts
+function parseEnvValue(object) {
+ if (object.fromEnvVar && object.fromEnvVar != "null") {
+ const value = process.env[object.fromEnvVar];
+ if (!value) {
+ throw new Error(
+ `Attempted to load provider value using \`env(${object.fromEnvVar})\` but it was not present. Please ensure that ${dim(
+ object.fromEnvVar
+ )} is present in your Environment Variables`
+ );
+ }
+ return value;
+ }
+ return object.value;
+}
+
+// ../internals/src/utils/path.ts
+var import_path = __toESM(require("path"));
+function pathToPosix(filePath) {
+ if (import_path.default.sep === import_path.default.posix.sep) {
+ return filePath;
+ }
+ return filePath.split(import_path.default.sep).join(import_path.default.posix.sep);
+}
+
+// ../internals/src/utils/parseAWSNodejsRuntimeEnvVarVersion.ts
+function parseAWSNodejsRuntimeEnvVarVersion() {
+ const runtimeEnvVar = process.env.AWS_LAMBDA_JS_RUNTIME;
+ if (!runtimeEnvVar || runtimeEnvVar === "") return null;
+ try {
+ const runtimeRegex = /^nodejs(\d+).x$/;
+ const match = runtimeRegex.exec(runtimeEnvVar);
+ if (match) {
+ return parseInt(match[1]);
+ }
+ } catch (e) {
+ console.error(
+ `We could not parse the AWS_LAMBDA_JS_RUNTIME env var with the following value: ${runtimeEnvVar}. This was silently ignored.`
+ );
+ }
+ return null;
+}
+
+// ../internals/src/utils/assertNever.ts
+function assertNever(arg, errorMessage) {
+ throw new Error(errorMessage);
+}
+
+// ../internals/src/utils/hasOwnProperty.ts
+function hasOwnProperty(object, key) {
+ return Object.prototype.hasOwnProperty.call(object, key);
+}
+
+// ../internals/src/utils/isValidJsIdentifier.ts
+var import_helper_validator_identifier = __toESM(require_lib2());
+function isValidJsIdentifier(str) {
+ return (0, import_helper_validator_identifier.isIdentifierName)(str);
+}
+
+// ../internals/src/utils/setClassName.ts
+function setClassName(classObject, name) {
+ Object.defineProperty(classObject, "name", {
+ value: name,
+ configurable: true
+ });
+}
+
+// src/runtime/externalToInternalDmmf.ts
+var import_pluralize = __toESM(require_pluralize());
+
+// src/generation/utils/common.ts
+var keyBy = (collection, prop) => {
+ const acc = {};
+ for (const obj of collection) {
+ const key = obj[prop];
+ acc[key] = obj;
+ }
+ return acc;
+};
+function needsNamespace(field) {
+ if (field.kind === "object") {
+ return true;
+ }
+ if (field.kind === "scalar") {
+ return field.type === "Json" || field.type === "Decimal";
+ }
+ return false;
+}
+var GraphQLScalarToJSTypeTable = {
+ String: "string",
+ Int: "number",
+ Float: "number",
+ Boolean: "boolean",
+ Long: "number",
+ DateTime: ["Date", "string"],
+ ID: "string",
+ UUID: "string",
+ Json: "JsonValue",
+ Bytes: "Buffer",
+ Decimal: ["Decimal", "DecimalJsLike", "number", "string"],
+ BigInt: ["bigint", "number"]
+};
+var JSOutputTypeToInputType = {
+ JsonValue: "InputJsonValue"
+};
+function capitalize(str) {
+ return str[0].toUpperCase() + str.slice(1);
+}
+function lowerCase(name) {
+ return name.substring(0, 1).toLowerCase() + name.substring(1);
+}
+
+// src/runtime/externalToInternalDmmf.ts
+function externalToInternalDmmf(document) {
+ return {
+ ...document,
+ mappings: getMappings(document.mappings, document.datamodel)
+ };
+}
+function getMappings(mappings, datamodel) {
+ const modelOperations = mappings.modelOperations.filter((mapping) => {
+ const model = datamodel.models.find((m) => m.name === mapping.model);
+ if (!model) {
+ throw new Error(`Mapping without model ${mapping.model}`);
+ }
+ return model.fields.some((f) => f.kind !== "object");
+ }).map((mapping) => ({
+ model: mapping.model,
+ plural: (0, import_pluralize.default)(lowerCase(mapping.model)),
+ // TODO not needed anymore
+ findUnique: mapping.findUnique || mapping.findSingle,
+ findUniqueOrThrow: mapping.findUniqueOrThrow,
+ findFirst: mapping.findFirst,
+ findFirstOrThrow: mapping.findFirstOrThrow,
+ findMany: mapping.findMany,
+ create: mapping.createOne || mapping.createSingle || mapping.create,
+ createMany: mapping.createMany,
+ createManyAndReturn: mapping.createManyAndReturn,
+ delete: mapping.deleteOne || mapping.deleteSingle || mapping.delete,
+ update: mapping.updateOne || mapping.updateSingle || mapping.update,
+ deleteMany: mapping.deleteMany,
+ updateMany: mapping.updateMany,
+ upsert: mapping.upsertOne || mapping.upsertSingle || mapping.upsert,
+ aggregate: mapping.aggregate,
+ groupBy: mapping.groupBy,
+ findRaw: mapping.findRaw,
+ aggregateRaw: mapping.aggregateRaw
+ }));
+ return {
+ modelOperations,
+ otherOperations: mappings.otherOperations
+ };
+}
+
+// src/generation/generateClient.ts
+var import_crypto2 = require("crypto");
+var import_env_paths = __toESM(require_env_paths());
+var import_fs2 = require("fs");
+var import_promises = __toESM(require("fs/promises"));
+var import_fs_extra = __toESM(require_lib());
+var import_path5 = __toESM(require("path"));
+var import_pkg_up = __toESM(require_pkg_up());
+var import_package = __toESM(require_package2());
+
+// src/generation/getDMMF.ts
+function getPrismaClientDMMF(dmmf) {
+ return externalToInternalDmmf(dmmf);
+}
+
+// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/index.js
+require_flatten();
+require_flat_map();
+
+// src/generation/TSClient/Enum.ts
+var import_indent_string = __toESM(require_indent_string());
+
+// src/runtime/core/types/exported/ObjectEnums.ts
+var objectEnumNames = ["JsonNullValueInput", "NullableJsonNullValueInput", "JsonNullValueFilter"];
+var secret = Symbol();
+var representations = /* @__PURE__ */ new WeakMap();
+var ObjectEnumValue = class {
+ constructor(arg) {
+ if (arg === secret) {
+ representations.set(this, `Prisma.${this._getName()}`);
+ } else {
+ representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`);
+ }
+ }
+ _getName() {
+ return this.constructor.name;
+ }
+ toString() {
+ return representations.get(this);
+ }
+};
+var NullTypesEnumValue = class extends ObjectEnumValue {
+ _getNamespace() {
+ return "NullTypes";
+ }
+};
+var DbNull = class extends NullTypesEnumValue {
+};
+setClassName2(DbNull, "DbNull");
+var JsonNull = class extends NullTypesEnumValue {
+};
+setClassName2(JsonNull, "JsonNull");
+var AnyNull = class extends NullTypesEnumValue {
+};
+setClassName2(AnyNull, "AnyNull");
+var objectEnumValues = {
+ classes: {
+ DbNull,
+ JsonNull,
+ AnyNull
+ },
+ instances: {
+ DbNull: new DbNull(secret),
+ JsonNull: new JsonNull(secret),
+ AnyNull: new AnyNull(secret)
+ }
+};
+function setClassName2(classObject, name) {
+ Object.defineProperty(classObject, "name", {
+ value: name,
+ configurable: true
+ });
+}
+
+// src/runtime/strictEnum.ts
+var strictEnumNames = ["TransactionIsolationLevel"];
+
+// src/generation/TSClient/constants.ts
+var TAB_SIZE = 2;
+
+// src/generation/TSClient/Enum.ts
+var Enum = class {
+ constructor(type, useNamespace) {
+ this.type = type;
+ this.useNamespace = useNamespace;
+ }
+ isObjectEnum() {
+ return this.useNamespace && objectEnumNames.includes(this.type.name);
+ }
+ isStrictEnum() {
+ return this.useNamespace && strictEnumNames.includes(this.type.name);
+ }
+ toJS() {
+ const { type } = this;
+ const enumVariants = `{
+${(0, import_indent_string.default)(type.values.map((v) => `${v}: ${this.getValueJS(v)}`).join(",\n"), TAB_SIZE)}
+}`;
+ const enumBody = this.isStrictEnum() ? `makeStrictEnum(${enumVariants})` : enumVariants;
+ return this.useNamespace ? `exports.Prisma.${type.name} = ${enumBody};` : `exports.${type.name} = exports.$Enums.${type.name} = ${enumBody};`;
+ }
+ getValueJS(value) {
+ return this.isObjectEnum() ? `Prisma.${value}` : `'${value}'`;
+ }
+ toTS() {
+ const { type } = this;
+ return `export const ${type.name}: {
+${(0, import_indent_string.default)(type.values.map((v) => `${v}: ${this.getValueTS(v)}`).join(",\n"), TAB_SIZE)}
+};
+
+export type ${type.name} = (typeof ${type.name})[keyof typeof ${type.name}]
+`;
+ }
+ getValueTS(value) {
+ return this.isObjectEnum() ? `typeof ${value}` : `'${value}'`;
+ }
+};
+
+// src/generation/TSClient/Generable.ts
+function JS(gen) {
+ return gen.toJS?.() ?? "";
+}
+function BrowserJS(gen) {
+ return gen.toBrowserJS?.() ?? "";
+}
+function TS(gen) {
+ return gen.toTS();
+}
+
+// src/generation/TSClient/Input.ts
+var import_indent_string2 = __toESM(require_indent_string());
+
+// src/runtime/utils/uniqueBy.ts
+function uniqueBy(arr, callee) {
+ const result = {};
+ for (const value of arr) {
+ const hash = callee(value);
+ if (!result[hash]) {
+ result[hash] = value;
+ }
+ }
+ return Object.values(result);
+}
+
+// src/generation/ts-builders/ArraySpread.ts
+init_TypeBuilder();
+var ArraySpread = class extends TypeBuilder {
+ constructor(innerType) {
+ super();
+ this.innerType = innerType;
+ }
+ write(writer) {
+ writer.write("[...").write(this.innerType).write("]");
+ }
+};
+function arraySpread(innerType) {
+ return new ArraySpread(innerType);
+}
+
+// src/generation/ts-builders/ArrayType.ts
+init_TypeBuilder();
+var ArrayType = class extends TypeBuilder {
+ constructor(elementType) {
+ super();
+ this.elementType = elementType;
+ }
+ write(writer) {
+ this.elementType.writeIndexed(writer);
+ writer.write("[]");
+ }
+};
+function array(elementType) {
+ return new ArrayType(elementType);
+}
+
+// src/generation/ts-builders/ConstDeclaration.ts
+var ConstDeclaration = class {
+ constructor(name, type) {
+ this.name = name;
+ this.type = type;
+ }
+ setDocComment(docComment2) {
+ this.docComment = docComment2;
+ return this;
+ }
+ write(writer) {
+ if (this.docComment) {
+ writer.write(this.docComment);
+ }
+ writer.write("const ").write(this.name).write(": ").write(this.type);
+ }
+};
+function constDeclaration(name, type) {
+ return new ConstDeclaration(name, type);
+}
+
+// src/generation/ts-builders/DocComment.ts
+var DocComment = class {
+ constructor(startingText) {
+ this.lines = [];
+ if (startingText) {
+ this.addText(startingText);
+ }
+ }
+ addText(text) {
+ this.lines.push(...text.split("\n"));
+ return this;
+ }
+ write(writer) {
+ writer.writeLine("/**");
+ for (const line of this.lines) {
+ writer.writeLine(` * ${line}`);
+ }
+ writer.writeLine(" */");
+ return writer;
+ }
+};
+function docComment(firstParameter, ...args) {
+ if (typeof firstParameter === "string" || typeof firstParameter === "undefined") {
+ return new DocComment(firstParameter);
+ }
+ return docCommentTag(firstParameter, args);
+}
+function docCommentTag(strings, args) {
+ const docComment2 = new DocComment();
+ const fullText = strings.flatMap((str, i) => {
+ if (i < args.length) {
+ return [str, args[i]];
+ }
+ return [str];
+ }).join("");
+ const lines = trimEmptyLines(fullText.split("\n"));
+ if (lines.length === 0) {
+ return docComment2;
+ }
+ const indent9 = getIndent(lines[0]);
+ for (const line of lines) {
+ docComment2.addText(line.slice(indent9));
+ }
+ return docComment2;
+}
+function trimEmptyLines(lines) {
+ const firstLine = findFirstNonEmptyLine(lines);
+ const lastLine = findLastNonEmptyLine(lines);
+ if (firstLine === -1 || lastLine === -1) {
+ return [];
+ }
+ return lines.slice(firstLine, lastLine + 1);
+}
+function findFirstNonEmptyLine(lines) {
+ return lines.findIndex((line) => !isEmptyLine(line));
+}
+function findLastNonEmptyLine(lines) {
+ let i = lines.length - 1;
+ while (i > 0 && isEmptyLine(lines[i])) {
+ i--;
+ }
+ return i;
+}
+function isEmptyLine(line) {
+ return line.trim().length === 0;
+}
+function getIndent(line) {
+ let indent9 = 0;
+ while (line[indent9] === " ") {
+ indent9++;
+ }
+ return indent9;
+}
+
+// src/generation/ts-builders/Export.ts
+var Export = class {
+ constructor(declaration) {
+ this.declaration = declaration;
+ }
+ setDocComment(docComment2) {
+ this.docComment = docComment2;
+ return this;
+ }
+ write(writer) {
+ if (this.docComment) {
+ writer.write(this.docComment);
+ }
+ writer.write("export ").write(this.declaration);
+ }
+};
+function moduleExport(declaration) {
+ return new Export(declaration);
+}
+
+// src/generation/ts-builders/ExportFrom.ts
+var NamespaceExport = class {
+ constructor(from, namespace2) {
+ this.from = from;
+ this.namespace = namespace2;
+ }
+ write(writer) {
+ writer.write(`export * as ${this.namespace} from '${this.from}'`);
+ }
+};
+var BindingsExport = class {
+ constructor(from) {
+ this.from = from;
+ this.namedExports = [];
+ }
+ named(namedExport) {
+ if (typeof namedExport === "string") {
+ namedExport = new NamedExport(namedExport);
+ }
+ this.namedExports.push(namedExport);
+ return this;
+ }
+ write(writer) {
+ writer.write("export ").write("{ ").writeJoined(", ", this.namedExports).write(" }").write(` from "${this.from}"`);
+ }
+};
+var NamedExport = class {
+ constructor(name) {
+ this.name = name;
+ }
+ as(alias) {
+ this.alias = alias;
+ return this;
+ }
+ write(writer) {
+ writer.write(this.name);
+ if (this.alias) {
+ writer.write(" as ").write(this.alias);
+ }
+ }
+};
+var ExportAllFrom = class {
+ constructor(from) {
+ this.from = from;
+ }
+ asNamespace(namespace2) {
+ return new NamespaceExport(this.from, namespace2);
+ }
+ named(binding) {
+ return new BindingsExport(this.from).named(binding);
+ }
+ write(writer) {
+ writer.write(`export * from "${this.from}"`);
+ }
+};
+function moduleExportFrom(from) {
+ return new ExportAllFrom(from);
+}
+
+// src/generation/ts-builders/File.ts
+var File = class {
+ constructor() {
+ this.imports = [];
+ this.declarations = [];
+ }
+ addImport(moduleImport2) {
+ this.imports.push(moduleImport2);
+ return this;
+ }
+ add(declaration) {
+ this.declarations.push(declaration);
+ }
+ write(writer) {
+ for (const moduleImport2 of this.imports) {
+ writer.writeLine(moduleImport2);
+ }
+ if (this.imports.length > 0) {
+ writer.newLine();
+ }
+ for (const [i, declaration] of this.declarations.entries()) {
+ writer.writeLine(declaration);
+ if (i < this.declarations.length - 1) {
+ writer.newLine();
+ }
+ }
+ }
+};
+function file() {
+ return new File();
+}
+
+// src/generation/ts-builders/PrimitiveType.ts
+init_TypeBuilder();
+var PrimitiveType = class extends TypeBuilder {
+ constructor(name) {
+ super();
+ this.name = name;
+ }
+ write(writer) {
+ writer.write(this.name);
+ }
+};
+var stringType = new PrimitiveType("string");
+var numberType = new PrimitiveType("number");
+var booleanType = new PrimitiveType("boolean");
+var nullType = new PrimitiveType("null");
+var undefinedType = new PrimitiveType("undefined");
+var bigintType = new PrimitiveType("bigint");
+var unknownType = new PrimitiveType("unknown");
+var anyType = new PrimitiveType("any");
+var voidType = new PrimitiveType("void");
+var thisType = new PrimitiveType("this");
+var neverType = new PrimitiveType("never");
+
+// src/generation/ts-builders/FunctionType.ts
+init_TypeBuilder();
+var FunctionType = class extends TypeBuilder {
+ constructor() {
+ super(...arguments);
+ this.needsParenthesisWhenIndexed = true;
+ this.needsParenthesisInKeyof = true;
+ this.needsParenthesisInUnion = true;
+ this.returnType = voidType;
+ this.parameters = [];
+ this.genericParameters = [];
+ }
+ setReturnType(returnType) {
+ this.returnType = returnType;
+ return this;
+ }
+ addParameter(param) {
+ this.parameters.push(param);
+ return this;
+ }
+ addGenericParameter(param) {
+ this.genericParameters.push(param);
+ return this;
+ }
+ write(writer) {
+ if (this.genericParameters.length > 0) {
+ writer.write("<").writeJoined(", ", this.genericParameters).write(">");
+ }
+ writer.write("(").writeJoined(", ", this.parameters).write(") => ").write(this.returnType);
+ }
+};
+function functionType() {
+ return new FunctionType();
+}
+
+// src/generation/ts-builders/NamedType.ts
+init_TypeBuilder();
+var NamedType = class extends TypeBuilder {
+ constructor(name) {
+ super();
+ this.name = name;
+ this.genericArguments = [];
+ }
+ addGenericArgument(type) {
+ this.genericArguments.push(type);
+ return this;
+ }
+ write(writer) {
+ writer.write(this.name);
+ if (this.genericArguments.length > 0) {
+ writer.write("<").writeJoined(", ", this.genericArguments).write(">");
+ }
+ }
+};
+function namedType(name) {
+ return new NamedType(name);
+}
+
+// src/generation/ts-builders/GenericParameter.ts
+var GenericParameter = class {
+ constructor(name) {
+ this.name = name;
+ }
+ extends(type) {
+ this.extendedType = type;
+ return this;
+ }
+ default(type) {
+ this.defaultType = type;
+ return this;
+ }
+ toArgument() {
+ return new NamedType(this.name);
+ }
+ write(writer) {
+ writer.write(this.name);
+ if (this.extendedType) {
+ writer.write(" extends ").write(this.extendedType);
+ }
+ if (this.defaultType) {
+ writer.write(" = ").write(this.defaultType);
+ }
+ }
+};
+function genericParameter(name) {
+ return new GenericParameter(name);
+}
+
+// src/generation/ts-builders/helpers.ts
+function omit(type, keyType2) {
+ return namedType("Omit").addGenericArgument(type).addGenericArgument(keyType2);
+}
+function promise(resultType) {
+ return new NamedType("$Utils.JsPromise").addGenericArgument(resultType);
+}
+function prismaPromise(resultType) {
+ return new NamedType("Prisma.PrismaPromise").addGenericArgument(resultType);
+}
+function optional(innerType) {
+ return new NamedType("$Utils.Optional").addGenericArgument(innerType);
+}
+
+// src/generation/ts-builders/Import.ts
+var NamespaceImport = class {
+ constructor(alias, from) {
+ this.alias = alias;
+ this.from = from;
+ }
+ write(writer) {
+ writer.write("import * as ").write(this.alias).write(` from "${this.from}"`);
+ }
+};
+var BindingsImport = class {
+ constructor(from) {
+ this.from = from;
+ this.namedImports = [];
+ }
+ default(name) {
+ this.defaultImport = name;
+ return this;
+ }
+ named(namedImport) {
+ if (typeof namedImport === "string") {
+ namedImport = new NamedImport(namedImport);
+ }
+ this.namedImports.push(namedImport);
+ return this;
+ }
+ write(writer) {
+ writer.write("import ");
+ if (this.defaultImport) {
+ writer.write(this.defaultImport);
+ if (this.hasNamedImports()) {
+ writer.write(", ");
+ }
+ }
+ if (this.hasNamedImports()) {
+ writer.write("{ ").writeJoined(", ", this.namedImports).write(" }");
+ }
+ writer.write(` from "${this.from}"`);
+ }
+ hasNamedImports() {
+ return this.namedImports.length > 0;
+ }
+};
+var NamedImport = class {
+ constructor(name) {
+ this.name = name;
+ }
+ as(alias) {
+ this.alias = alias;
+ return this;
+ }
+ write(writer) {
+ writer.write(this.name);
+ if (this.alias) {
+ writer.write(" as ").write(this.alias);
+ }
+ }
+};
+var ModuleImport = class {
+ constructor(from) {
+ this.from = from;
+ }
+ asNamespace(alias) {
+ return new NamespaceImport(alias, this.from);
+ }
+ default(alias) {
+ return new BindingsImport(this.from).default(alias);
+ }
+ named(namedImport) {
+ return new BindingsImport(this.from).named(namedImport);
+ }
+ write(writer) {
+ writer.write("import ").write(`"${this.from}"`);
+ }
+};
+function moduleImport(from) {
+ return new ModuleImport(from);
+}
+
+// src/generation/ts-builders/Interface.ts
+init_TypeBuilder();
+var InterfaceDeclaration = class extends TypeBuilder {
+ constructor(name) {
+ super();
+ this.name = name;
+ this.needsParenthesisWhenIndexed = true;
+ this.items = [];
+ this.genericParameters = [];
+ this.extendedTypes = [];
+ }
+ add(item) {
+ this.items.push(item);
+ return this;
+ }
+ addMultiple(items) {
+ for (const item of items) {
+ this.add(item);
+ }
+ return this;
+ }
+ addGenericParameter(param) {
+ this.genericParameters.push(param);
+ return this;
+ }
+ extends(type) {
+ this.extendedTypes.push(type);
+ return this;
+ }
+ write(writer) {
+ writer.write("interface ").write(this.name);
+ if (this.genericParameters.length > 0) {
+ writer.write("<").writeJoined(", ", this.genericParameters).write(">");
+ }
+ if (this.extendedTypes.length > 0) {
+ writer.write(" extends ").writeJoined(", ", this.extendedTypes);
+ }
+ if (this.items.length === 0) {
+ writer.writeLine(" {}");
+ return;
+ }
+ writer.writeLine(" {").withIndent(() => {
+ for (const item of this.items) {
+ writer.writeLine(item);
+ }
+ }).write("}");
+ }
+};
+function interfaceDeclaration(name) {
+ return new InterfaceDeclaration(name);
+}
+
+// src/generation/ts-builders/Method.ts
+var Method = class {
+ constructor(name) {
+ this.name = name;
+ this.returnType = voidType;
+ this.parameters = [];
+ this.genericParameters = [];
+ }
+ setDocComment(docComment2) {
+ this.docComment = docComment2;
+ return this;
+ }
+ setReturnType(returnType) {
+ this.returnType = returnType;
+ return this;
+ }
+ addParameter(param) {
+ this.parameters.push(param);
+ return this;
+ }
+ addGenericParameter(param) {
+ this.genericParameters.push(param);
+ return this;
+ }
+ write(writer) {
+ if (this.docComment) {
+ writer.write(this.docComment);
+ }
+ writer.write(this.name);
+ if (this.genericParameters.length > 0) {
+ writer.write("<").writeJoined(", ", this.genericParameters).write(">");
+ }
+ writer.write("(");
+ if (this.parameters.length > 0) {
+ writer.writeJoined(", ", this.parameters);
+ }
+ writer.write(")");
+ if (this.name !== "constructor") {
+ writer.write(": ").write(this.returnType);
+ }
+ }
+};
+function method(name) {
+ return new Method(name);
+}
+
+// src/generation/ts-builders/NamespaceDeclaration.ts
+var NamespaceDeclaration = class {
+ constructor(name) {
+ this.name = name;
+ this.items = [];
+ }
+ add(declaration) {
+ this.items.push(declaration);
+ }
+ write(writer) {
+ writer.writeLine(`namespace ${this.name} {`).withIndent(() => {
+ for (const item of this.items) {
+ writer.writeLine(item);
+ }
+ }).write("}");
+ }
+};
+function namespace(name) {
+ return new NamespaceDeclaration(name);
+}
+
+// src/generation/ts-builders/ObjectType.ts
+init_TypeBuilder();
+var ObjectType = class extends TypeBuilder {
+ constructor() {
+ super(...arguments);
+ this.needsParenthesisWhenIndexed = true;
+ this.items = [];
+ this.inline = false;
+ }
+ add(item) {
+ this.items.push(item);
+ return this;
+ }
+ addMultiple(items) {
+ for (const item of items) {
+ this.add(item);
+ }
+ return this;
+ }
+ formatInline() {
+ this.inline = true;
+ return this;
+ }
+ write(writer) {
+ if (this.items.length === 0) {
+ writer.write("{}");
+ } else if (this.inline) {
+ this.writeInline(writer);
+ } else {
+ this.writeMultiline(writer);
+ }
+ }
+ writeMultiline(writer) {
+ writer.writeLine("{").withIndent(() => {
+ for (const item of this.items) {
+ writer.writeLine(item);
+ }
+ }).write("}");
+ }
+ writeInline(writer) {
+ writer.write("{ ").writeJoined(", ", this.items).write(" }");
+ }
+};
+function objectType() {
+ return new ObjectType();
+}
+
+// src/generation/ts-builders/Parameter.ts
+var Parameter = class {
+ constructor(name, type) {
+ this.name = name;
+ this.type = type;
+ this.isOptional = false;
+ }
+ optional() {
+ this.isOptional = true;
+ return this;
+ }
+ write(writer) {
+ writer.write(this.name);
+ if (this.isOptional) {
+ writer.write("?");
+ }
+ writer.write(": ").write(this.type);
+ }
+};
+function parameter(name, type) {
+ return new Parameter(name, type);
+}
+
+// src/generation/ts-builders/Property.ts
+var Property = class {
+ constructor(name, type) {
+ this.name = name;
+ this.type = type;
+ this.isOptional = false;
+ this.isReadonly = false;
+ }
+ optional() {
+ this.isOptional = true;
+ return this;
+ }
+ readonly() {
+ this.isReadonly = true;
+ return this;
+ }
+ setDocComment(docComment2) {
+ this.docComment = docComment2;
+ return this;
+ }
+ write(writer) {
+ if (this.docComment) {
+ writer.write(this.docComment);
+ }
+ if (this.isReadonly) {
+ writer.write("readonly ");
+ }
+ if (typeof this.name === "string") {
+ if (isValidJsIdentifier(this.name)) {
+ writer.write(this.name);
+ } else {
+ writer.write("[").write(JSON.stringify(this.name)).write("]");
+ }
+ } else {
+ writer.write("[").write(this.name).write("]");
+ }
+ if (this.isOptional) {
+ writer.write("?");
+ }
+ writer.write(": ").write(this.type);
+ }
+};
+function property(name, type) {
+ return new Property(name, type);
+}
+
+// src/generation/ts-builders/Writer.ts
+var INDENT_SIZE = 2;
+var Writer = class {
+ constructor(startingIndent = 0, context) {
+ this.context = context;
+ this.lines = [];
+ this.currentLine = "";
+ this.currentIndent = 0;
+ this.currentIndent = startingIndent;
+ }
+ /**
+ * Adds provided value to the current line. Does not end the line.
+ *
+ * @param value
+ * @returns
+ */
+ write(value) {
+ if (typeof value === "string") {
+ this.currentLine += value;
+ } else {
+ value.write(this);
+ }
+ return this;
+ }
+ /**
+ * Adds several `values` to the current line, separated by `separator`. Both values and separator
+ * can also be `Builder` instances for more advanced formatting.
+ *
+ * @param separator
+ * @param values
+ * @param writeItem allow to customize how individual item is written
+ * @returns
+ */
+ writeJoined(separator, values, writeItem = (item, w) => w.write(item)) {
+ const last = values.length - 1;
+ for (let i = 0; i < values.length; i++) {
+ writeItem(values[i], this);
+ if (i !== last) {
+ this.write(separator);
+ }
+ }
+ return this;
+ }
+ /**
+ * Adds a string to current line, flushes current line and starts a new line.
+ * @param line
+ * @returns
+ */
+ writeLine(line) {
+ return this.write(line).newLine();
+ }
+ /**
+ * Flushes current line and starts a new line. New line starts at previously configured indentation level
+ * @returns
+ */
+ newLine() {
+ this.lines.push(this.indentedCurrentLine());
+ this.currentLine = "";
+ this.marginSymbol = void 0;
+ const afterNextNewLineCallback = this.afterNextNewLineCallback;
+ this.afterNextNewLineCallback = void 0;
+ afterNextNewLineCallback?.();
+ return this;
+ }
+ /**
+ * Increases indentation level by 1, calls provided callback and then decreases indentation again.
+ * Could be used for writing indented blocks of text:
+ *
+ * @example
+ * ```ts
+ * writer
+ * .writeLine('{')
+ * .withIndent(() => {
+ * writer.writeLine('foo: 123');
+ * writer.writeLine('bar: 456');
+ * })
+ * .writeLine('}')
+ * ```
+ * @param callback
+ * @returns
+ */
+ withIndent(callback) {
+ this.indent();
+ callback(this);
+ this.unindent();
+ return this;
+ }
+ /**
+ * Calls provided callback next time when new line is started.
+ * Callback is called after old line have already been flushed and a new
+ * line have been started. Can be used for adding "between the lines" decorations,
+ * such as underlines.
+ *
+ * @param callback
+ * @returns
+ */
+ afterNextNewline(callback) {
+ this.afterNextNewLineCallback = callback;
+ return this;
+ }
+ /**
+ * Increases indentation level of the current line by 1
+ * @returns
+ */
+ indent() {
+ this.currentIndent++;
+ return this;
+ }
+ /**
+ * Decreases indentation level of the current line by 1, if it is possible
+ * @returns
+ */
+ unindent() {
+ if (this.currentIndent > 0) {
+ this.currentIndent--;
+ }
+ return this;
+ }
+ /**
+ * Adds a symbol, that will replace the first character of the current line (including indentation)
+ * when it is flushed. Can be used for adding markers to the line.
+ *
+ * Note: if indentation level of the line is 0, it will replace the first actually printed character
+ * of the line. Use with caution.
+ * @param symbol
+ * @returns
+ */
+ addMarginSymbol(symbol) {
+ this.marginSymbol = symbol;
+ return this;
+ }
+ toString() {
+ return this.lines.concat(this.indentedCurrentLine()).join("\n");
+ }
+ getCurrentLineLength() {
+ return this.currentLine.length;
+ }
+ indentedCurrentLine() {
+ const line = this.currentLine.padStart(this.currentLine.length + INDENT_SIZE * this.currentIndent);
+ if (this.marginSymbol) {
+ return this.marginSymbol + line.slice(1);
+ }
+ return line;
+ }
+};
+
+// src/generation/ts-builders/stringify.ts
+function stringify(builder, { indentLevel = 0, newLine = "none" } = {}) {
+ const str = new Writer(indentLevel, void 0).write(builder).toString();
+ switch (newLine) {
+ case "none":
+ return str;
+ case "leading":
+ return "\n" + str;
+ case "trailing":
+ return str + "\n";
+ case "both":
+ return "\n" + str + "\n";
+ default:
+ assertNever(newLine, "Unexpected value");
+ }
+}
+
+// src/generation/ts-builders/StringLiteralType.ts
+init_TypeBuilder();
+var StringLiteralType = class extends TypeBuilder {
+ constructor(content) {
+ super();
+ this.content = content;
+ }
+ write(writer) {
+ writer.write(JSON.stringify(this.content));
+ }
+};
+function stringLiteral(content) {
+ return new StringLiteralType(content);
+}
+
+// src/generation/ts-builders/TupleType.ts
+init_TypeBuilder();
+var TupleItem = class {
+ constructor(type) {
+ this.type = type;
+ }
+ setName(name) {
+ this.name = name;
+ return this;
+ }
+ write(writer) {
+ if (this.name) {
+ writer.write(this.name).write(": ");
+ }
+ writer.write(this.type);
+ }
+};
+var TupleType = class extends TypeBuilder {
+ constructor() {
+ super(...arguments);
+ this.items = [];
+ }
+ add(item) {
+ if (item instanceof TypeBuilder) {
+ item = new TupleItem(item);
+ }
+ this.items.push(item);
+ return this;
+ }
+ write(writer) {
+ writer.write("[").writeJoined(", ", this.items).write("]");
+ }
+};
+function tupleType() {
+ return new TupleType();
+}
+function tupleItem(type) {
+ return new TupleItem(type);
+}
+
+// src/generation/ts-builders/TypeDeclaration.ts
+var TypeDeclaration = class {
+ constructor(name, type) {
+ this.name = name;
+ this.type = type;
+ this.genericParameters = [];
+ }
+ addGenericParameter(param) {
+ this.genericParameters.push(param);
+ return this;
+ }
+ setName(name) {
+ this.name = name;
+ return this;
+ }
+ setDocComment(docComment2) {
+ this.docComment = docComment2;
+ return this;
+ }
+ write(writer) {
+ if (this.docComment) {
+ writer.write(this.docComment);
+ }
+ writer.write("type ").write(this.name);
+ if (this.genericParameters.length > 0) {
+ writer.write("<").writeJoined(", ", this.genericParameters).write(">");
+ }
+ writer.write(" = ").write(this.type);
+ }
+};
+function typeDeclaration(name, type) {
+ return new TypeDeclaration(name, type);
+}
+
+// src/generation/ts-builders/UnionType.ts
+init_TypeBuilder();
+var UnionType = class extends TypeBuilder {
+ constructor(firstType) {
+ super();
+ this.needsParenthesisWhenIndexed = true;
+ this.needsParenthesisInKeyof = true;
+ this.variants = [firstType];
+ }
+ addVariant(variant) {
+ this.variants.push(variant);
+ return this;
+ }
+ addVariants(variants) {
+ for (const variant of variants) {
+ this.addVariant(variant);
+ }
+ return this;
+ }
+ write(writer) {
+ writer.writeJoined(" | ", this.variants, (variant, writer2) => {
+ if (variant.needsParenthesisInUnion) {
+ writer2.write("(").write(variant).write(")");
+ } else {
+ writer2.write(variant);
+ }
+ });
+ }
+ mapVariants(callback) {
+ return unionType(this.variants.map((v) => callback(v)));
+ }
+};
+function unionType(types) {
+ if (Array.isArray(types)) {
+ if (types.length === 0) {
+ throw new TypeError("Union types array can not be empty");
+ }
+ const union = new UnionType(types[0]);
+ for (let i = 1; i < types.length; i++) {
+ union.addVariant(types[i]);
+ }
+ return union;
+ }
+ return new UnionType(types);
+}
+
+// src/generation/ts-builders/WellKnownSymbol.ts
+var WellKnownSymbol = class {
+ constructor(name) {
+ this.name = name;
+ }
+ write(writer) {
+ writer.write("Symbol.").write(this.name);
+ }
+};
+function wellKnownSymbol(name) {
+ return new WellKnownSymbol(name);
+}
+var toStringTag = wellKnownSymbol("toStringTag");
+
+// src/generation/utils.ts
+function getSelectName(modelName) {
+ return `${modelName}Select`;
+}
+function getSelectCreateManyAndReturnName(modelName) {
+ return `${modelName}SelectCreateManyAndReturn`;
+}
+function getIncludeName(modelName) {
+ return `${modelName}Include`;
+}
+function getIncludeCreateManyAndReturnName(modelName) {
+ return `${modelName}IncludeCreateManyAndReturn`;
+}
+function getCreateManyAndReturnOutputType(modelName) {
+ return `CreateMany${modelName}AndReturnOutputType`;
+}
+function getOmitName(modelName) {
+ return `${modelName}Omit`;
+}
+function getAggregateName(modelName) {
+ return `Aggregate${capitalize2(modelName)}`;
+}
+function getGroupByName(modelName) {
+ return `${capitalize2(modelName)}GroupByOutputType`;
+}
+function getAvgAggregateName(modelName) {
+ return `${capitalize2(modelName)}AvgAggregateOutputType`;
+}
+function getSumAggregateName(modelName) {
+ return `${capitalize2(modelName)}SumAggregateOutputType`;
+}
+function getMinAggregateName(modelName) {
+ return `${capitalize2(modelName)}MinAggregateOutputType`;
+}
+function getMaxAggregateName(modelName) {
+ return `${capitalize2(modelName)}MaxAggregateOutputType`;
+}
+function getCountAggregateInputName(modelName) {
+ return `${capitalize2(modelName)}CountAggregateInputType`;
+}
+function getCountAggregateOutputName(modelName) {
+ return `${capitalize2(modelName)}CountAggregateOutputType`;
+}
+function getAggregateInputType(aggregateOutputType) {
+ return aggregateOutputType.replace(/OutputType$/, "InputType");
+}
+function getGroupByArgsName(modelName) {
+ return `${modelName}GroupByArgs`;
+}
+function getGroupByPayloadName(modelName) {
+ return `Get${capitalize2(modelName)}GroupByPayload`;
+}
+function getAggregateArgsName(modelName) {
+ return `${capitalize2(modelName)}AggregateArgs`;
+}
+function getAggregateGetName(modelName) {
+ return `Get${capitalize2(modelName)}AggregateType`;
+}
+function getFieldArgName(field, modelName) {
+ if (field.args.length) {
+ return getModelFieldArgsName(field, modelName);
+ }
+ return getModelArgName(field.outputType.type);
+}
+function getModelFieldArgsName(field, modelName) {
+ return `${modelName}$${field.name}Args`;
+}
+function getLegacyModelArgName(modelName) {
+ return `${modelName}Args`;
+}
+function getModelArgName(modelName, action) {
+ if (!action) {
+ return `${modelName}DefaultArgs`;
+ }
+ switch (action) {
+ case DMMF.ModelAction.findMany:
+ return `${modelName}FindManyArgs`;
+ case DMMF.ModelAction.findUnique:
+ return `${modelName}FindUniqueArgs`;
+ case DMMF.ModelAction.findUniqueOrThrow:
+ return `${modelName}FindUniqueOrThrowArgs`;
+ case DMMF.ModelAction.findFirst:
+ return `${modelName}FindFirstArgs`;
+ case DMMF.ModelAction.findFirstOrThrow:
+ return `${modelName}FindFirstOrThrowArgs`;
+ case DMMF.ModelAction.upsert:
+ return `${modelName}UpsertArgs`;
+ case DMMF.ModelAction.update:
+ return `${modelName}UpdateArgs`;
+ case DMMF.ModelAction.updateMany:
+ return `${modelName}UpdateManyArgs`;
+ case DMMF.ModelAction.delete:
+ return `${modelName}DeleteArgs`;
+ case DMMF.ModelAction.create:
+ return `${modelName}CreateArgs`;
+ case DMMF.ModelAction.createMany:
+ return `${modelName}CreateManyArgs`;
+ case DMMF.ModelAction.createManyAndReturn:
+ return `${modelName}CreateManyAndReturnArgs`;
+ case DMMF.ModelAction.deleteMany:
+ return `${modelName}DeleteManyArgs`;
+ case DMMF.ModelAction.groupBy:
+ return getGroupByArgsName(modelName);
+ case DMMF.ModelAction.aggregate:
+ return getAggregateArgsName(modelName);
+ case DMMF.ModelAction.count:
+ return `${modelName}CountArgs`;
+ case DMMF.ModelAction.findRaw:
+ return `${modelName}FindRawArgs`;
+ case DMMF.ModelAction.aggregateRaw:
+ return `${modelName}AggregateRawArgs`;
+ default:
+ assertNever(action, `Unknown action: ${action}`);
+ }
+}
+function getPayloadName(modelName, namespace2 = true) {
+ if (namespace2) {
+ return `Prisma.${getPayloadName(modelName, false)}`;
+ }
+ return `$${modelName}Payload`;
+}
+function getFieldRefsTypeName(name) {
+ return `${name}FieldRefs`;
+}
+function capitalize2(str) {
+ return str[0].toUpperCase() + str.slice(1);
+}
+function getRefAllowedTypeName(type) {
+ let typeName = type.type;
+ if (type.isList) {
+ typeName += "[]";
+ }
+ return `'${typeName}'`;
+}
+function appendSkipType(context, type) {
+ if (context.isPreviewFeatureOn("strictUndefinedChecks")) {
+ return unionType([type, namedType("$Types.Skip")]);
+ }
+ return type;
+}
+var extArgsParam = genericParameter("ExtArgs").extends(namedType("$Extensions.InternalArgs")).default(namedType("$Extensions.DefaultArgs"));
+
+// src/generation/TSClient/Input.ts
+var InputField = class {
+ constructor(field, context, source) {
+ this.field = field;
+ this.context = context;
+ this.source = source;
+ }
+ toTS() {
+ const property2 = buildInputField(this.field, this.context, this.source);
+ return stringify(property2);
+ }
+};
+function buildInputField(field, context, source) {
+ const tsType = buildAllFieldTypes(field.inputTypes, context, source);
+ const tsProperty = property(field.name, field.isRequired ? tsType : appendSkipType(context, tsType));
+ if (!field.isRequired) {
+ tsProperty.optional();
+ }
+ const docComment2 = docComment();
+ if (field.comment) {
+ docComment2.addText(field.comment);
+ }
+ if (field.deprecation) {
+ docComment2.addText(`@deprecated since ${field.deprecation.sinceVersion}: ${field.deprecation.reason}`);
+ }
+ if (docComment2.lines.length > 0) {
+ tsProperty.setDocComment(docComment2);
+ }
+ return tsProperty;
+}
+function buildSingleFieldType(t, genericsInfo, source) {
+ let type;
+ const scalarType = GraphQLScalarToJSTypeTable[t.type];
+ if (t.location === "enumTypes" && t.namespace === "model") {
+ type = namedType(`$Enums.${t.type}`);
+ } else if (t.type === "Null") {
+ return nullType;
+ } else if (Array.isArray(scalarType)) {
+ const union = unionType(scalarType.map(namedInputType));
+ if (t.isList) {
+ return union.mapVariants((variant) => array(variant));
+ }
+ return union;
+ } else {
+ type = namedInputType(scalarType ?? t.type);
+ }
+ if (genericsInfo.typeRefNeedsGenericModelArg(t)) {
+ if (source) {
+ type.addGenericArgument(stringLiteral(source));
+ } else {
+ type.addGenericArgument(namedType("$PrismaModel"));
+ }
+ }
+ if (t.isList) {
+ return array(type);
+ }
+ return type;
+}
+function namedInputType(typeName) {
+ return namedType(JSOutputTypeToInputType[typeName] ?? typeName);
+}
+function buildAllFieldTypes(inputTypes, context, source) {
+ const inputObjectTypes = inputTypes.filter((t) => t.location === "inputObjectTypes" && !t.isList);
+ const otherTypes = inputTypes.filter((t) => t.location !== "inputObjectTypes" || t.isList);
+ const tsInputObjectTypes = inputObjectTypes.map((type) => buildSingleFieldType(type, context.genericArgsInfo, source));
+ const tsOtherTypes = otherTypes.map((type) => buildSingleFieldType(type, context.genericArgsInfo, source));
+ if (tsOtherTypes.length === 0) {
+ return xorTypes(tsInputObjectTypes);
+ }
+ if (tsInputObjectTypes.length === 0) {
+ return unionType(tsOtherTypes);
+ }
+ return unionType(xorTypes(tsInputObjectTypes)).addVariants(tsOtherTypes);
+}
+function xorTypes(types) {
+ return types.reduce((prev, curr) => namedType("XOR").addGenericArgument(prev).addGenericArgument(curr));
+}
+var InputType = class {
+ constructor(type, context) {
+ this.type = type;
+ this.context = context;
+ this.generatedName = type.name;
+ }
+ toTS() {
+ const { type } = this;
+ const source = type.meta?.source;
+ const fields = uniqueBy(type.fields, (f) => f.name);
+ const body = `{
+${(0, import_indent_string2.default)(
+ fields.map((arg) => {
+ return new InputField(arg, this.context, source).toTS();
+ }).join("\n"),
+ TAB_SIZE
+ )}
+}`;
+ return `
+export type ${this.getTypeName()} = ${wrapWithAtLeast(body, type)}`;
+ }
+ overrideName(name) {
+ this.generatedName = name;
+ return this;
+ }
+ getTypeName() {
+ if (this.context.genericArgsInfo.typeNeedsGenericModelArg(this.type)) {
+ return `${this.generatedName}<$PrismaModel = never>`;
+ }
+ return this.generatedName;
+ }
+};
+function wrapWithAtLeast(body, input) {
+ if (input.constraints?.fields && input.constraints.fields.length > 0) {
+ const fields = input.constraints.fields.map((f) => `"${f}"`).join(" | ");
+ return `Prisma.AtLeast<${body}, ${fields}>`;
+ }
+ return body;
+}
+
+// src/generation/TSClient/Model.ts
+var import_indent_string3 = __toESM(require_indent_string());
+
+// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs
+function klona(x) {
+ if (typeof x !== "object") return x;
+ var k, tmp, str = Object.prototype.toString.call(x);
+ if (str === "[object Object]") {
+ if (x.constructor !== Object && typeof x.constructor === "function") {
+ tmp = new x.constructor();
+ for (k in x) {
+ if (x.hasOwnProperty(k) && tmp[k] !== x[k]) {
+ tmp[k] = klona(x[k]);
+ }
+ }
+ } else {
+ tmp = {};
+ for (k in x) {
+ if (k === "__proto__") {
+ Object.defineProperty(tmp, k, {
+ value: klona(x[k]),
+ configurable: true,
+ enumerable: true,
+ writable: true
+ });
+ } else {
+ tmp[k] = klona(x[k]);
+ }
+ }
+ }
+ return tmp;
+ }
+ if (str === "[object Array]") {
+ k = x.length;
+ for (tmp = Array(k); k--; ) {
+ tmp[k] = klona(x[k]);
+ }
+ return tmp;
+ }
+ if (str === "[object Set]") {
+ tmp = /* @__PURE__ */ new Set();
+ x.forEach(function(val) {
+ tmp.add(klona(val));
+ });
+ return tmp;
+ }
+ if (str === "[object Map]") {
+ tmp = /* @__PURE__ */ new Map();
+ x.forEach(function(val, key) {
+ tmp.set(klona(key), klona(val));
+ });
+ return tmp;
+ }
+ if (str === "[object Date]") {
+ return /* @__PURE__ */ new Date(+x);
+ }
+ if (str === "[object RegExp]") {
+ tmp = new RegExp(x.source, x.flags);
+ tmp.lastIndex = x.lastIndex;
+ return tmp;
+ }
+ if (str === "[object DataView]") {
+ return new x.constructor(klona(x.buffer));
+ }
+ if (str === "[object ArrayBuffer]") {
+ return x.slice(0);
+ }
+ if (str.slice(-6) === "Array]") {
+ return new x.constructor(x);
+ }
+ return x;
+}
+
+// src/generation/TSClient/helpers.ts
+var import_pluralize2 = __toESM(require_pluralize());
+
+// src/generation/TSClient/jsdoc.ts
+var Docs = {
+ cursor: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}`,
+ pagination: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}`,
+ aggregations: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}`,
+ distinct: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}`,
+ sorting: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}`
+};
+function addLinkToDocs(comment, docs) {
+ return `${Docs[docs]}
+
+${comment}`;
+}
+function getDeprecationString(since, replacement) {
+ return `@deprecated since ${since} please use \`${replacement}\``;
+}
+var undefinedNote = `Note, that providing \`undefined\` is treated as the value not being there.
+Read more here: https://pris.ly/d/null-undefined`;
+var JSDocFields = {
+ take: (singular, plural) => addLinkToDocs(`Take \`\xB1n\` ${plural} from the position of the cursor.`, "pagination"),
+ skip: (singular, plural) => addLinkToDocs(`Skip the first \`n\` ${plural}.`, "pagination"),
+ _count: (singular, plural) => addLinkToDocs(`Count returned ${plural}`, "aggregations"),
+ _avg: () => addLinkToDocs(`Select which fields to average`, "aggregations"),
+ _sum: () => addLinkToDocs(`Select which fields to sum`, "aggregations"),
+ _min: () => addLinkToDocs(`Select which fields to find the minimum value`, "aggregations"),
+ _max: () => addLinkToDocs(`Select which fields to find the maximum value`, "aggregations"),
+ count: () => getDeprecationString("2.23.0", "_count"),
+ avg: () => getDeprecationString("2.23.0", "_avg"),
+ sum: () => getDeprecationString("2.23.0", "_sum"),
+ min: () => getDeprecationString("2.23.0", "_min"),
+ max: () => getDeprecationString("2.23.0", "_max"),
+ distinct: (singular, plural) => addLinkToDocs(`Filter by unique combinations of ${plural}.`, "distinct"),
+ orderBy: (singular, plural) => addLinkToDocs(`Determine the order of ${plural} to fetch.`, "sorting")
+};
+var JSDocs = {
+ groupBy: {
+ body: (ctx) => `Group by ${ctx.singular}.
+${undefinedNote}
+@param {${getGroupByArgsName(ctx.model.name)}} args - Group by arguments.
+@example
+// Group by city, order by createdAt, get count
+const result = await prisma.user.groupBy({
+ by: ['city', 'createdAt'],
+ orderBy: {
+ createdAt: true
+ },
+ _count: {
+ _all: true
+ },
+})
+`,
+ fields: {}
+ },
+ create: {
+ body: (ctx) => `Create a ${ctx.singular}.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to create a ${ctx.singular}.
+@example
+// Create one ${ctx.singular}
+const ${ctx.singular} = await ${ctx.method}({
+ data: {
+ // ... data to create a ${ctx.singular}
+ }
+})
+`,
+ fields: {
+ data: (singular) => `The data needed to create a ${singular}.`
+ }
+ },
+ createMany: {
+ body: (ctx) => `Create many ${ctx.plural}.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to create many ${ctx.plural}.
+@example
+// Create many ${ctx.plural}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ data: [
+ // ... provide data here
+ ]
+})
+ `,
+ fields: {
+ data: (singular, plural) => `The data used to create many ${plural}.`
+ }
+ },
+ createManyAndReturn: {
+ body: (ctx) => {
+ const onlySelect = ctx.firstScalar ? `
+// Create many ${ctx.plural} and only return the \`${ctx.firstScalar.name}\`
+const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({
+ select: { ${ctx.firstScalar.name}: true },
+ data: [
+ // ... provide data here
+ ]
+})` : "";
+ return `Create many ${ctx.plural} and returns the data saved in the database.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to create many ${ctx.plural}.
+@example
+// Create many ${ctx.plural}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ data: [
+ // ... provide data here
+ ]
+})
+${onlySelect}
+${undefinedNote}
+`;
+ },
+ fields: {
+ data: (singular, plural) => `The data used to create many ${plural}.`
+ }
+ },
+ findUnique: {
+ body: (ctx) => `Find zero or one ${ctx.singular} that matches the filter.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular}
+@example
+// Get one ${ctx.singular}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ where: {
+ // ... provide filter here
+ }
+})`,
+ fields: {
+ where: (singular) => `Filter, which ${singular} to fetch.`
+ }
+ },
+ findUniqueOrThrow: {
+ body: (ctx) => `Find one ${ctx.singular} that matches the filter or throw an error with \`error.code='P2025'\`
+if no matches were found.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular}
+@example
+// Get one ${ctx.singular}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ where: {
+ // ... provide filter here
+ }
+})`,
+ fields: {
+ where: (singular) => `Filter, which ${singular} to fetch.`
+ }
+ },
+ findFirst: {
+ body: (ctx) => `Find the first ${ctx.singular} that matches the filter.
+${undefinedNote}
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular}
+@example
+// Get one ${ctx.singular}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ where: {
+ // ... provide filter here
+ }
+})`,
+ fields: {
+ where: (singular) => `Filter, which ${singular} to fetch.`,
+ orderBy: JSDocFields.orderBy,
+ cursor: (singular, plural) => addLinkToDocs(`Sets the position for searching for ${plural}.`, "cursor"),
+ take: JSDocFields.take,
+ skip: JSDocFields.skip,
+ distinct: JSDocFields.distinct
+ }
+ },
+ findFirstOrThrow: {
+ body: (ctx) => `Find the first ${ctx.singular} that matches the filter or
+throw \`PrismaKnownClientError\` with \`P2025\` code if no matches were found.
+${undefinedNote}
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular}
+@example
+// Get one ${ctx.singular}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ where: {
+ // ... provide filter here
+ }
+})`,
+ fields: {
+ where: (singular) => `Filter, which ${singular} to fetch.`,
+ orderBy: JSDocFields.orderBy,
+ cursor: (singular, plural) => addLinkToDocs(`Sets the position for searching for ${plural}.`, "cursor"),
+ take: JSDocFields.take,
+ skip: JSDocFields.skip,
+ distinct: JSDocFields.distinct
+ }
+ },
+ findMany: {
+ body: (ctx) => {
+ const onlySelect = ctx.firstScalar ? `
+// Only select the \`${ctx.firstScalar.name}\`
+const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({ select: { ${ctx.firstScalar.name}: true } })` : "";
+ return `Find zero or more ${ctx.plural} that matches the filter.
+${undefinedNote}
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to filter and select certain fields only.
+@example
+// Get all ${ctx.plural}
+const ${ctx.mapping.plural} = await ${ctx.method}()
+
+// Get first 10 ${ctx.plural}
+const ${ctx.mapping.plural} = await ${ctx.method}({ take: 10 })
+${onlySelect}
+`;
+ },
+ fields: {
+ where: (singular, plural) => `Filter, which ${plural} to fetch.`,
+ orderBy: JSDocFields.orderBy,
+ skip: JSDocFields.skip,
+ cursor: (singular, plural) => addLinkToDocs(`Sets the position for listing ${plural}.`, "cursor"),
+ take: JSDocFields.take
+ }
+ },
+ update: {
+ body: (ctx) => `Update one ${ctx.singular}.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update one ${ctx.singular}.
+@example
+// Update one ${ctx.singular}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ where: {
+ // ... provide filter here
+ },
+ data: {
+ // ... provide data here
+ }
+})
+`,
+ fields: {
+ data: (singular) => `The data needed to update a ${singular}.`,
+ where: (singular) => `Choose, which ${singular} to update.`
+ }
+ },
+ upsert: {
+ body: (ctx) => `Create or update one ${ctx.singular}.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update or create a ${ctx.singular}.
+@example
+// Update or create a ${ctx.singular}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ create: {
+ // ... data to create a ${ctx.singular}
+ },
+ update: {
+ // ... in case it already exists, update
+ },
+ where: {
+ // ... the filter for the ${ctx.singular} we want to update
+ }
+})`,
+ fields: {
+ where: (singular) => `The filter to search for the ${singular} to update in case it exists.`,
+ create: (singular) => `In case the ${singular} found by the \`where\` argument doesn't exist, create a new ${singular} with this data.`,
+ update: (singular) => `In case the ${singular} was found with the provided \`where\` argument, update it with this data.`
+ }
+ },
+ delete: {
+ body: (ctx) => `Delete a ${ctx.singular}.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to delete one ${ctx.singular}.
+@example
+// Delete one ${ctx.singular}
+const ${ctx.singular} = await ${ctx.method}({
+ where: {
+ // ... filter to delete one ${ctx.singular}
+ }
+})
+`,
+ fields: {
+ where: (singular) => `Filter which ${singular} to delete.`
+ }
+ },
+ aggregate: {
+ body: (ctx) => `Allows you to perform aggregations operations on a ${ctx.singular}.
+${undefinedNote}
+@param {${getModelArgName(
+ ctx.model.name,
+ ctx.action
+ )}} args - Select which aggregations you would like to apply and on what fields.
+@example
+// Ordered by age ascending
+// Where email contains prisma.io
+// Limited to the 10 users
+const aggregations = await prisma.user.aggregate({
+ _avg: {
+ age: true,
+ },
+ where: {
+ email: {
+ contains: "prisma.io",
+ },
+ },
+ orderBy: {
+ age: "asc",
+ },
+ take: 10,
+})`,
+ fields: {
+ where: (singular) => `Filter which ${singular} to aggregate.`,
+ orderBy: JSDocFields.orderBy,
+ cursor: () => addLinkToDocs(`Sets the start position`, "cursor"),
+ take: JSDocFields.take,
+ skip: JSDocFields.skip,
+ _count: JSDocFields._count,
+ _avg: JSDocFields._avg,
+ _sum: JSDocFields._sum,
+ _min: JSDocFields._min,
+ _max: JSDocFields._max,
+ count: JSDocFields.count,
+ avg: JSDocFields.avg,
+ sum: JSDocFields.sum,
+ min: JSDocFields.min,
+ max: JSDocFields.max
+ }
+ },
+ count: {
+ body: (ctx) => `Count the number of ${ctx.plural}.
+${undefinedNote}
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to filter ${ctx.plural} to count.
+@example
+// Count the number of ${ctx.plural}
+const count = await ${ctx.method}({
+ where: {
+ // ... the filter for the ${ctx.plural} we want to count
+ }
+})`,
+ fields: {}
+ },
+ updateMany: {
+ body: (ctx) => `Update zero or more ${ctx.plural}.
+${undefinedNote}
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update one or more rows.
+@example
+// Update many ${ctx.plural}
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ where: {
+ // ... provide filter here
+ },
+ data: {
+ // ... provide data here
+ }
+})
+`,
+ fields: {
+ data: (singular, plural) => `The data used to update ${plural}.`,
+ where: (singular, plural) => `Filter which ${plural} to update`
+ }
+ },
+ deleteMany: {
+ body: (ctx) => `Delete zero or more ${ctx.plural}.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to filter ${ctx.plural} to delete.
+@example
+// Delete a few ${ctx.plural}
+const { count } = await ${ctx.method}({
+ where: {
+ // ... provide filter here
+ }
+})
+`,
+ fields: {
+ where: (singular, plural) => `Filter which ${plural} to delete`
+ }
+ },
+ aggregateRaw: {
+ body: (ctx) => `Perform aggregation operations on a ${ctx.singular}.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Select which aggregations you would like to apply.
+@example
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ pipeline: [
+ { $match: { status: "registered" } },
+ { $group: { _id: "$country", total: { $sum: 1 } } }
+ ]
+})`,
+ fields: {
+ pipeline: () => "An array of aggregation stages to process and transform the document stream via the aggregation pipeline. ${@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline MongoDB Docs}.",
+ options: () => "Additional options to pass to the `aggregate` command ${@link https://docs.mongodb.com/manual/reference/command/aggregate/#command-fields MongoDB Docs}."
+ }
+ },
+ findRaw: {
+ body: (ctx) => `Find zero or more ${ctx.plural} that matches the filter.
+@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Select which filters you would like to apply.
+@example
+const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
+ filter: { age: { $gt: 25 } }
+})`,
+ fields: {
+ filter: () => "The query predicate filter. If unspecified, then all documents in the collection will match the predicate. ${@link https://docs.mongodb.com/manual/reference/operator/query MongoDB Docs}.",
+ options: () => "Additional options to pass to the `find` command ${@link https://docs.mongodb.com/manual/reference/command/find/#command-fields MongoDB Docs}."
+ }
+ }
+};
+
+// src/generation/TSClient/helpers.ts
+function getMethodJSDocBody(action, mapping, model) {
+ const ctx = {
+ singular: capitalize(mapping.model),
+ plural: capitalize(mapping.plural),
+ firstScalar: model.fields.find((f) => f.kind === "scalar"),
+ method: `prisma.${lowerCase(mapping.model)}.${action}`,
+ action,
+ mapping,
+ model
+ };
+ const jsdoc = JSDocs[action]?.body(ctx);
+ return jsdoc ? jsdoc : "";
+}
+function getMethodJSDoc(action, mapping, model) {
+ return wrapComment(getMethodJSDocBody(action, mapping, model));
+}
+function wrapComment(str) {
+ return `/**
+${str.split("\n").map((l) => " * " + l).join("\n")}
+**/`;
+}
+function getArgFieldJSDoc(type, action, field) {
+ if (!field || !action || !type) return;
+ const fieldName = typeof field === "string" ? field : field.name;
+ if (JSDocs[action] && JSDocs[action]?.fields[fieldName]) {
+ const singular = type.name;
+ const plural = (0, import_pluralize2.default)(type.name);
+ const comment = JSDocs[action]?.fields[fieldName](singular, plural);
+ return comment;
+ }
+ return void 0;
+}
+function escapeJson(str) {
+ return str.replace(/\\n/g, "\\\\n").replace(/\\r/g, "\\\\r").replace(/\\t/g, "\\\\t");
+}
+
+// src/generation/TSClient/Args.ts
+var ArgsTypeBuilder = class {
+ constructor(type, context, action) {
+ this.type = type;
+ this.context = context;
+ this.action = action;
+ this.hasDefaultName = true;
+ this.moduleExport = moduleExport(
+ typeDeclaration(getModelArgName(type.name, action), objectType()).addGenericParameter(extArgsParam)
+ ).setDocComment(docComment(`${type.name} ${action ?? "without action"}`));
+ }
+ addProperty(prop) {
+ this.moduleExport.declaration.type.add(prop);
+ }
+ addSchemaArgs(args) {
+ for (const arg of args) {
+ const inputField = buildInputField(arg, this.context);
+ const docComment2 = getArgFieldJSDoc(this.type, this.action, arg);
+ if (docComment2) {
+ inputField.setDocComment(docComment(docComment2));
+ }
+ this.addProperty(inputField);
+ }
+ return this;
+ }
+ addSelectArg(selectTypeName = getSelectName(this.type.name)) {
+ this.addProperty(
+ property(
+ "select",
+ unionType([namedType(selectTypeName).addGenericArgument(extArgsParam.toArgument()), nullType])
+ ).optional().setDocComment(docComment(`Select specific fields to fetch from the ${this.type.name}`))
+ );
+ return this;
+ }
+ addIncludeArgIfHasRelations(includeTypeName = getIncludeName(this.type.name), type = this.type) {
+ const hasRelationField = type.fields.some((f) => f.outputType.location === "outputObjectTypes");
+ if (!hasRelationField) {
+ return this;
+ }
+ this.addProperty(
+ property(
+ "include",
+ unionType([namedType(includeTypeName).addGenericArgument(extArgsParam.toArgument()), nullType])
+ ).optional().setDocComment(docComment("Choose, which related nodes to fetch as well"))
+ );
+ return this;
+ }
+ addOmitArg() {
+ if (!this.context.isPreviewFeatureOn("omitApi")) {
+ return this;
+ }
+ this.addProperty(
+ property(
+ "omit",
+ unionType([
+ namedType(getOmitName(this.type.name)).addGenericArgument(extArgsParam.toArgument()),
+ nullType
+ ])
+ ).optional().setDocComment(docComment(`Omit specific fields from the ${this.type.name}`))
+ );
+ return this;
+ }
+ setGeneratedName(name) {
+ this.hasDefaultName = false;
+ this.moduleExport.declaration.setName(name);
+ return this;
+ }
+ setComment(comment) {
+ this.moduleExport.setDocComment(docComment(comment));
+ return this;
+ }
+ createExport() {
+ if (!this.action && this.hasDefaultName) {
+ this.context.defaultArgsAliases.addPossibleAlias(
+ getModelArgName(this.type.name),
+ getLegacyModelArgName(this.type.name)
+ );
+ }
+ this.context.defaultArgsAliases.registerArgName(this.moduleExport.declaration.name);
+ return this.moduleExport;
+ }
+};
+
+// src/generation/TSClient/ModelFieldRefs.ts
+var ModelFieldRefs = class {
+ constructor(outputType) {
+ this.outputType = outputType;
+ }
+ toTS() {
+ const { name } = this.outputType;
+ return `
+
+/**
+ * Fields of the ${name} model
+ */
+interface ${getFieldRefsTypeName(name)} {
+${this.stringifyFields()}
+}
+ `;
+ }
+ stringifyFields() {
+ const { name } = this.outputType;
+ return this.outputType.fields.filter((field) => field.outputType.location !== "outputObjectTypes").map((field) => {
+ const fieldOutput = field.outputType;
+ const refTypeName = getRefAllowedTypeName(fieldOutput);
+ return ` readonly ${field.name}: FieldRef<"${name}", ${refTypeName}>`;
+ }).join("\n");
+ }
+};
+
+// src/generation/TSClient/Output.ts
+function buildModelOutputProperty(field, dmmf) {
+ let fieldTypeName = hasOwnProperty(GraphQLScalarToJSTypeTable, field.type) ? GraphQLScalarToJSTypeTable[field.type] : field.type;
+ if (Array.isArray(fieldTypeName)) {
+ fieldTypeName = fieldTypeName[0];
+ }
+ if (needsNamespace(field)) {
+ fieldTypeName = `Prisma.${fieldTypeName}`;
+ }
+ let fieldType;
+ if (field.kind === "object") {
+ const payloadType = namedType(getPayloadName(field.type));
+ if (!dmmf.isComposite(field.type)) {
+ payloadType.addGenericArgument(namedType("ExtArgs"));
+ }
+ fieldType = payloadType;
+ } else if (field.kind === "enum") {
+ fieldType = namedType(`$Enums.${fieldTypeName}`);
+ } else {
+ fieldType = namedType(fieldTypeName);
+ }
+ if (field.isList) {
+ fieldType = array(fieldType);
+ } else if (!field.isRequired) {
+ fieldType = unionType(fieldType).addVariant(nullType);
+ }
+ const property2 = property(field.name, fieldType);
+ if (field.documentation) {
+ property2.setDocComment(docComment(field.documentation));
+ }
+ return property2;
+}
+function buildOutputType(type) {
+ return moduleExport(typeDeclaration(type.name, objectType().addMultiple(type.fields.map(buildOutputField))));
+}
+function buildOutputField(field) {
+ let fieldType;
+ if (field.outputType.location === "enumTypes" && field.outputType.namespace === "model") {
+ fieldType = namedType(enumTypeName(field.outputType));
+ } else {
+ const typeNames = GraphQLScalarToJSTypeTable[field.outputType.type] ?? field.outputType.type;
+ fieldType = Array.isArray(typeNames) ? namedType(typeNames[0]) : namedType(typeNames);
+ }
+ if (field.outputType.isList) {
+ fieldType = array(fieldType);
+ } else if (field.isNullable) {
+ fieldType = unionType(fieldType).addVariant(nullType);
+ }
+ const property2 = property(field.name, fieldType);
+ if (field.deprecation) {
+ property2.setDocComment(
+ docComment(`@deprecated since ${field.deprecation.sinceVersion} because ${field.deprecation.reason}`)
+ );
+ }
+ return property2;
+}
+function enumTypeName(ref) {
+ const name = ref.type;
+ const namespace2 = ref.namespace === "model" ? "$Enums" : "Prisma";
+ return `${namespace2}.${name}`;
+}
+
+// src/generation/TSClient/Payload.ts
+function buildModelPayload(model, context) {
+ const isComposite = context.dmmf.isComposite(model.name);
+ const objects = objectType();
+ const scalars = objectType();
+ const composites = objectType();
+ for (const field of model.fields) {
+ if (field.kind === "object") {
+ if (context.dmmf.isComposite(field.type)) {
+ composites.add(buildModelOutputProperty(field, context.dmmf));
+ } else {
+ objects.add(buildModelOutputProperty(field, context.dmmf));
+ }
+ } else if (field.kind === "enum" || field.kind === "scalar") {
+ scalars.add(buildModelOutputProperty(field, context.dmmf));
+ }
+ }
+ const scalarsType = isComposite ? scalars : namedType("$Extensions.GetPayloadResult").addGenericArgument(scalars).addGenericArgument(namedType("ExtArgs").subKey("result").subKey(lowerCase(model.name)));
+ const payloadTypeDeclaration = typeDeclaration(
+ getPayloadName(model.name, false),
+ objectType().add(property("name", stringLiteral(model.name))).add(property("objects", objects)).add(property("scalars", scalarsType)).add(property("composites", composites))
+ );
+ if (!isComposite) {
+ payloadTypeDeclaration.addGenericParameter(extArgsParam);
+ }
+ return moduleExport(payloadTypeDeclaration);
+}
+
+// src/generation/TSClient/SelectIncludeOmit.ts
+function buildIncludeType({
+ modelName,
+ typeName = getIncludeName(modelName),
+ context,
+ fields
+}) {
+ const type = buildSelectOrIncludeObject(modelName, getIncludeFields(fields, context.dmmf), context);
+ return buildExport(typeName, type);
+}
+function buildOmitType({ modelName, fields, context }) {
+ const keysType = unionType(
+ fields.filter(
+ (field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes" || context.dmmf.isComposite(field.outputType.type)
+ ).map((field) => stringLiteral(field.name))
+ );
+ const omitType = namedType("$Extensions.GetOmit").addGenericArgument(keysType).addGenericArgument(modelResultExtensionsType(modelName));
+ if (context.isPreviewFeatureOn("strictUndefinedChecks")) {
+ omitType.addGenericArgument(namedType("$Types.Skip"));
+ }
+ return buildExport(getOmitName(modelName), omitType);
+}
+function buildSelectType({
+ modelName,
+ typeName = getSelectName(modelName),
+ fields,
+ context
+}) {
+ const objectType2 = buildSelectOrIncludeObject(modelName, fields, context);
+ const selectType = namedType("$Extensions.GetSelect").addGenericArgument(objectType2).addGenericArgument(modelResultExtensionsType(modelName));
+ return buildExport(typeName, selectType);
+}
+function modelResultExtensionsType(modelName) {
+ return extArgsParam.toArgument().subKey("result").subKey(lowerCase(modelName));
+}
+function buildScalarSelectType({ modelName, fields, context }) {
+ const object = buildSelectOrIncludeObject(
+ modelName,
+ fields.filter((field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes"),
+ context
+ );
+ return moduleExport(typeDeclaration(`${getSelectName(modelName)}Scalar`, object));
+}
+function buildSelectOrIncludeObject(modelName, fields, context) {
+ const objectType2 = objectType();
+ for (const field of fields) {
+ const fieldType = unionType(booleanType);
+ if (field.outputType.location === "outputObjectTypes") {
+ const subSelectType = namedType(getFieldArgName(field, modelName));
+ subSelectType.addGenericArgument(extArgsParam.toArgument());
+ fieldType.addVariant(subSelectType);
+ }
+ objectType2.add(property(field.name, appendSkipType(context, fieldType)).optional());
+ }
+ return objectType2;
+}
+function buildExport(typeName, type) {
+ const declaration = typeDeclaration(typeName, type);
+ return moduleExport(declaration.addGenericParameter(extArgsParam));
+}
+function getIncludeFields(fields, dmmf) {
+ return fields.filter((field) => {
+ if (field.outputType.location !== "outputObjectTypes") {
+ return false;
+ }
+ return !dmmf.isComposite(field.outputType.type);
+ });
+}
+
+// src/generation/TSClient/utils/getModelActions.ts
+function getModelActions(dmmf, name) {
+ const mapping = dmmf.mappingsMap[name] ?? { model: name, plural: `${name}s` };
+ const mappingKeys = Object.keys(mapping).filter(
+ (key) => key !== "model" && key !== "plural" && mapping[key]
+ );
+ if ("aggregate" in mapping) {
+ mappingKeys.push("count");
+ }
+ return mappingKeys;
+}
+
+// src/generation/TSClient/Model.ts
+var Model = class {
+ constructor(model, context) {
+ this.model = model;
+ this.context = context;
+ this.dmmf = context.dmmf;
+ this.type = this.context.dmmf.outputTypeMap.model[model.name];
+ this.createManyAndReturnType = this.context.dmmf.outputTypeMap.model[getCreateManyAndReturnOutputType(model.name)];
+ this.mapping = this.context.dmmf.mappings.modelOperations.find((m) => m.model === model.name);
+ }
+ get argsTypes() {
+ const argsTypes = [];
+ for (const action of Object.keys(DMMF.ModelAction)) {
+ const fieldName = this.rootFieldNameForAction(action);
+ if (!fieldName) {
+ continue;
+ }
+ const field = this.dmmf.rootFieldMap[fieldName];
+ if (!field) {
+ throw new Error(`Oops this must not happen. Could not find field ${fieldName} on either Query or Mutation`);
+ }
+ if (action === "updateMany" || action === "deleteMany" || action === "createMany" || action === "findRaw" || action === "aggregateRaw") {
+ argsTypes.push(
+ new ArgsTypeBuilder(this.type, this.context, action).addSchemaArgs(field.args).createExport()
+ );
+ } else if (action === "createManyAndReturn") {
+ const args = new ArgsTypeBuilder(this.type, this.context, action).addSelectArg(getSelectCreateManyAndReturnName(this.type.name)).addOmitArg().addSchemaArgs(field.args);
+ if (this.createManyAndReturnType) {
+ args.addIncludeArgIfHasRelations(
+ getIncludeCreateManyAndReturnName(this.model.name),
+ this.createManyAndReturnType
+ );
+ }
+ argsTypes.push(args.createExport());
+ } else if (action !== "groupBy" && action !== "aggregate") {
+ argsTypes.push(
+ new ArgsTypeBuilder(this.type, this.context, action).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().addSchemaArgs(field.args).createExport()
+ );
+ }
+ }
+ for (const field of this.type.fields) {
+ if (!field.args.length) {
+ continue;
+ }
+ const fieldOutput = this.dmmf.resolveOutputObjectType(field.outputType);
+ if (!fieldOutput) {
+ continue;
+ }
+ argsTypes.push(
+ new ArgsTypeBuilder(fieldOutput, this.context).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().addSchemaArgs(field.args).setGeneratedName(getModelFieldArgsName(field, this.model.name)).setComment(`${this.model.name}.${field.name}`).createExport()
+ );
+ }
+ argsTypes.push(
+ new ArgsTypeBuilder(this.type, this.context).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().createExport()
+ );
+ return argsTypes;
+ }
+ rootFieldNameForAction(action) {
+ return this.mapping?.[action];
+ }
+ getGroupByTypes() {
+ const { model, mapping } = this;
+ const groupByType = this.dmmf.outputTypeMap.prisma[getGroupByName(model.name)];
+ if (!groupByType) {
+ throw new Error(`Could not get group by type for model ${model.name}`);
+ }
+ const groupByRootField = this.dmmf.rootFieldMap[mapping.groupBy];
+ if (!groupByRootField) {
+ throw new Error(`Could not find groupBy root field for model ${model.name}. Mapping: ${mapping?.groupBy}`);
+ }
+ const groupByArgsName = getGroupByArgsName(model.name);
+ this.context.defaultArgsAliases.registerArgName(groupByArgsName);
+ return `
+
+
+export type ${groupByArgsName} = {
+${(0, import_indent_string3.default)(
+ groupByRootField.args.map((arg) => {
+ const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, DMMF.ModelAction.groupBy, arg) };
+ return new InputField(updatedArg, this.context).toTS();
+ }).concat(
+ groupByType.fields.filter((f) => f.outputType.location === "outputObjectTypes").map((f) => {
+ if (f.outputType.location === "outputObjectTypes") {
+ return `${f.name}?: ${getAggregateInputType(f.outputType.type)}${f.name === "_count" ? " | true" : ""}`;
+ }
+ return "";
+ })
+ ).join("\n"),
+ TAB_SIZE
+ )}
+}
+
+${stringify(buildOutputType(groupByType))}
+
+type ${getGroupByPayloadName(model.name)} = Prisma.PrismaPromise<
+ Array<
+ PickEnumerable<${groupByType.name}, T['by']> &
+ {
+ [P in ((keyof T) & (keyof ${groupByType.name}))]: P extends '_count'
+ ? T[P] extends boolean
+ ? number
+ : GetScalarType
+ : GetScalarType
+ }
+ >
+ >
+`;
+ }
+ getAggregationTypes() {
+ const { model, mapping } = this;
+ let aggregateType = this.dmmf.outputTypeMap.prisma[getAggregateName(model.name)];
+ if (!aggregateType) {
+ throw new Error(`Could not get aggregate type "${getAggregateName(model.name)}" for "${model.name}"`);
+ }
+ aggregateType = klona(aggregateType);
+ const aggregateRootField = this.dmmf.rootFieldMap[mapping.aggregate];
+ if (!aggregateRootField) {
+ throw new Error(`Could not find aggregate root field for model ${model.name}. Mapping: ${mapping?.aggregate}`);
+ }
+ const aggregateTypes = [aggregateType];
+ const avgType = this.dmmf.outputTypeMap.prisma[getAvgAggregateName(model.name)];
+ const sumType = this.dmmf.outputTypeMap.prisma[getSumAggregateName(model.name)];
+ const minType = this.dmmf.outputTypeMap.prisma[getMinAggregateName(model.name)];
+ const maxType = this.dmmf.outputTypeMap.prisma[getMaxAggregateName(model.name)];
+ const countType = this.dmmf.outputTypeMap.prisma[getCountAggregateOutputName(model.name)];
+ if (avgType) {
+ aggregateTypes.push(avgType);
+ }
+ if (sumType) {
+ aggregateTypes.push(sumType);
+ }
+ if (minType) {
+ aggregateTypes.push(minType);
+ }
+ if (maxType) {
+ aggregateTypes.push(maxType);
+ }
+ if (countType) {
+ aggregateTypes.push(countType);
+ }
+ const aggregateArgsName = getAggregateArgsName(model.name);
+ this.context.defaultArgsAliases.registerArgName(aggregateArgsName);
+ const aggregateName = getAggregateName(model.name);
+ return `${aggregateTypes.map(buildOutputType).map((type) => stringify(type)).join("\n\n")}
+
+${aggregateTypes.length > 1 ? aggregateTypes.slice(1).map((type) => {
+ const newType = {
+ name: getAggregateInputType(type.name),
+ constraints: {
+ maxNumFields: null,
+ minNumFields: null
+ },
+ fields: type.fields.map((field) => ({
+ ...field,
+ name: field.name,
+ isNullable: false,
+ isRequired: false,
+ inputTypes: [
+ {
+ isList: false,
+ location: "scalar",
+ type: "true"
+ }
+ ]
+ }))
+ };
+ return new InputType(newType, this.context).toTS();
+ }).join("\n") : ""}
+
+export type ${aggregateArgsName} = {
+${(0, import_indent_string3.default)(
+ aggregateRootField.args.map((arg) => {
+ const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, DMMF.ModelAction.aggregate, arg) };
+ return new InputField(updatedArg, this.context).toTS();
+ }).concat(
+ aggregateType.fields.map((f) => {
+ let data = "";
+ const comment = getArgFieldJSDoc(this.type, DMMF.ModelAction.aggregate, f.name);
+ data += comment ? wrapComment(comment) + "\n" : "";
+ if (f.name === "_count" || f.name === "count") {
+ data += `${f.name}?: true | ${getCountAggregateInputName(model.name)}`;
+ } else {
+ data += `${f.name}?: ${getAggregateInputType(f.outputType.type)}`;
+ }
+ return data;
+ })
+ ).join("\n"),
+ TAB_SIZE
+ )}
+}
+
+export type ${getAggregateGetName(model.name)} = {
+ [P in keyof T & keyof ${aggregateName}]: P extends '_count' | 'count'
+ ? T[P] extends true
+ ? number
+ : GetScalarType
+ : GetScalarType
+}`;
+ }
+ toTSWithoutNamespace() {
+ const { model } = this;
+ const docLines = model.documentation ?? "";
+ const modelLine = `Model ${model.name}
+`;
+ const docs = `${modelLine}${docLines}`;
+ const modelTypeExport = moduleExport(
+ typeDeclaration(
+ model.name,
+ namedType(`$Result.DefaultSelection`).addGenericArgument(namedType(getPayloadName(model.name)))
+ )
+ ).setDocComment(docComment(docs));
+ return stringify(modelTypeExport);
+ }
+ toTS() {
+ const { model } = this;
+ const isComposite = this.dmmf.isComposite(model.name);
+ const omitType = this.context.isPreviewFeatureOn("omitApi") ? stringify(buildOmitType({ modelName: this.model.name, context: this.context, fields: this.type.fields }), {
+ newLine: "leading"
+ }) : "";
+ const hasRelationField = model.fields.some((f) => f.kind === "object");
+ const includeType = hasRelationField ? stringify(
+ buildIncludeType({ modelName: this.model.name, context: this.context, fields: this.type.fields }),
+ {
+ newLine: "leading"
+ }
+ ) : "";
+ const createManyAndReturnIncludeType = hasRelationField && this.createManyAndReturnType ? stringify(
+ buildIncludeType({
+ typeName: getIncludeCreateManyAndReturnName(this.model.name),
+ modelName: this.model.name,
+ context: this.context,
+ fields: this.createManyAndReturnType.fields
+ }),
+ {
+ newLine: "leading"
+ }
+ ) : "";
+ return `
+/**
+ * Model ${model.name}
+ */
+
+${!isComposite ? this.getAggregationTypes() : ""}
+
+${!isComposite ? this.getGroupByTypes() : ""}
+
+${stringify(buildSelectType({ modelName: this.model.name, fields: this.type.fields, context: this.context }))}
+${this.createManyAndReturnType ? stringify(
+ buildSelectType({
+ modelName: this.model.name,
+ fields: this.createManyAndReturnType.fields,
+ context: this.context,
+ typeName: getSelectCreateManyAndReturnName(this.model.name)
+ }),
+ { newLine: "leading" }
+ ) : ""}
+${stringify(buildScalarSelectType({ modelName: this.model.name, fields: this.type.fields, context: this.context }), {
+ newLine: "leading"
+ })}
+${omitType}${includeType}${createManyAndReturnIncludeType}
+
+${stringify(buildModelPayload(this.model, this.context), { newLine: "none" })}
+
+type ${model.name}GetPayload = $Result.GetResult<${getPayloadName(model.name)}, S>
+
+${isComposite ? "" : new ModelDelegate(this.type, this.context).toTS()}
+
+${new ModelFieldRefs(this.type).toTS()}
+
+// Custom InputTypes
+${this.argsTypes.map((type) => stringify(type)).join("\n\n")}
+`;
+ }
+};
+var ModelDelegate = class {
+ constructor(outputType, context) {
+ this.outputType = outputType;
+ this.context = context;
+ }
+ /**
+ * Returns all available non-aggregate or group actions
+ * Includes both dmmf and client-only actions
+ *
+ * @param availableActions
+ * @returns
+ */
+ getNonAggregateActions(availableActions) {
+ const actions = availableActions.filter(
+ (key) => key !== DMMF.ModelAction.aggregate && key !== DMMF.ModelAction.groupBy && key !== DMMF.ModelAction.count
+ );
+ return actions;
+ }
+ toTS() {
+ const { name } = this.outputType;
+ const { dmmf } = this.context;
+ const mapping = dmmf.mappingsMap[name] ?? { model: name, plural: `${name}s` };
+ const modelOrType = dmmf.typeAndModelMap[name];
+ const availableActions = getModelActions(dmmf, name);
+ const nonAggregateActions = this.getNonAggregateActions(availableActions);
+ const groupByArgsName = getGroupByArgsName(name);
+ const countArgsName = getModelArgName(name, DMMF.ModelAction.count);
+ this.context.defaultArgsAliases.registerArgName(countArgsName);
+ const genericDelegateParams = [extArgsParam];
+ const excludedArgsForCount = ["select", "include", "distinct"];
+ if (this.context.isPreviewFeatureOn("omitApi")) {
+ excludedArgsForCount.push("omit");
+ genericDelegateParams.push(genericParameter("ClientOptions").default(objectType()));
+ }
+ if (this.context.isPreviewFeatureOn("relationJoins")) {
+ excludedArgsForCount.push("relationLoadStrategy");
+ }
+ const excludedArgsForCountType = excludedArgsForCount.map((name2) => `'${name2}'`).join(" | ");
+ return `${availableActions.includes(DMMF.ModelAction.aggregate) ? `type ${countArgsName} =
+ Omit<${getModelArgName(name, DMMF.ModelAction.findMany)}, ${excludedArgsForCountType}> & {
+ select?: ${getCountAggregateInputName(name)} | true
+ }
+` : ""}
+export interface ${name}Delegate<${genericDelegateParams.map((param) => stringify(param)).join(", ")}> {
+${(0, import_indent_string3.default)(`[K: symbol]: { types: Prisma.TypeMap['model']['${name}'], meta: { name: '${name}' } }`, TAB_SIZE)}
+${nonAggregateActions.map((action) => {
+ const method2 = buildModelDelegateMethod(name, action, this.context);
+ return stringify(method2, { indentLevel: 1, newLine: "trailing" });
+ }).join("\n")}
+
+${availableActions.includes(DMMF.ModelAction.aggregate) ? `${(0, import_indent_string3.default)(getMethodJSDoc(DMMF.ModelAction.count, mapping, modelOrType), TAB_SIZE)}
+ count(
+ args?: Subset,
+ ): Prisma.PrismaPromise<
+ T extends $Utils.Record<'select', any>
+ ? T['select'] extends true
+ ? number
+ : GetScalarType
+ : number
+ >
+` : ""}
+${availableActions.includes(DMMF.ModelAction.aggregate) ? `${(0, import_indent_string3.default)(getMethodJSDoc(DMMF.ModelAction.aggregate, mapping, modelOrType), TAB_SIZE)}
+ aggregate(args: Subset): Prisma.PrismaPromise<${getAggregateGetName(name)}>
+` : ""}
+${availableActions.includes(DMMF.ModelAction.groupBy) ? `${(0, import_indent_string3.default)(getMethodJSDoc(DMMF.ModelAction.groupBy, mapping, modelOrType), TAB_SIZE)}
+ groupBy<
+ T extends ${groupByArgsName},
+ HasSelectOrTake extends Or<
+ Extends<'skip', Keys>,
+ Extends<'take', Keys>
+ >,
+ OrderByArg extends True extends HasSelectOrTake
+ ? { orderBy: ${groupByArgsName}['orderBy'] }
+ : { orderBy?: ${groupByArgsName}['orderBy'] },
+ OrderFields extends ExcludeUnderscoreKeys>>,
+ ByFields extends MaybeTupleToUnion,
+ ByValid extends Has,
+ HavingFields extends GetHavingFields,
+ HavingValid extends Has,
+ ByEmpty extends T['by'] extends never[] ? True : False,
+ InputErrors extends ByEmpty extends True
+ ? \`Error: "by" must not be empty.\`
+ : HavingValid extends False
+ ? {
+ [P in HavingFields]: P extends ByFields
+ ? never
+ : P extends string
+ ? \`Error: Field "\${P}" used in "having" needs to be provided in "by".\`
+ : [
+ Error,
+ 'Field ',
+ P,
+ \` in "having" needs to be provided in "by"\`,
+ ]
+ }[HavingFields]
+ : 'take' extends Keys
+ ? 'orderBy' extends Keys
+ ? ByValid extends True
+ ? {}
+ : {
+ [P in OrderFields]: P extends ByFields
+ ? never
+ : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
+ }[OrderFields]
+ : 'Error: If you provide "take", you also need to provide "orderBy"'
+ : 'skip' extends Keys
+ ? 'orderBy' extends Keys
+ ? ByValid extends True
+ ? {}
+ : {
+ [P in OrderFields]: P extends ByFields
+ ? never
+ : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
+ }[OrderFields]
+ : 'Error: If you provide "skip", you also need to provide "orderBy"'
+ : ByValid extends True
+ ? {}
+ : {
+ [P in OrderFields]: P extends ByFields
+ ? never
+ : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
+ }[OrderFields]
+ >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? ${getGroupByPayloadName(
+ name
+ )} : Prisma.PrismaPromise` : ""}
+/**
+ * Fields of the ${name} model
+ */
+readonly fields: ${getFieldRefsTypeName(name)};
+}
+
+${stringify(buildFluentWrapperDefinition(name, this.outputType, this.context))}
+`;
+ }
+};
+function buildModelDelegateMethod(modelName, actionName, context) {
+ const mapping = context.dmmf.mappingsMap[modelName] ?? { model: modelName, plural: `${modelName}s` };
+ const modelOrType = context.dmmf.typeAndModelMap[modelName];
+ const method2 = method(actionName).setDocComment(docComment(getMethodJSDocBody(actionName, mapping, modelOrType))).addParameter(getNonAggregateMethodArgs(modelName, actionName)).setReturnType(getReturnType({ modelName, actionName, context }));
+ const generic = getNonAggregateMethodGenericParam(modelName, actionName);
+ if (generic) {
+ method2.addGenericParameter(generic);
+ }
+ return method2;
+}
+function getNonAggregateMethodArgs(modelName, actionName) {
+ getReturnType;
+ const makeParameter = (type2) => parameter("args", type2);
+ if (actionName === DMMF.ModelAction.count) {
+ const type2 = omit(
+ namedType(getModelArgName(modelName, DMMF.ModelAction.findMany)),
+ unionType(stringLiteral("select")).addVariant(stringLiteral("include")).addVariant(stringLiteral("distinct"))
+ );
+ return makeParameter(type2).optional();
+ }
+ if (actionName === DMMF.ModelAction.findRaw || actionName === DMMF.ModelAction.aggregateRaw) {
+ return makeParameter(namedType(getModelArgName(modelName, actionName))).optional();
+ }
+ const type = namedType("SelectSubset").addGenericArgument(namedType("T")).addGenericArgument(
+ namedType(getModelArgName(modelName, actionName)).addGenericArgument(extArgsParam.toArgument())
+ );
+ const param = makeParameter(type);
+ if (actionName === DMMF.ModelAction.findMany || actionName === DMMF.ModelAction.findFirst || actionName === DMMF.ModelAction.deleteMany || actionName === DMMF.ModelAction.createMany || actionName === DMMF.ModelAction.createManyAndReturn || actionName === DMMF.ModelAction.findFirstOrThrow) {
+ param.optional();
+ }
+ return param;
+}
+function getNonAggregateMethodGenericParam(modelName, actionName) {
+ if (actionName === DMMF.ModelAction.count || actionName === DMMF.ModelAction.findRaw || actionName === DMMF.ModelAction.aggregateRaw) {
+ return null;
+ }
+ const arg = genericParameter("T");
+ if (actionName === DMMF.ModelAction.aggregate) {
+ return arg.extends(namedType(getAggregateArgsName(modelName)));
+ }
+ return arg.extends(namedType(getModelArgName(modelName, actionName)));
+}
+function getReturnType({
+ modelName,
+ actionName,
+ context,
+ isChaining = false,
+ isNullable = false
+}) {
+ if (actionName === DMMF.ModelAction.count) {
+ return promise(numberType);
+ }
+ if (actionName === DMMF.ModelAction.aggregate) {
+ return promise(namedType(getAggregateGetName(modelName)).addGenericArgument(namedType("T")));
+ }
+ if (actionName === DMMF.ModelAction.findRaw || actionName === DMMF.ModelAction.aggregateRaw) {
+ return prismaPromise(namedType("JsonObject"));
+ }
+ if (actionName === DMMF.ModelAction.deleteMany || actionName === DMMF.ModelAction.updateMany || actionName === DMMF.ModelAction.createMany) {
+ return prismaPromise(namedType("BatchPayload"));
+ }
+ const isList = actionName === DMMF.ModelAction.findMany || actionName === DMMF.ModelAction.createManyAndReturn;
+ if (isList) {
+ let result = getResultType(modelName, actionName, context);
+ if (isChaining) {
+ result = unionType(result).addVariant(namedType("Null"));
+ }
+ return prismaPromise(result);
+ }
+ if (isChaining && actionName === DMMF.ModelAction.findUniqueOrThrow) {
+ const nullType2 = isNullable ? nullType : namedType("Null");
+ const result = unionType(getResultType(modelName, actionName, context)).addVariant(nullType2);
+ return getFluentWrapper(modelName, context, result, nullType2);
+ }
+ if (actionName === DMMF.ModelAction.findFirst || actionName === DMMF.ModelAction.findUnique) {
+ const result = unionType(getResultType(modelName, actionName, context)).addVariant(nullType);
+ return getFluentWrapper(modelName, context, result, nullType);
+ }
+ return getFluentWrapper(modelName, context, getResultType(modelName, actionName, context));
+}
+function getFluentWrapper(modelName, context, resultType, nullType2 = neverType) {
+ const result = namedType(fluentWrapperName(modelName)).addGenericArgument(resultType).addGenericArgument(nullType2).addGenericArgument(extArgsParam.toArgument());
+ if (context.isPreviewFeatureOn("omitApi")) {
+ result.addGenericArgument(namedType("ClientOptions"));
+ }
+ return result;
+}
+function getResultType(modelName, actionName, context) {
+ const result = namedType("$Result.GetResult").addGenericArgument(namedType(getPayloadName(modelName)).addGenericArgument(extArgsParam.toArgument())).addGenericArgument(namedType("T")).addGenericArgument(stringLiteral(actionName));
+ if (context.isPreviewFeatureOn("omitApi")) {
+ result.addGenericArgument(namedType("ClientOptions"));
+ }
+ return result;
+}
+function buildFluentWrapperDefinition(modelName, outputType, context) {
+ const definition = interfaceDeclaration(fluentWrapperName(modelName));
+ definition.addGenericParameter(genericParameter("T")).addGenericParameter(genericParameter("Null").default(neverType)).addGenericParameter(extArgsParam).extends(prismaPromise(namedType("T")));
+ if (context.isPreviewFeatureOn("omitApi")) {
+ definition.addGenericParameter(genericParameter("ClientOptions").default(objectType()));
+ }
+ definition.add(property(toStringTag, stringLiteral("PrismaPromise")).readonly());
+ definition.addMultiple(
+ outputType.fields.filter(
+ (field) => field.outputType.location === "outputObjectTypes" && !context.dmmf.isComposite(field.outputType.type) && field.name !== "_count"
+ ).map((field) => {
+ const fieldArgType = namedType(getFieldArgName(field, modelName)).addGenericArgument(extArgsParam.toArgument());
+ const argsParam = genericParameter("T").extends(fieldArgType).default(objectType());
+ return method(field.name).addGenericParameter(argsParam).addParameter(parameter("args", subset(argsParam.toArgument(), fieldArgType)).optional()).setReturnType(
+ getReturnType({
+ modelName: field.outputType.type,
+ actionName: field.outputType.isList ? DMMF.ModelAction.findMany : DMMF.ModelAction.findUniqueOrThrow,
+ isChaining: true,
+ context,
+ isNullable: field.isNullable
+ })
+ );
+ })
+ );
+ definition.add(
+ method("then").setDocComment(
+ docComment`
+ Attaches callbacks for the resolution and/or rejection of the Promise.
+ @param onfulfilled The callback to execute when the Promise is resolved.
+ @param onrejected The callback to execute when the Promise is rejected.
+ @returns A Promise for the completion of which ever callback is executed.
+ `
+ ).addGenericParameter(genericParameter("TResult1").default(namedType("T"))).addGenericParameter(genericParameter("TResult2").default(neverType)).addParameter(promiseCallback("onfulfilled", parameter("value", namedType("T")), namedType("TResult1"))).addParameter(promiseCallback("onrejected", parameter("reason", anyType), namedType("TResult2"))).setReturnType(promise(unionType([namedType("TResult1"), namedType("TResult2")])))
+ );
+ definition.add(
+ method("catch").setDocComment(
+ docComment`
+ Attaches a callback for only the rejection of the Promise.
+ @param onrejected The callback to execute when the Promise is rejected.
+ @returns A Promise for the completion of the callback.
+ `
+ ).addGenericParameter(genericParameter("TResult").default(neverType)).addParameter(promiseCallback("onrejected", parameter("reason", anyType), namedType("TResult"))).setReturnType(promise(unionType([namedType("T"), namedType("TResult")])))
+ );
+ definition.add(
+ method("finally").setDocComment(
+ docComment`
+ Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
+ resolved value cannot be modified from the callback.
+ @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
+ @returns A Promise for the completion of the callback.
+ `
+ ).addParameter(
+ parameter("onfinally", unionType([functionType(), undefinedType, nullType])).optional()
+ ).setReturnType(promise(namedType("T")))
+ );
+ return moduleExport(definition).setDocComment(docComment`
+ The delegate class that acts as a "Promise-like" for ${modelName}.
+ Why is this prefixed with \`Prisma__\`?
+ Because we want to prevent naming conflicts as mentioned in
+ https://github.com/prisma/prisma-client-js/issues/707
+ `);
+}
+function promiseCallback(name, callbackParam, returnType) {
+ return parameter(
+ name,
+ unionType([
+ functionType().addParameter(callbackParam).setReturnType(typeOrPromiseLike(returnType)),
+ undefinedType,
+ nullType
+ ])
+ ).optional();
+}
+function typeOrPromiseLike(type) {
+ return unionType([type, namedType("PromiseLike").addGenericArgument(type)]);
+}
+function subset(arg, baseType) {
+ return namedType("Subset").addGenericArgument(arg).addGenericArgument(baseType);
+}
+function fluentWrapperName(modelName) {
+ return `Prisma__${modelName}Client`;
+}
+
+// src/generation/TSClient/TSClient.ts
+var import_ci_info = __toESM(require_ci_info());
+var import_crypto = __toESM(require("crypto"));
+var import_indent_string8 = __toESM(require_indent_string());
+var import_path4 = __toESM(require("path"));
+
+// src/generation/dmmf.ts
+var DMMFHelper = class {
+ constructor(document) {
+ this.document = document;
+ }
+ get compositeNames() {
+ return this._compositeNames ??= new Set(this.datamodel.types.map((t) => t.name));
+ }
+ get inputTypesByName() {
+ return this._inputTypesByName ??= this.buildInputTypesMap();
+ }
+ get typeAndModelMap() {
+ return this._typeAndModelMap ??= this.buildTypeModelMap();
+ }
+ get mappingsMap() {
+ return this._mappingsMap ??= this.buildMappingsMap();
+ }
+ get outputTypeMap() {
+ return this._outputTypeMap ??= this.buildMergedOutputTypeMap();
+ }
+ get rootFieldMap() {
+ return this._rootFieldMap ??= this.buildRootFieldMap();
+ }
+ get datamodel() {
+ return this.document.datamodel;
+ }
+ get mappings() {
+ return this.document.mappings;
+ }
+ get schema() {
+ return this.document.schema;
+ }
+ get inputObjectTypes() {
+ return this.schema.inputObjectTypes;
+ }
+ get outputObjectTypes() {
+ return this.schema.outputObjectTypes;
+ }
+ isComposite(modelOrTypeName) {
+ return this.compositeNames.has(modelOrTypeName);
+ }
+ getOtherOperationNames() {
+ return [
+ Object.values(this.mappings.otherOperations.write),
+ Object.values(this.mappings.otherOperations.read)
+ ].flat();
+ }
+ hasEnumInNamespace(enumName, namespace2) {
+ return this.schema.enumTypes[namespace2]?.find((schemaEnum) => schemaEnum.name === enumName) !== void 0;
+ }
+ resolveInputObjectType(ref) {
+ return this.inputTypesByName.get(fullyQualifiedName(ref.type, ref.namespace));
+ }
+ resolveOutputObjectType(ref) {
+ if (ref.location !== "outputObjectTypes") {
+ return void 0;
+ }
+ return this.outputObjectTypes[ref.namespace ?? "prisma"].find((outputObject) => outputObject.name === ref.type);
+ }
+ buildModelMap() {
+ return keyBy(this.datamodel.models, "name");
+ }
+ buildTypeMap() {
+ return keyBy(this.datamodel.types, "name");
+ }
+ buildTypeModelMap() {
+ return { ...this.buildTypeMap(), ...this.buildModelMap() };
+ }
+ buildMappingsMap() {
+ return keyBy(this.mappings.modelOperations, "model");
+ }
+ buildMergedOutputTypeMap() {
+ if (!this.schema.outputObjectTypes.prisma) {
+ return {
+ model: keyBy(this.schema.outputObjectTypes.model, "name"),
+ prisma: keyBy([], "name")
+ };
+ }
+ return {
+ model: keyBy(this.schema.outputObjectTypes.model, "name"),
+ prisma: keyBy(this.schema.outputObjectTypes.prisma, "name")
+ };
+ }
+ buildRootFieldMap() {
+ return {
+ ...keyBy(this.outputTypeMap.prisma.Query.fields, "name"),
+ ...keyBy(this.outputTypeMap.prisma.Mutation.fields, "name")
+ };
+ }
+ buildInputTypesMap() {
+ const result = /* @__PURE__ */ new Map();
+ for (const type of this.inputObjectTypes.prisma) {
+ result.set(fullyQualifiedName(type.name, "prisma"), type);
+ }
+ if (!this.inputObjectTypes.model) {
+ return result;
+ }
+ for (const type of this.inputObjectTypes.model) {
+ result.set(fullyQualifiedName(type.name, "model"), type);
+ }
+ return result;
+ }
+};
+function fullyQualifiedName(typeName, namespace2) {
+ if (namespace2) {
+ return `${namespace2}.${typeName}`;
+ }
+ return typeName;
+}
+
+// src/generation/Cache.ts
+var Cache = class {
+ constructor() {
+ this._map = /* @__PURE__ */ new Map();
+ }
+ get(key) {
+ return this._map.get(key)?.value;
+ }
+ set(key, value) {
+ this._map.set(key, { value });
+ }
+ getOrCreate(key, create) {
+ const cached = this._map.get(key);
+ if (cached) {
+ return cached.value;
+ }
+ const value = create();
+ this.set(key, value);
+ return value;
+ }
+};
+
+// src/generation/GenericsArgsInfo.ts
+var GenericArgsInfo = class {
+ constructor(_dmmf) {
+ this._dmmf = _dmmf;
+ this._cache = new Cache();
+ }
+ /**
+ * Determines if arg types need generic <$PrismaModel> argument added.
+ * Essentially, performs breadth-first search for any fieldRefTypes that
+ * do not have corresponding `meta.source` defined.
+ *
+ * @param type
+ * @returns
+ */
+ typeNeedsGenericModelArg(topLevelType) {
+ return this._cache.getOrCreate(topLevelType, () => {
+ const toVisit = [{ type: topLevelType }];
+ const visited = /* @__PURE__ */ new Set();
+ let item;
+ while (item = toVisit.shift()) {
+ const { type: currentType } = item;
+ const cached = this._cache.get(currentType);
+ if (cached === true) {
+ this._cacheResultsForTree(item);
+ return true;
+ }
+ if (cached === false) {
+ continue;
+ }
+ if (visited.has(currentType)) {
+ continue;
+ }
+ if (currentType.meta?.source) {
+ this._cache.set(currentType, false);
+ continue;
+ }
+ visited.add(currentType);
+ for (const field of currentType.fields) {
+ for (const fieldType of field.inputTypes) {
+ if (fieldType.location === "fieldRefTypes") {
+ this._cacheResultsForTree(item);
+ return true;
+ }
+ const inputObject = this._dmmf.resolveInputObjectType(fieldType);
+ if (inputObject) {
+ toVisit.push({ type: inputObject, parent: item });
+ }
+ }
+ }
+ }
+ for (const visitedType of visited) {
+ this._cache.set(visitedType, false);
+ }
+ return false;
+ });
+ }
+ typeRefNeedsGenericModelArg(ref) {
+ if (ref.location === "fieldRefTypes") {
+ return true;
+ }
+ const inputType = this._dmmf.resolveInputObjectType(ref);
+ if (!inputType) {
+ return false;
+ }
+ return this.typeNeedsGenericModelArg(inputType);
+ }
+ _cacheResultsForTree(item) {
+ let currentItem = item;
+ while (currentItem) {
+ this._cache.set(currentItem.type, true);
+ currentItem = currentItem.parent;
+ }
+ }
+};
+
+// src/generation/utils/buildInjectableEdgeEnv.ts
+function buildInjectableEdgeEnv(edge, datasources) {
+ if (edge === true) {
+ return declareInjectableEdgeEnv(datasources);
+ }
+ return ``;
+}
+function declareInjectableEdgeEnv(datasources) {
+ const injectableEdgeEnv = { parsed: {} };
+ const envVarNames = getSelectedEnvVarNames(datasources);
+ for (const envVarName of envVarNames) {
+ injectableEdgeEnv.parsed[envVarName] = getRuntimeEdgeEnvVar(envVarName);
+ }
+ const injectableEdgeEnvJson = JSON.stringify(injectableEdgeEnv, null, 2);
+ const injectableEdgeEnvCode = injectableEdgeEnvJson.replace(/"/g, "");
+ return `
+config.injectableEdgeEnv = () => (${injectableEdgeEnvCode})`;
+}
+function getSelectedEnvVarNames(datasources) {
+ return datasources.reduce((acc, datasource) => {
+ if (datasource.url.fromEnvVar) {
+ return [...acc, datasource.url.fromEnvVar];
+ }
+ return acc;
+ }, []);
+}
+function getRuntimeEdgeEnvVar(envVarName) {
+ const cfwEnv = `typeof globalThis !== 'undefined' && globalThis['${envVarName}']`;
+ const nodeOrVercelEnv = `typeof process !== 'undefined' && process.env && process.env.${envVarName}`;
+ return `${cfwEnv} || ${nodeOrVercelEnv} || undefined`;
+}
+
+// src/generation/utils/buildDebugInitialization.ts
+function buildDebugInitialization(edge) {
+ if (!edge) {
+ return "";
+ }
+ const debugVar = getRuntimeEdgeEnvVar("DEBUG");
+ return `if (${debugVar}) {
+ Debug.enable(${debugVar})
+}
+`;
+}
+
+// src/generation/utils/buildDirname.ts
+function buildDirname(edge, relativeOutdir) {
+ if (edge === true) {
+ return buildDirnameDefault();
+ }
+ return buildDirnameFind(relativeOutdir);
+}
+function buildDirnameFind(relativeOutdir) {
+ return `
+const fs = require('fs')
+
+config.dirname = __dirname
+if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) {
+ const alternativePaths = [
+ ${JSON.stringify(pathToPosix(relativeOutdir))},
+ ${JSON.stringify(pathToPosix(relativeOutdir).split("/").slice(1).join("/"))},
+ ]
+
+ const alternativePath = alternativePaths.find((altPath) => {
+ return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma'))
+ }) ?? alternativePaths[0]
+
+ config.dirname = path.join(process.cwd(), alternativePath)
+ config.isBundled = true
+}`;
+}
+function buildDirnameDefault() {
+ return `config.dirname = '/'`;
+}
+
+// src/runtime/core/runtimeDataModel.ts
+function dmmfToRuntimeDataModel(dmmfDataModel) {
+ return {
+ models: buildMapForRuntime(dmmfDataModel.models),
+ enums: buildMapForRuntime(dmmfDataModel.enums),
+ types: buildMapForRuntime(dmmfDataModel.types)
+ };
+}
+function pruneRuntimeDataModel({ models }) {
+ const prunedModels = {};
+ for (const modelName of Object.keys(models)) {
+ prunedModels[modelName] = { fields: [], dbName: models[modelName].dbName };
+ for (const { name, kind, type, relationName, dbName } of models[modelName].fields) {
+ prunedModels[modelName].fields.push({ name, kind, type, relationName, dbName });
+ }
+ }
+ return { models: prunedModels, enums: {}, types: {} };
+}
+function buildMapForRuntime(list) {
+ const result = {};
+ for (const { name, ...rest } of list) {
+ result[name] = rest;
+ }
+ return result;
+}
+
+// src/generation/utils/buildDMMF.ts
+function buildRuntimeDataModel(datamodel, runtimeNameJs) {
+ const runtimeDataModel = dmmfToRuntimeDataModel(datamodel);
+ let prunedDataModel;
+ if (runtimeNameJs === "wasm") {
+ prunedDataModel = pruneRuntimeDataModel(runtimeDataModel);
+ } else {
+ prunedDataModel = runtimeDataModel;
+ }
+ const datamodelString = escapeJson(JSON.stringify(prunedDataModel));
+ return `
+config.runtimeDataModel = JSON.parse(${JSON.stringify(datamodelString)})
+defineDmmfProperty(exports.Prisma, config.runtimeDataModel)`;
+}
+
+// src/generation/utils/buildGetQueryEngineWasmModule.ts
+function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
+ if (copyEngine && runtimeNameJs === "library" && process.env.PRISMA_CLIENT_FORCE_WASM) {
+ return `config.engineWasm = {
+ getRuntime: () => require('./query_engine_bg.js'),
+ getQueryEngineWasmModule: async () => {
+ const queryEngineWasmFilePath = require('path').join(config.dirname, 'query_engine_bg.wasm')
+ const queryEngineWasmFileBytes = require('fs').readFileSync(queryEngineWasmFilePath)
+
+ return new WebAssembly.Module(queryEngineWasmFileBytes)
+ }
+ }`;
+ }
+ if (copyEngine && wasm === true) {
+ return `config.engineWasm = {
+ getRuntime: () => require('./query_engine_bg.js'),
+ getQueryEngineWasmModule: async () => {
+ const loader = (await import('#wasm-engine-loader')).default
+ const engine = (await loader).default
+ return engine
+ }
+}`;
+ }
+ return `config.engineWasm = undefined`;
+}
+
+// src/generation/utils/buildNFTAnnotations.ts
+var import_path3 = __toESM(require("path"));
+
+// ../../helpers/blaze/map.ts
+function mapList(object, mapper) {
+ const mapped = new Array(object.length);
+ for (let i = 0; i < object.length; ++i) {
+ mapped[i] = mapper(object[i], i);
+ }
+ return mapped;
+}
+function mapObject(object, mapper) {
+ const mapped = {};
+ const keys = Object.keys(object);
+ for (let i = 0; i < keys.length; ++i) {
+ mapped[i] = mapper(object[keys[i]], keys[i]);
+ }
+ return mapped;
+}
+var map = (object, mapper) => {
+ return Array.isArray(object) ? mapList(object, mapper) : mapObject(object, mapper);
+};
+
+// src/generation/utils/buildNFTAnnotations.ts
+function buildNFTAnnotations(noEngine, engineType, binaryTargets, relativeOutdir) {
+ if (noEngine === true) return "";
+ if (binaryTargets === void 0) {
+ return "";
+ }
+ if (process.env.NETLIFY) {
+ const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20;
+ const awsRuntimeVersion = parseAWSNodejsRuntimeEnvVarVersion();
+ const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20;
+ const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18;
+ if ((isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) {
+ binaryTargets = ["rhel-openssl-3.0.x"];
+ } else {
+ binaryTargets = ["rhel-openssl-1.0.x"];
+ }
+ }
+ const engineAnnotations = map(binaryTargets, (binaryTarget) => {
+ const engineFilename = getQueryEngineFilename(engineType, binaryTarget);
+ return engineFilename ? buildNFTAnnotation(engineFilename, relativeOutdir) : "";
+ }).join("\n");
+ const schemaAnnotations = buildNFTAnnotation("schema.prisma", relativeOutdir);
+ return `${engineAnnotations}${schemaAnnotations}`;
+}
+function getQueryEngineFilename(engineType, binaryTarget) {
+ if (engineType === "library" /* Library */) {
+ return getNodeAPIName(binaryTarget, "fs");
+ }
+ if (engineType === "binary" /* Binary */) {
+ return `query-engine-${binaryTarget}`;
+ }
+ return void 0;
+}
+function buildNFTAnnotation(fileName, relativeOutdir) {
+ const relativeFilePath = import_path3.default.join(relativeOutdir, fileName);
+ return `
+// file annotations for bundling tools to include these files
+path.join(__dirname, ${JSON.stringify(pathToPosix(fileName))});
+path.join(process.cwd(), ${JSON.stringify(pathToPosix(relativeFilePath))})`;
+}
+
+// src/generation/utils/buildRequirePath.ts
+function buildRequirePath(edge) {
+ if (edge === true) return "";
+ return `
+ const path = require('path')`;
+}
+
+// src/generation/utils/buildWarnEnvConflicts.ts
+function buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs) {
+ if (edge === true) return "";
+ return `
+const { warnEnvConflicts } = require('${runtimeBase}/${runtimeNameJs}.js')
+
+warnEnvConflicts({
+ rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath),
+ schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath)
+})`;
+}
+
+// src/generation/TSClient/common.ts
+var import_indent_string4 = __toESM(require_indent_string());
+var commonCodeJS = ({
+ runtimeBase,
+ runtimeNameJs,
+ browser,
+ clientVersion: clientVersion2,
+ engineVersion,
+ generator,
+ deno
+}) => `${deno ? "const exports = {}" : ""}
+Object.defineProperty(exports, "__esModule", { value: true });
+${deno ? `
+import {
+ PrismaClientKnownRequestError,
+ PrismaClientUnknownRequestError,
+ PrismaClientRustPanicError,
+ PrismaClientInitializationError,
+ PrismaClientValidationError,
+ NotFoundError,
+ getPrismaClient,
+ sqltag,
+ empty,
+ join,
+ raw,
+ Decimal,
+ Debug,
+ objectEnumValues,
+ makeStrictEnum,
+ Extensions,
+ defineDmmfProperty,
+ Public,
+ getRuntime,
+ skip
+} from '${runtimeBase}/${runtimeNameJs}.js'` : browser ? `
+const {
+ Decimal,
+ objectEnumValues,
+ makeStrictEnum,
+ Public,
+ getRuntime,
+ skip
+} = require('${runtimeBase}/${runtimeNameJs}.js')
+` : `
+const {
+ PrismaClientKnownRequestError,
+ PrismaClientUnknownRequestError,
+ PrismaClientRustPanicError,
+ PrismaClientInitializationError,
+ PrismaClientValidationError,
+ NotFoundError,
+ getPrismaClient,
+ sqltag,
+ empty,
+ join,
+ raw,
+ skip,
+ Decimal,
+ Debug,
+ objectEnumValues,
+ makeStrictEnum,
+ Extensions,
+ warnOnce,
+ defineDmmfProperty,
+ Public,
+ getRuntime
+} = require('${runtimeBase}/${runtimeNameJs}.js')
+`}
+
+const Prisma = {}
+
+exports.Prisma = Prisma
+exports.$Enums = {}
+
+/**
+ * Prisma Client JS version: ${clientVersion2}
+ * Query Engine version: ${engineVersion}
+ */
+Prisma.prismaVersion = {
+ client: "${clientVersion2}",
+ engine: "${engineVersion}"
+}
+
+Prisma.PrismaClientKnownRequestError = ${notSupportOnBrowser("PrismaClientKnownRequestError", browser)};
+Prisma.PrismaClientUnknownRequestError = ${notSupportOnBrowser("PrismaClientUnknownRequestError", browser)}
+Prisma.PrismaClientRustPanicError = ${notSupportOnBrowser("PrismaClientRustPanicError", browser)}
+Prisma.PrismaClientInitializationError = ${notSupportOnBrowser("PrismaClientInitializationError", browser)}
+Prisma.PrismaClientValidationError = ${notSupportOnBrowser("PrismaClientValidationError", browser)}
+Prisma.NotFoundError = ${notSupportOnBrowser("NotFoundError", browser)}
+Prisma.Decimal = Decimal
+
+/**
+ * Re-export of sql-template-tag
+ */
+Prisma.sql = ${notSupportOnBrowser("sqltag", browser)}
+Prisma.empty = ${notSupportOnBrowser("empty", browser)}
+Prisma.join = ${notSupportOnBrowser("join", browser)}
+Prisma.raw = ${notSupportOnBrowser("raw", browser)}
+Prisma.validator = Public.validator
+
+/**
+* Extensions
+*/
+Prisma.getExtensionContext = ${notSupportOnBrowser("Extensions.getExtensionContext", browser)}
+Prisma.defineExtension = ${notSupportOnBrowser("Extensions.defineExtension", browser)}
+
+/**
+ * Shorthand utilities for JSON filtering
+ */
+Prisma.DbNull = objectEnumValues.instances.DbNull
+Prisma.JsonNull = objectEnumValues.instances.JsonNull
+Prisma.AnyNull = objectEnumValues.instances.AnyNull
+
+Prisma.NullTypes = {
+ DbNull: objectEnumValues.classes.DbNull,
+ JsonNull: objectEnumValues.classes.JsonNull,
+ AnyNull: objectEnumValues.classes.AnyNull
+}
+
+${buildPrismaSkipJs(generator.previewFeatures)}
+`;
+var notSupportOnBrowser = (fnc, browser) => {
+ if (browser) {
+ return `() => {
+ const runtimeName = getRuntime().prettyName;
+ throw new Error(\`${fnc} is unable to run in this browser environment, or has been bundled for the browser (running in \${runtimeName}).
+In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report\`,
+)}`;
+ }
+ return fnc;
+};
+var commonCodeTS = ({
+ runtimeBase,
+ runtimeNameTs,
+ clientVersion: clientVersion2,
+ engineVersion,
+ generator
+}) => ({
+ tsWithoutNamespace: () => `import * as runtime from '${runtimeBase}/${runtimeNameTs}';
+import $Types = runtime.Types // general types
+import $Public = runtime.Types.Public
+import $Utils = runtime.Types.Utils
+import $Extensions = runtime.Types.Extensions
+import $Result = runtime.Types.Result
+
+export type PrismaPromise = $Public.PrismaPromise
+`,
+ ts: () => `export import DMMF = runtime.DMMF
+
+export type PrismaPromise = $Public.PrismaPromise
+
+/**
+ * Validator
+ */
+export import validator = runtime.Public.validator
+
+/**
+ * Prisma Errors
+ */
+export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError
+export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError
+export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
+export import PrismaClientInitializationError = runtime.PrismaClientInitializationError
+export import PrismaClientValidationError = runtime.PrismaClientValidationError
+export import NotFoundError = runtime.NotFoundError
+
+/**
+ * Re-export of sql-template-tag
+ */
+export import sql = runtime.sqltag
+export import empty = runtime.empty
+export import join = runtime.join
+export import raw = runtime.raw
+export import Sql = runtime.Sql
+
+${buildPrismaSkipTs(generator.previewFeatures)}
+
+/**
+ * Decimal.js
+ */
+export import Decimal = runtime.Decimal
+
+export type DecimalJsLike = runtime.DecimalJsLike
+
+/**
+ * Metrics
+ */
+export type Metrics = runtime.Metrics
+export type Metric = runtime.Metric
+export type MetricHistogram = runtime.MetricHistogram
+export type MetricHistogramBucket = runtime.MetricHistogramBucket
+
+/**
+* Extensions
+*/
+export import Extension = $Extensions.UserArgs
+export import getExtensionContext = runtime.Extensions.getExtensionContext
+export import Args = $Public.Args
+export import Payload = $Public.Payload
+export import Result = $Public.Result
+export import Exact = $Public.Exact
+
+/**
+ * Prisma Client JS version: ${clientVersion2}
+ * Query Engine version: ${engineVersion}
+ */
+export type PrismaVersion = {
+ client: string
+}
+
+export const prismaVersion: PrismaVersion
+
+/**
+ * Utility Types
+ */
+
+
+export import JsonObject = runtime.JsonObject
+export import JsonArray = runtime.JsonArray
+export import JsonValue = runtime.JsonValue
+export import InputJsonObject = runtime.InputJsonObject
+export import InputJsonArray = runtime.InputJsonArray
+export import InputJsonValue = runtime.InputJsonValue
+
+/**
+ * Types of the values used to represent different kinds of \`null\` values when working with JSON fields.
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+namespace NullTypes {
+${buildNullClass("DbNull")}
+
+${buildNullClass("JsonNull")}
+
+${buildNullClass("AnyNull")}
+}
+
+/**
+ * Helper for filtering JSON entries that have \`null\` on the database (empty on the db)
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+export const DbNull: NullTypes.DbNull
+
+/**
+ * Helper for filtering JSON entries that have JSON \`null\` values (not empty on the db)
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+export const JsonNull: NullTypes.JsonNull
+
+/**
+ * Helper for filtering JSON entries that are \`Prisma.DbNull\` or \`Prisma.JsonNull\`
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+export const AnyNull: NullTypes.AnyNull
+
+type SelectAndInclude = {
+ select: any
+ include: any
+}
+
+type SelectAndOmit = {
+ select: any
+ omit: any
+}
+
+/**
+ * Get the type of the value, that the Promise holds.
+ */
+export type PromiseType> = T extends PromiseLike ? U : T;
+
+/**
+ * Get the return type of a function which returns a Promise.
+ */
+export type PromiseReturnType $Utils.JsPromise> = PromiseType>
+
+/**
+ * From T, pick a set of properties whose keys are in the union K
+ */
+type Prisma__Pick = {
+ [P in K]: T[P];
+};
+
+
+export type Enumerable = T | Array;
+
+export type RequiredKeys = {
+ [K in keyof T]-?: {} extends Prisma__Pick ? never : K
+}[keyof T]
+
+export type TruthyKeys = keyof {
+ [K in keyof T as T[K] extends false | undefined | null ? never : K]: K
+}
+
+export type TrueKeys = TruthyKeys>>
+
+/**
+ * Subset
+ * @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection
+ */
+export type Subset = {
+ [key in keyof T]: key extends keyof U ? T[key] : never;
+};
+
+/**
+ * SelectSubset
+ * @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection.
+ * Additionally, it validates, if both select and include are present. If the case, it errors.
+ */
+export type SelectSubset = {
+ [key in keyof T]: key extends keyof U ? T[key] : never
+} &
+ (T extends SelectAndInclude
+ ? 'Please either choose \`select\` or \`include\`.'
+ : T extends SelectAndOmit
+ ? 'Please either choose \`select\` or \`omit\`.'
+ : {})
+
+/**
+ * Subset + Intersection
+ * @desc From \`T\` pick properties that exist in \`U\` and intersect \`K\`
+ */
+export type SubsetIntersection = {
+ [key in keyof T]: key extends keyof U ? T[key] : never
+} &
+ K
+
+type Without = { [P in Exclude]?: never };
+
+/**
+ * XOR is needed to have a real mutually exclusive union type
+ * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types
+ */
+type XOR =
+ T extends object ?
+ U extends object ?
+ (Without & U) | (Without & T)
+ : U : T
+
+
+/**
+ * Is T a Record?
+ */
+type IsObject = T extends Array
+? False
+: T extends Date
+? False
+: T extends Uint8Array
+? False
+: T extends BigInt
+? False
+: T extends object
+? True
+: False
+
+
+/**
+ * If it's T[], return T
+ */
+export type UnEnumerate = T extends Array ? U : T
+
+/**
+ * From ts-toolbelt
+ */
+
+type __Either = Omit &
+ {
+ // Merge all but K
+ [P in K]: Prisma__Pick // With K possibilities
+ }[K]
+
+type EitherStrict = Strict<__Either>
+
+type EitherLoose = ComputeRaw<__Either>
+
+type _Either<
+ O extends object,
+ K extends Key,
+ strict extends Boolean
+> = {
+ 1: EitherStrict
+ 0: EitherLoose
+}[strict]
+
+type Either<
+ O extends object,
+ K extends Key,
+ strict extends Boolean = 1
+> = O extends unknown ? _Either : never
+
+export type Union = any
+
+type PatchUndefined = {
+ [K in keyof O]: O[K] extends undefined ? At : O[K]
+} & {}
+
+/** Helper Types for "Merge" **/
+export type IntersectOf = (
+ U extends unknown ? (k: U) => void : never
+) extends (k: infer I) => void
+ ? I
+ : never
+
+export type Overwrite = {
+ [K in keyof O]: K extends keyof O1 ? O1[K] : O[K];
+} & {};
+
+type _Merge = IntersectOf;
+}>>;
+
+type Key = string | number | symbol;
+type AtBasic = K extends keyof O ? O[K] : never;
+type AtStrict = O[K & keyof O];
+type AtLoose = O extends unknown ? AtStrict : never;
+export type At = {
+ 1: AtStrict;
+ 0: AtLoose;
+}[strict];
+
+export type ComputeRaw = A extends Function ? A : {
+ [K in keyof A]: A[K];
+} & {};
+
+export type OptionalFlat = {
+ [K in keyof O]?: O[K];
+} & {};
+
+type _Record = {
+ [P in K]: T;
+};
+
+// cause typescript not to expand types and preserve names
+type NoExpand = T extends unknown ? T : never;
+
+// this type assumes the passed object is entirely optional
+type AtLeast = NoExpand<
+ O extends unknown
+ ? | (K extends keyof O ? { [P in K]: O[P] } & O : O)
+ | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O
+ : never>;
+
+type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never;
+
+export type Strict = ComputeRaw<_Strict>;
+/** End Helper Types for "Merge" **/
+
+export type Merge = ComputeRaw<_Merge>>;
+
+/**
+A [[Boolean]]
+*/
+export type Boolean = True | False
+
+// /**
+// 1
+// */
+export type True = 1
+
+/**
+0
+*/
+export type False = 0
+
+export type Not = {
+ 0: 1
+ 1: 0
+}[B]
+
+export type Extends = [A1] extends [never]
+ ? 0 // anything \`never\` is false
+ : A1 extends A2
+ ? 1
+ : 0
+
+export type Has = Not<
+ Extends, U1>
+>
+
+export type Or = {
+ 0: {
+ 0: 0
+ 1: 1
+ }
+ 1: {
+ 0: 1
+ 1: 1
+ }
+}[B1][B2]
+
+export type Keys = U extends unknown ? keyof U : never
+
+type Cast = A extends B ? A : B;
+
+export const type: unique symbol;
+
+
+
+/**
+ * Used by group by
+ */
+
+export type GetScalarType = O extends object ? {
+ [P in keyof T]: P extends keyof O
+ ? O[P]
+ : never
+} : never
+
+type FieldPaths<
+ T,
+ U = Omit
+> = IsObject extends True ? U : T
+
+type GetHavingFields = {
+ [K in keyof T]: Or<
+ Or, Extends<'AND', K>>,
+ Extends<'NOT', K>
+ > extends True
+ ? // infer is only needed to not hit TS limit
+ // based on the brilliant idea of Pierre-Antoine Mills
+ // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437
+ T[K] extends infer TK
+ ? GetHavingFields extends object ? Merge> : never>
+ : never
+ : {} extends FieldPaths
+ ? never
+ : K
+}[keyof T]
+
+/**
+ * Convert tuple to union
+ */
+type _TupleToUnion = T extends (infer E)[] ? E : never
+type TupleToUnion = _TupleToUnion
+type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T
+
+/**
+ * Like \`Pick\`, but additionally can also accept an array of keys
+ */
+type PickEnumerable | keyof T> = Prisma__Pick>
+
+/**
+ * Exclude all keys with underscores
+ */
+type ExcludeUnderscoreKeys = T extends \`_\${string}\` ? never : T
+
+
+export type FieldRef = runtime.FieldRef
+
+type FieldRefInputType = Model extends never ? never : FieldRef
+
+`
+});
+function buildNullClass(name) {
+ const source = `/**
+* Type of \`Prisma.${name}\`.
+*
+* You cannot use other instances of this class. Please use the \`Prisma.${name}\` value.
+*
+* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+*/
+class ${name} {
+ private ${name}: never
+ private constructor()
+}`;
+ return (0, import_indent_string4.default)(source, TAB_SIZE);
+}
+function buildPrismaSkipTs(previewFeatures) {
+ if (previewFeatures.includes("strictUndefinedChecks")) {
+ return `
+/**
+ * Prisma.skip
+ */
+export import skip = runtime.skip
+`;
+ }
+ return "";
+}
+function buildPrismaSkipJs(previewFeatures) {
+ if (previewFeatures.includes("strictUndefinedChecks")) {
+ return `
+Prisma.skip = skip
+`;
+ }
+ return "";
+}
+
+// src/generation/TSClient/Count.ts
+var import_indent_string5 = __toESM(require_indent_string());
+var Count = class {
+ constructor(type, context) {
+ this.type = type;
+ this.context = context;
+ }
+ get argsTypes() {
+ const argsTypes = [];
+ argsTypes.push(
+ new ArgsTypeBuilder(this.type, this.context).addSelectArg().addIncludeArgIfHasRelations().createExport()
+ );
+ for (const field of this.type.fields) {
+ if (field.args.length > 0) {
+ argsTypes.push(
+ new ArgsTypeBuilder(this.type, this.context).addSchemaArgs(field.args).setGeneratedName(getCountArgsType(this.type.name, field.name)).createExport()
+ );
+ }
+ }
+ return argsTypes;
+ }
+ toTS() {
+ const { type } = this;
+ const { name } = type;
+ const outputType = buildOutputType(type);
+ return `
+/**
+ * Count Type ${name}
+ */
+
+${stringify(outputType)}
+
+export type ${getSelectName(name)} = {
+${(0, import_indent_string5.default)(
+ type.fields.map((field) => {
+ const types = ["boolean"];
+ if (field.outputType.location === "outputObjectTypes") {
+ types.push(getFieldArgName(field, this.type.name));
+ }
+ if (field.args.length > 0) {
+ types.push(getCountArgsType(name, field.name));
+ }
+ return `${field.name}?: ${types.join(" | ")}`;
+ }).join("\n"),
+ TAB_SIZE
+ )}
+}
+
+// Custom InputTypes
+${this.argsTypes.map((typeExport) => stringify(typeExport)).join("\n\n")}
+`;
+ }
+};
+function getCountArgsType(typeName, fieldName) {
+ return `${typeName}Count${capitalize2(fieldName)}Args`;
+}
+
+// src/generation/TSClient/DefaultArgsAliases.ts
+var DefaultArgsAliases = class {
+ constructor() {
+ this.existingArgTypes = /* @__PURE__ */ new Set();
+ this.possibleAliases = [];
+ }
+ addPossibleAlias(newName, legacyName) {
+ this.possibleAliases.push({ newName, legacyName });
+ }
+ registerArgName(name) {
+ this.existingArgTypes.add(name);
+ }
+ generateAliases() {
+ const aliases = [];
+ for (const { newName, legacyName } of this.possibleAliases) {
+ if (this.existingArgTypes.has(legacyName)) {
+ continue;
+ }
+ aliases.push(
+ stringify(
+ moduleExport(
+ typeDeclaration(legacyName, namedType(newName).addGenericArgument(extArgsParam.toArgument())).addGenericParameter(extArgsParam)
+ ).setDocComment(docComment(`@deprecated Use ${newName} instead`)),
+ { indentLevel: 1 }
+ )
+ );
+ }
+ return aliases.join("\n");
+ }
+};
+
+// src/generation/TSClient/FieldRefInput.ts
+var FieldRefInput = class {
+ constructor(type) {
+ this.type = type;
+ }
+ toTS() {
+ const allowedTypes = this.getAllowedTypes();
+ return `
+/**
+ * Reference to a field of type ${allowedTypes}
+ */
+export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${allowedTypes}>
+ `;
+ }
+ getAllowedTypes() {
+ return this.type.allowTypes.map(getRefAllowedTypeName).join(" | ");
+ }
+};
+
+// src/generation/TSClient/GenerateContext.ts
+var GenerateContext = class {
+ constructor({ dmmf, genericArgsInfo, defaultArgsAliases, generator }) {
+ this.dmmf = dmmf;
+ this.genericArgsInfo = genericArgsInfo;
+ this.defaultArgsAliases = defaultArgsAliases;
+ this.generator = generator;
+ }
+ isPreviewFeatureOn(previewFeature) {
+ return this.generator?.previewFeatures?.includes(previewFeature) ?? false;
+ }
+};
+
+// src/generation/TSClient/PrismaClient.ts
+var import_indent_string7 = __toESM(require_indent_string());
+
+// src/generation/utils/runtimeImport.ts
+function runtimeImport(name) {
+ return name;
+}
+function runtimeImportedType(name) {
+ return namedType(`runtime.${name}`);
+}
+
+// src/generation/TSClient/Datasources.ts
+var import_indent_string6 = __toESM(require_indent_string());
+var Datasources = class {
+ constructor(internalDatasources) {
+ this.internalDatasources = internalDatasources;
+ }
+ toTS() {
+ const sources = this.internalDatasources;
+ return `export type Datasources = {
+${(0, import_indent_string6.default)(sources.map((s) => `${s.name}?: Datasource`).join("\n"), 2)}
+}`;
+ }
+};
+
+// src/generation/TSClient/globalOmit.ts
+function globalOmitConfig(dmmf) {
+ const objectType2 = objectType().addMultiple(
+ dmmf.datamodel.models.map((model) => {
+ const type = namedType(getOmitName(model.name));
+ return property(lowerCase(model.name), type).optional();
+ })
+ );
+ return moduleExport(typeDeclaration("GlobalOmitConfig", objectType2));
+}
+
+// src/generation/TSClient/PrismaClient.ts
+function clientTypeMapModelsDefinition(context) {
+ const meta = objectType();
+ const modelNames = context.dmmf.datamodel.models.map((m) => m.name);
+ if (modelNames.length === 0) {
+ meta.add(property("modelProps", neverType));
+ } else {
+ meta.add(property("modelProps", unionType(modelNames.map((name) => stringLiteral(lowerCase(name))))));
+ }
+ const isolationLevel = context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma") ? namedType("Prisma.TransactionIsolationLevel") : neverType;
+ meta.add(property("txIsolationLevel", isolationLevel));
+ const model = objectType();
+ model.addMultiple(
+ modelNames.map((modelName) => {
+ const entry = objectType();
+ entry.add(
+ property("payload", namedType(getPayloadName(modelName)).addGenericArgument(extArgsParam.toArgument()))
+ );
+ entry.add(property("fields", namedType(`Prisma.${getFieldRefsTypeName(modelName)}`)));
+ const actions = getModelActions(context.dmmf, modelName);
+ const operations = objectType();
+ operations.addMultiple(
+ actions.map((action) => {
+ const operationType = objectType();
+ const argsType = `Prisma.${getModelArgName(modelName, action)}`;
+ operationType.add(property("args", namedType(argsType).addGenericArgument(extArgsParam.toArgument())));
+ operationType.add(property("result", clientTypeMapModelsResultDefinition(modelName, action)));
+ return property(action, operationType);
+ })
+ );
+ entry.add(property("operations", operations));
+ return property(modelName, entry);
+ })
+ );
+ return objectType().add(property("meta", meta)).add(property("model", model));
+}
+function clientTypeMapModelsResultDefinition(modelName, action) {
+ if (action === "count")
+ return unionType([optional(namedType(getCountAggregateOutputName(modelName))), numberType]);
+ if (action === "groupBy") return array(optional(namedType(getGroupByName(modelName))));
+ if (action === "aggregate") return optional(namedType(getAggregateName(modelName)));
+ if (action === "findRaw") return namedType("JsonObject");
+ if (action === "aggregateRaw") return namedType("JsonObject");
+ if (action === "deleteMany") return namedType("BatchPayload");
+ if (action === "createMany") return namedType("BatchPayload");
+ if (action === "createManyAndReturn") return array(payloadToResult(modelName));
+ if (action === "updateMany") return namedType("BatchPayload");
+ if (action === "findMany") return array(payloadToResult(modelName));
+ if (action === "findFirst") return unionType([payloadToResult(modelName), nullType]);
+ if (action === "findUnique") return unionType([payloadToResult(modelName), nullType]);
+ if (action === "findFirstOrThrow") return payloadToResult(modelName);
+ if (action === "findUniqueOrThrow") return payloadToResult(modelName);
+ if (action === "create") return payloadToResult(modelName);
+ if (action === "update") return payloadToResult(modelName);
+ if (action === "upsert") return payloadToResult(modelName);
+ if (action === "delete") return payloadToResult(modelName);
+ assertNever(action, `Unknown action: ${action}`);
+}
+function payloadToResult(modelName) {
+ return namedType("$Utils.PayloadToResult").addGenericArgument(namedType(getPayloadName(modelName)));
+}
+function clientTypeMapOthersDefinition(context) {
+ const otherOperationsNames = context.dmmf.getOtherOperationNames().flatMap((name) => {
+ const results = [`$${name}`];
+ if (name === "executeRaw" || name === "queryRaw") {
+ results.push(`$${name}Unsafe`);
+ }
+ if (name === "queryRaw" && context.isPreviewFeatureOn("typedSql")) {
+ results.push(`$queryRawTyped`);
+ }
+ return results;
+ });
+ const argsResultMap = {
+ $executeRaw: { args: "[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]", result: "any" },
+ $queryRaw: { args: "[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]", result: "any" },
+ $executeRawUnsafe: { args: "[query: string, ...values: any[]]", result: "any" },
+ $queryRawUnsafe: { args: "[query: string, ...values: any[]]", result: "any" },
+ $runCommandRaw: { args: "Prisma.InputJsonObject", result: "Prisma.JsonObject" },
+ $queryRawTyped: { args: "runtime.UnknownTypedSql", result: "Prisma.JsonObject" }
+ };
+ return `{
+ other: {
+ payload: any
+ operations: {${otherOperationsNames.reduce((acc, action) => {
+ return `${acc}
+ ${action}: {
+ args: ${argsResultMap[action].args},
+ result: ${argsResultMap[action].result}
+ }`;
+ }, "")}
+ }
+ }
+}`;
+}
+function clientTypeMapDefinition(context) {
+ const typeMap = `${stringify(clientTypeMapModelsDefinition(context))} & ${clientTypeMapOthersDefinition(context)}`;
+ return `
+interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.InternalArgs, clientOptions: PrismaClientOptions }, $Utils.Record> {
+ returns: Prisma.TypeMap
+}
+
+export type TypeMap = ${typeMap}`;
+}
+function clientExtensionsDefinitions(context) {
+ const typeMap = clientTypeMapDefinition(context);
+ const define2 = moduleExport(
+ constDeclaration(
+ "defineExtension",
+ namedType("$Extensions.ExtendsHook").addGenericArgument(stringLiteral("define")).addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(namedType("$Extensions.DefaultArgs"))
+ )
+ );
+ return [typeMap, stringify(define2)].join("\n");
+}
+function extendsPropertyDefinition(context) {
+ const extendsDefinition = namedType("$Extensions.ExtendsHook").addGenericArgument(stringLiteral("extends")).addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(namedType("ExtArgs"));
+ if (context.isPreviewFeatureOn("omitApi")) {
+ extendsDefinition.addGenericArgument(
+ namedType("$Utils.Call").addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(objectType().add(property("extArgs", namedType("ExtArgs"))))
+ ).addGenericArgument(namedType("ClientOptions"));
+ }
+ return stringify(property("$extends", extendsDefinition), { indentLevel: 1 });
+}
+function batchingTransactionDefinition(context) {
+ const method2 = method("$transaction").setDocComment(
+ docComment`
+ Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
+ @example
+ \`\`\`
+ const [george, bob, alice] = await prisma.$transaction([
+ prisma.user.create({ data: { name: 'George' } }),
+ prisma.user.create({ data: { name: 'Bob' } }),
+ prisma.user.create({ data: { name: 'Alice' } }),
+ ])
+ \`\`\`
+
+ Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions).
+ `
+ ).addGenericParameter(genericParameter("P").extends(array(prismaPromise(anyType)))).addParameter(parameter("arg", arraySpread(namedType("P")))).setReturnType(promise(namedType("runtime.Types.Utils.UnwrapTuple").addGenericArgument(namedType("P"))));
+ if (context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) {
+ const options = objectType().formatInline().add(property("isolationLevel", namedType("Prisma.TransactionIsolationLevel")).optional());
+ method2.addParameter(parameter("options", options).optional());
+ }
+ return stringify(method2, { indentLevel: 1, newLine: "leading" });
+}
+function interactiveTransactionDefinition(context) {
+ const options = objectType().formatInline().add(property("maxWait", numberType).optional()).add(property("timeout", numberType).optional());
+ if (context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) {
+ const isolationLevel = property("isolationLevel", namedType("Prisma.TransactionIsolationLevel")).optional();
+ options.add(isolationLevel);
+ }
+ const returnType = promise(namedType("R"));
+ const callbackType = functionType().addParameter(
+ parameter("prisma", omit(namedType("PrismaClient"), namedType("runtime.ITXClientDenyList")))
+ ).setReturnType(returnType);
+ const method2 = method("$transaction").addGenericParameter(genericParameter("R")).addParameter(parameter("fn", callbackType)).addParameter(parameter("options", options).optional()).setReturnType(returnType);
+ return stringify(method2, { indentLevel: 1, newLine: "leading" });
+}
+function queryRawDefinition(context) {
+ if (!context.dmmf.mappings.otherOperations.write.includes("queryRaw")) {
+ return "";
+ }
+ return `
+ /**
+ * Performs a prepared raw query and returns the \`SELECT\` data.
+ * @example
+ * \`\`\`
+ * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
+ * \`\`\`
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise;
+
+ /**
+ * Performs a raw query and returns the \`SELECT\` data.
+ * Susceptible to SQL injections, see documentation.
+ * @example
+ * \`\`\`
+ * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
+ * \`\`\`
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;`;
+}
+function executeRawDefinition(context) {
+ if (!context.dmmf.mappings.otherOperations.write.includes("executeRaw")) {
+ return "";
+ }
+ return `
+ /**
+ * Executes a prepared raw query and returns the number of affected rows.
+ * @example
+ * \`\`\`
+ * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
+ * \`\`\`
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise;
+
+ /**
+ * Executes a raw query and returns the number of affected rows.
+ * Susceptible to SQL injections, see documentation.
+ * @example
+ * \`\`\`
+ * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
+ * \`\`\`
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;`;
+}
+function queryRawTypedDefinition(context) {
+ if (!context.isPreviewFeatureOn("typedSql")) {
+ return "";
+ }
+ if (!context.dmmf.mappings.otherOperations.write.includes("queryRaw")) {
+ return "";
+ }
+ const param = genericParameter("T");
+ const method2 = method("$queryRawTyped").setDocComment(
+ docComment`
+ Executes a typed SQL query and returns a typed result
+ @example
+ \`\`\`
+ import { myQuery } from '@prisma/client/sql'
+
+ const result = await prisma.$queryRawTyped(myQuery())
+ \`\`\`
+ `
+ ).addGenericParameter(param).addParameter(
+ parameter(
+ "typedSql",
+ runtimeImportedType("TypedSql").addGenericArgument(array(unknownType)).addGenericArgument(param.toArgument())
+ )
+ ).setReturnType(prismaPromise(array(param.toArgument())));
+ return stringify(method2, { indentLevel: 1, newLine: "leading" });
+}
+function metricDefinition(context) {
+ if (!context.isPreviewFeatureOn("metrics")) {
+ return "";
+ }
+ const property2 = property("$metrics", namedType(`runtime.${runtimeImport("MetricsClient")}`)).setDocComment(
+ docComment`
+ Gives access to the client metrics in json or prometheus format.
+
+ @example
+ \`\`\`
+ const metrics = await prisma.$metrics.json()
+ // or
+ const metrics = await prisma.$metrics.prometheus()
+ \`\`\`
+ `
+ ).readonly();
+ return stringify(property2, { indentLevel: 1, newLine: "leading" });
+}
+function runCommandRawDefinition(context) {
+ if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) {
+ return "";
+ }
+ const method2 = method("$runCommandRaw").addParameter(parameter("command", namedType("Prisma.InputJsonObject"))).setReturnType(prismaPromise(namedType("Prisma.JsonObject"))).setDocComment(docComment`
+ Executes a raw MongoDB command and returns the result of it.
+ @example
+ \`\`\`
+ const user = await prisma.$runCommandRaw({
+ aggregate: 'User',
+ pipeline: [{ $match: { name: 'Bob' } }, { $project: { email: true, _id: false } }],
+ explain: false,
+ })
+ \`\`\`
+
+ Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ `);
+ return stringify(method2, { indentLevel: 1, newLine: "leading" });
+}
+function applyPendingMigrationsDefinition() {
+ if (this.runtimeNameTs !== "react-native") {
+ return null;
+ }
+ const method2 = method("$applyPendingMigrations").setReturnType(promise(voidType)).setDocComment(
+ docComment`Tries to apply pending migrations one by one. If a migration fails to apply, the function will stop and throw an error. You are responsible for informing the user and possibly blocking the app as we cannot guarantee the state of the database.`
+ );
+ return stringify(method2, { indentLevel: 1, newLine: "leading" });
+}
+function eventRegistrationMethodDeclaration(runtimeNameTs) {
+ if (runtimeNameTs === "binary.js") {
+ return `$on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => $Utils.JsPromise : Prisma.LogEvent) => void): void;`;
+ } else {
+ return `$on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): void;`;
+ }
+}
+var PrismaClientClass = class {
+ constructor(context, internalDatasources, outputDir, runtimeNameTs, browser) {
+ this.context = context;
+ this.internalDatasources = internalDatasources;
+ this.outputDir = outputDir;
+ this.runtimeNameTs = runtimeNameTs;
+ this.browser = browser;
+ }
+ get jsDoc() {
+ const { dmmf } = this.context;
+ let example;
+ if (dmmf.mappings.modelOperations.length) {
+ example = dmmf.mappings.modelOperations[0];
+ } else {
+ example = {
+ model: "User",
+ plural: "users"
+ };
+ }
+ return `/**
+ * ## Prisma Client \u02B2\u02E2
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * \`\`\`
+ * const prisma = new PrismaClient()
+ * // Fetch zero or more ${capitalize2(example.plural)}
+ * const ${lowerCase(example.plural)} = await prisma.${lowerCase(example.model)}.findMany()
+ * \`\`\`
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
+ */`;
+ }
+ toTSWithoutNamespace() {
+ const { dmmf } = this.context;
+ return `${this.jsDoc}
+export class PrismaClient<
+ ClientOptions extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
+ U = 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never,
+ ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs
+> {
+ [K: symbol]: { types: Prisma.TypeMap['other'] }
+
+ ${(0, import_indent_string7.default)(this.jsDoc, TAB_SIZE)}
+
+ constructor(optionsArg ?: Prisma.Subset);
+ ${eventRegistrationMethodDeclaration(this.runtimeNameTs)}
+
+ /**
+ * Connect with the database
+ */
+ $connect(): $Utils.JsPromise;
+
+ /**
+ * Disconnect from the database
+ */
+ $disconnect(): $Utils.JsPromise;
+
+ /**
+ * Add a middleware
+ * @deprecated since 4.16.0. For new code, prefer client extensions instead.
+ * @see https://pris.ly/d/extensions
+ */
+ $use(cb: Prisma.Middleware): void
+
+${[
+ executeRawDefinition(this.context),
+ queryRawDefinition(this.context),
+ queryRawTypedDefinition(this.context),
+ batchingTransactionDefinition(this.context),
+ interactiveTransactionDefinition(this.context),
+ runCommandRawDefinition(this.context),
+ metricDefinition(this.context),
+ applyPendingMigrationsDefinition.bind(this)(),
+ extendsPropertyDefinition(this.context)
+ ].filter((d) => d !== null).join("\n").trim()}
+
+ ${(0, import_indent_string7.default)(
+ dmmf.mappings.modelOperations.filter((m) => m.findMany).map((m) => {
+ let methodName = lowerCase(m.model);
+ if (methodName === "constructor") {
+ methodName = '["constructor"]';
+ }
+ const generics = ["ExtArgs"];
+ if (this.context.isPreviewFeatureOn("omitApi")) {
+ generics.push("ClientOptions");
+ }
+ return `/**
+ * \`prisma.${methodName}\`: Exposes CRUD operations for the **${m.model}** model.
+ * Example usage:
+ * \`\`\`ts
+ * // Fetch zero or more ${capitalize2(m.plural)}
+ * const ${lowerCase(m.plural)} = await prisma.${methodName}.findMany()
+ * \`\`\`
+ */
+get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`;
+ }).join("\n\n"),
+ 2
+ )}
+}`;
+ }
+ toTS() {
+ const clientOptions = this.buildClientOptions();
+ const isOmitEnabled = this.context.isPreviewFeatureOn("omitApi");
+ return `${new Datasources(this.internalDatasources).toTS()}
+${clientExtensionsDefinitions(this.context)}
+export type DefaultPrismaClient = PrismaClient
+export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
+${stringify(moduleExport(clientOptions))}
+${isOmitEnabled ? stringify(globalOmitConfig(this.context.dmmf)) : ""}
+
+/* Types for Logging */
+export type LogLevel = 'info' | 'query' | 'warn' | 'error'
+export type LogDefinition = {
+ level: LogLevel
+ emit: 'stdout' | 'event'
+}
+
+export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never
+export type GetEvents = T extends Array ?
+ GetLogType | GetLogType | GetLogType | GetLogType
+ : never
+
+export type QueryEvent = {
+ timestamp: Date
+ query: string
+ params: string
+ duration: number
+ target: string
+}
+
+export type LogEvent = {
+ timestamp: Date
+ message: string
+ target: string
+}
+/* End Types for Logging */
+
+
+export type PrismaAction =
+ | 'findUnique'
+ | 'findUniqueOrThrow'
+ | 'findMany'
+ | 'findFirst'
+ | 'findFirstOrThrow'
+ | 'create'
+ | 'createMany'
+ | 'createManyAndReturn'
+ | 'update'
+ | 'updateMany'
+ | 'upsert'
+ | 'delete'
+ | 'deleteMany'
+ | 'executeRaw'
+ | 'queryRaw'
+ | 'aggregate'
+ | 'count'
+ | 'runCommandRaw'
+ | 'findRaw'
+ | 'groupBy'
+
+/**
+ * These options are being passed into the middleware as "params"
+ */
+export type MiddlewareParams = {
+ model?: ModelName
+ action: PrismaAction
+ args: any
+ dataPath: string[]
+ runInTransaction: boolean
+}
+
+/**
+ * The \`T\` type makes sure, that the \`return proceed\` is not forgotten in the middleware implementation
+ */
+export type Middleware = (
+ params: MiddlewareParams,
+ next: (params: MiddlewareParams) => $Utils.JsPromise,
+) => $Utils.JsPromise
+
+// tested in getLogLevel.test.ts
+export function getLogLevel(log: Array): LogLevel | undefined;
+
+/**
+ * \`PrismaClient\` proxy available in interactive transactions.
+ */
+export type TransactionClient = Omit
+`;
+ }
+ buildClientOptions() {
+ const clientOptions = interfaceDeclaration("PrismaClientOptions").add(
+ property("datasources", namedType("Datasources")).optional().setDocComment(docComment("Overwrites the datasource url from your schema.prisma file"))
+ ).add(
+ property("datasourceUrl", stringType).optional().setDocComment(docComment("Overwrites the datasource url from your schema.prisma file"))
+ ).add(
+ property("errorFormat", namedType("ErrorFormat")).optional().setDocComment(docComment('@default "colorless"'))
+ ).add(
+ property("log", array(unionType([namedType("LogLevel"), namedType("LogDefinition")]))).optional().setDocComment(docComment`
+ @example
+ \`\`\`
+ // Defaults to stdout
+ log: ['query', 'info', 'warn', 'error']
+
+ // Emit as events
+ log: [
+ { emit: 'stdout', level: 'query' },
+ { emit: 'stdout', level: 'info' },
+ { emit: 'stdout', level: 'warn' }
+ { emit: 'stdout', level: 'error' }
+ ]
+ \`\`\`
+ Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
+ `)
+ );
+ const transactionOptions = objectType().add(property("maxWait", numberType).optional()).add(property("timeout", numberType).optional());
+ if (this.context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) {
+ transactionOptions.add(property("isolationLevel", namedType("Prisma.TransactionIsolationLevel")).optional());
+ }
+ clientOptions.add(
+ property("transactionOptions", transactionOptions).optional().setDocComment(docComment`
+ The default values for transactionOptions
+ maxWait ?= 2000
+ timeout ?= 5000
+ `)
+ );
+ if (this.runtimeNameTs === "library.js" && this.context.isPreviewFeatureOn("driverAdapters")) {
+ clientOptions.add(
+ property("adapter", unionType([namedType("runtime.DriverAdapter"), namedType("null")])).optional().setDocComment(
+ docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`")
+ )
+ );
+ }
+ if (this.context.isPreviewFeatureOn("omitApi")) {
+ clientOptions.add(
+ property("omit", namedType("Prisma.GlobalOmitConfig")).optional().setDocComment(docComment`
+ Global configuration for omitting model fields by default.
+
+ @example
+ \`\`\`
+ const prisma = new PrismaClient({
+ omit: {
+ user: {
+ password: true
+ }
+ }
+ })
+ \`\`\`
+ `)
+ );
+ }
+ return clientOptions;
+ }
+};
+
+// src/generation/TSClient/TSClient.ts
+var TSClient = class {
+ constructor(options) {
+ this.options = options;
+ this.dmmf = new DMMFHelper(options.dmmf);
+ this.genericsInfo = new GenericArgsInfo(this.dmmf);
+ }
+ toJS() {
+ const {
+ edge,
+ wasm,
+ binaryPaths,
+ generator,
+ outputDir,
+ datamodel: inlineSchema,
+ runtimeBase,
+ runtimeNameJs,
+ datasources,
+ deno,
+ copyEngine = true,
+ reusedJs,
+ envPaths
+ } = this.options;
+ if (reusedJs) {
+ return `module.exports = { ...require('${reusedJs}') }`;
+ }
+ const relativeEnvPaths = {
+ rootEnvPath: envPaths.rootEnvPath && pathToPosix(import_path4.default.relative(outputDir, envPaths.rootEnvPath)),
+ schemaEnvPath: envPaths.schemaEnvPath && pathToPosix(import_path4.default.relative(outputDir, envPaths.schemaEnvPath))
+ };
+ const clientEngineType = getClientEngineType(generator);
+ generator.config.engineType = clientEngineType;
+ const binaryTargets = clientEngineType === "library" /* Library */ ? Object.keys(binaryPaths.libqueryEngine ?? {}) : Object.keys(binaryPaths.queryEngine ?? {});
+ const inlineSchemaHash = import_crypto.default.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex");
+ const datasourceFilePath = datasources[0].sourceFilePath;
+ const config = {
+ generator,
+ relativeEnvPaths,
+ relativePath: pathToPosix(import_path4.default.relative(outputDir, import_path4.default.dirname(datasourceFilePath))),
+ clientVersion: this.options.clientVersion,
+ engineVersion: this.options.engineVersion,
+ datasourceNames: datasources.map((d) => d.name),
+ activeProvider: this.options.activeProvider,
+ postinstall: this.options.postinstall,
+ ciName: import_ci_info.default.name ?? void 0,
+ inlineDatasources: datasources.reduce((acc, ds) => {
+ return acc[ds.name] = { url: ds.url }, acc;
+ }, {}),
+ inlineSchema,
+ inlineSchemaHash,
+ copyEngine
+ };
+ const relativeOutdir = import_path4.default.relative(process.cwd(), outputDir);
+ const code = `${commonCodeJS({ ...this.options, browser: false })}
+${buildRequirePath(edge)}
+
+/**
+ * Enums
+ */
+${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
+${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(type, false).toJS()).join("\n\n") ?? ""}
+
+${new Enum(
+ {
+ name: "ModelName",
+ values: this.dmmf.mappings.modelOperations.map((m) => m.model)
+ },
+ true
+ ).toJS()}
+/**
+ * Create the Client
+ */
+const config = ${JSON.stringify(config, null, 2)}
+${buildDirname(edge, relativeOutdir)}
+${buildRuntimeDataModel(this.dmmf.datamodel, runtimeNameJs)}
+${buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs)}
+${buildInjectableEdgeEnv(edge, datasources)}
+${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
+${buildDebugInitialization(edge)}
+const PrismaClient = getPrismaClient(config)
+exports.PrismaClient = PrismaClient
+Object.assign(exports, Prisma)${deno ? "\nexport { exports as default, Prisma, PrismaClient }" : ""}
+${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
+`;
+ return code;
+ }
+ toTS() {
+ const { reusedTs } = this.options;
+ if (reusedTs) {
+ const topExports = moduleExportFrom(`./${reusedTs}`);
+ return stringify(topExports);
+ }
+ const context = new GenerateContext({
+ dmmf: this.dmmf,
+ genericArgsInfo: this.genericsInfo,
+ generator: this.options.generator,
+ defaultArgsAliases: new DefaultArgsAliases()
+ });
+ const prismaClientClass = new PrismaClientClass(
+ context,
+ this.options.datasources,
+ this.options.outputDir,
+ this.options.runtimeNameTs,
+ this.options.browser
+ );
+ const commonCode = commonCodeTS(this.options);
+ const modelAndTypes = Object.values(this.dmmf.typeAndModelMap).reduce((acc, modelOrType) => {
+ if (this.dmmf.outputTypeMap.model[modelOrType.name]) {
+ acc.push(new Model(modelOrType, context));
+ }
+ return acc;
+ }, []);
+ const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toTS());
+ const modelEnums = [];
+ const modelEnumsAliases = [];
+ for (const enumType of this.dmmf.schema.enumTypes.model ?? []) {
+ modelEnums.push(new Enum(enumType, false).toTS());
+ modelEnumsAliases.push(
+ stringify(moduleExport(typeDeclaration(enumType.name, namedType(`$Enums.${enumType.name}`)))),
+ stringify(
+ moduleExport(constDeclaration(enumType.name, namedType(`typeof $Enums.${enumType.name}`)))
+ )
+ );
+ }
+ const fieldRefs = this.dmmf.schema.fieldRefTypes.prisma?.map((type) => new FieldRefInput(type).toTS()) ?? [];
+ const countTypes = this.dmmf.schema.outputObjectTypes.prisma?.filter((t) => t.name.endsWith("CountOutputType")).map((t) => new Count(t, context));
+ const code = `
+/**
+ * Client
+**/
+
+${commonCode.tsWithoutNamespace()}
+
+${modelAndTypes.map((m) => m.toTSWithoutNamespace()).join("\n")}
+${modelEnums.length > 0 ? `
+/**
+ * Enums
+ */
+export namespace $Enums {
+ ${modelEnums.join("\n\n")}
+}
+
+${modelEnumsAliases.join("\n\n")}
+` : ""}
+${prismaClientClass.toTSWithoutNamespace()}
+
+export namespace Prisma {
+${(0, import_indent_string8.default)(
+ `${commonCode.ts()}
+${new Enum(
+ {
+ name: "ModelName",
+ values: this.dmmf.mappings.modelOperations.map((m) => m.model)
+ },
+ true
+ ).toTS()}
+
+${prismaClientClass.toTS()}
+export type Datasource = {
+ url?: string
+}
+
+/**
+ * Count Types
+ */
+
+${countTypes.map((t) => t.toTS()).join("\n")}
+
+/**
+ * Models
+ */
+${modelAndTypes.map((model) => model.toTS()).join("\n")}
+
+/**
+ * Enums
+ */
+
+${prismaEnums?.join("\n\n")}
+${fieldRefs.length > 0 ? `
+/**
+ * Field references
+ */
+
+${fieldRefs.join("\n\n")}` : ""}
+/**
+ * Deep Input Types
+ */
+
+${this.dmmf.inputObjectTypes.prisma?.reduce((acc, inputType) => {
+ if (inputType.name.includes("Json") && inputType.name.includes("Filter")) {
+ const needsGeneric = this.genericsInfo.typeNeedsGenericModelArg(inputType);
+ const innerName = needsGeneric ? `${inputType.name}Base<$PrismaModel>` : `${inputType.name}Base`;
+ const typeName = needsGeneric ? `${inputType.name}<$PrismaModel = never>` : inputType.name;
+ const baseName = `Required<${innerName}>`;
+ acc.push(`export type ${typeName} =
+ | PatchUndefined<
+ Either<${baseName}, Exclude>,
+ ${baseName}
+ >
+ | OptionalFlat>`);
+ acc.push(new InputType(inputType, context).overrideName(`${inputType.name}Base`).toTS());
+ } else {
+ acc.push(new InputType(inputType, context).toTS());
+ }
+ return acc;
+ }, []).join("\n")}
+
+${this.dmmf.inputObjectTypes.model?.map((inputType) => new InputType(inputType, context).toTS()).join("\n") ?? ""}
+
+/**
+ * Aliases for legacy arg types
+ */
+${context.defaultArgsAliases.generateAliases()}
+
+/**
+ * Batch Payload for updateMany & deleteMany & createMany
+ */
+
+export type BatchPayload = {
+ count: number
+}
+
+/**
+ * DMMF
+ */
+export const dmmf: runtime.BaseDMMF
+`,
+ 2
+ )}}`;
+ return code;
+ }
+ toBrowserJS() {
+ const code = `${commonCodeJS({
+ ...this.options,
+ runtimeNameJs: "index-browser",
+ browser: true
+ })}
+/**
+ * Enums
+ */
+
+${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
+${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(type, false).toJS()).join("\n\n") ?? ""}
+
+${new Enum(
+ {
+ name: "ModelName",
+ values: this.dmmf.mappings.modelOperations.map((m) => m.model)
+ },
+ true
+ ).toJS()}
+
+/**
+ * This is a stub Prisma Client that will error at runtime if called.
+ */
+class PrismaClient {
+ constructor() {
+ return new Proxy(this, {
+ get(target, prop) {
+ let message
+ const runtime = getRuntime()
+ if (runtime.isEdge) {
+ message = \`PrismaClient is not configured to run in \${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
+- Use Prisma Accelerate: https://pris.ly/d/accelerate
+- Use Driver Adapters: https://pris.ly/d/driver-adapters
+\`;
+ } else {
+ message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
+ }
+
+ message += \`
+If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report\`
+
+ throw new Error(message)
+ }
+ })
+ }
+}
+
+exports.PrismaClient = PrismaClient
+
+Object.assign(exports, Prisma)
+`;
+ return code;
+ }
+};
+
+// src/generation/typedSql/buildDbEnums.ts
+var DbEnumsList = class {
+ constructor(enums) {
+ this.enums = enums.map((dmmfEnum) => ({
+ name: dmmfEnum.dbName ?? dmmfEnum.name,
+ values: dmmfEnum.values.map((dmmfValue) => dmmfValue.dbName ?? dmmfValue.name)
+ }));
+ }
+ isEmpty() {
+ return this.enums.length === 0;
+ }
+ hasEnum(name) {
+ return Boolean(this.enums.find((dbEnum) => dbEnum.name === name));
+ }
+ *validJsIdentifiers() {
+ for (const dbEnum of this.enums) {
+ if (isValidJsIdentifier(dbEnum.name)) {
+ yield dbEnum;
+ }
+ }
+ }
+ *invalidJsIdentifiers() {
+ for (const dbEnum of this.enums) {
+ if (!isValidJsIdentifier(dbEnum.name)) {
+ yield dbEnum;
+ }
+ }
+ }
+};
+function buildDbEnums(list) {
+ const file2 = file();
+ file2.add(buildInvalidIdentifierEnums(list));
+ file2.add(buildValidIdentifierEnums(list));
+ return stringify(file2);
+}
+function buildValidIdentifierEnums(list) {
+ const namespace2 = namespace("$DbEnums");
+ for (const dbEnum of list.validJsIdentifiers()) {
+ namespace2.add(typeDeclaration(dbEnum.name, enumToUnion(dbEnum)));
+ }
+ return moduleExport(namespace2);
+}
+function buildInvalidIdentifierEnums(list) {
+ const iface = interfaceDeclaration("$DbEnums");
+ for (const dbEnum of list.invalidJsIdentifiers()) {
+ iface.add(property(dbEnum.name, enumToUnion(dbEnum)));
+ }
+ return moduleExport(iface);
+}
+function enumToUnion(dbEnum) {
+ return unionType(dbEnum.values.map(stringLiteral));
+}
+function queryUsesEnums(query, enums) {
+ if (enums.isEmpty()) {
+ return false;
+ }
+ return query.parameters.some((param) => enums.hasEnum(param.typ)) || query.resultColumns.some((column) => enums.hasEnum(column.typ));
+}
+
+// src/generation/typedSql/buildIndex.ts
+function buildIndexTs(queries, enums) {
+ const file2 = file();
+ if (!enums.isEmpty()) {
+ file2.add(moduleExportFrom("./$DbEnums").named("$DbEnums"));
+ }
+ for (const query of queries) {
+ file2.add(moduleExportFrom(`./${query.name}`));
+ }
+ return stringify(file2);
+}
+function buildIndexCjs(queries, edgeRuntimeSuffix) {
+ const writer = new Writer(0, void 0);
+ writer.writeLine('"use strict"');
+ for (const { name } of queries) {
+ const fileName = edgeRuntimeSuffix ? `${name}.${edgeRuntimeSuffix}` : name;
+ writer.writeLine(`exports.${name} = require("./${fileName}.js").${name}`);
+ }
+ return writer.toString();
+}
+function buildIndexEsm(queries, edgeRuntimeSuffix) {
+ const writer = new Writer(0, void 0);
+ for (const { name } of queries) {
+ const fileName = edgeRuntimeSuffix ? `${name}.${edgeRuntimeSuffix}` : name;
+ writer.writeLine(`export * from "./${fileName}.mjs"`);
+ }
+ return writer.toString();
+}
+
+// src/generation/typedSql/mapTypes.ts
+var decimal = namedType("$runtime.Decimal");
+var buffer = namedType("Buffer");
+var date = namedType("Date");
+var inputJsonValue = namedType("$runtime.InputJsonObject");
+var jsonValue = namedType("$runtime.JsonValue");
+var bigintIn = unionType([numberType, bigintType]);
+var decimalIn = unionType([numberType, decimal]);
+var typeMappings = {
+ unknown: unknownType,
+ string: stringType,
+ int: numberType,
+ bigint: {
+ in: bigintIn,
+ out: bigintType
+ },
+ decimal: {
+ in: decimalIn,
+ out: decimal
+ },
+ float: numberType,
+ double: numberType,
+ enum: stringType,
+ // TODO:
+ bytes: buffer,
+ bool: booleanType,
+ char: stringType,
+ json: {
+ in: inputJsonValue,
+ out: jsonValue
+ },
+ xml: stringType,
+ uuid: stringType,
+ date,
+ datetime: date,
+ time: date,
+ null: nullType,
+ "int-array": array(numberType),
+ "string-array": array(stringType),
+ "json-array": {
+ in: array(inputJsonValue),
+ out: array(jsonValue)
+ },
+ "uuid-array": array(stringType),
+ "xml-array": array(stringType),
+ "bigint-array": {
+ in: array(bigintIn),
+ out: array(bigintType)
+ },
+ "float-array": array(numberType),
+ "double-array": array(numberType),
+ "char-array": array(stringType),
+ "bytes-array": array(buffer),
+ "bool-array": array(booleanType),
+ "date-array": array(date),
+ "time-array": array(date),
+ "datetime-array": array(date),
+ "decimal-array": {
+ in: array(decimalIn),
+ out: array(decimal)
+ }
+};
+function getInputType(introspectionType, nullable, enums) {
+ const inn = getMappingConfig(introspectionType, enums).in;
+ if (!nullable) {
+ return inn;
+ } else {
+ return new UnionType(inn).addVariant(nullType);
+ }
+}
+function getOutputType(introspectionType, nullable, enums) {
+ const out = getMappingConfig(introspectionType, enums).out;
+ if (!nullable) {
+ return out;
+ } else {
+ return new UnionType(out).addVariant(nullType);
+ }
+}
+function getMappingConfig(introspectionType, enums) {
+ const config = typeMappings[introspectionType];
+ if (!config) {
+ if (enums.hasEnum(introspectionType)) {
+ const type = getEnumType(introspectionType);
+ return { in: type, out: type };
+ }
+ throw new Error("Unknown type");
+ }
+ if (config instanceof TypeBuilder) {
+ return { in: config, out: config };
+ }
+ return config;
+}
+function getEnumType(name) {
+ if (isValidJsIdentifier(name)) {
+ return namedType(`$DbEnums.${name}`);
+ }
+ return namedType("$DbEnums").subKey(name);
+}
+
+// src/generation/typedSql/buildTypedQuery.ts
+function buildTypedQueryTs({ query, runtimeBase, runtimeName, enums }) {
+ const file2 = file();
+ file2.addImport(moduleImport(`${runtimeBase}/${runtimeName}`).asNamespace("$runtime"));
+ if (queryUsesEnums(query, enums)) {
+ file2.addImport(moduleImport("./$DbEnums").named("$DbEnums"));
+ }
+ const doc = docComment(query.documentation ?? void 0);
+ const factoryType = functionType();
+ const parametersType = tupleType();
+ for (const param of query.parameters) {
+ const paramType = getInputType(param.typ, param.nullable, enums);
+ factoryType.addParameter(parameter(param.name, paramType));
+ parametersType.add(tupleItem(paramType).setName(param.name));
+ if (param.documentation) {
+ doc.addText(`@param ${param.name} ${param.documentation}`);
+ } else {
+ doc.addText(`@param ${param.name}`);
+ }
+ }
+ factoryType.setReturnType(
+ namedType("$runtime.TypedSql").addGenericArgument(namedType(`${query.name}.Parameters`)).addGenericArgument(namedType(`${query.name}.Result`))
+ );
+ file2.add(moduleExport(constDeclaration(query.name, factoryType)).setDocComment(doc));
+ const namespace2 = namespace(query.name);
+ namespace2.add(moduleExport(typeDeclaration("Parameters", parametersType)));
+ namespace2.add(buildResultType(query, enums));
+ file2.add(moduleExport(namespace2));
+ return stringify(file2);
+}
+function buildResultType(query, enums) {
+ const type = objectType().addMultiple(
+ query.resultColumns.map((column) => property(column.name, getOutputType(column.typ, column.nullable, enums)))
+ );
+ return moduleExport(typeDeclaration("Result", type));
+}
+function buildTypedQueryCjs({ query, runtimeBase, runtimeName }) {
+ const writer = new Writer(0, void 0);
+ writer.writeLine('"use strict"');
+ writer.writeLine(`const { makeTypedQueryFactory: $mkFactory } = require("${runtimeBase}/${runtimeName}")`);
+ writer.writeLine(`exports.${query.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(query.source)})`);
+ return writer.toString();
+}
+function buildTypedQueryEsm({ query, runtimeBase, runtimeName }) {
+ const writer = new Writer(0, void 0);
+ writer.writeLine(`import { makeTypedQueryFactory as $mkFactory } from "${runtimeBase}/${runtimeName}"`);
+ writer.writeLine(`export const ${query.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(query.source)})`);
+ return writer.toString();
+}
+
+// src/generation/typedSql/typedSql.ts
+function buildTypedSql({
+ queries,
+ runtimeBase,
+ edgeRuntimeName,
+ mainRuntimeName,
+ dmmf
+}) {
+ const fileMap = {};
+ const enums = new DbEnumsList(dmmf.datamodel.enums);
+ if (!enums.isEmpty()) {
+ fileMap["$DbEnums.d.ts"] = buildDbEnums(enums);
+ }
+ for (const query of queries) {
+ const options = { query, runtimeBase, runtimeName: mainRuntimeName, enums };
+ const edgeOptions = { ...options, runtimeName: `${edgeRuntimeName}.js` };
+ fileMap[`${query.name}.d.ts`] = buildTypedQueryTs(options);
+ fileMap[`${query.name}.js`] = buildTypedQueryCjs(options);
+ fileMap[`${query.name}.${edgeRuntimeName}.js`] = buildTypedQueryCjs(edgeOptions);
+ fileMap[`${query.name}.mjs`] = buildTypedQueryEsm(options);
+ fileMap[`${query.name}.edge.mjs`] = buildTypedQueryEsm(edgeOptions);
+ }
+ fileMap["index.d.ts"] = buildIndexTs(queries, enums);
+ fileMap["index.js"] = buildIndexCjs(queries);
+ fileMap["index.mjs"] = buildIndexEsm(queries);
+ fileMap[`index.${edgeRuntimeName}.mjs`] = buildIndexEsm(queries, edgeRuntimeName);
+ fileMap[`index.${edgeRuntimeName}.js`] = buildIndexCjs(queries, edgeRuntimeName);
+ return fileMap;
+}
+
+// src/generation/generateClient.ts
+var debug2 = src_default("prisma:client:generateClient");
+var DenylistError = class extends Error {
+ constructor(message) {
+ super(message);
+ this.stack = void 0;
+ }
+};
+setClassName(DenylistError, "DenylistError");
+async function buildClient({
+ schemaPath,
+ runtimeBase,
+ datamodel,
+ binaryPaths,
+ outputDir,
+ generator,
+ dmmf,
+ datasources,
+ engineVersion,
+ clientVersion: clientVersion2,
+ activeProvider,
+ postinstall,
+ copyEngine,
+ envPaths,
+ typedSql
+}) {
+ const clientEngineType = getClientEngineType(generator);
+ const baseClientOptions = {
+ dmmf: getPrismaClientDMMF(dmmf),
+ envPaths: envPaths ?? { rootEnvPath: null, schemaEnvPath: void 0 },
+ datasources,
+ generator,
+ binaryPaths,
+ schemaPath,
+ outputDir,
+ runtimeBase,
+ clientVersion: clientVersion2,
+ engineVersion,
+ activeProvider,
+ postinstall,
+ copyEngine,
+ datamodel,
+ browser: false,
+ deno: false,
+ edge: false,
+ wasm: false
+ };
+ const nodeClientOptions = {
+ ...baseClientOptions,
+ runtimeNameJs: getNodeRuntimeName(clientEngineType),
+ runtimeNameTs: `${getNodeRuntimeName(clientEngineType)}.js`
+ };
+ const nodeClient = new TSClient(nodeClientOptions);
+ const defaultClient = new TSClient({
+ ...nodeClientOptions,
+ reusedTs: "index",
+ reusedJs: "."
+ });
+ const edgeClient = new TSClient({
+ ...baseClientOptions,
+ runtimeNameJs: "edge",
+ runtimeNameTs: "library.js",
+ reusedTs: "default",
+ edge: true
+ });
+ const rnTsClient = new TSClient({
+ ...baseClientOptions,
+ runtimeNameJs: "react-native",
+ runtimeNameTs: "react-native",
+ edge: true
+ });
+ const trampolineTsClient = new TSClient({
+ ...nodeClientOptions,
+ reusedTs: "index",
+ reusedJs: "#main-entry-point"
+ });
+ const exportsMapBase = {
+ node: "./index.js",
+ "edge-light": "./wasm.js",
+ workerd: "./wasm.js",
+ worker: "./wasm.js",
+ browser: "./index-browser.js",
+ default: "./index.js"
+ };
+ const exportsMapDefault = {
+ require: exportsMapBase,
+ import: exportsMapBase,
+ default: exportsMapBase.default
+ };
+ const pkgJson = {
+ name: getUniquePackageName(datamodel),
+ main: "index.js",
+ types: "index.d.ts",
+ browser: "index-browser.js",
+ exports: {
+ ...import_package.default.exports,
+ // TODO: remove on DA ga
+ ...{ ".": exportsMapDefault }
+ },
+ version: clientVersion2,
+ sideEffects: false
+ };
+ const fileMap = {};
+ fileMap["index.js"] = JS(nodeClient);
+ fileMap["index.d.ts"] = TS(nodeClient);
+ fileMap["default.js"] = JS(defaultClient);
+ fileMap["default.d.ts"] = TS(defaultClient);
+ fileMap["index-browser.js"] = BrowserJS(nodeClient);
+ fileMap["edge.js"] = JS(edgeClient);
+ fileMap["edge.d.ts"] = TS(edgeClient);
+ if (generator.previewFeatures.includes("reactNative")) {
+ fileMap["react-native.js"] = JS(rnTsClient);
+ fileMap["react-native.d.ts"] = TS(rnTsClient);
+ }
+ const usesWasmRuntime = generator.previewFeatures.includes("driverAdapters");
+ if (usesWasmRuntime) {
+ fileMap["default.js"] = JS(trampolineTsClient);
+ fileMap["default.d.ts"] = TS(trampolineTsClient);
+ fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`;
+ fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_engine_bg.wasm?module')`;
+ pkgJson["browser"] = "default.js";
+ pkgJson["imports"] = {
+ // when `import('#wasm-engine-loader')` is called, it will be resolved to the correct file
+ "#wasm-engine-loader": {
+ // Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
+ /**
+ * Vercel Edge Functions / Next.js Middlewares
+ */
+ "edge-light": "./wasm-edge-light-loader.mjs",
+ /**
+ * Cloudflare Workers, Cloudflare Pages
+ */
+ workerd: "./wasm-worker-loader.mjs",
+ /**
+ * (Old) Cloudflare Workers
+ * @millsp It's a fallback, in case both other keys didn't work because we could be on a different edge platform. It's a hypothetical case rather than anything actually tested.
+ */
+ worker: "./wasm-worker-loader.mjs",
+ /**
+ * Fallback for every other JavaScript runtime
+ */
+ default: "./wasm-worker-loader.mjs"
+ },
+ // when `require('#main-entry-point')` is called, it will be resolved to the correct file
+ "#main-entry-point": exportsMapDefault
+ };
+ const wasmClient = new TSClient({
+ ...baseClientOptions,
+ runtimeNameJs: "wasm",
+ runtimeNameTs: "library.js",
+ reusedTs: "default",
+ edge: true,
+ wasm: true
+ });
+ fileMap["wasm.js"] = JS(wasmClient);
+ fileMap["wasm.d.ts"] = TS(wasmClient);
+ } else {
+ fileMap["wasm.js"] = fileMap["index-browser.js"];
+ fileMap["wasm.d.ts"] = fileMap["default.d.ts"];
+ }
+ if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
+ const denoEdgeClient = new TSClient({
+ ...baseClientOptions,
+ runtimeBase: `../${runtimeBase}`,
+ runtimeNameJs: "edge-esm",
+ runtimeNameTs: "library.d.ts",
+ deno: true,
+ edge: true
+ });
+ fileMap["deno/edge.js"] = JS(denoEdgeClient);
+ fileMap["deno/index.d.ts"] = TS(denoEdgeClient);
+ fileMap["deno/edge.ts"] = `
+import './polyfill.js'
+// @deno-types="./index.d.ts"
+export * from './edge.js'`;
+ fileMap["deno/polyfill.js"] = "globalThis.process = { env: Deno.env.toObject() }; globalThis.global = globalThis";
+ }
+ if (typedSql && typedSql.length > 0) {
+ const edgeRuntimeName = usesWasmRuntime ? "wasm" : "edge";
+ const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
+ const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
+ pkgJson.exports["./sql"] = {
+ require: {
+ types: "./sql/index.d.ts",
+ "edge-light": cjsEdgeIndex,
+ workerd: cjsEdgeIndex,
+ worker: cjsEdgeIndex,
+ node: "./sql/index.js",
+ default: "./sql/index.js"
+ },
+ import: {
+ types: "./sql/index.d.ts",
+ "edge-light": esmEdgeIndex,
+ workerd: esmEdgeIndex,
+ worker: esmEdgeIndex,
+ node: "./sql/index.mjs",
+ default: "./sql/index.mjs"
+ },
+ default: "./sql/index.js"
+ };
+ fileMap["sql"] = buildTypedSql({
+ dmmf,
+ runtimeBase: getTypedSqlRuntimeBase(runtimeBase),
+ mainRuntimeName: getNodeRuntimeName(clientEngineType),
+ queries: typedSql,
+ edgeRuntimeName
+ });
+ }
+ fileMap["package.json"] = JSON.stringify(pkgJson, null, 2);
+ return {
+ fileMap,
+ // a map of file names to their contents
+ prismaClientDmmf: dmmf
+ // the DMMF document
+ };
+}
+function getTypedSqlRuntimeBase(runtimeBase) {
+ if (!runtimeBase.startsWith(".")) {
+ return runtimeBase;
+ }
+ if (runtimeBase.startsWith("./")) {
+ return `.${runtimeBase}`;
+ }
+ return `../${runtimeBase}`;
+}
+async function getDefaultOutdir(outputDir) {
+ if (outputDir.endsWith("node_modules/@prisma/client")) {
+ return import_path5.default.join(outputDir, "../../.prisma/client");
+ }
+ if (process.env.INIT_CWD && process.env.npm_lifecycle_event === "postinstall" && !process.env.PWD?.includes(".pnpm")) {
+ if ((0, import_fs2.existsSync)(import_path5.default.join(process.env.INIT_CWD, "package.json"))) {
+ return import_path5.default.join(process.env.INIT_CWD, "node_modules/.prisma/client");
+ }
+ const packagePath = await (0, import_pkg_up.default)({ cwd: process.env.INIT_CWD });
+ if (packagePath) {
+ return import_path5.default.join(import_path5.default.dirname(packagePath), "node_modules/.prisma/client");
+ }
+ }
+ return import_path5.default.join(outputDir, "../../.prisma/client");
+}
+async function generateClient(options) {
+ const {
+ datamodel,
+ schemaPath,
+ generator,
+ dmmf,
+ datasources,
+ binaryPaths,
+ testMode,
+ copyRuntime,
+ copyRuntimeSourceMaps = false,
+ clientVersion: clientVersion2,
+ engineVersion,
+ activeProvider,
+ postinstall,
+ envPaths,
+ copyEngine = true,
+ typedSql
+ } = options;
+ const clientEngineType = getClientEngineType(generator);
+ const { runtimeBase, outputDir } = await getGenerationDirs(options);
+ const { prismaClientDmmf, fileMap } = await buildClient({
+ datamodel,
+ schemaPath,
+ runtimeBase,
+ outputDir,
+ generator,
+ dmmf,
+ datasources,
+ binaryPaths,
+ clientVersion: clientVersion2,
+ engineVersion,
+ activeProvider,
+ postinstall,
+ copyEngine,
+ testMode,
+ envPaths,
+ typedSql
+ });
+ const provider = datasources[0].provider;
+ const denylistsErrors = validateDmmfAgainstDenylists(prismaClientDmmf);
+ if (denylistsErrors) {
+ let message = `${bold(
+ red("Error: ")
+ )}The schema at "${schemaPath}" contains reserved keywords.
+ Rename the following items:`;
+ for (const error of denylistsErrors) {
+ message += "\n - " + error.message;
+ }
+ message += `
+To learn more about how to rename models, check out https://pris.ly/d/naming-models`;
+ throw new DenylistError(message);
+ }
+ if (!copyEngine) {
+ await deleteOutputDir(outputDir);
+ }
+ await (0, import_fs_extra.ensureDir)(outputDir);
+ if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
+ await (0, import_fs_extra.ensureDir)(import_path5.default.join(outputDir, "deno"));
+ }
+ await writeFileMap(outputDir, fileMap);
+ const runtimeDir = import_path5.default.join(__dirname, `${testMode ? "../" : ""}../runtime`);
+ if (copyRuntime || generator.isCustomOutput === true) {
+ const copiedRuntimeDir = import_path5.default.join(outputDir, "runtime");
+ await (0, import_fs_extra.ensureDir)(copiedRuntimeDir);
+ await copyRuntimeFiles({
+ from: runtimeDir,
+ to: copiedRuntimeDir,
+ sourceMaps: copyRuntimeSourceMaps,
+ runtimeName: getNodeRuntimeName(clientEngineType)
+ });
+ }
+ const enginePath = clientEngineType === "library" /* Library */ ? binaryPaths.libqueryEngine : binaryPaths.queryEngine;
+ if (!enginePath) {
+ throw new Error(
+ `Prisma Client needs \`${clientEngineType === "library" /* Library */ ? "libqueryEngine" : "queryEngine"}\` in the \`binaryPaths\` object.`
+ );
+ }
+ if (copyEngine) {
+ if (process.env.NETLIFY) {
+ await (0, import_fs_extra.ensureDir)("/tmp/prisma-engines");
+ }
+ for (const [binaryTarget, filePath] of Object.entries(enginePath)) {
+ const fileName = import_path5.default.basename(filePath);
+ let target;
+ if (process.env.NETLIFY && !["rhel-openssl-1.0.x", "rhel-openssl-3.0.x"].includes(binaryTarget)) {
+ target = import_path5.default.join("/tmp/prisma-engines", fileName);
+ } else {
+ target = import_path5.default.join(outputDir, fileName);
+ }
+ await overwriteFile(filePath, target);
+ }
+ }
+ const schemaTargetPath = import_path5.default.join(outputDir, "schema.prisma");
+ await import_promises.default.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" });
+ if (generator.previewFeatures.includes("driverAdapters") && isWasmEngineSupported(provider) && copyEngine && !testMode) {
+ const suffix = provider === "postgres" ? "postgresql" : provider;
+ await import_promises.default.copyFile(
+ import_path5.default.join(runtimeDir, `query_engine_bg.${suffix}.wasm`),
+ import_path5.default.join(outputDir, `query_engine_bg.wasm`)
+ );
+ await import_promises.default.copyFile(import_path5.default.join(runtimeDir, `query_engine_bg.${suffix}.js`), import_path5.default.join(outputDir, `query_engine_bg.js`));
+ }
+ try {
+ const prismaCache = (0, import_env_paths.default)("prisma").cache;
+ const signalsPath = import_path5.default.join(prismaCache, "last-generate");
+ await import_promises.default.mkdir(prismaCache, { recursive: true });
+ await import_promises.default.writeFile(signalsPath, Date.now().toString());
+ } catch {
+ }
+}
+function writeFileMap(outputDir, fileMap) {
+ return Promise.all(
+ Object.entries(fileMap).map(async ([fileName, content]) => {
+ const absolutePath = import_path5.default.join(outputDir, fileName);
+ await import_promises.default.rm(absolutePath, { recursive: true, force: true });
+ if (typeof content === "string") {
+ await import_promises.default.writeFile(absolutePath, content);
+ } else {
+ await import_promises.default.mkdir(absolutePath);
+ await writeFileMap(absolutePath, content);
+ }
+ })
+ );
+}
+function isWasmEngineSupported(provider) {
+ return provider === "postgresql" || provider === "postgres" || provider === "mysql" || provider === "sqlite";
+}
+function validateDmmfAgainstDenylists(prismaClientDmmf) {
+ const errorArray = [];
+ const denylists = {
+ // A copy of this list is also in prisma-engines. Any edit should be done in both places.
+ // https://github.com/prisma/prisma-engines/blob/main/psl/parser-database/src/names/reserved_model_names.rs
+ models: [
+ // Reserved Prisma keywords
+ "PrismaClient",
+ "Prisma",
+ // JavaScript keywords
+ "break",
+ "case",
+ "catch",
+ "class",
+ "const",
+ "continue",
+ "debugger",
+ "default",
+ "delete",
+ "do",
+ "else",
+ "enum",
+ "export",
+ "extends",
+ "false",
+ "finally",
+ "for",
+ "function",
+ "if",
+ "implements",
+ "import",
+ "in",
+ "instanceof",
+ "interface",
+ "let",
+ "new",
+ "null",
+ "package",
+ "private",
+ "protected",
+ "public",
+ "return",
+ "super",
+ "switch",
+ "this",
+ "throw",
+ "true",
+ "try",
+ "typeof",
+ "var",
+ "void",
+ "while",
+ "with",
+ "yield"
+ ],
+ fields: ["AND", "OR", "NOT"],
+ dynamic: []
+ };
+ if (prismaClientDmmf.datamodel.enums) {
+ for (const it of prismaClientDmmf.datamodel.enums) {
+ if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) {
+ errorArray.push(Error(`"enum ${it.name}"`));
+ }
+ }
+ }
+ if (prismaClientDmmf.datamodel.models) {
+ for (const it of prismaClientDmmf.datamodel.models) {
+ if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) {
+ errorArray.push(Error(`"model ${it.name}"`));
+ }
+ }
+ }
+ return errorArray.length > 0 ? errorArray : null;
+}
+async function getGenerationDirs({
+ runtimeBase,
+ generator,
+ outputDir,
+ datamodel,
+ schemaPath,
+ testMode
+}) {
+ const isCustomOutput = generator.isCustomOutput === true;
+ let userRuntimeImport = isCustomOutput ? "./runtime" : "@prisma/client/runtime";
+ let userOutputDir = isCustomOutput ? outputDir : await getDefaultOutdir(outputDir);
+ if (testMode && runtimeBase) {
+ userOutputDir = outputDir;
+ userRuntimeImport = pathToPosix(runtimeBase);
+ }
+ if (isCustomOutput) {
+ await verifyOutputDirectory(userOutputDir, datamodel, schemaPath);
+ }
+ const userPackageRoot = await (0, import_pkg_up.default)({ cwd: import_path5.default.dirname(userOutputDir) });
+ const userProjectRoot = userPackageRoot ? import_path5.default.dirname(userPackageRoot) : process.cwd();
+ return {
+ runtimeBase: userRuntimeImport,
+ outputDir: userOutputDir,
+ projectRoot: userProjectRoot
+ };
+}
+async function verifyOutputDirectory(directory, datamodel, schemaPath) {
+ let content;
+ try {
+ content = await import_promises.default.readFile(import_path5.default.join(directory, "package.json"), "utf8");
+ } catch (e) {
+ if (e.code === "ENOENT") {
+ return;
+ }
+ throw e;
+ }
+ const { name } = JSON.parse(content);
+ if (name === import_package.default.name) {
+ const message = [`Generating client into ${bold(directory)} is not allowed.`];
+ message.push("This package is used by `prisma generate` and overwriting its content is dangerous.");
+ message.push("");
+ message.push("Suggestion:");
+ const outputDeclaration = findOutputPathDeclaration(datamodel);
+ if (outputDeclaration && outputDeclaration.content.includes(import_package.default.name)) {
+ const outputLine = outputDeclaration.content;
+ message.push(`In ${bold(schemaPath)} replace:`);
+ message.push("");
+ message.push(`${dim(outputDeclaration.lineNumber)} ${replacePackageName(outputLine, red(import_package.default.name))}`);
+ message.push("with");
+ message.push(`${dim(outputDeclaration.lineNumber)} ${replacePackageName(outputLine, green(".prisma/client"))}`);
+ } else {
+ message.push(`Generate client into ${bold(replacePackageName(directory, green(".prisma/client")))} instead`);
+ }
+ message.push("");
+ message.push("You won't need to change your imports.");
+ message.push("Imports from `@prisma/client` will be automatically forwarded to `.prisma/client`");
+ const error = new Error(message.join("\n"));
+ throw error;
+ }
+}
+function replacePackageName(directoryPath, replacement) {
+ return directoryPath.replace(import_package.default.name, replacement);
+}
+function findOutputPathDeclaration(datamodel) {
+ const lines = datamodel.split(/\r?\n/);
+ for (const [i, line] of lines.entries()) {
+ if (/output\s*=/.test(line)) {
+ return { lineNumber: i + 1, content: line.trim() };
+ }
+ }
+ return null;
+}
+function getNodeRuntimeName(engineType) {
+ if (engineType === "binary" /* Binary */) {
+ return "binary";
+ }
+ if (engineType === "library" /* Library */) {
+ return "library";
+ }
+ assertNever(engineType, "Unknown engine type");
+}
+async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
+ const files = [
+ // library.d.ts is always included, as it contains the actual runtime type
+ // definitions. Rest of the `runtime.d.ts` files just re-export everything
+ // from `library.d.ts`
+ "library.d.ts",
+ "index-browser.js",
+ "index-browser.d.ts",
+ "edge.js",
+ "edge-esm.js",
+ "react-native.js",
+ "wasm.js"
+ ];
+ files.push(`${runtimeName}.js`);
+ if (runtimeName !== "library") {
+ files.push(`${runtimeName}.d.ts`);
+ }
+ if (sourceMaps) {
+ files.push(...files.filter((file2) => file2.endsWith(".js")).map((file2) => `${file2}.map`));
+ }
+ await Promise.all(files.map((file2) => import_promises.default.copyFile(import_path5.default.join(from, file2), import_path5.default.join(to, file2))));
+}
+async function deleteOutputDir(outputDir) {
+ try {
+ debug2(`attempting to delete ${outputDir} recursively`);
+ if (require(`${outputDir}/package.json`).name?.startsWith(GENERATED_PACKAGE_NAME_PREFIX)) {
+ await import_promises.default.rmdir(outputDir, { recursive: true }).catch(() => {
+ debug2(`failed to delete ${outputDir} recursively`);
+ });
+ }
+ } catch {
+ debug2(`failed to delete ${outputDir} recursively, not found`);
+ }
+}
+function getUniquePackageName(datamodel) {
+ const hash = (0, import_crypto2.createHash)("sha256");
+ hash.write(datamodel);
+ return `${GENERATED_PACKAGE_NAME_PREFIX}${hash.digest().toString("hex")}`;
+}
+var GENERATED_PACKAGE_NAME_PREFIX = "prisma-client-";
+
+// src/generation/utils/types/dmmfToTypes.ts
+function dmmfToTypes(dmmf) {
+ return new TSClient({
+ dmmf,
+ datasources: [],
+ clientVersion: "",
+ engineVersion: "",
+ runtimeBase: "@prisma/client",
+ runtimeNameJs: "library",
+ runtimeNameTs: "library",
+ schemaPath: "",
+ outputDir: "",
+ activeProvider: "",
+ binaryPaths: {},
+ generator: {
+ binaryTargets: [],
+ config: {},
+ name: "prisma-client-js",
+ output: null,
+ provider: { value: "prisma-client-js", fromEnvVar: null },
+ previewFeatures: [],
+ isCustomOutput: false,
+ sourceFilePath: "schema.prisma"
+ },
+ datamodel: "",
+ browser: false,
+ deno: false,
+ edge: false,
+ wasm: false,
+ envPaths: {
+ rootEnvPath: null,
+ schemaEnvPath: void 0
+ }
+ }).toTS();
+}
+
+// src/generation/generator.ts
+var debug3 = src_default("prisma:client:generator");
+var pkg = require_package2();
+var clientVersion = pkg.version;
+if (process.argv[1] === __filename) {
+ generatorHandler({
+ onManifest(config) {
+ const requiredEngine = getClientEngineType(config) === "library" /* Library */ ? "libqueryEngine" : "queryEngine";
+ debug3(`requiredEngine: ${requiredEngine}`);
+ return {
+ defaultOutput: ".prisma/client",
+ // the value here doesn't matter, as it's resolved in https://github.com/prisma/prisma/blob/88fe98a09092d8e53e51f11b730c7672c19d1bd4/packages/sdk/src/get-generators/getGenerators.ts
+ prettyName: "Prisma Client",
+ requiresEngines: [requiredEngine],
+ version: clientVersion,
+ requiresEngineVersion: import_engines_version.enginesVersion
+ };
+ },
+ async onGenerate(options) {
+ const outputDir = parseEnvValue(options.generator.output);
+ return generateClient({
+ datamodel: options.datamodel,
+ schemaPath: options.schemaPath,
+ binaryPaths: options.binaryPaths,
+ datasources: options.datasources,
+ envPaths: options.envPaths,
+ outputDir,
+ copyRuntime: Boolean(options.generator.config.copyRuntime),
+ // TODO: is this needed/valid?
+ copyRuntimeSourceMaps: Boolean(process.env.PRISMA_COPY_RUNTIME_SOURCEMAPS),
+ dmmf: options.dmmf,
+ generator: options.generator,
+ engineVersion: options.version,
+ clientVersion,
+ activeProvider: options.datasources[0]?.activeProvider,
+ postinstall: options.postinstall,
+ copyEngine: !options.noEngine,
+ typedSql: options.typedSql
+ });
+ }
+ });
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ dmmfToTypes,
+ externalToInternalDmmf
+});
diff --git a/database/node_modules/@prisma/client/index-browser.js b/database/node_modules/@prisma/client/index-browser.js
new file mode 100644
index 00000000..3ea8d77d
--- /dev/null
+++ b/database/node_modules/@prisma/client/index-browser.js
@@ -0,0 +1,3 @@
+const prisma = require('.prisma/client/index-browser')
+
+module.exports = prisma
diff --git a/database/node_modules/@prisma/client/index.d.ts b/database/node_modules/@prisma/client/index.d.ts
new file mode 100644
index 00000000..bedfdce0
--- /dev/null
+++ b/database/node_modules/@prisma/client/index.d.ts
@@ -0,0 +1 @@
+export * from '.prisma/client/default'
diff --git a/database/node_modules/@prisma/client/index.js b/database/node_modules/@prisma/client/index.js
new file mode 100644
index 00000000..1be37ebf
--- /dev/null
+++ b/database/node_modules/@prisma/client/index.js
@@ -0,0 +1,4 @@
+module.exports = {
+ // https://github.com/prisma/prisma/pull/12907
+ ...require('.prisma/client/default'),
+}
diff --git a/database/node_modules/@prisma/client/package.json b/database/node_modules/@prisma/client/package.json
new file mode 100644
index 00000000..711e8681
--- /dev/null
+++ b/database/node_modules/@prisma/client/package.json
@@ -0,0 +1,280 @@
+{
+ "name": "@prisma/client",
+ "version": "5.21.1",
+ "description": "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.",
+ "keywords": [
+ "ORM",
+ "Prisma",
+ "prisma2",
+ "Prisma Client",
+ "client",
+ "query",
+ "query-builder",
+ "database",
+ "db",
+ "JavaScript",
+ "JS",
+ "TypeScript",
+ "TS",
+ "SQL",
+ "SQLite",
+ "pg",
+ "Postgres",
+ "PostgreSQL",
+ "CockroachDB",
+ "MySQL",
+ "MariaDB",
+ "MSSQL",
+ "SQL Server",
+ "SQLServer",
+ "MongoDB",
+ "react-native"
+ ],
+ "main": "default.js",
+ "types": "default.d.ts",
+ "browser": "index-browser.js",
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "require": {
+ "types": "./default.d.ts",
+ "node": "./default.js",
+ "edge-light": "./default.js",
+ "workerd": "./default.js",
+ "worker": "./default.js",
+ "browser": "./index-browser.js"
+ },
+ "import": {
+ "types": "./default.d.ts",
+ "node": "./default.js",
+ "edge-light": "./default.js",
+ "workerd": "./default.js",
+ "worker": "./default.js",
+ "browser": "./index-browser.js"
+ },
+ "default": "./default.js"
+ },
+ "./edge": {
+ "types": "./edge.d.ts",
+ "require": "./edge.js",
+ "import": "./edge.js",
+ "default": "./edge.js"
+ },
+ "./react-native": {
+ "types": "./react-native.d.ts",
+ "require": "./react-native.js",
+ "import": "./react-native.js",
+ "default": "./react-native.js"
+ },
+ "./extension": {
+ "types": "./extension.d.ts",
+ "require": "./extension.js",
+ "import": "./extension.js",
+ "default": "./extension.js"
+ },
+ "./index-browser": {
+ "types": "./index.d.ts",
+ "require": "./index-browser.js",
+ "import": "./index-browser.js",
+ "default": "./index-browser.js"
+ },
+ "./index": {
+ "types": "./index.d.ts",
+ "require": "./index.js",
+ "import": "./index.js",
+ "default": "./index.js"
+ },
+ "./wasm": {
+ "types": "./wasm.d.ts",
+ "require": "./wasm.js",
+ "import": "./wasm.js",
+ "default": "./wasm.js"
+ },
+ "./runtime/library": {
+ "types": "./runtime/library.d.ts",
+ "require": "./runtime/library.js",
+ "import": "./runtime/library.js",
+ "default": "./runtime/library.js"
+ },
+ "./runtime/binary": {
+ "types": "./runtime/binary.d.ts",
+ "require": "./runtime/binary.js",
+ "import": "./runtime/binary.js",
+ "default": "./runtime/binary.js"
+ },
+ "./generator-build": {
+ "require": "./generator-build/index.js",
+ "import": "./generator-build/index.js",
+ "default": "./generator-build/index.js"
+ },
+ "./sql": {
+ "require": {
+ "types": "./sql.d.ts",
+ "node": "./sql.js",
+ "default": "./sql.js"
+ },
+ "import": {
+ "types": "./sql.d.ts",
+ "node": "./sql.mjs",
+ "default": "./sql.mjs"
+ },
+ "default": "./sql.js"
+ },
+ "./*": "./*"
+ },
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=16.13"
+ },
+ "homepage": "https://www.prisma.io",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/prisma/prisma.git",
+ "directory": "packages/client"
+ },
+ "author": "Tim Suchanek ",
+ "bugs": "https://github.com/prisma/prisma/issues",
+ "files": [
+ "README.md",
+ "runtime",
+ "!runtime/*.map",
+ "scripts",
+ "generator-build",
+ "edge.js",
+ "edge.d.ts",
+ "wasm.js",
+ "wasm.d.ts",
+ "index.js",
+ "index.d.ts",
+ "react-native.js",
+ "react-native.d.ts",
+ "default.js",
+ "default.d.ts",
+ "index-browser.js",
+ "extension.js",
+ "extension.d.ts",
+ "sql.d.ts",
+ "sql.js",
+ "sql.mjs"
+ ],
+ "devDependencies": {
+ "@cloudflare/workers-types": "4.20240614.0",
+ "@codspeed/benchmark.js-plugin": "3.1.1",
+ "@faker-js/faker": "8.4.1",
+ "@fast-check/jest": "1.8.2",
+ "@inquirer/prompts": "5.0.5",
+ "@jest/create-cache-key-function": "29.7.0",
+ "@jest/globals": "29.7.0",
+ "@jest/test-sequencer": "29.7.0",
+ "@libsql/client": "0.8.0",
+ "@neondatabase/serverless": "0.9.3",
+ "@opentelemetry/api": "1.9.0",
+ "@opentelemetry/context-async-hooks": "1.25.1",
+ "@opentelemetry/instrumentation": "0.52.1",
+ "@opentelemetry/resources": "1.25.1",
+ "@opentelemetry/sdk-trace-base": "1.25.1",
+ "@opentelemetry/semantic-conventions": "1.25.1",
+ "@planetscale/database": "1.18.0",
+ "@prisma/engines-version": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ "@prisma/mini-proxy": "0.9.5",
+ "@prisma/query-engine-wasm": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ "@snaplet/copycat": "0.17.3",
+ "@swc-node/register": "1.10.9",
+ "@swc/core": "1.6.13",
+ "@swc/jest": "0.2.36",
+ "@timsuchanek/copy": "1.4.5",
+ "@types/debug": "4.1.12",
+ "@types/fs-extra": "9.0.13",
+ "@types/jest": "29.5.12",
+ "@types/js-levenshtein": "1.1.3",
+ "@types/mssql": "9.1.5",
+ "@types/node": "18.19.31",
+ "@types/pg": "8.11.6",
+ "arg": "5.0.2",
+ "benchmark": "2.1.4",
+ "ci-info": "4.0.0",
+ "decimal.js": "10.4.3",
+ "detect-runtime": "1.0.4",
+ "env-paths": "2.2.1",
+ "esbuild": "0.23.0",
+ "execa": "5.1.1",
+ "expect-type": "0.19.0",
+ "flat-map-polyfill": "0.3.8",
+ "fs-extra": "11.1.1",
+ "get-stream": "6.0.1",
+ "globby": "11.1.0",
+ "indent-string": "4.0.0",
+ "jest": "29.7.0",
+ "jest-extended": "4.0.2",
+ "jest-junit": "16.0.0",
+ "jest-serializer-ansi-escapes": "3.0.0",
+ "jest-snapshot": "29.7.0",
+ "js-levenshtein": "1.1.6",
+ "kleur": "4.1.5",
+ "klona": "2.0.6",
+ "mariadb": "3.3.1",
+ "memfs": "4.9.3",
+ "mssql": "11.0.1",
+ "new-github-issue-url": "0.2.1",
+ "node-fetch": "3.3.2",
+ "p-retry": "4.6.2",
+ "pg": "8.11.5",
+ "pkg-up": "3.1.0",
+ "pluralize": "8.0.0",
+ "resolve": "1.22.8",
+ "rimraf": "3.0.2",
+ "simple-statistics": "7.8.5",
+ "sort-keys": "4.2.0",
+ "source-map-support": "0.5.21",
+ "sql-template-tag": "5.2.1",
+ "stacktrace-parser": "0.1.10",
+ "strip-ansi": "6.0.1",
+ "strip-indent": "3.0.0",
+ "ts-node": "10.9.2",
+ "ts-pattern": "5.2.0",
+ "tsd": "0.31.1",
+ "typescript": "5.4.5",
+ "undici": "5.28.4",
+ "wrangler": "3.62.0",
+ "zx": "7.2.3",
+ "@prisma/adapter-d1": "5.21.1",
+ "@prisma/adapter-libsql": "5.21.1",
+ "@prisma/adapter-pg": "5.21.1",
+ "@prisma/adapter-pg-worker": "5.21.1",
+ "@prisma/adapter-neon": "5.21.1",
+ "@prisma/adapter-planetscale": "5.21.1",
+ "@prisma/debug": "5.21.1",
+ "@prisma/driver-adapter-utils": "5.21.1",
+ "@prisma/engines": "5.21.1",
+ "@prisma/fetch-engine": "5.21.1",
+ "@prisma/generator-helper": "5.21.1",
+ "@prisma/get-platform": "5.21.1",
+ "@prisma/internals": "5.21.1",
+ "@prisma/instrumentation": "5.21.1",
+ "@prisma/migrate": "5.21.1",
+ "@prisma/pg-worker": "5.21.1"
+ },
+ "peerDependencies": {
+ "prisma": "*"
+ },
+ "peerDependenciesMeta": {
+ "prisma": {
+ "optional": true
+ }
+ },
+ "sideEffects": false,
+ "scripts": {
+ "dev": "DEV=true tsx helpers/build.ts",
+ "build": "tsx helpers/build.ts",
+ "test": "dotenv -e ../../.db.env -- jest --silent",
+ "test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts",
+ "test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts",
+ "test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts",
+ "test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types",
+ "test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only",
+ "test-notypes": "dotenv -e ../../.db.env -- jest --testPathIgnorePatterns src/__tests__/types/types.test.ts",
+ "generate": "node scripts/postinstall.js",
+ "postinstall": "node scripts/postinstall.js",
+ "new-test": "tsx ./helpers/new-test/new-test.ts"
+ }
+}
\ No newline at end of file
diff --git a/database/node_modules/@prisma/client/react-native.d.ts b/database/node_modules/@prisma/client/react-native.d.ts
new file mode 100644
index 00000000..bfcd7068
--- /dev/null
+++ b/database/node_modules/@prisma/client/react-native.d.ts
@@ -0,0 +1 @@
+export * from '.prisma/client/react-native'
diff --git a/database/node_modules/@prisma/client/react-native.js b/database/node_modules/@prisma/client/react-native.js
new file mode 100644
index 00000000..12b76d33
--- /dev/null
+++ b/database/node_modules/@prisma/client/react-native.js
@@ -0,0 +1,3 @@
+module.exports = {
+ ...require('.prisma/client/react-native'),
+}
diff --git a/database/node_modules/@prisma/client/runtime/binary.d.ts b/database/node_modules/@prisma/client/runtime/binary.d.ts
new file mode 100644
index 00000000..b935a732
--- /dev/null
+++ b/database/node_modules/@prisma/client/runtime/binary.d.ts
@@ -0,0 +1 @@
+export * from "./library"
diff --git a/database/node_modules/@prisma/client/runtime/binary.js b/database/node_modules/@prisma/client/runtime/binary.js
new file mode 100644
index 00000000..4768c1de
--- /dev/null
+++ b/database/node_modules/@prisma/client/runtime/binary.js
@@ -0,0 +1,210 @@
+"use strict";var DD=Object.create;var qi=Object.defineProperty;var bD=Object.getOwnPropertyDescriptor;var kD=Object.getOwnPropertyNames;var SD=Object.getPrototypeOf,FD=Object.prototype.hasOwnProperty;var pd=e=>{throw TypeError(e)};var ND=(e,A,t)=>A in e?qi(e,A,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[A]=t;var Q=(e,A)=>()=>(A||e((A={exports:{}}).exports,A),A.exports),Oi=(e,A)=>{for(var t in A)qi(e,t,{get:A[t],enumerable:!0})},md=(e,A,t,r)=>{if(A&&typeof A=="object"||typeof A=="function")for(let n of kD(A))!FD.call(e,n)&&n!==t&&qi(e,n,{get:()=>A[n],enumerable:!(r=bD(A,n))||r.enumerable});return e};var Z=(e,A,t)=>(t=e!=null?DD(SD(e)):{},md(A||!e||!e.__esModule?qi(t,"default",{value:e,enumerable:!0}):t,e)),xD=e=>md(qi({},"__esModule",{value:!0}),e);var yd=(e,A,t)=>ND(e,typeof A!="symbol"?A+"":A,t),Og=(e,A,t)=>A.has(e)||pd("Cannot "+t);var f=(e,A,t)=>(Og(e,A,"read from private field"),t?t.call(e):A.get(e)),Ne=(e,A,t)=>A.has(e)?pd("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(e):A.set(e,t),Ae=(e,A,t,r)=>(Og(e,A,"write to private field"),r?r.call(e,t):A.set(e,t),t),MA=(e,A,t)=>(Og(e,A,"access private method"),t);var jd=Q((SV,_d)=>{"use strict";_d.exports=Wd;Wd.sync=Ib;var Od=require("fs");function fb(e,A){var t=A.pathExt!==void 0?A.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var r=0;r{"use strict";zd.exports=Zd;Zd.sync=Bb;var Kd=require("fs");function Zd(e,A,t){Kd.stat(e,function(r,n){t(r,r?!1:Xd(n,A))})}function Bb(e,A){return Xd(Kd.statSync(e),A)}function Xd(e,A){return e.isFile()&&pb(e,A)}function pb(e,A){var t=e.mode,r=e.uid,n=e.gid,i=A.uid!==void 0?A.uid:process.getuid&&process.getuid(),s=A.gid!==void 0?A.gid:process.getgid&&process.getgid(),o=parseInt("100",8),a=parseInt("010",8),c=parseInt("001",8),g=o|a,l=t&c||t&a&&n===s||t&o&&r===i||t&g&&i===0;return l}});var AQ=Q((xV,eQ)=>{"use strict";var NV=require("fs"),Wo;process.platform==="win32"||global.TESTING_WINDOWS?Wo=jd():Wo=$d();eQ.exports=Al;Al.sync=mb;function Al(e,A,t){if(typeof A=="function"&&(t=A,A={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,n){Al(e,A||{},function(i,s){i?n(i):r(s)})})}Wo(e,A||{},function(r,n){r&&(r.code==="EACCES"||A&&A.ignoreErrors)&&(r=null,n=!1),t(r,n)})}function mb(e,A){try{return Wo.sync(e,A||{})}catch(t){if(A&&A.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var aQ=Q((LV,oQ)=>{"use strict";var Cn=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",tQ=require("path"),yb=Cn?";":":",rQ=AQ(),nQ=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),iQ=(e,A)=>{let t=A.colon||yb,r=e.match(/\//)||Cn&&e.match(/\\/)?[""]:[...Cn?[process.cwd()]:[],...(A.path||process.env.PATH||"").split(t)],n=Cn?A.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=Cn?n.split(t):[""];return Cn&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:n}},sQ=(e,A,t)=>{typeof A=="function"&&(t=A,A={}),A||(A={});let{pathEnv:r,pathExt:n,pathExtExe:i}=iQ(e,A),s=[],o=c=>new Promise((g,l)=>{if(c===r.length)return A.all&&s.length?g(s):l(nQ(e));let u=r[c],E=/^".*"$/.test(u)?u.slice(1,-1):u,h=tQ.join(E,e),d=!E&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;g(a(d,c,0))}),a=(c,g,l)=>new Promise((u,E)=>{if(l===n.length)return u(o(g+1));let h=n[l];rQ(c+h,{pathExt:i},(d,C)=>{if(!d&&C)if(A.all)s.push(c+h);else return u(c+h);return u(a(c,g,l+1))})});return t?o(0).then(c=>t(null,c),t):o(0)},wb=(e,A)=>{A=A||{};let{pathEnv:t,pathExt:r,pathExtExe:n}=iQ(e,A),i=[];for(let s=0;s{"use strict";var cQ=(e={})=>{let A=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(A).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};tl.exports=cQ;tl.exports.default=cQ});var EQ=Q((TV,uQ)=>{"use strict";var gQ=require("path"),Rb=aQ(),Db=rl();function lQ(e,A){let t=e.options.env||process.env,r=process.cwd(),n=e.options.cwd!=null,i=n&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Rb.sync(e.command,{path:t[Db({env:t})],pathExt:A?gQ.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=gQ.resolve(n?e.options.cwd:"",s)),s}function bb(e){return lQ(e)||lQ(e,!0)}uQ.exports=bb});var hQ=Q((MV,il)=>{"use strict";var nl=/([()\][%!^"`<>&|;, *?])/g;function kb(e){return e=e.replace(nl,"^$1"),e}function Sb(e,A){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(nl,"^$1"),A&&(e=e.replace(nl,"^$1")),e}il.exports.command=kb;il.exports.argument=Sb});var QQ=Q((vV,dQ)=>{"use strict";dQ.exports=/^#!(.*)/});var fQ=Q((PV,CQ)=>{"use strict";var Fb=QQ();CQ.exports=(e="")=>{let A=e.match(Fb);if(!A)return null;let[t,r]=A[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?r:r?`${n} ${r}`:n}});var BQ=Q((GV,IQ)=>{"use strict";var sl=require("fs"),Nb=fQ();function xb(e){let t=Buffer.alloc(150),r;try{r=sl.openSync(e,"r"),sl.readSync(r,t,0,150,0),sl.closeSync(r)}catch{}return Nb(t.toString())}IQ.exports=xb});var wQ=Q((JV,yQ)=>{"use strict";var Lb=require("path"),pQ=EQ(),mQ=hQ(),Ub=BQ(),Tb=process.platform==="win32",Mb=/\.(?:com|exe)$/i,vb=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Pb(e){e.file=pQ(e);let A=e.file&&Ub(e.file);return A?(e.args.unshift(e.file),e.command=A,pQ(e)):e.file}function Gb(e){if(!Tb)return e;let A=Pb(e),t=!Mb.test(A);if(e.options.forceShell||t){let r=vb.test(A);e.command=Lb.normalize(e.command),e.command=mQ.command(e.command),e.args=e.args.map(i=>mQ.argument(i,r));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Jb(e,A,t){A&&!Array.isArray(A)&&(t=A,A=null),A=A?A.slice(0):[],t=Object.assign({},t);let r={command:e,args:A,options:t,file:void 0,original:{command:e,args:A}};return t.shell?r:Gb(r)}yQ.exports=Jb});var bQ=Q((YV,DQ)=>{"use strict";var ol=process.platform==="win32";function al(e,A){return Object.assign(new Error(`${A} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${A} ${e.command}`,path:e.command,spawnargs:e.args})}function Yb(e,A){if(!ol)return;let t=e.emit;e.emit=function(r,n){if(r==="exit"){let i=RQ(n,A,"spawn");if(i)return t.call(e,"error",i)}return t.apply(e,arguments)}}function RQ(e,A){return ol&&e===1&&!A.file?al(A.original,"spawn"):null}function Vb(e,A){return ol&&e===1&&!A.file?al(A.original,"spawnSync"):null}DQ.exports={hookChildProcess:Yb,verifyENOENT:RQ,verifyENOENTSync:Vb,notFoundError:al}});var FQ=Q((VV,fn)=>{"use strict";var kQ=require("child_process"),cl=wQ(),gl=bQ();function SQ(e,A,t){let r=cl(e,A,t),n=kQ.spawn(r.command,r.args,r.options);return gl.hookChildProcess(n,r),n}function qb(e,A,t){let r=cl(e,A,t),n=kQ.spawnSync(r.command,r.args,r.options);return n.error=n.error||gl.verifyENOENTSync(n.status,r),n}fn.exports=SQ;fn.exports.spawn=SQ;fn.exports.sync=qb;fn.exports._parse=cl;fn.exports._enoent=gl});var xQ=Q((qV,NQ)=>{"use strict";NQ.exports=e=>{let A=typeof e=="string"?`
+`:10,t=typeof e=="string"?"\r":13;return e[e.length-1]===A&&(e=e.slice(0,e.length-1)),e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e}});var TQ=Q((OV,Zi)=>{"use strict";var Ki=require("path"),LQ=rl(),UQ=e=>{e={cwd:process.cwd(),path:process.env[LQ()],execPath:process.execPath,...e};let A,t=Ki.resolve(e.cwd),r=[];for(;A!==t;)r.push(Ki.join(t,"node_modules/.bin")),A=t,t=Ki.resolve(t,"..");let n=Ki.resolve(e.cwd,e.execPath,"..");return r.push(n),r.concat(e.path).join(Ki.delimiter)};Zi.exports=UQ;Zi.exports.default=UQ;Zi.exports.env=e=>{e={env:process.env,...e};let A={...e.env},t=LQ({env:A});return e.path=A[t],A[t]=Zi.exports(e),A}});var vQ=Q((HV,ll)=>{"use strict";var MQ=(e,A)=>{for(let t of Reflect.ownKeys(A))Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t));return e};ll.exports=MQ;ll.exports.default=MQ});var GQ=Q((WV,jo)=>{"use strict";var Ob=vQ(),_o=new WeakMap,PQ=(e,A={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,r=0,n=e.displayName||e.name||"",i=function(...s){if(_o.set(i,++r),r===1)t=e.apply(this,s),e=null;else if(A.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return t};return Ob(i,e),_o.set(i,r),i};jo.exports=PQ;jo.exports.default=PQ;jo.exports.callCount=e=>{if(!_o.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return _o.get(e)}});var JQ=Q(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.SIGNALS=void 0;var Hb=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Ko.SIGNALS=Hb});var ul=Q(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.SIGRTMAX=In.getRealtimeSignals=void 0;var Wb=function(){let e=VQ-YQ+1;return Array.from({length:e},_b)};In.getRealtimeSignals=Wb;var _b=function(e,A){return{name:`SIGRT${A+1}`,number:YQ+A,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},YQ=34,VQ=64;In.SIGRTMAX=VQ});var qQ=Q(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.getSignals=void 0;var jb=require("os"),Kb=JQ(),Zb=ul(),Xb=function(){let e=(0,Zb.getRealtimeSignals)();return[...Kb.SIGNALS,...e].map(zb)};Zo.getSignals=Xb;var zb=function({name:e,number:A,description:t,action:r,forced:n=!1,standard:i}){let{signals:{[e]:s}}=jb.constants,o=s!==void 0;return{name:e,number:o?s:A,description:t,supported:o,action:r,forced:n,standard:i}}});var HQ=Q(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.signalsByNumber=Bn.signalsByName=void 0;var $b=require("os"),OQ=qQ(),ek=ul(),Ak=function(){return(0,OQ.getSignals)().reduce(tk,{})},tk=function(e,{name:A,number:t,description:r,supported:n,action:i,forced:s,standard:o}){return{...e,[A]:{name:A,number:t,description:r,supported:n,action:i,forced:s,standard:o}}},rk=Ak();Bn.signalsByName=rk;var nk=function(){let e=(0,OQ.getSignals)(),A=ek.SIGRTMAX+1,t=Array.from({length:A},(r,n)=>ik(n,e));return Object.assign({},...t)},ik=function(e,A){let t=sk(e,A);if(t===void 0)return{};let{name:r,description:n,supported:i,action:s,forced:o,standard:a}=t;return{[e]:{name:r,number:e,description:n,supported:i,action:s,forced:o,standard:a}}},sk=function(e,A){let t=A.find(({name:r})=>$b.constants.signals[r]===e);return t!==void 0?t:A.find(r=>r.number===e)},ok=nk();Bn.signalsByNumber=ok});var _Q=Q((XV,WQ)=>{"use strict";var{signalsByName:ak}=HQ(),ck=({timedOut:e,timeout:A,errorCode:t,signal:r,signalDescription:n,exitCode:i,isCanceled:s})=>e?`timed out after ${A} milliseconds`:s?"was canceled":t!==void 0?`failed with ${t}`:r!==void 0?`was killed with ${r} (${n})`:i!==void 0?`failed with exit code ${i}`:"failed",gk=({stdout:e,stderr:A,all:t,error:r,signal:n,exitCode:i,command:s,escapedCommand:o,timedOut:a,isCanceled:c,killed:g,parsed:{options:{timeout:l}}})=>{i=i===null?void 0:i,n=n===null?void 0:n;let u=n===void 0?void 0:ak[n].description,E=r&&r.code,d=`Command ${ck({timedOut:a,timeout:l,errorCode:E,signal:n,signalDescription:u,exitCode:i,isCanceled:c})}: ${s}`,C=Object.prototype.toString.call(r)==="[object Error]",I=C?`${d}
+${r.message}`:d,p=[I,A,e].filter(Boolean).join(`
+`);return C?(r.originalMessage=r.message,r.message=p):r=new Error(p),r.shortMessage=I,r.command=s,r.escapedCommand=o,r.exitCode=i,r.signal=n,r.signalDescription=u,r.stdout=e,r.stderr=A,t!==void 0&&(r.all=t),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!a,r.isCanceled=c,r.killed=g&&!a,r};WQ.exports=gk});var KQ=Q((zV,El)=>{"use strict";var Xo=["stdin","stdout","stderr"],lk=e=>Xo.some(A=>e[A]!==void 0),jQ=e=>{if(!e)return;let{stdio:A}=e;if(A===void 0)return Xo.map(r=>e[r]);if(lk(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Xo.map(r=>`\`${r}\``).join(", ")}`);if(typeof A=="string")return A;if(!Array.isArray(A))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof A}\``);let t=Math.max(A.length,Xo.length);return Array.from({length:t},(r,n)=>A[n])};El.exports=jQ;El.exports.node=e=>{let A=jQ(e);return A==="ipc"?"ipc":A===void 0||typeof A=="string"?[A,A,A,"ipc"]:A.includes("ipc")?A:[...A,"ipc"]}});var ZQ=Q(($V,zo)=>{"use strict";zo.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&zo.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&zo.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var AC=Q((eq,yn)=>{"use strict";var we=global.process,Mr=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Mr(we)?(XQ=require("assert"),pn=ZQ(),zQ=/^win/i.test(we.platform),Xi=require("events"),typeof Xi!="function"&&(Xi=Xi.EventEmitter),we.__signal_exit_emitter__?qe=we.__signal_exit_emitter__:(qe=we.__signal_exit_emitter__=new Xi,qe.count=0,qe.emitted={}),qe.infinite||(qe.setMaxListeners(1/0),qe.infinite=!0),yn.exports=function(e,A){if(!Mr(global.process))return function(){};XQ.equal(typeof e,"function","a callback must be provided for exit handler"),mn===!1&&hl();var t="exit";A&&A.alwaysLast&&(t="afterexit");var r=function(){qe.removeListener(t,e),qe.listeners("exit").length===0&&qe.listeners("afterexit").length===0&&$o()};return qe.on(t,e),r},$o=function(){!mn||!Mr(global.process)||(mn=!1,pn.forEach(function(A){try{we.removeListener(A,ea[A])}catch{}}),we.emit=Aa,we.reallyExit=dl,qe.count-=1)},yn.exports.unload=$o,vr=function(A,t,r){qe.emitted[A]||(qe.emitted[A]=!0,qe.emit(A,t,r))},ea={},pn.forEach(function(e){ea[e]=function(){if(Mr(global.process)){var t=we.listeners(e);t.length===qe.count&&($o(),vr("exit",null,e),vr("afterexit",null,e),zQ&&e==="SIGHUP"&&(e="SIGINT"),we.kill(we.pid,e))}}}),yn.exports.signals=function(){return pn},mn=!1,hl=function(){mn||!Mr(global.process)||(mn=!0,qe.count+=1,pn=pn.filter(function(A){try{return we.on(A,ea[A]),!0}catch{return!1}}),we.emit=eC,we.reallyExit=$Q)},yn.exports.load=hl,dl=we.reallyExit,$Q=function(A){Mr(global.process)&&(we.exitCode=A||0,vr("exit",we.exitCode,null),vr("afterexit",we.exitCode,null),dl.call(we,we.exitCode))},Aa=we.emit,eC=function(A,t){if(A==="exit"&&Mr(global.process)){t!==void 0&&(we.exitCode=t);var r=Aa.apply(this,arguments);return vr("exit",we.exitCode,null),vr("afterexit",we.exitCode,null),r}else return Aa.apply(this,arguments)}):yn.exports=function(){return function(){}};var XQ,pn,zQ,Xi,qe,$o,vr,ea,mn,hl,dl,$Q,Aa,eC});var rC=Q((Aq,tC)=>{"use strict";var uk=require("os"),Ek=AC(),hk=1e3*5,dk=(e,A="SIGTERM",t={})=>{let r=e(A);return Qk(e,A,t,r),r},Qk=(e,A,t,r)=>{if(!Ck(A,t,r))return;let n=Ik(t),i=setTimeout(()=>{e("SIGKILL")},n);i.unref&&i.unref()},Ck=(e,{forceKillAfterTimeout:A},t)=>fk(e)&&A!==!1&&t,fk=e=>e===uk.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ik=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return hk;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Bk=(e,A)=>{e.kill()&&(A.isCanceled=!0)},pk=(e,A,t)=>{e.kill(A),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:A}))},mk=(e,{timeout:A,killSignal:t="SIGTERM"},r)=>{if(A===0||A===void 0)return r;let n,i=new Promise((o,a)=>{n=setTimeout(()=>{pk(e,t,a)},A)}),s=r.finally(()=>{clearTimeout(n)});return Promise.race([i,s])},yk=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},wk=async(e,{cleanup:A,detached:t},r)=>{if(!A||t)return r;let n=Ek(()=>{e.kill()});return r.finally(()=>{n()})};tC.exports={spawnedKill:dk,spawnedCancel:Bk,setupTimeout:mk,validateTimeout:yk,setExitHandler:wk}});var iC=Q((tq,nC)=>{"use strict";var gt=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";gt.writable=e=>gt(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";gt.readable=e=>gt(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";gt.duplex=e=>gt.writable(e)&>.readable(e);gt.transform=e=>gt.duplex(e)&&typeof e._transform=="function";nC.exports=gt});var oC=Q((rq,sC)=>{"use strict";var{PassThrough:Rk}=require("stream");sC.exports=e=>{e={...e};let{array:A}=e,{encoding:t}=e,r=t==="buffer",n=!1;A?n=!(t||r):t=t||"utf8",r&&(t=null);let i=new Rk({objectMode:n});t&&i.setEncoding(t);let s=0,o=[];return i.on("data",a=>{o.push(a),n?s=o.length:s+=a.length}),i.getBufferedValue=()=>A?o:r?Buffer.concat(o,s):o.join(""),i.getBufferedLength=()=>s,i}});var Cl=Q((nq,zi)=>{"use strict";var{constants:Dk}=require("buffer"),bk=require("stream"),{promisify:kk}=require("util"),Sk=oC(),Fk=kk(bk.pipeline),ta=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Ql(e,A){if(!e)throw new Error("Expected a stream");A={maxBuffer:1/0,...A};let{maxBuffer:t}=A,r=Sk(A);return await new Promise((n,i)=>{let s=o=>{o&&r.getBufferedLength()<=Dk.MAX_LENGTH&&(o.bufferedData=r.getBufferedValue()),i(o)};(async()=>{try{await Fk(e,r),n()}catch(o){s(o)}})(),r.on("data",()=>{r.getBufferedLength()>t&&s(new ta)})}),r.getBufferedValue()}zi.exports=Ql;zi.exports.buffer=(e,A)=>Ql(e,{...A,encoding:"buffer"});zi.exports.array=(e,A)=>Ql(e,{...A,array:!0});zi.exports.MaxBufferError=ta});var cC=Q((iq,aC)=>{"use strict";var{PassThrough:Nk}=require("stream");aC.exports=function(){var e=[],A=new Nk({objectMode:!0});return A.setMaxListeners(0),A.add=t,A.isEmpty=r,A.on("unpipe",n),Array.prototype.slice.call(arguments).forEach(t),A;function t(i){return Array.isArray(i)?(i.forEach(t),this):(e.push(i),i.once("end",n.bind(null,i)),i.once("error",A.emit.bind(A,"error")),i.pipe(A,{end:!1}),this)}function r(){return e.length==0}function n(i){e=e.filter(function(s){return s!==i}),!e.length&&A.readable&&A.end()}}});var EC=Q((sq,uC)=>{"use strict";var lC=iC(),gC=Cl(),xk=cC(),Lk=(e,A)=>{A===void 0||e.stdin===void 0||(lC(A)?A.pipe(e.stdin):e.stdin.end(A))},Uk=(e,{all:A})=>{if(!A||!e.stdout&&!e.stderr)return;let t=xk();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},fl=async(e,A)=>{if(e){e.destroy();try{return await A}catch(t){return t.bufferedData}}},Il=(e,{encoding:A,buffer:t,maxBuffer:r})=>{if(!(!e||!t))return A?gC(e,{encoding:A,maxBuffer:r}):gC.buffer(e,{maxBuffer:r})},Tk=async({stdout:e,stderr:A,all:t},{encoding:r,buffer:n,maxBuffer:i},s)=>{let o=Il(e,{encoding:r,buffer:n,maxBuffer:i}),a=Il(A,{encoding:r,buffer:n,maxBuffer:i}),c=Il(t,{encoding:r,buffer:n,maxBuffer:i*2});try{return await Promise.all([s,o,a,c])}catch(g){return Promise.all([{error:g,signal:g.signal,timedOut:g.timedOut},fl(e,o),fl(A,a),fl(t,c)])}},Mk=({input:e})=>{if(lC(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};uC.exports={handleInput:Lk,makeAllStream:Uk,getSpawnedResult:Tk,validateInputSync:Mk}});var dC=Q((oq,hC)=>{"use strict";var vk=(async()=>{})().constructor.prototype,Pk=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(vk,e)]),Gk=(e,A)=>{for(let[t,r]of Pk){let n=typeof A=="function"?(...i)=>Reflect.apply(r.value,A(),i):r.value.bind(A);Reflect.defineProperty(e,t,{...r,value:n})}return e},Jk=e=>new Promise((A,t)=>{e.on("exit",(r,n)=>{A({exitCode:r,signal:n})}),e.on("error",r=>{t(r)}),e.stdin&&e.stdin.on("error",r=>{t(r)})});hC.exports={mergePromise:Gk,getSpawnedPromise:Jk}});var fC=Q((aq,CC)=>{"use strict";var QC=(e,A=[])=>Array.isArray(A)?[e,...A]:[e],Yk=/^[\w.-]+$/,Vk=/"/g,qk=e=>typeof e!="string"||Yk.test(e)?e:`"${e.replace(Vk,'\\"')}"`,Ok=(e,A)=>QC(e,A).join(" "),Hk=(e,A)=>QC(e,A).map(t=>qk(t)).join(" "),Wk=/ +/g,_k=e=>{let A=[];for(let t of e.trim().split(Wk)){let r=A[A.length-1];r&&r.endsWith("\\")?A[A.length-1]=`${r.slice(0,-1)} ${t}`:A.push(t)}return A};CC.exports={joinCommand:Ok,getEscapedCommand:Hk,parseCommand:_k}});var RC=Q((cq,wn)=>{"use strict";var jk=require("path"),Bl=require("child_process"),Kk=FQ(),Zk=xQ(),Xk=TQ(),zk=GQ(),ra=_Q(),BC=KQ(),{spawnedKill:$k,spawnedCancel:eS,setupTimeout:AS,validateTimeout:tS,setExitHandler:rS}=rC(),{handleInput:nS,getSpawnedResult:iS,makeAllStream:sS,validateInputSync:oS}=EC(),{mergePromise:IC,getSpawnedPromise:aS}=dC(),{joinCommand:pC,parseCommand:mC,getEscapedCommand:yC}=fC(),cS=1e3*1e3*100,gS=({env:e,extendEnv:A,preferLocal:t,localDir:r,execPath:n})=>{let i=A?{...process.env,...e}:e;return t?Xk.env({env:i,cwd:r,execPath:n}):i},wC=(e,A,t={})=>{let r=Kk._parse(e,A,t);return e=r.command,A=r.args,t=r.options,t={maxBuffer:cS,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=gS(t),t.stdio=BC(t),process.platform==="win32"&&jk.basename(e,".exe")==="cmd"&&A.unshift("/q"),{file:e,args:A,options:t,parsed:r}},$i=(e,A,t)=>typeof A!="string"&&!Buffer.isBuffer(A)?t===void 0?void 0:"":e.stripFinalNewline?Zk(A):A,na=(e,A,t)=>{let r=wC(e,A,t),n=pC(e,A),i=yC(e,A);tS(r.options);let s;try{s=Bl.spawn(r.file,r.args,r.options)}catch(E){let h=new Bl.ChildProcess,d=Promise.reject(ra({error:E,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return IC(h,d)}let o=aS(s),a=AS(s,r.options,o),c=rS(s,r.options,a),g={isCanceled:!1};s.kill=$k.bind(null,s.kill.bind(s)),s.cancel=eS.bind(null,s,g);let u=zk(async()=>{let[{error:E,exitCode:h,signal:d,timedOut:C},I,p,w]=await iS(s,r.options,c),m=$i(r.options,I),K=$i(r.options,p),H=$i(r.options,w);if(E||h!==0||d!==null){let ne=ra({error:E,exitCode:h,signal:d,stdout:m,stderr:K,all:H,command:n,escapedCommand:i,parsed:r,timedOut:C,isCanceled:g.isCanceled,killed:s.killed});if(!r.options.reject)return ne;throw ne}return{command:n,escapedCommand:i,exitCode:0,stdout:m,stderr:K,all:H,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return nS(s,r.options.input),s.all=sS(s,r.options),IC(s,u)};wn.exports=na;wn.exports.sync=(e,A,t)=>{let r=wC(e,A,t),n=pC(e,A),i=yC(e,A);oS(r.options);let s;try{s=Bl.spawnSync(r.file,r.args,r.options)}catch(c){throw ra({error:c,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let o=$i(r.options,s.stdout,s.error),a=$i(r.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let c=ra({stdout:o,stderr:a,error:s.error,signal:s.signal,exitCode:s.status,command:n,escapedCommand:i,parsed:r,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!r.options.reject)return c;throw c}return{command:n,escapedCommand:i,exitCode:0,stdout:o,stderr:a,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};wn.exports.command=(e,A)=>{let[t,...r]=mC(e);return na(t,r,A)};wn.exports.commandSync=(e,A)=>{let[t,...r]=mC(e);return na.sync(t,r,A)};wn.exports.node=(e,A,t={})=>{A&&!Array.isArray(A)&&typeof A=="object"&&(t=A,A=[]);let r=BC.node(t),n=process.execArgv.filter(o=>!o.startsWith("--inspect")),{nodePath:i=process.execPath,nodeOptions:s=n}=t;return na(i,[...s,e,...Array.isArray(A)?A:[]],{...t,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})}});var pl=Q((Qq,lS)=>{lS.exports={name:"@prisma/engines-version",version:"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.34",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var ml=Q(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.enginesVersion=void 0;ia.enginesVersion=pl().prisma.enginesVersion});var bC=Q((fq,DC)=>{"use strict";function GA(e,A){typeof A=="boolean"&&(A={forever:A}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=A||{},this._maxRetryTime=A&&A.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}DC.exports=GA;GA.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};GA.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};GA.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var A=new Date().getTime();if(e&&A-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};GA.prototype.attempt=function(e,A){this._fn=e,A&&(A.timeout&&(this._operationTimeout=A.timeout),A.cb&&(this._operationTimeoutCb=A.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};GA.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};GA.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};GA.prototype.start=GA.prototype.try;GA.prototype.errors=function(){return this._errors};GA.prototype.attempts=function(){return this._attempts};GA.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},A=null,t=0,r=0;r=t&&(A=n,t=s)}return A}});var kC=Q(Pr=>{"use strict";var uS=bC();Pr.operation=function(e){var A=Pr.timeouts(e);return new uS(A,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};Pr.timeouts=function(e){if(e instanceof Array)return[].concat(e);var A={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in e)A[t]=e[t];if(A.minTimeout>A.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],n=0;n{"use strict";SC.exports=kC()});var xC=Q((pq,oa)=>{"use strict";var ES=FC(),hS=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],sa=class extends Error{constructor(A){super(),A instanceof Error?(this.originalError=A,{message:A}=A):(this.originalError=new Error(A),this.originalError.stack=this.stack),this.name="AbortError",this.message=A}},dS=(e,A,t)=>{let r=t.retries-(A-1);return e.attemptNumber=A,e.retriesLeft=r,e},QS=e=>hS.includes(e),NC=(e,A)=>new Promise((t,r)=>{A={onFailedAttempt:()=>{},retries:10,...A};let n=ES.operation(A);n.attempt(async i=>{try{t(await e(i))}catch(s){if(!(s instanceof Error)){r(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof sa)n.stop(),r(s.originalError);else if(s instanceof TypeError&&!QS(s.message))n.stop(),r(s);else{dS(s,i,A);try{await A.onFailedAttempt(s)}catch(o){r(o);return}n.retry(s)||r(n.mainError())}}})});oa.exports=NC;oa.exports.default=NC;oa.exports.AbortError=sa});var TC=Q((Tq,IS)=>{IS.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var vC=Q((Mq,ca)=>{"use strict";var BS=require("fs"),MC=require("path"),pS=require("os"),mS=TC(),yS=mS.version,wS=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function RS(e){let A={},t=e.toString();t=t.replace(/\r\n?/mg,`
+`);let r;for(;(r=wS.exec(t))!=null;){let n=r[1],i=r[2]||"";i=i.trim();let s=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(i=i.replace(/\\n/g,`
+`),i=i.replace(/\\r/g,"\r")),A[n]=i}return A}function Rl(e){console.log(`[dotenv@${yS}][DEBUG] ${e}`)}function DS(e){return e[0]==="~"?MC.join(pS.homedir(),e.slice(1)):e}function bS(e){let A=MC.resolve(process.cwd(),".env"),t="utf8",r=!!(e&&e.debug),n=!!(e&&e.override);e&&(e.path!=null&&(A=DS(e.path)),e.encoding!=null&&(t=e.encoding));try{let i=aa.parse(BS.readFileSync(A,{encoding:t}));return Object.keys(i).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(n===!0&&(process.env[s]=i[s]),r&&Rl(n===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=i[s]}),{parsed:i}}catch(i){return r&&Rl(`Failed to load ${A} ${i.message}`),{error:i}}}var aa={config:bS,parse:RS};ca.exports.config=aa.config;ca.exports.parse=aa.parse;ca.exports=aa});var qC=Q((qq,VC)=>{"use strict";VC.exports=e=>{let A=e.match(/^[ \t]*(?=\S)/gm);return A?A.reduce((t,r)=>Math.min(t,r.length),1/0):0}});var HC=Q((Oq,OC)=>{"use strict";var NS=qC();OC.exports=e=>{let A=NS(e);if(A===0)return e;let t=new RegExp(`^[ \\t]{${A}}`,"gm");return e.replace(t,"")}});var Sl=Q((Zq,WC)=>{"use strict";WC.exports=(e,A=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof A!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof A}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(A===0)return e;let r=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,t.indent.repeat(A))}});var ZC=Q(($q,KC)=>{"use strict";KC.exports=({onlyFirst:e=!1}={})=>{let A=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(A,e?void 0:"g")}});var Ll=Q((eO,XC)=>{"use strict";var GS=ZC();XC.exports=e=>typeof e=="string"?e.replace(GS(),""):e});var $C=Q((rO,ua)=>{"use strict";ua.exports=(e={})=>{let A;if(e.repoUrl)A=e.repoUrl;else if(e.user&&e.repo)A=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let t=new URL(`${A}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(let n of r){let i=e[n];if(i!==void 0){if(n==="labels"||n==="projects"){if(!Array.isArray(i))throw new TypeError(`The \`${n}\` option should be an array`);i=i.join(",")}t.searchParams.set(n,i)}}return t.toString()};ua.exports.default=ua.exports});var de=Q((o4,kI)=>{"use strict";kI.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kHTTP2BuildRequest:Symbol("http2 build request"),kHTTP1BuildRequest:Symbol("http1 build request"),kHTTP2CopyHeaders:Symbol("http2 copy headers"),kHTTPConnVersion:Symbol("http connection version"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable")}});var le=Q((a4,SI)=>{"use strict";var Le=class extends Error{constructor(A){super(A),this.name="UndiciError",this.code="UND_ERR"}},ou=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ConnectTimeoutError",this.message=A||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}},au=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="HeadersTimeoutError",this.message=A||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}},cu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="HeadersOverflowError",this.message=A||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}},gu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="BodyTimeoutError",this.message=A||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}},lu=class e extends Le{constructor(A,t,r,n){super(A),Error.captureStackTrace(this,e),this.name="ResponseStatusCodeError",this.message=A||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=n,this.status=t,this.statusCode=t,this.headers=r}},uu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="InvalidArgumentError",this.message=A||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}},Eu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="InvalidReturnValueError",this.message=A||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}},hu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="AbortError",this.message=A||"Request aborted",this.code="UND_ERR_ABORTED"}},du=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="InformationalError",this.message=A||"Request information",this.code="UND_ERR_INFO"}},Qu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="RequestContentLengthMismatchError",this.message=A||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}},Cu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ResponseContentLengthMismatchError",this.message=A||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}},fu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ClientDestroyedError",this.message=A||"The client is destroyed",this.code="UND_ERR_DESTROYED"}},Iu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ClientClosedError",this.message=A||"The client is closed",this.code="UND_ERR_CLOSED"}},Bu=class e extends Le{constructor(A,t){super(A),Error.captureStackTrace(this,e),this.name="SocketError",this.message=A||"Socket error",this.code="UND_ERR_SOCKET",this.socket=t}},Ya=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="NotSupportedError",this.message=A||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}},pu=class extends Le{constructor(A){super(A),Error.captureStackTrace(this,Ya),this.name="MissingUpstreamError",this.message=A||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}},mu=class e extends Error{constructor(A,t,r){super(A),Error.captureStackTrace(this,e),this.name="HTTPParserError",this.code=t?`HPE_${t}`:void 0,this.data=r?r.toString():void 0}},yu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ResponseExceededMaxSizeError",this.message=A||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}},wu=class e extends Le{constructor(A,t,{headers:r,data:n}){super(A),Error.captureStackTrace(this,e),this.name="RequestRetryError",this.message=A||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=t,this.data=n,this.headers=r}};SI.exports={HTTPParserError:mu,UndiciError:Le,HeadersTimeoutError:au,HeadersOverflowError:cu,BodyTimeoutError:gu,RequestContentLengthMismatchError:Qu,ConnectTimeoutError:ou,ResponseStatusCodeError:lu,InvalidArgumentError:uu,InvalidReturnValueError:Eu,RequestAbortedError:hu,ClientDestroyedError:fu,ClientClosedError:Iu,InformationalError:du,SocketError:Bu,NotSupportedError:Ya,ResponseContentLengthMismatchError:Cu,BalancedPoolMissingUpstreamError:pu,ResponseExceededMaxSizeError:yu,RequestRetryError:wu}});var NI=Q((c4,FI)=>{"use strict";var Va={},Ru=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let e=0;e{"use strict";var TI=require("assert"),{kDestroyed:MI,kBodyUsed:xI}=de(),{IncomingMessage:ON}=require("http"),qn=require("stream"),HN=require("net"),{InvalidArgumentError:je}=le(),{Blob:LI}=require("buffer"),qa=require("util"),{stringify:WN}=require("querystring"),{headerNameLowerCasedRecord:_N}=NI(),[Du,UI]=process.versions.node.split(".").map(e=>Number(e));function jN(){}function bu(e){return e&&typeof e=="object"&&typeof e.pipe=="function"&&typeof e.on=="function"}function vI(e){return LI&&e instanceof LI||e&&typeof e=="object"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function KN(e,A){if(e.includes("?")||e.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let t=WN(A);return t&&(e+="?"+t),e}function PI(e){if(typeof e=="string"){if(e=new URL(e),!/^https?:/.test(e.origin||e.protocol))throw new je("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}if(!e||typeof e!="object")throw new je("Invalid URL: The URL argument must be a non-null object.");if(!/^https?:/.test(e.origin||e.protocol))throw new je("Invalid URL protocol: the URL must start with `http:` or `https:`.");if(!(e instanceof URL)){if(e.port!=null&&e.port!==""&&!Number.isFinite(parseInt(e.port)))throw new je("Invalid URL: port must be a valid integer or a string representation of an integer.");if(e.path!=null&&typeof e.path!="string")throw new je("Invalid URL path: the path must be a string or null/undefined.");if(e.pathname!=null&&typeof e.pathname!="string")throw new je("Invalid URL pathname: the pathname must be a string or null/undefined.");if(e.hostname!=null&&typeof e.hostname!="string")throw new je("Invalid URL hostname: the hostname must be a string or null/undefined.");if(e.origin!=null&&typeof e.origin!="string")throw new je("Invalid URL origin: the origin must be a string or null/undefined.");let A=e.port!=null?e.port:e.protocol==="https:"?443:80,t=e.origin!=null?e.origin:`${e.protocol}//${e.hostname}:${A}`,r=e.path!=null?e.path:`${e.pathname||""}${e.search||""}`;t.endsWith("/")&&(t=t.substring(0,t.length-1)),r&&!r.startsWith("/")&&(r=`/${r}`),e=new URL(t+r)}return e}function ZN(e){if(e=PI(e),e.pathname!=="/"||e.search||e.hash)throw new je("invalid url");return e}function XN(e){if(e[0]==="["){let t=e.indexOf("]");return TI(t!==-1),e.substring(1,t)}let A=e.indexOf(":");return A===-1?e:e.substring(0,A)}function zN(e){if(!e)return null;TI.strictEqual(typeof e,"string");let A=XN(e);return HN.isIP(A)?"":A}function $N(e){return JSON.parse(JSON.stringify(e))}function ex(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}function Ax(e){return e!=null&&(typeof e[Symbol.iterator]=="function"||typeof e[Symbol.asyncIterator]=="function")}function tx(e){if(e==null)return 0;if(bu(e)){let A=e._readableState;return A&&A.objectMode===!1&&A.ended===!0&&Number.isFinite(A.length)?A.length:null}else{if(vI(e))return e.size!=null?e.size:null;if(JI(e))return e.byteLength}return null}function ku(e){return!e||!!(e.destroyed||e[MI])}function GI(e){let A=e&&e._readableState;return ku(e)&&A&&!A.endEmitted}function rx(e,A){e==null||!bu(e)||ku(e)||(typeof e.destroy=="function"?(Object.getPrototypeOf(e).constructor===ON&&(e.socket=null),e.destroy(A)):A&&process.nextTick((t,r)=>{t.emit("error",r)},e,A),e.destroyed!==!0&&(e[MI]=!0))}var nx=/timeout=(\d+)/;function ix(e){let A=e.toString().match(nx);return A?parseInt(A[1],10)*1e3:null}function sx(e){return _N[e]||e.toLowerCase()}function ox(e,A={}){if(!Array.isArray(e))return e;for(let t=0;ti.toString("utf8")):A[r]=e[t+1].toString("utf8")}return"content-length"in A&&"content-disposition"in A&&(A["content-disposition"]=Buffer.from(A["content-disposition"]).toString("latin1")),A}function ax(e){let A=[],t=!1,r=-1;for(let n=0;n{t.close()});else{let i=Buffer.isBuffer(n)?n:Buffer.from(n);t.enqueue(new Uint8Array(i))}return t.desiredSize>0},async cancel(t){await A.return()}},0)}function Qx(e){return e&&typeof e=="object"&&typeof e.append=="function"&&typeof e.delete=="function"&&typeof e.get=="function"&&typeof e.getAll=="function"&&typeof e.has=="function"&&typeof e.set=="function"&&e[Symbol.toStringTag]==="FormData"}function Cx(e){if(e){if(typeof e.throwIfAborted=="function")e.throwIfAborted();else if(e.aborted){let A=new Error("The operation was aborted");throw A.name="AbortError",A}}}function fx(e,A){return"addEventListener"in e?(e.addEventListener("abort",A,{once:!0}),()=>e.removeEventListener("abort",A)):(e.addListener("abort",A),()=>e.removeListener("abort",A))}var Ix=!!String.prototype.toWellFormed;function Bx(e){return Ix?`${e}`.toWellFormed():qa.toUSVString?qa.toUSVString(e):`${e}`}function px(e){if(e==null||e==="")return{start:0,end:null,size:null};let A=e?e.match(/^bytes (\d+)-(\d+)\/(\d+)?$/):null;return A?{start:parseInt(A[1]),end:A[2]?parseInt(A[2]):null,size:A[3]?parseInt(A[3]):null}:null}var YI=Object.create(null);YI.enumerable=!0;VI.exports={kEnumerableProperty:YI,nop:jN,isDisturbed:gx,isErrored:lx,isReadable:ux,toUSVString:Bx,isReadableAborted:GI,isBlobLike:vI,parseOrigin:ZN,parseURL:PI,getServerName:zN,isStream:bu,isIterable:Ax,isAsyncIterable:ex,isDestroyed:ku,headerNameToString:sx,parseRawHeaders:ax,parseHeaders:ox,parseKeepAliveTimeout:ix,destroy:rx,bodyLength:tx,deepClone:$N,ReadableStreamFrom:dx,isBuffer:JI,validateHandler:cx,getSocketInfo:Ex,isFormDataLike:Qx,buildURL:KN,throwIfAborted:Cx,addAbortListener:fx,parseRangeHeader:px,nodeMajor:Du,nodeMinor:UI,nodeHasAutoSelectFamily:Du>18||Du===18&&UI>=13,safeHTTPMethods:["GET","HEAD","OPTIONS","TRACE"]}});var HI=Q((l4,OI)=>{"use strict";var Su=Date.now(),Br,pr=[];function mx(){Su=Date.now();let e=pr.length,A=0;for(;A0&&Su>=t.state&&(t.state=-1,t.callback(t.opaque)),t.state===-1?(t.state=-2,A!==e-1?pr[A]=pr.pop():pr.pop(),e-=1):A+=1}pr.length>0&&qI()}function qI(){Br&&Br.refresh?Br.refresh():(clearTimeout(Br),Br=setTimeout(mx,1e3),Br.unref&&Br.unref())}var Oa=class{constructor(A,t,r){this.callback=A,this.delay=t,this.opaque=r,this.state=-2,this.refresh()}refresh(){this.state===-2&&(pr.push(this),(!Br||pr.length===1)&&qI()),this.state=0}clear(){this.state=-1}};OI.exports={setTimeout(e,A,t){return A<1e3?setTimeout(e,A,t):new Oa(e,A,t)},clearTimeout(e){e instanceof Oa?e.clear():clearTimeout(e)}}});var Fu=Q((u4,WI)=>{"use strict";var yx=require("events").EventEmitter,wx=require("util").inherits;function Vr(e){if(typeof e=="string"&&(e=Buffer.from(e)),!Buffer.isBuffer(e))throw new TypeError("The needle has to be a String or a Buffer.");let A=e.length;if(A===0)throw new Error("The needle cannot be an empty String/Buffer.");if(A>256)throw new Error("The needle cannot have a length bigger than 256.");this.maxMatches=1/0,this.matches=0,this._occ=new Array(256).fill(A),this._lookbehind_size=0,this._needle=e,this._bufpos=0,this._lookbehind=Buffer.alloc(A);for(var t=0;t=0)this.emit("info",!1,this._lookbehind,0,this._lookbehind_size),this._lookbehind_size=0;else{let o=this._lookbehind_size+i;return o>0&&this.emit("info",!1,this._lookbehind,0,o),this._lookbehind.copy(this._lookbehind,0,o,this._lookbehind_size-o),this._lookbehind_size-=o,e.copy(this._lookbehind,this._lookbehind_size),this._lookbehind_size+=A,this._bufpos=A,A}}if(i+=(i>=0)*this._bufpos,e.indexOf(t,i)!==-1)return i=e.indexOf(t,i),++this.matches,i>0?this.emit("info",!0,e,this._bufpos,i):this.emit("info",!0),this._bufpos=i+r;for(i=A-r;i0&&this.emit("info",!1,e,this._bufpos,i{"use strict";var Rx=require("util").inherits,_I=require("stream").Readable;function Nu(e){_I.call(this,e)}Rx(Nu,_I);Nu.prototype._read=function(e){};jI.exports=Nu});var Ha=Q((h4,ZI)=>{"use strict";ZI.exports=function(A,t,r){if(!A||A[t]===void 0||A[t]===null)return r;if(typeof A[t]!="number"||isNaN(A[t]))throw new TypeError("Limit "+t+" is not a valid number");return A[t]}});var eB=Q((d4,$I)=>{"use strict";var zI=require("events").EventEmitter,Dx=require("util").inherits,XI=Ha(),bx=Fu(),kx=Buffer.from(`\r
+\r
+`),Sx=/\r\n/g,Fx=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function On(e){zI.call(this),e=e||{};let A=this;this.nread=0,this.maxed=!1,this.npairs=0,this.maxHeaderPairs=XI(e,"maxHeaderPairs",2e3),this.maxHeaderSize=XI(e,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=!1,this.ss=new bx(kx),this.ss.on("info",function(t,r,n,i){r&&!A.maxed&&(A.nread+i-n>=A.maxHeaderSize?(i=A.maxHeaderSize-A.nread+n,A.nread=A.maxHeaderSize,A.maxed=!0):A.nread+=i-n,A.buffer+=r.toString("binary",n,i)),t&&A._finish()})}Dx(On,zI);On.prototype.push=function(e){let A=this.ss.push(e);if(this.finished)return A};On.prototype.reset=function(){this.finished=!1,this.buffer="",this.header={},this.ss.reset()};On.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let e=this.header;this.header={},this.buffer="",this.finished=!0,this.nread=this.npairs=0,this.maxed=!1,this.emit("header",e)};On.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let e=this.buffer.split(Sx),A=e.length,t,r;for(var n=0;n{"use strict";var xu=require("stream").Writable,Nx=require("util").inherits,xx=Fu(),AB=KI(),Lx=eB(),Ux=45,Tx=Buffer.from("-"),Mx=Buffer.from(`\r
+`),vx=function(){};function zA(e){if(!(this instanceof zA))return new zA(e);if(xu.call(this,e),!e||!e.headerFirst&&typeof e.boundary!="string")throw new TypeError("Boundary required");typeof e.boundary=="string"?this.setBoundary(e.boundary):this._bparser=void 0,this._headerFirst=e.headerFirst,this._dashes=0,this._parts=0,this._finished=!1,this._realFinish=!1,this._isPreamble=!0,this._justMatched=!1,this._firstWrite=!0,this._inHeader=!0,this._part=void 0,this._cb=void 0,this._ignoreData=!1,this._partOpts={highWaterMark:e.partHwm},this._pause=!1;let A=this;this._hparser=new Lx(e),this._hparser.on("header",function(t){A._inHeader=!1,A._part.emit("header",t)})}Nx(zA,xu);zA.prototype.emit=function(e){if(e==="finish"&&!this._realFinish){if(!this._finished){let A=this;process.nextTick(function(){if(A.emit("error",new Error("Unexpected end of multipart data")),A._part&&!A._ignoreData){let t=A._isPreamble?"Preamble":"Part";A._part.emit("error",new Error(t+" terminated early due to unexpected end of multipart data")),A._part.push(null),process.nextTick(function(){A._realFinish=!0,A.emit("finish"),A._realFinish=!1});return}A._realFinish=!0,A.emit("finish"),A._realFinish=!1})}}else xu.prototype.emit.apply(this,arguments)};zA.prototype._write=function(e,A,t){if(!this._hparser&&!this._bparser)return t();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new AB(this._partOpts),this._events.preamble?this.emit("preamble",this._part):this._ignore());let r=this._hparser.push(e);if(!this._inHeader&&r!==void 0&&r{"use strict";var rB=new TextDecoder("utf-8"),Wa=new Map([["utf-8",rB],["utf8",rB]]);function Px(e,A,t){if(e)if(Wa.has(t))try{return Wa.get(t).decode(Buffer.from(e,A))}catch{}else try{return Wa.set(t,new TextDecoder(t)),Wa.get(t).decode(Buffer.from(e,A))}catch{}return e}nB.exports=Px});var Uu=Q((f4,oB)=>{"use strict";var ja=_a(),iB=/%([a-fA-F0-9]{2})/g;function sB(e,A){return String.fromCharCode(parseInt(A,16))}function Gx(e){let A=[],t="key",r="",n=!1,i=!1,s=0,o="";for(var a=0,c=e.length;a{"use strict";aB.exports=function(A){if(typeof A!="string")return"";for(var t=A.length-1;t>=0;--t)switch(A.charCodeAt(t)){case 47:case 92:return A=A.slice(t+1),A===".."||A==="."?"":A}return A===".."||A==="."?"":A}});var EB=Q((B4,uB)=>{"use strict";var{Readable:lB}=require("stream"),{inherits:Jx}=require("util"),Yx=Lu(),gB=Uu(),Vx=_a(),qx=cB(),qr=Ha(),Ox=/^boundary$/i,Hx=/^form-data$/i,Wx=/^charset$/i,_x=/^filename$/i,jx=/^name$/i;Ka.detect=/^multipart\/form-data/i;function Ka(e,A){let t,r,n=this,i,s=A.limits,o=A.isPartAFile||((ee,Y,ce)=>Y==="application/octet-stream"||ce!==void 0),a=A.parsedConType||[],c=A.defCharset||"utf8",g=A.preservePath,l={highWaterMark:A.fileHwm};for(t=0,r=a.length;tI)return n.parser.removeListener("part",ee),n.parser.on("part",Hn),e.hitPartsLimit=!0,e.emit("partsLimit"),Hn(Y);if(q){let ce=q;ce.emit("end"),ce.removeAllListeners("end")}Y.on("header",function(ce){let Je,fe,P,Uo,To,Yi,Vi=0;if(ce["content-type"]&&(P=gB(ce["content-type"][0]),P[0])){for(Je=P[0].toLowerCase(),t=0,r=P.length;th){let xt=h-Vi+st.length;xt>0&&Ye.push(st.slice(0,xt)),Ye.truncated=!0,Ye.bytesRead=h,Y.removeAllListeners("data"),Ye.emit("limit");return}else Ye.push(st)||(n._pause=!0);Ye.bytesRead=Vi},qg=function(){ne=void 0,Ye.push(null)}}else{if(K===C)return e.hitFieldsLimit||(e.hitFieldsLimit=!0,e.emit("fieldsLimit")),Hn(Y);++K,++H;let Ye="",st=!1;q=Y,Vg=function(xt){if((Vi+=xt.length)>E){let RD=E-(Vi-xt.length);Ye+=xt.toString("binary",0,RD),st=!0,Y.removeAllListeners("data")}else Ye+=xt.toString("binary")},qg=function(){q=void 0,Ye.length&&(Ye=Vx(Ye,"binary",Uo)),e.emit("field",fe,Ye,!1,st,To,Je),--H,u()}}Y._readableState.sync=!1,Y.on("data",Vg),Y.on("end",qg)}).on("error",function(ce){ne&&ne.emit("error",ce)})}).on("error",function(ee){e.emit("error",ee)}).on("finish",function(){ae=!0,u()})}Ka.prototype.write=function(e,A){let t=this.parser.write(e);t&&!this._pause?A():(this._needDrain=!t,this._cb=A)};Ka.prototype.end=function(){let e=this;e.parser.writable?e.parser.end():e._boy._done||process.nextTick(function(){e._boy._done=!0,e._boy.emit("finish")})};function Hn(e){e.resume()}function Tu(e){lB.call(this,e),this.bytesRead=0,this.truncated=!1}Jx(Tu,lB);Tu.prototype._read=function(e){};uB.exports=Ka});var dB=Q((p4,hB)=>{"use strict";var Kx=/\+/g,Zx=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function Mu(){this.buffer=void 0}Mu.prototype.write=function(e){e=e.replace(Kx," ");let A="",t=0,r=0,n=e.length;for(;tr&&(A+=e.substring(r,t),r=t),this.buffer="",++r);return r{"use strict";var Xx=dB(),Wn=_a(),vu=Ha(),zx=/^charset$/i;Za.detect=/^application\/x-www-form-urlencoded/i;function Za(e,A){let t=A.limits,r=A.parsedConType;this.boy=e,this.fieldSizeLimit=vu(t,"fieldSize",1*1024*1024),this.fieldNameSizeLimit=vu(t,"fieldNameSize",100),this.fieldsLimit=vu(t,"fields",1/0);let n;for(var i=0,s=r.length;ii&&(this._key+=this.decoder.write(e.toString("binary",i,t))),this._state="val",this._hitLimit=!1,this._checkingBytes=!0,this._val="",this._bytesVal=0,this._valTrunc=!1,this.decoder.reset(),i=t+1;else if(r!==void 0){++this._fields;let o,a=this._keyTrunc;if(r>i?o=this._key+=this.decoder.write(e.toString("binary",i,r)):o=this._key,this._hitLimit=!1,this._checkingBytes=!0,this._key="",this._bytesKey=0,this._keyTrunc=!1,this.decoder.reset(),o.length&&this.boy.emit("field",Wn(o,"binary",this.charset),"",a,!1),i=r+1,this._fields===this.fieldsLimit)return A()}else this._hitLimit?(n>i&&(this._key+=this.decoder.write(e.toString("binary",i,n))),i=n,(this._bytesKey=this._key.length)===this.fieldNameSizeLimit&&(this._checkingBytes=!1,this._keyTrunc=!0)):(ii&&(this._val+=this.decoder.write(e.toString("binary",i,r))),this.boy.emit("field",Wn(this._key,"binary",this.charset),Wn(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this._state="key",this._hitLimit=!1,this._checkingBytes=!0,this._key="",this._bytesKey=0,this._keyTrunc=!1,this.decoder.reset(),i=r+1,this._fields===this.fieldsLimit)return A()}else this._hitLimit?(n>i&&(this._val+=this.decoder.write(e.toString("binary",i,n))),i=n,(this._val===""&&this.fieldSizeLimit===0||(this._bytesVal=this._val.length)===this.fieldSizeLimit)&&(this._checkingBytes=!1,this._valTrunc=!0)):(i0?this.boy.emit("field",Wn(this._key,"binary",this.charset),"",this._keyTrunc,!1):this._state==="val"&&this.boy.emit("field",Wn(this._key,"binary",this.charset),Wn(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this.boy._done=!0,this.boy.emit("finish"))};QB.exports=Za});var BB=Q((y4,ws)=>{"use strict";var Pu=require("stream").Writable,{inherits:$x}=require("util"),eL=Lu(),fB=EB(),IB=CB(),AL=Uu();function Vt(e){if(!(this instanceof Vt))return new Vt(e);if(typeof e!="object")throw new TypeError("Busboy expected an options-Object.");if(typeof e.headers!="object")throw new TypeError("Busboy expected an options-Object with headers-attribute.");if(typeof e.headers["content-type"]!="string")throw new TypeError("Missing Content-Type-header.");let{headers:A,...t}=e;this.opts={autoDestroy:!1,...t},Pu.call(this,this.opts),this._done=!1,this._parser=this.getParserByHeaders(A),this._finished=!1}$x(Vt,Pu);Vt.prototype.emit=function(e){if(e==="finish"){if(this._done){if(this._finished)return}else{this._parser?.end();return}this._finished=!0}Pu.prototype.emit.apply(this,arguments)};Vt.prototype.getParserByHeaders=function(e){let A=AL(e["content-type"]),t={defCharset:this.opts.defCharset,fileHwm:this.opts.fileHwm,headers:e,highWaterMark:this.opts.highWaterMark,isPartAFile:this.opts.isPartAFile,limits:this.opts.limits,parsedConType:A,preservePath:this.opts.preservePath};if(fB.detect.test(A[0]))return new fB(this,t);if(IB.detect.test(A[0]))return new IB(this,t);throw new Error("Unsupported Content-Type.")};Vt.prototype._write=function(e,A,t){this._parser.write(e,t)};ws.exports=Vt;ws.exports.default=Vt;ws.exports.Busboy=Vt;ws.exports.Dicer=eL});var mr=Q((w4,kB)=>{"use strict";var{MessageChannel:tL,receiveMessageOnPort:rL}=require("worker_threads"),pB=["GET","HEAD","POST"],nL=new Set(pB),iL=[101,204,205,304],mB=[301,302,303,307,308],sL=new Set(mB),yB=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","5060","5061","6000","6566","6665","6666","6667","6668","6669","6697","10080"],oL=new Set(yB),wB=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],aL=new Set(wB),cL=["follow","manual","error"],RB=["GET","HEAD","OPTIONS","TRACE"],gL=new Set(RB),lL=["navigate","same-origin","no-cors","cors"],uL=["omit","same-origin","include"],EL=["default","no-store","reload","no-cache","force-cache","only-if-cached"],hL=["content-encoding","content-language","content-location","content-type","content-length"],dL=["half"],DB=["CONNECT","TRACE","TRACK"],QL=new Set(DB),bB=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],CL=new Set(bB),fL=globalThis.DOMException??(()=>{try{atob("~")}catch(e){return Object.getPrototypeOf(e).constructor}})(),_n,IL=globalThis.structuredClone??function(A,t=void 0){if(arguments.length===0)throw new TypeError("missing argument");return _n||(_n=new tL),_n.port1.unref(),_n.port2.unref(),_n.port1.postMessage(A,t?.transfer),rL(_n.port2).message};kB.exports={DOMException:fL,structuredClone:IL,subresource:bB,forbiddenMethods:DB,requestBodyHeader:hL,referrerPolicy:wB,requestRedirect:cL,requestMode:lL,requestCredentials:uL,requestCache:EL,redirectStatus:mB,corsSafeListedMethods:pB,nullBodyStatus:iL,safeMethods:RB,badPorts:yB,requestDuplex:dL,subresourceSet:CL,badPortsSet:oL,redirectStatusSet:sL,corsSafeListedMethodsSet:nL,safeMethodsSet:gL,forbiddenMethodsSet:QL,referrerPolicySet:aL}});var jn=Q((R4,SB)=>{"use strict";var Gu=Symbol.for("undici.globalOrigin.1");function BL(){return globalThis[Gu]}function pL(e){if(e===void 0){Object.defineProperty(globalThis,Gu,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let A=new URL(e);if(A.protocol!=="http:"&&A.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${A.protocol}`);Object.defineProperty(globalThis,Gu,{value:A,writable:!0,enumerable:!1,configurable:!1})}SB.exports={getGlobalOrigin:BL,setGlobalOrigin:pL}});var YA=Q((D4,vB)=>{"use strict";var{redirectStatusSet:mL,referrerPolicySet:yL,badPortsSet:wL}=mr(),{getGlobalOrigin:RL}=jn(),{performance:DL}=require("perf_hooks"),{isBlobLike:bL,toUSVString:kL,ReadableStreamFrom:SL}=W(),Kn=require("assert"),{isUint8Array:FL}=require("util/types"),FB=[],Xa;try{Xa=require("crypto");let e=["sha256","sha384","sha512"];FB=Xa.getHashes().filter(A=>e.includes(A))}catch{}function NB(e){let A=e.urlList,t=A.length;return t===0?null:A[t-1].toString()}function NL(e,A){if(!mL.has(e.status))return null;let t=e.headersList.get("location");return t!==null&&LB(t)&&(t=new URL(t,NB(e))),t&&!t.hash&&(t.hash=A),t}function Ds(e){return e.urlList[e.urlList.length-1]}function xL(e){let A=Ds(e);return MB(A)&&wL.has(A.port)?"blocked":"allowed"}function LL(e){return e instanceof Error||e?.constructor?.name==="Error"||e?.constructor?.name==="DOMException"}function UL(e){for(let A=0;A=32&&t<=126||t>=128&&t<=255))return!1}return!0}function TL(e){switch(e){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return e>=33&&e<=126}}function xB(e){if(e.length===0)return!1;for(let A=0;A0)for(let i=r.length;i!==0;i--){let s=r[i-1].trim();if(yL.has(s)){n=s;break}}n!==""&&(e.referrerPolicy=n)}function PL(){return"allowed"}function GL(){return"success"}function JL(){return"success"}function YL(e){let A=null;A=e.mode,e.headersList.set("sec-fetch-mode",A)}function VL(e){let A=e.origin;if(e.responseTainting==="cors"||e.mode==="websocket")A&&e.headersList.append("origin",A);else if(e.method!=="GET"&&e.method!=="HEAD"){switch(e.referrerPolicy){case"no-referrer":A=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&Vu(e.origin)&&!Vu(Ds(e))&&(A=null);break;case"same-origin":za(e,Ds(e))||(A=null);break;default:}A&&e.headersList.append("origin",A)}}function qL(e){return DL.now()}function OL(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function HL(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function WL(e){return{referrerPolicy:e.referrerPolicy}}function _L(e){let A=e.referrerPolicy;Kn(A);let t=null;if(e.referrer==="client"){let o=RL();if(!o||o.origin==="null")return"no-referrer";t=new URL(o)}else e.referrer instanceof URL&&(t=e.referrer);let r=Ju(t),n=Ju(t,!0);r.toString().length>4096&&(r=n);let i=za(e,r),s=Rs(r)&&!Rs(e.url);switch(A){case"origin":return n??Ju(t,!0);case"unsafe-url":return r;case"same-origin":return i?n:"no-referrer";case"origin-when-cross-origin":return i?r:n;case"strict-origin-when-cross-origin":{let o=Ds(e);return za(r,o)?r:Rs(r)&&!Rs(o)?"no-referrer":n}case"strict-origin":case"no-referrer-when-downgrade":default:return s?"no-referrer":n}}function Ju(e,A){return Kn(e instanceof URL),e.protocol==="file:"||e.protocol==="about:"||e.protocol==="blank:"?"no-referrer":(e.username="",e.password="",e.hash="",A&&(e.pathname="",e.search=""),e)}function Rs(e){if(!(e instanceof URL))return!1;if(e.href==="about:blank"||e.href==="about:srcdoc"||e.protocol==="data:"||e.protocol==="file:")return!0;return A(e.origin);function A(t){if(t==null||t==="null")return!1;let r=new URL(t);return!!(r.protocol==="https:"||r.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(r.hostname)||r.hostname==="localhost"||r.hostname.includes("localhost.")||r.hostname.endsWith(".localhost"))}}function jL(e,A){if(Xa===void 0)return!0;let t=UB(A);if(t==="no metadata"||t.length===0)return!0;let r=ZL(t),n=XL(t,r);for(let i of n){let s=i.algo,o=i.hash,a=Xa.createHash(s).update(e).digest("base64");if(a[a.length-1]==="="&&(a[a.length-2]==="="?a=a.slice(0,-2):a=a.slice(0,-1)),zL(a,o))return!0}return!1}var KL=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function UB(e){let A=[],t=!0;for(let r of e.split(" ")){t=!1;let n=KL.exec(r);if(n===null||n.groups===void 0||n.groups.algo===void 0)continue;let i=n.groups.algo.toLowerCase();FB.includes(i)&&A.push(n.groups)}return t===!0?"no metadata":A}function ZL(e){let A=e[0].algo;if(A[3]==="5")return A;for(let t=1;t{e=r,A=n}),resolve:e,reject:A}}function AU(e){return e.controller.state==="aborted"}function tU(e){return e.controller.state==="aborted"||e.controller.state==="terminated"}var qu={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"};Object.setPrototypeOf(qu,null);function rU(e){return qu[e.toLowerCase()]??e}function nU(e){let A=JSON.stringify(e);if(A===void 0)throw new TypeError("Value is not JSON serializable");return Kn(typeof A=="string"),A}var iU=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function sU(e,A,t){let r={index:0,kind:t,target:e},n={next(){if(Object.getPrototypeOf(this)!==n)throw new TypeError(`'next' called on an object that does not implement interface ${A} Iterator.`);let{index:i,kind:s,target:o}=r,a=o(),c=a.length;if(i>=c)return{value:void 0,done:!0};let g=a[i];return r.index=i+1,oU(g,s)},[Symbol.toStringTag]:`${A} Iterator`};return Object.setPrototypeOf(n,iU),Object.setPrototypeOf({},n)}function oU(e,A){let t;switch(A){case"key":{t=e[0];break}case"value":{t=e[1];break}case"key+value":{t=e;break}}return{value:t,done:!1}}async function aU(e,A,t){let r=A,n=t,i;try{i=e.stream.getReader()}catch(s){n(s);return}try{let s=await TB(i);r(s)}catch(s){n(s)}}var Yu=globalThis.ReadableStream;function cU(e){return Yu||(Yu=require("stream/web").ReadableStream),e instanceof Yu||e[Symbol.toStringTag]==="ReadableStream"&&typeof e.tee=="function"}var gU=65535;function lU(e){return e.lengthA+String.fromCharCode(t),"")}function uU(e){try{e.close()}catch(A){if(!A.message.includes("Controller is already closed"))throw A}}function EU(e){for(let A=0;AObject.prototype.hasOwnProperty.call(e,A));vB.exports={isAborted:AU,isCancelled:tU,createDeferredPromise:eU,ReadableStreamFrom:SL,toUSVString:kL,tryUpgradeRequestToAPotentiallyTrustworthyURL:$L,coarsenedSharedCurrentTime:qL,determineRequestsReferrer:_L,makePolicyContainer:HL,clonePolicyContainer:WL,appendFetchMetadata:YL,appendRequestOriginHeader:VL,TAOCheck:JL,corsCheck:GL,crossOriginResourcePolicyCheck:PL,createOpaqueTimingInfo:OL,setRequestReferrerPolicyOnRedirect:vL,isValidHTTPToken:xB,requestBadPort:xL,requestCurrentURL:Ds,responseURL:NB,responseLocationURL:NL,isBlobLike:bL,isURLPotentiallyTrustworthy:Rs,isValidReasonPhrase:UL,sameOrigin:za,normalizeMethod:rU,serializeJavascriptValueToJSONString:nU,makeIterator:sU,isValidHeaderName:ML,isValidHeaderValue:LB,hasOwn:dU,isErrorLike:LL,fullyReadBody:aU,bytesMatch:jL,isReadableStreamLike:cU,readableStreamClose:uU,isomorphicEncode:EU,isomorphicDecode:lU,urlIsLocal:hU,urlHasHttpsScheme:Vu,urlIsHttpHttpsScheme:MB,readAllBytes:TB,normalizeMethodRecord:qu,parseMetadata:UB}});var qt=Q((b4,PB)=>{"use strict";PB.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kGuard:Symbol("guard"),kRealm:Symbol("realm")}});var iA=Q((k4,JB)=>{"use strict";var{types:It}=require("util"),{hasOwn:GB,toUSVString:QU}=YA(),R={};R.converters={};R.util={};R.errors={};R.errors.exception=function(e){return new TypeError(`${e.header}: ${e.message}`)};R.errors.conversionFailed=function(e){let A=e.types.length===1?"":" one of",t=`${e.argument} could not be converted to${A}: ${e.types.join(", ")}.`;return R.errors.exception({header:e.prefix,message:t})};R.errors.invalidArgument=function(e){return R.errors.exception({header:e.prefix,message:`"${e.value}" is an invalid ${e.type}.`})};R.brandCheck=function(e,A,t=void 0){if(t?.strict!==!1&&!(e instanceof A))throw new TypeError("Illegal invocation");return e?.[Symbol.toStringTag]===A.prototype[Symbol.toStringTag]};R.argumentLengthCheck=function({length:e},A,t){if(en)throw R.errors.exception({header:"Integer conversion",message:`Value must be between ${i}-${n}, got ${s}.`});return s}return!Number.isNaN(s)&&r.clamp===!0?(s=Math.min(Math.max(s,i),n),Math.floor(s)%2===0?s=Math.floor(s):s=Math.ceil(s),s):Number.isNaN(s)||s===0&&Object.is(0,s)||s===Number.POSITIVE_INFINITY||s===Number.NEGATIVE_INFINITY?0:(s=R.util.IntegerPart(s),s=s%Math.pow(2,A),t==="signed"&&s>=Math.pow(2,A)-1?s-Math.pow(2,A):s)};R.util.IntegerPart=function(e){let A=Math.floor(Math.abs(e));return e<0?-1*A:A};R.sequenceConverter=function(e){return A=>{if(R.util.Type(A)!=="Object")throw R.errors.exception({header:"Sequence",message:`Value of type ${R.util.Type(A)} is not an Object.`});let t=A?.[Symbol.iterator]?.(),r=[];if(t===void 0||typeof t.next!="function")throw R.errors.exception({header:"Sequence",message:"Object is not an iterator."});for(;;){let{done:n,value:i}=t.next();if(n)break;r.push(e(i))}return r}};R.recordConverter=function(e,A){return t=>{if(R.util.Type(t)!=="Object")throw R.errors.exception({header:"Record",message:`Value of type ${R.util.Type(t)} is not an Object.`});let r={};if(!It.isProxy(t)){let i=Object.keys(t);for(let s of i){let o=e(s),a=A(t[s]);r[o]=a}return r}let n=Reflect.ownKeys(t);for(let i of n)if(Reflect.getOwnPropertyDescriptor(t,i)?.enumerable){let o=e(i),a=A(t[i]);r[o]=a}return r}};R.interfaceConverter=function(e){return(A,t={})=>{if(t.strict!==!1&&!(A instanceof e))throw R.errors.exception({header:e.name,message:`Expected ${A} to be an instance of ${e.name}.`});return A}};R.dictionaryConverter=function(e){return A=>{let t=R.util.Type(A),r={};if(t==="Null"||t==="Undefined")return r;if(t!=="Object")throw R.errors.exception({header:"Dictionary",message:`Expected ${A} to be one of: Null, Undefined, Object.`});for(let n of e){let{key:i,defaultValue:s,required:o,converter:a}=n;if(o===!0&&!GB(A,i))throw R.errors.exception({header:"Dictionary",message:`Missing required key "${i}".`});let c=A[i],g=GB(n,"defaultValue");if(g&&c!==null&&(c=c??s),o||g||c!==void 0){if(c=a(c),n.allowedValues&&!n.allowedValues.includes(c))throw R.errors.exception({header:"Dictionary",message:`${c} is not an accepted type. Expected one of ${n.allowedValues.join(", ")}.`});r[i]=c}}return r}};R.nullableConverter=function(e){return A=>A===null?A:e(A)};R.converters.DOMString=function(e,A={}){if(e===null&&A.legacyNullToEmptyString)return"";if(typeof e=="symbol")throw new TypeError("Could not convert argument of type symbol to string.");return String(e)};R.converters.ByteString=function(e){let A=R.converters.DOMString(e);for(let t=0;t255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${t} has a value of ${A.charCodeAt(t)} which is greater than 255.`);return A};R.converters.USVString=QU;R.converters.boolean=function(e){return!!e};R.converters.any=function(e){return e};R.converters["long long"]=function(e){return R.util.ConvertToInt(e,64,"signed")};R.converters["unsigned long long"]=function(e){return R.util.ConvertToInt(e,64,"unsigned")};R.converters["unsigned long"]=function(e){return R.util.ConvertToInt(e,32,"unsigned")};R.converters["unsigned short"]=function(e,A){return R.util.ConvertToInt(e,16,"unsigned",A)};R.converters.ArrayBuffer=function(e,A={}){if(R.util.Type(e)!=="Object"||!It.isAnyArrayBuffer(e))throw R.errors.conversionFailed({prefix:`${e}`,argument:`${e}`,types:["ArrayBuffer"]});if(A.allowShared===!1&&It.isSharedArrayBuffer(e))throw R.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});return e};R.converters.TypedArray=function(e,A,t={}){if(R.util.Type(e)!=="Object"||!It.isTypedArray(e)||e.constructor.name!==A.name)throw R.errors.conversionFailed({prefix:`${A.name}`,argument:`${e}`,types:[A.name]});if(t.allowShared===!1&&It.isSharedArrayBuffer(e.buffer))throw R.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});return e};R.converters.DataView=function(e,A={}){if(R.util.Type(e)!=="Object"||!It.isDataView(e))throw R.errors.exception({header:"DataView",message:"Object is not a DataView."});if(A.allowShared===!1&&It.isSharedArrayBuffer(e.buffer))throw R.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});return e};R.converters.BufferSource=function(e,A={}){if(It.isAnyArrayBuffer(e))return R.converters.ArrayBuffer(e,A);if(It.isTypedArray(e))return R.converters.TypedArray(e,e.constructor);if(It.isDataView(e))return R.converters.DataView(e,A);throw new TypeError(`Could not convert ${e} to a BufferSource.`)};R.converters["sequence