From 4e6ee362138fd7016bcbd14c4310b039c056efa8 Mon Sep 17 00:00:00 2001 From: Gabriel Pinto Date: Mon, 28 Oct 2024 16:28:44 +0000 Subject: [PATCH 1/7] feat: assets for fleek functions; external esbuild config; --- .fleek/function.js | 94783 ++++++++++++++++ locales/en.json | 8 +- package.json | 6 +- polyfills/async_hooks.js | 83 - src/commands/functions/deploy.ts | 49 +- src/commands/functions/index.ts | 47 +- .../plugins/asyncLocalStoragePolyfill.ts | 31 - .../plugins/nodeProtocolImportSpecifier.ts | 74 - .../plugins/unsupportedModuleStub.ts | 45 - .../functions/utils/getJsCodeFromPath.ts | 78 +- .../functions/utils/uploadFunctionAssets.ts | 28 + 11 files changed, 94898 insertions(+), 334 deletions(-) create mode 100644 .fleek/function.js delete mode 100644 polyfills/async_hooks.js delete mode 100644 src/commands/functions/plugins/asyncLocalStoragePolyfill.ts delete mode 100644 src/commands/functions/plugins/nodeProtocolImportSpecifier.ts delete mode 100644 src/commands/functions/plugins/unsupportedModuleStub.ts create mode 100644 src/commands/functions/utils/uploadFunctionAssets.ts diff --git a/.fleek/function.js b/.fleek/function.js new file mode 100644 index 00000000..73bf65cc --- /dev/null +++ b/.fleek/function.js @@ -0,0 +1,94783 @@ + +import { Buffer } from "node:buffer"; +import { AsyncLocalStorage } from "node:async_hooks"; +import { PerformanceObserver, performance } from 'node:perf_hooks'; +globalThis.AsyncLocalStorage = AsyncLocalStorage; +globalThis.process = { + ...globalThis.process, + env: { + ...globalThis.process.env, + AUTH_SECRET: "secret",POSTGRES_URL: "postgresql://nextjs-test_owner:r96IADoHqnMF@ep-ancient-sunset-a505d15y-pooler.us-east-2.aws.neon.tech/nextjs-test?sslmode",ASSETS_CID: "bafybeifkphvt6fp6dfovhbibk2cyuszahmn2boi7swixj4q74lblyql3zu" + } +}; +globalThis.fleek = { + env: { + AUTH_SECRET: "secret",POSTGRES_URL: "postgresql://nextjs-test_owner:r96IADoHqnMF@ep-ancient-sunset-a505d15y-pooler.us-east-2.aws.neon.tech/nextjs-test?sslmode",ASSETS_CID: "bafybeifkphvt6fp6dfovhbibk2cyuszahmn2boi7swixj4q74lblyql3zu" + } +}; + +import * as node_buffer_star from "node:buffer"; +import * as node_async_hooks_star from "node:async_hooks"; +import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks"; +var __defProp = Object.defineProperty; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __toBinary = /* @__PURE__ */ (() => { + var table = new Uint8Array(128); + for (var i = 0; i < 64; i++) table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i; + return (base64) => { + var n = base64.length, bytes = new Uint8Array((n - (base64[n - 1] == "=") - (base64[n - 2] == "=")) * 3 / 4 | 0); + for (var i2 = 0, j = 0; i2 < n; ) { + var c0 = table[base64.charCodeAt(i2++)], c1 = table[base64.charCodeAt(i2++)]; + var c2 = table[base64.charCodeAt(i2++)], c3 = table[base64.charCodeAt(i2++)]; + bytes[j++] = c0 << 2 | c1 >> 4; + bytes[j++] = c1 << 4 | c2 >> 2; + bytes[j++] = c2 << 6 | c3; + } + return bytes; + }; +})(); +var __namedExportsObject; +var __getNamedExports; +var init_cfe768a8b9054820b752095c864680de = __esm({ + ".vercel/output/static/_worker.js/__next-on-fleek-dist__/webpack/cfe768a8b9054820b752095c864680de.js"() { + "use strict"; + __namedExportsObject = {}; + __getNamedExports = (self, globalThis2, global) => { + __namedExportsObject["__chunk_74281"] = (e, a, t) => { + "use strict"; + t.r(a), t.d(a, { default: () => o }); + var r = t(21158), s = t(10791), i = t(6945); + async function o({ children: e2 }) { + let a2 = await (0, i.bG)(); + return (0, r.jsxs)("div", { className: "flex flex-grow font-helvetica-roman", children: [(0, r.jsxs)("aside", { className: "hidden w-64 min-w-64 max-w-64 border-r p-4 md:block", children: [(0, r.jsx)("h2", { className: "border-b border-green-800 text-sm font-semibold text-green-900", children: "Choose a Category" }), (0, r.jsx)("ul", { className: "flex flex-col items-start justify-center", children: a2.map((e3) => (0, r.jsx)("li", { className: "w-full", children: (0, r.jsx)(s.r, { prefetch: true, href: `/${e3.slug}`, className: "block w-full py-1 text-xs text-gray-800 hover:bg-yellow-100 hover:underline", children: e3.name }) }, e3.slug)) })] }), (0, r.jsx)("main", { className: "h-[calc(100vh-113px)] overflow-y-auto p-4 pt-0", id: "main-content", children: e2 })] }); + } + }; + __namedExportsObject["__chunk_84476"] = (e, a, t) => { + Promise.resolve().then(t.bind(t, 13972)); + }; + return __namedExportsObject; + }; + } +}); +var __namedExportsObject2; +var __getNamedExports2; +var init__ = __esm({ + ".vercel/output/static/_worker.js/__next-on-fleek-dist__/webpack/66473.js"() { + "use strict"; + __namedExportsObject2 = {}; + __getNamedExports2 = (self, globalThis2, global) => { + __namedExportsObject2["__chunk_66473"] = (e, a, t) => { + Promise.resolve().then(t.bind(t, 12835)), Promise.resolve().then(t.bind(t, 13972)); + }; + return __namedExportsObject2; + }; + } +}); +var __namedExportsObject3; +var __getNamedExports3; +var init__2 = __esm({ + ".vercel/output/static/_worker.js/__next-on-fleek-dist__/webpack/57799.js"() { + "use strict"; + __namedExportsObject3 = {}; + __getNamedExports3 = (self, globalThis2, global) => { + __namedExportsObject3["__chunk_57799"] = (e, a, t) => { + let r = { "69628d0c5ad9a69bc20b72992b2a9f15e2aa4452": () => Promise.resolve().then(t.bind(t, 3938)).then((e2) => e2.signOut), "8fd11345410fd70a6b93f7a85a181aa32d29db46": () => Promise.resolve().then(t.bind(t, 3938)).then((e2) => e2.signUp), "9bb9d577eddd038999f60ce48b2f1fbe87a8d7ab": () => Promise.resolve().then(t.bind(t, 3938)).then((e2) => e2.signIn) }; + async function s(e2, ...a2) { + return (await r[e2]()).apply(null, a2); + } + e.exports = { "69628d0c5ad9a69bc20b72992b2a9f15e2aa4452": s.bind(null, "69628d0c5ad9a69bc20b72992b2a9f15e2aa4452"), "8fd11345410fd70a6b93f7a85a181aa32d29db46": s.bind(null, "8fd11345410fd70a6b93f7a85a181aa32d29db46"), "9bb9d577eddd038999f60ce48b2f1fbe87a8d7ab": s.bind(null, "9bb9d577eddd038999f60ce48b2f1fbe87a8d7ab") }; + }; + return __namedExportsObject3; + }; + } +}); +var __defProp2; +var __getOwnPropDesc; +var __getOwnPropNames2; +var __hasOwnProp; +var __esm2; +var __copyProps; +var __reExport; +var __toCommonJS; +var node_buffer_exports; +var init_node_buffer; +var node_async_hooks_exports; +var init_node_async_hooks; +var __namedExportsObject4; +var __getNamedExports4; +var init_b326749eb881fe4b71a36afe5f53f11d = __esm({ + ".vercel/output/static/_worker.js/__next-on-fleek-dist__/webpack/b326749eb881fe4b71a36afe5f53f11d.js"() { + "use strict"; + __defProp2 = Object.defineProperty; + __getOwnPropDesc = Object.getOwnPropertyDescriptor; + __getOwnPropNames2 = Object.getOwnPropertyNames; + __hasOwnProp = Object.prototype.hasOwnProperty; + __esm2 = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res; + }; + __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); + __toCommonJS = (mod) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod); + node_buffer_exports = {}; + init_node_buffer = __esm2({ + "built-in-modules:node:buffer"() { + __reExport(node_buffer_exports, node_buffer_star); + } + }); + node_async_hooks_exports = {}; + init_node_async_hooks = __esm2({ + "built-in-modules:node:async_hooks"() { + __reExport(node_async_hooks_exports, node_async_hooks_star); + } + }); + __namedExportsObject4 = {}; + __getNamedExports4 = (self, globalThis2, global) => { + __namedExportsObject4["__chunk_26195"] = (e) => { + "use strict"; + e.exports = (init_node_buffer(), __toCommonJS(node_buffer_exports)); + }; + __namedExportsObject4["__chunk_2067"] = (e) => { + "use strict"; + e.exports = (init_node_async_hooks(), __toCommonJS(node_async_hooks_exports)); + }; + __namedExportsObject4["__chunk_49216"] = (e, t, r) => { + "use strict"; + r.d(t, { F: () => o, S: () => n }); + let n = (0, r(94461).P_)(); + function o(e2) { + let t2 = n.getStore(); + if (t2) { + if ("request" === t2.type) + return t2; + if ("prerender" === t2.type || "prerender-ppr" === t2.type || "prerender-legacy" === t2.type) + throw Error(`\`${e2}\` cannot be called inside a prerender. This is a bug in Next.js.`); + if ("cache" === t2.type) + throw Error(`\`${e2}\` cannot be called inside "use cache". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`); + if ("unstable-cache" === t2.type) + throw Error(`\`${e2}\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`); + } + throw Error(`\`${e2}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`); + } + }; + __namedExportsObject4["__chunk_57418"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { workAsyncStorage: () => n }); + let n = (0, r(94461).P_)(); + }; + __namedExportsObject4["__chunk_94461"] = (e, t, r) => { + "use strict"; + r.d(t, { P_: () => a }); + let n = Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"); + class o { + disable() { + throw n; + } + getStore() { + } + run() { + throw n; + } + exit() { + throw n; + } + enterWith() { + throw n; + } + static bind(e2) { + return e2; + } + } + let i = "undefined" != typeof globalThis2 && globalThis2.AsyncLocalStorage; + function a() { + return i ? new i() : new o(); + } + }; + __namedExportsObject4["__chunk_15291"] = (e, t, r) => { + "use strict"; + r.d(t, { W: () => n }); + let n = (0, r(94461).P_)(); + }; + __namedExportsObject4["__chunk_7684"] = (e, t, r) => { + "use strict"; + r.d(t, { _9: () => n }), "undefined" != typeof performance && ["mark", "measure", "getEntriesByName"].every((e2) => "function" == typeof performance[e2]); + class n extends Error { + } + }; + __namedExportsObject4["__chunk_51465"] = (e, t, r) => { + "use strict"; + function n(e2) { + return "(" === e2[0] && e2.endsWith(")"); + } + r.d(t, { GC: () => o, av: () => i, lv: () => n }); + let o = "__PAGE__", i = "__DEFAULT__"; + }; + __namedExportsObject4["__chunk_75222"] = (e, t, r) => { + "use strict"; + r.d(t, { JV: () => f, vG: () => l }); + var n = r(12758), o = r(76851), i = r(43031), a = r(45374); + let s = /\[((?:\[.*\])|.+)\]/; + function u(e2) { + let t2 = e2.startsWith("[") && e2.endsWith("]"); + t2 && (e2 = e2.slice(1, -1)); + let r2 = e2.startsWith("..."); + return r2 && (e2 = e2.slice(3)), { key: e2, repeat: r2, optional: t2 }; + } + function l(e2) { + let { parameterizedRoute: t2, groups: r2 } = function(e3) { + let t3 = (0, a.Q)(e3).slice(1).split("/"), r3 = {}, n2 = 1; + return { parameterizedRoute: t3.map((e4) => { + let t4 = o.Wz.find((t5) => e4.startsWith(t5)), a2 = e4.match(s); + if (t4 && a2) { + let { key: e5, optional: o2, repeat: s2 } = u(a2[1]); + return r3[e5] = { pos: n2++, repeat: s2, optional: o2 }, "/" + (0, i.f)(t4) + "([^/]+?)"; + } + if (!a2) + return "/" + (0, i.f)(e4); + { + let { key: e5, repeat: t5, optional: o2 } = u(a2[1]); + return r3[e5] = { pos: n2++, repeat: t5, optional: o2 }, t5 ? o2 ? "(?:/(.+?))?" : "/(.+?)" : "/([^/]+?)"; + } + }).join(""), groups: r3 }; + }(e2); + return { re: RegExp("^" + t2 + "(?:/)?$"), groups: r2 }; + } + function c(e2) { + let { interceptionMarker: t2, getSafeRouteKey: r2, segment: n2, routeKeys: o2, keyPrefix: a2 } = e2, { key: s2, optional: l2, repeat: c2 } = u(n2), f2 = s2.replace(/\W/g, ""); + a2 && (f2 = "" + a2 + f2); + let d = false; + (0 === f2.length || f2.length > 30) && (d = true), isNaN(parseInt(f2.slice(0, 1))) || (d = true), d && (f2 = r2()), a2 ? o2[f2] = "" + a2 + s2 : o2[f2] = s2; + let p = t2 ? (0, i.f)(t2) : ""; + return c2 ? l2 ? "(?:/" + p + "(?<" + f2 + ">.+?))?" : "/" + p + "(?<" + f2 + ">.+?)" : "/" + p + "(?<" + f2 + ">[^/]+?)"; + } + function f(e2, t2) { + let r2 = function(e3, t3) { + let r3; + let s2 = (0, a.Q)(e3).slice(1).split("/"), u2 = (r3 = 0, () => { + let e4 = "", t4 = ++r3; + for (; t4 > 0; ) + e4 += String.fromCharCode(97 + (t4 - 1) % 26), t4 = Math.floor((t4 - 1) / 26); + return e4; + }), l2 = {}; + return { namedParameterizedRoute: s2.map((e4) => { + let r4 = o.Wz.some((t4) => e4.startsWith(t4)), a2 = e4.match(/\[((?:\[.*\])|.+)\]/); + if (r4 && a2) { + let [r5] = e4.split(a2[0]); + return c({ getSafeRouteKey: u2, interceptionMarker: r5, segment: a2[1], routeKeys: l2, keyPrefix: t3 ? n.u7 : void 0 }); + } + return a2 ? c({ getSafeRouteKey: u2, segment: a2[1], routeKeys: l2, keyPrefix: t3 ? n.dN : void 0 }) : "/" + (0, i.f)(e4); + }).join(""), routeKeys: l2 }; + }(e2, t2); + return { ...l(e2), namedRegex: "^" + r2.namedParameterizedRoute + "(?:/)?$", routeKeys: r2.routeKeys }; + } + }; + __namedExportsObject4["__chunk_59770"] = (e, t, r) => { + "use strict"; + r.d(t, { t: () => o }); + var n = r(7684); + function o(e2) { + let { re: t2, groups: r2 } = e2; + return (e3) => { + let o2 = t2.exec(e3); + if (!o2) + return false; + let i = (e4) => { + try { + return decodeURIComponent(e4); + } catch (e5) { + throw new n._9("failed to decode param"); + } + }, a = {}; + return Object.keys(r2).forEach((e4) => { + let t3 = r2[e4], n2 = o2[t3.pos]; + void 0 !== n2 && (a[e4] = ~n2.indexOf("/") ? n2.split("/").map((e5) => i(e5)) : t3.repeat ? [i(n2)] : i(n2)); + }), a; + }; + } + }; + __namedExportsObject4["__chunk_45374"] = (e, t, r) => { + "use strict"; + function n(e2) { + return e2.replace(/\/$/, "") || "/"; + } + r.d(t, { Q: () => n }); + }; + __namedExportsObject4["__chunk_42571"] = (e, t, r) => { + "use strict"; + function n(e2) { + let t2 = {}; + return e2.forEach((e3, r2) => { + void 0 === t2[r2] ? t2[r2] = e3 : Array.isArray(t2[r2]) ? t2[r2].push(e3) : t2[r2] = [t2[r2], e3]; + }), t2; + } + r.d(t, { u5: () => n }); + }; + __namedExportsObject4["__chunk_85852"] = (e, t, r) => { + "use strict"; + r.d(t, { Y: () => o }); + var n = r(95803); + function o(e2, t2) { + if ("string" != typeof e2) + return false; + let { pathname: r2 } = (0, n.c)(e2); + return r2 === t2 || r2.startsWith(t2 + "/"); + } + }; + __namedExportsObject4["__chunk_95803"] = (e, t, r) => { + "use strict"; + function n(e2) { + let t2 = e2.indexOf("#"), r2 = e2.indexOf("?"), n2 = r2 > -1 && (t2 < 0 || r2 < t2); + return n2 || t2 > -1 ? { pathname: e2.substring(0, n2 ? r2 : t2), query: n2 ? e2.substring(r2, t2 > -1 ? t2 : void 0) : "", hash: t2 > -1 ? e2.slice(t2) : "" } : { pathname: e2, query: "", hash: "" }; + } + r.d(t, { c: () => n }); + }; + __namedExportsObject4["__chunk_89720"] = (e, t, r) => { + "use strict"; + r.d(t, { $: () => i }); + var n = r(76851); + let o = /\/\[[^/]+?\](?=\/|$)/; + function i(e2) { + return (0, n.Ag)(e2) && (e2 = (0, n.CK)(e2).interceptedRoute), o.test(e2); + } + }; + __namedExportsObject4["__chunk_54889"] = (e, t, r) => { + "use strict"; + r.d(t, { b: () => a, w: () => i }); + var n = r(62080), o = r(51465); + function i(e2) { + return (0, n.e)(e2.split("/").reduce((e3, t2, r2, n2) => !t2 || (0, o.lv)(t2) || "@" === t2[0] || ("page" === t2 || "route" === t2) && r2 === n2.length - 1 ? e3 : e3 + "/" + t2, "")); + } + function a(e2) { + return e2.replace(/\.rsc($|\?)/, "$1"); + } + }; + __namedExportsObject4["__chunk_62080"] = (e, t, r) => { + "use strict"; + function n(e2) { + return e2.startsWith("/") ? e2 : "/" + e2; + } + r.d(t, { e: () => n }); + }; + __namedExportsObject4["__chunk_84953"] = (e, t, r) => { + "use strict"; + let n; + n = r(61940), e.exports = n; + }; + __namedExportsObject4["__chunk_85820"] = (e, t, r) => { + "use strict"; + function n(e2) { + return null !== e2 && "object" == typeof e2 && "then" in e2 && "function" == typeof e2.then; + } + r.d(t, { J: () => n }); + }; + __namedExportsObject4["__chunk_83336"] = (e, t, r) => { + "use strict"; + r.d(t, { e: () => n }); + class n extends Error { + constructor(e2, t2) { + super("Invariant: " + (e2.endsWith(".") ? e2 : e2 + ".") + " This is a bug in Next.js.", t2), this.name = "InvariantError"; + } + } + }; + __namedExportsObject4["__chunk_57566"] = (e, t, r) => { + "use strict"; + function n(e2, t2) { + let r2; + let n2 = e2.split("/"); + return (t2 || []).some((t3) => !!n2[1] && n2[1].toLowerCase() === t3.toLowerCase() && (r2 = t3, n2.splice(1, 1), e2 = n2.join("/") || "/", true)), { pathname: e2, detectedLocale: r2 }; + } + r.d(t, { h: () => n }); + }; + __namedExportsObject4["__chunk_43031"] = (e, t, r) => { + "use strict"; + r.d(t, { f: () => i }); + let n = /[|\\{}()[\]^$+*?.-]/, o = /[|\\{}()[\]^$+*?.-]/g; + function i(e2) { + return n.test(e2) ? e2.replace(o, "\\$&") : e2; + } + }; + __namedExportsObject4["__chunk_87352"] = (e, t, r) => { + "use strict"; + r.d(t, { EK: () => o, LI: () => u, l$: () => i, lb: () => a, r4: () => s }); + var n = r(12758); + function o(e2) { + let t2 = new Headers(); + for (let [r2, n2] of Object.entries(e2)) + for (let e3 of Array.isArray(n2) ? n2 : [n2]) + void 0 !== e3 && ("number" == typeof e3 && (e3 = e3.toString()), t2.append(r2, e3)); + return t2; + } + function i(e2) { + var t2, r2, n2, o2, i2, a2 = [], s2 = 0; + function u2() { + for (; s2 < e2.length && /\s/.test(e2.charAt(s2)); ) + s2 += 1; + return s2 < e2.length; + } + for (; s2 < e2.length; ) { + for (t2 = s2, i2 = false; u2(); ) + if ("," === (r2 = e2.charAt(s2))) { + for (n2 = s2, s2 += 1, u2(), o2 = s2; s2 < e2.length && "=" !== (r2 = e2.charAt(s2)) && ";" !== r2 && "," !== r2; ) + s2 += 1; + s2 < e2.length && "=" === e2.charAt(s2) ? (i2 = true, s2 = o2, a2.push(e2.substring(t2, n2)), t2 = s2) : s2 = n2 + 1; + } else + s2 += 1; + (!i2 || s2 >= e2.length) && a2.push(e2.substring(t2, e2.length)); + } + return a2; + } + function a(e2) { + let t2 = {}, r2 = []; + if (e2) + for (let [n2, o2] of e2.entries()) + "set-cookie" === n2.toLowerCase() ? (r2.push(...i(o2)), t2[n2] = 1 === r2.length ? r2[0] : r2) : t2[n2] = o2; + return t2; + } + function s(e2) { + try { + return String(new URL(String(e2))); + } catch (t2) { + throw Error(`URL is malformed "${String(e2)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, { cause: t2 }); + } + } + function u(e2, t2) { + for (let r2 of [n.dN, n.u7]) + e2 !== r2 && e2.startsWith(r2) && t2(e2.substring(r2.length)); + } + }; + __namedExportsObject4["__chunk_67534"] = (e, t, r) => { + "use strict"; + r.d(t, { I: () => u }); + var n = r(92179), o = r(87352), i = r(8597), a = r(43677); + let s = Symbol("internal request"); + class u extends Request { + constructor(e2, t2 = {}) { + let r2 = "string" != typeof e2 && "url" in e2 ? e2.url : String(e2); + (0, o.r4)(r2), e2 instanceof Request ? super(e2, t2) : super(r2, t2); + let i2 = new n.c(r2, { headers: (0, o.lb)(this.headers), nextConfig: t2.nextConfig }); + this[s] = { cookies: new a.qC(this.headers), nextUrl: i2, url: i2.toString() }; + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return { cookies: this.cookies, nextUrl: this.nextUrl, url: this.url, bodyUsed: this.bodyUsed, cache: this.cache, credentials: this.credentials, destination: this.destination, headers: Object.fromEntries(this.headers), integrity: this.integrity, keepalive: this.keepalive, method: this.method, mode: this.mode, redirect: this.redirect, referrer: this.referrer, referrerPolicy: this.referrerPolicy, signal: this.signal }; + } + get cookies() { + return this[s].cookies; + } + get nextUrl() { + return this[s].nextUrl; + } + get page() { + throw new i.cR(); + } + get ua() { + throw new i.Y5(); + } + get url() { + return this[s].url; + } + } + }; + __namedExportsObject4["__chunk_43677"] = (e, t, r) => { + "use strict"; + r.d(t, { Q7: () => n.stringifyCookie, nV: () => n.ResponseCookies, qC: () => n.RequestCookies }); + var n = r(20601); + }; + __namedExportsObject4["__chunk_58904"] = (e, t, r) => { + "use strict"; + r.d(t, { O2: () => p, Qb: () => u, Xv: () => d, _5: () => c, vr: () => f }); + var n = r(43677), o = r(70938), i = r(57418), a = r(49216); + class s extends Error { + constructor() { + super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options"); + } + static callable() { + throw new s(); + } + } + class u { + static seal(e2) { + return new Proxy(e2, { get(e3, t2, r2) { + switch (t2) { + case "clear": + case "delete": + case "set": + return s.callable; + default: + return o.g.get(e3, t2, r2); + } + } }); + } + } + let l = Symbol.for("next.mutated.cookies"); + function c(e2, t2) { + let r2 = function(e3) { + let t3 = e3[l]; + return t3 && Array.isArray(t3) && 0 !== t3.length ? t3 : []; + }(t2); + if (0 === r2.length) + return false; + let o2 = new n.nV(e2), i2 = o2.getAll(); + for (let e3 of r2) + o2.set(e3); + for (let e3 of i2) + o2.set(e3); + return true; + } + class f { + static wrap(e2, t2) { + let r2 = new n.nV(new Headers()); + for (let t3 of e2.getAll()) + r2.set(t3); + let a2 = [], s2 = /* @__PURE__ */ new Set(), u2 = () => { + let e3 = i.workAsyncStorage.getStore(); + if (e3 && (e3.pathWasRevalidated = true), a2 = r2.getAll().filter((e4) => s2.has(e4.name)), t2) { + let e4 = []; + for (let t3 of a2) { + let r3 = new n.nV(new Headers()); + r3.set(t3), e4.push(r3.toString()); + } + t2(e4); + } + }, c2 = new Proxy(r2, { get(e3, t3, r3) { + switch (t3) { + case l: + return a2; + case "delete": + return function(...t4) { + s2.add("string" == typeof t4[0] ? t4[0] : t4[0].name); + try { + return e3.delete(...t4), c2; + } finally { + u2(); + } + }; + case "set": + return function(...t4) { + s2.add("string" == typeof t4[0] ? t4[0] : t4[0].name); + try { + return e3.set(...t4), c2; + } finally { + u2(); + } + }; + default: + return o.g.get(e3, t3, r3); + } + } }); + return c2; + } + } + function d(e2) { + let t2 = new Proxy(e2, { get(e3, r2, n2) { + switch (r2) { + case "delete": + return function(...r3) { + return h("cookies().delete"), e3.delete(...r3), t2; + }; + case "set": + return function(...r3) { + return h("cookies().set"), e3.set(...r3), t2; + }; + default: + return o.g.get(e3, r2, n2); + } + } }); + return t2; + } + function p(e2) { + return "action" === e2.phase; + } + function h(e2) { + if (!p((0, a.F)(e2))) + throw new s(); + } + }; + __namedExportsObject4["__chunk_70938"] = (e, t, r) => { + "use strict"; + r.d(t, { g: () => n }); + class n { + static get(e2, t2, r2) { + let n2 = Reflect.get(e2, t2, r2); + return "function" == typeof n2 ? n2.bind(e2) : n2; + } + static set(e2, t2, r2, n2) { + return Reflect.set(e2, t2, r2, n2); + } + static has(e2, t2) { + return Reflect.has(e2, t2); + } + static deleteProperty(e2, t2) { + return Reflect.deleteProperty(e2, t2); + } + } + }; + __namedExportsObject4["__chunk_98362"] = (e, t, r) => { + "use strict"; + r.d(t, { h: () => i }); + var n = r(70938); + class o extends Error { + constructor() { + super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers"); + } + static callable() { + throw new o(); + } + } + class i extends Headers { + constructor(e2) { + super(), this.headers = new Proxy(e2, { get(t2, r2, o2) { + if ("symbol" == typeof r2) + return n.g.get(t2, r2, o2); + let i2 = r2.toLowerCase(), a = Object.keys(e2).find((e3) => e3.toLowerCase() === i2); + if (void 0 !== a) + return n.g.get(t2, a, o2); + }, set(t2, r2, o2, i2) { + if ("symbol" == typeof r2) + return n.g.set(t2, r2, o2, i2); + let a = r2.toLowerCase(), s = Object.keys(e2).find((e3) => e3.toLowerCase() === a); + return n.g.set(t2, s ?? r2, o2, i2); + }, has(t2, r2) { + if ("symbol" == typeof r2) + return n.g.has(t2, r2); + let o2 = r2.toLowerCase(), i2 = Object.keys(e2).find((e3) => e3.toLowerCase() === o2); + return void 0 !== i2 && n.g.has(t2, i2); + }, deleteProperty(t2, r2) { + if ("symbol" == typeof r2) + return n.g.deleteProperty(t2, r2); + let o2 = r2.toLowerCase(), i2 = Object.keys(e2).find((e3) => e3.toLowerCase() === o2); + return void 0 === i2 || n.g.deleteProperty(t2, i2); + } }); + } + static seal(e2) { + return new Proxy(e2, { get(e3, t2, r2) { + switch (t2) { + case "append": + case "delete": + case "set": + return o.callable; + default: + return n.g.get(e3, t2, r2); + } + } }); + } + merge(e2) { + return Array.isArray(e2) ? e2.join(", ") : e2; + } + static from(e2) { + return e2 instanceof Headers ? e2 : new i(e2); + } + append(e2, t2) { + let r2 = this.headers[e2]; + "string" == typeof r2 ? this.headers[e2] = [r2, t2] : Array.isArray(r2) ? r2.push(t2) : this.headers[e2] = t2; + } + delete(e2) { + delete this.headers[e2]; + } + get(e2) { + let t2 = this.headers[e2]; + return void 0 !== t2 ? this.merge(t2) : null; + } + has(e2) { + return void 0 !== this.headers[e2]; + } + set(e2, t2) { + this.headers[e2] = t2; + } + forEach(e2, t2) { + for (let [r2, n2] of this.entries()) + e2.call(t2, n2, r2, this); + } + *entries() { + for (let e2 of Object.keys(this.headers)) { + let t2 = e2.toLowerCase(), r2 = this.get(t2); + yield [t2, r2]; + } + } + *keys() { + for (let e2 of Object.keys(this.headers)) { + let t2 = e2.toLowerCase(); + yield t2; + } + } + *values() { + for (let e2 of Object.keys(this.headers)) { + let t2 = this.get(e2); + yield t2; + } + } + [Symbol.iterator]() { + return this.entries(); + } + } + }; + __namedExportsObject4["__chunk_92179"] = (e, t, r) => { + "use strict"; + r.d(t, { c: () => d }); + var n = r(45374), o = r(95803); + function i(e2, t2) { + if (!e2.startsWith("/") || !t2) + return e2; + let { pathname: r2, query: n2, hash: i2 } = (0, o.c)(e2); + return "" + t2 + r2 + n2 + i2; + } + function a(e2, t2) { + if (!e2.startsWith("/") || !t2) + return e2; + let { pathname: r2, query: n2, hash: i2 } = (0, o.c)(e2); + return "" + r2 + t2 + n2 + i2; + } + var s = r(85852), u = r(57566); + let l = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/; + function c(e2, t2) { + return new URL(String(e2).replace(l, "localhost"), t2 && String(t2).replace(l, "localhost")); + } + let f = Symbol("NextURLInternal"); + class d { + constructor(e2, t2, r2) { + let n2, o2; + "object" == typeof t2 && "pathname" in t2 || "string" == typeof t2 ? (n2 = t2, o2 = r2 || {}) : o2 = r2 || t2 || {}, this[f] = { url: c(e2, n2 ?? o2.base), options: o2, basePath: "" }, this.analyze(); + } + analyze() { + var e2, t2, r2, n2, o2; + let i2 = function(e3, t3) { + var r3, n3; + let { basePath: o3, i18n: i3, trailingSlash: a3 } = null != (r3 = t3.nextConfig) ? r3 : {}, l3 = { pathname: e3, trailingSlash: "/" !== e3 ? e3.endsWith("/") : a3 }; + o3 && (0, s.Y)(l3.pathname, o3) && (l3.pathname = function(e4, t4) { + if (!(0, s.Y)(e4, t4)) + return e4; + let r4 = e4.slice(t4.length); + return r4.startsWith("/") ? r4 : "/" + r4; + }(l3.pathname, o3), l3.basePath = o3); + let c2 = l3.pathname; + if (l3.pathname.startsWith("/_next/data/") && l3.pathname.endsWith(".json")) { + let e4 = l3.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/"), r4 = e4[0]; + l3.buildId = r4, c2 = "index" !== e4[1] ? "/" + e4.slice(1).join("/") : "/", true === t3.parseData && (l3.pathname = c2); + } + if (i3) { + let e4 = t3.i18nProvider ? t3.i18nProvider.analyze(l3.pathname) : (0, u.h)(l3.pathname, i3.locales); + l3.locale = e4.detectedLocale, l3.pathname = null != (n3 = e4.pathname) ? n3 : l3.pathname, !e4.detectedLocale && l3.buildId && (e4 = t3.i18nProvider ? t3.i18nProvider.analyze(c2) : (0, u.h)(c2, i3.locales)).detectedLocale && (l3.locale = e4.detectedLocale); + } + return l3; + }(this[f].url.pathname, { nextConfig: this[f].options.nextConfig, parseData: true, i18nProvider: this[f].options.i18nProvider }), a2 = function(e3, t3) { + let r3; + if ((null == t3 ? void 0 : t3.host) && !Array.isArray(t3.host)) + r3 = t3.host.toString().split(":", 1)[0]; + else { + if (!e3.hostname) + return; + r3 = e3.hostname; + } + return r3.toLowerCase(); + }(this[f].url, this[f].options.headers); + this[f].domainLocale = this[f].options.i18nProvider ? this[f].options.i18nProvider.detectDomainLocale(a2) : function(e3, t3, r3) { + if (e3) + for (let i3 of (r3 && (r3 = r3.toLowerCase()), e3)) { + var n3, o3; + if (t3 === (null == (n3 = i3.domain) ? void 0 : n3.split(":", 1)[0].toLowerCase()) || r3 === i3.defaultLocale.toLowerCase() || (null == (o3 = i3.locales) ? void 0 : o3.some((e4) => e4.toLowerCase() === r3))) + return i3; + } + }(null == (t2 = this[f].options.nextConfig) ? void 0 : null == (e2 = t2.i18n) ? void 0 : e2.domains, a2); + let l2 = (null == (r2 = this[f].domainLocale) ? void 0 : r2.defaultLocale) || (null == (o2 = this[f].options.nextConfig) ? void 0 : null == (n2 = o2.i18n) ? void 0 : n2.defaultLocale); + this[f].url.pathname = i2.pathname, this[f].defaultLocale = l2, this[f].basePath = i2.basePath ?? "", this[f].buildId = i2.buildId, this[f].locale = i2.locale ?? l2, this[f].trailingSlash = i2.trailingSlash; + } + formatPathname() { + var e2; + let t2; + return t2 = function(e3, t3, r2, n2) { + if (!t3 || t3 === r2) + return e3; + let o2 = e3.toLowerCase(); + return !n2 && ((0, s.Y)(o2, "/api") || (0, s.Y)(o2, "/" + t3.toLowerCase())) ? e3 : i(e3, "/" + t3); + }((e2 = { basePath: this[f].basePath, buildId: this[f].buildId, defaultLocale: this[f].options.forceLocale ? void 0 : this[f].defaultLocale, locale: this[f].locale, pathname: this[f].url.pathname, trailingSlash: this[f].trailingSlash }).pathname, e2.locale, e2.buildId ? void 0 : e2.defaultLocale, e2.ignorePrefix), (e2.buildId || !e2.trailingSlash) && (t2 = (0, n.Q)(t2)), e2.buildId && (t2 = a(i(t2, "/_next/data/" + e2.buildId), "/" === e2.pathname ? "index.json" : ".json")), t2 = i(t2, e2.basePath), !e2.buildId && e2.trailingSlash ? t2.endsWith("/") ? t2 : a(t2, "/") : (0, n.Q)(t2); + } + formatSearch() { + return this[f].url.search; + } + get buildId() { + return this[f].buildId; + } + set buildId(e2) { + this[f].buildId = e2; + } + get locale() { + return this[f].locale ?? ""; + } + set locale(e2) { + var t2, r2; + if (!this[f].locale || !(null == (r2 = this[f].options.nextConfig) ? void 0 : null == (t2 = r2.i18n) ? void 0 : t2.locales.includes(e2))) + throw TypeError(`The NextURL configuration includes no locale "${e2}"`); + this[f].locale = e2; + } + get defaultLocale() { + return this[f].defaultLocale; + } + get domainLocale() { + return this[f].domainLocale; + } + get searchParams() { + return this[f].url.searchParams; + } + get host() { + return this[f].url.host; + } + set host(e2) { + this[f].url.host = e2; + } + get hostname() { + return this[f].url.hostname; + } + set hostname(e2) { + this[f].url.hostname = e2; + } + get port() { + return this[f].url.port; + } + set port(e2) { + this[f].url.port = e2; + } + get protocol() { + return this[f].url.protocol; + } + set protocol(e2) { + this[f].url.protocol = e2; + } + get href() { + let e2 = this.formatPathname(), t2 = this.formatSearch(); + return `${this.protocol}//${this.host}${e2}${t2}${this.hash}`; + } + set href(e2) { + this[f].url = c(e2), this.analyze(); + } + get origin() { + return this[f].url.origin; + } + get pathname() { + return this[f].url.pathname; + } + set pathname(e2) { + this[f].url.pathname = e2; + } + get hash() { + return this[f].url.hash; + } + set hash(e2) { + this[f].url.hash = e2; + } + get search() { + return this[f].url.search; + } + set search(e2) { + this[f].url.search = e2; + } + get password() { + return this[f].url.password; + } + set password(e2) { + this[f].url.password = e2; + } + get username() { + return this[f].url.username; + } + set username(e2) { + this[f].url.username = e2; + } + get basePath() { + return this[f].basePath; + } + set basePath(e2) { + this[f].basePath = e2.startsWith("/") ? e2 : `/${e2}`; + } + toString() { + return this.href; + } + toJSON() { + return this.href; + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return { href: this.href, origin: this.origin, protocol: this.protocol, username: this.username, password: this.password, host: this.host, hostname: this.hostname, port: this.port, pathname: this.pathname, search: this.search, searchParams: this.searchParams, hash: this.hash }; + } + clone() { + return new d(String(this), this[f].options); + } + } + }; + __namedExportsObject4["__chunk_8597"] = (e, t, r) => { + "use strict"; + r.d(t, { Y5: () => i, cR: () => o, qJ: () => n }); + class n extends Error { + constructor({ page: e2 }) { + super(`The middleware "${e2}" accepts an async API directly with the form: + + export function middleware(request, event) { + return NextResponse.redirect('/new-location') + } + + Read more: https://nextjs.org/docs/messages/middleware-new-signature + `); + } + } + class o extends Error { + constructor() { + super(`The request.page has been deprecated in favour of \`URLPattern\`. + Read more: https://nextjs.org/docs/messages/middleware-request-page + `); + } + } + class i extends Error { + constructor() { + super(`The request.ua has been removed in favour of \`userAgent\` function. + Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent + `); + } + } + }; + __namedExportsObject4["__chunk_43825"] = (e, t, r) => { + "use strict"; + r(8155), r(83748), new Uint8Array([60, 104, 116, 109, 108]), new Uint8Array([60, 98, 111, 100, 121]), new Uint8Array([60, 47, 104, 101, 97, 100, 62]), new Uint8Array([60, 47, 98, 111, 100, 121, 62]), new Uint8Array([60, 47, 104, 116, 109, 108, 62]), new Uint8Array([60, 47, 98, 111, 100, 121, 62, 60, 47, 104, 116, 109, 108, 62]), r(26195).Buffer, new TextEncoder(); + }; + __namedExportsObject4["__chunk_53467"] = (e, t, r) => { + "use strict"; + r.d(t, { IC: () => m, oE: () => v }); + var n = r(64755), o = r(57566), i = r(7666), a = r(75222), s = r(59770), u = r(43031), l = r(42571); + r(7684); + var c = r(76851), f = r(56225); + function d(e2) { + return e2.replace(/__ESC_COLON_/gi, ":"); + } + function p(e2, t2) { + if (!e2.includes(":")) + return e2; + for (let r2 of Object.keys(t2)) + e2.includes(":" + r2) && (e2 = e2.replace(RegExp(":" + r2 + "\\*", "g"), ":" + r2 + "--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":" + r2 + "\\?", "g"), ":" + r2 + "--ESCAPED_PARAM_QUESTION").replace(RegExp(":" + r2 + "\\+", "g"), ":" + r2 + "--ESCAPED_PARAM_PLUS").replace(RegExp(":" + r2 + "(?!\\w)", "g"), "--ESCAPED_PARAM_COLON" + r2)); + return e2 = e2.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g, "\\$1").replace(/--ESCAPED_PARAM_PLUS/g, "+").replace(/--ESCAPED_PARAM_COLON/g, ":").replace(/--ESCAPED_PARAM_QUESTION/g, "?").replace(/--ESCAPED_PARAM_ASTERISKS/g, "*"), (0, i.compile)("/" + e2, { validate: false })(t2).slice(1); + } + var h = r(45374), y = r(54889), g = r(12758); + function v(e2, t2, r2) { + if (!r2) + return e2; + for (let n2 of Object.keys(r2.groups)) { + let o2; + let { optional: i2, repeat: a2 } = r2.groups[n2], s2 = `[${a2 ? "..." : ""}${n2}]`; + i2 && (s2 = `[${s2}]`); + let u2 = t2[n2]; + o2 = Array.isArray(u2) ? u2.map((e3) => e3 && encodeURIComponent(e3)).join("/") : u2 ? encodeURIComponent(u2) : "", e2 = e2.replaceAll(s2, o2); + } + return e2; + } + function m({ page: e2, i18n: t2, basePath: m2, rewrites: b, pageIsDynamic: S, trailingSlash: w, caseSensitive: x }) { + let E, _, C; + return S && (E = (0, a.JV)(e2, false), C = (_ = (0, s.t)(E))(e2)), { handleRewrites: function(n2, a2) { + let s2 = {}, y2 = a2.pathname, g2 = (h2) => { + let g3 = function(e3, t3) { + let r2 = [], n3 = (0, i.pathToRegexp)(e3, r2, { delimiter: "/", sensitive: "boolean" == typeof (null == t3 ? void 0 : t3.sensitive) && t3.sensitive, strict: null == t3 ? void 0 : t3.strict }), o2 = (0, i.regexpToFunction)((null == t3 ? void 0 : t3.regexModifier) ? new RegExp(t3.regexModifier(n3.source), n3.flags) : n3, r2); + return (e4, n4) => { + if ("string" != typeof e4) + return false; + let i2 = o2(e4); + if (!i2) + return false; + if (null == t3 ? void 0 : t3.removeUnnamedParams) + for (let e5 of r2) + "number" == typeof e5.name && delete i2.params[e5.name]; + return { ...n4, ...i2.params }; + }; + }(h2.source + (w ? "(/)?" : ""), { removeUnnamedParams: true, strict: true, sensitive: !!x })(a2.pathname); + if ((h2.has || h2.missing) && g3) { + let e3 = function(e4, t3, n3, o2) { + void 0 === n3 && (n3 = []), void 0 === o2 && (o2 = []); + let i2 = {}, a3 = (n4) => { + let o3; + let a4 = n4.key; + switch (n4.type) { + case "header": + a4 = a4.toLowerCase(), o3 = e4.headers[a4]; + break; + case "cookie": + if ("cookies" in e4) + o3 = e4.cookies[n4.key]; + else { + var s3; + o3 = (s3 = e4.headers, function() { + let { cookie: e5 } = s3; + if (!e5) + return {}; + let { parse: t4 } = r(13776); + return t4(Array.isArray(e5) ? e5.join("; ") : e5); + })()[n4.key]; + } + break; + case "query": + o3 = t3[a4]; + break; + case "host": { + let { host: t4 } = (null == e4 ? void 0 : e4.headers) || {}; + o3 = null == t4 ? void 0 : t4.split(":", 1)[0].toLowerCase(); + } + } + if (!n4.value && o3) + return i2[function(e5) { + let t4 = ""; + for (let r2 = 0; r2 < e5.length; r2++) { + let n5 = e5.charCodeAt(r2); + (n5 > 64 && n5 < 91 || n5 > 96 && n5 < 123) && (t4 += e5[r2]); + } + return t4; + }(a4)] = o3, true; + if (o3) { + let e5 = RegExp("^" + n4.value + "$"), t4 = Array.isArray(o3) ? o3.slice(-1)[0].match(e5) : o3.match(e5); + if (t4) + return Array.isArray(t4) && (t4.groups ? Object.keys(t4.groups).forEach((e6) => { + i2[e6] = t4.groups[e6]; + }) : "host" === n4.type && t4[0] && (i2.host = t4[0])), true; + } + return false; + }; + return !!n3.every((e5) => a3(e5)) && !o2.some((e5) => a3(e5)) && i2; + }(n2, a2.query, h2.has, h2.missing); + e3 ? Object.assign(g3, e3) : g3 = false; + } + if (g3) { + let { parsedDestination: r2, destQuery: n3 } = function(e3) { + let t3; + let r3 = Object.assign({}, e3.query); + delete r3.__nextLocale, delete r3.__nextDefaultLocale, delete r3.__nextDataReq, delete r3.__nextInferredLocaleFromDefault, delete r3[f.H4]; + let n4 = e3.destination; + for (let t4 of Object.keys({ ...e3.params, ...r3 })) + n4 = t4 ? n4.replace(RegExp(":" + (0, u.f)(t4), "g"), "__ESC_COLON_" + t4) : n4; + let o2 = function(e4) { + if (e4.startsWith("/")) + return function(e5, t5, r4) { + void 0 === r4 && (r4 = true); + let n5 = new URL("http://n"), o3 = e5.startsWith(".") ? new URL("http://n") : n5, { pathname: i2, searchParams: a4, search: s4, hash: u2, href: c2, origin: f2 } = new URL(e5, o3); + if (f2 !== n5.origin) + throw Error("invariant: invalid relative URL, router received " + e5); + return { pathname: i2, query: r4 ? (0, l.u5)(a4) : void 0, search: s4, hash: u2, href: c2.slice(f2.length) }; + }(e4); + let t4 = new URL(e4); + return { hash: t4.hash, hostname: t4.hostname, href: t4.href, pathname: t4.pathname, port: t4.port, protocol: t4.protocol, query: (0, l.u5)(t4.searchParams), search: t4.search }; + }(n4), a3 = o2.query, s3 = d("" + o2.pathname + (o2.hash || "")), h3 = d(o2.hostname || ""), y3 = [], g4 = []; + (0, i.pathToRegexp)(s3, y3), (0, i.pathToRegexp)(h3, g4); + let v2 = []; + y3.forEach((e4) => v2.push(e4.name)), g4.forEach((e4) => v2.push(e4.name)); + let m3 = (0, i.compile)(s3, { validate: false }), b2 = (0, i.compile)(h3, { validate: false }); + for (let [t4, r4] of Object.entries(a3)) + Array.isArray(r4) ? a3[t4] = r4.map((t5) => p(d(t5), e3.params)) : "string" == typeof r4 && (a3[t4] = p(d(r4), e3.params)); + let S2 = Object.keys(e3.params).filter((e4) => "nextInternalLocale" !== e4); + if (e3.appendParamsToQuery && !S2.some((e4) => v2.includes(e4))) + for (let t4 of S2) + t4 in a3 || (a3[t4] = e3.params[t4]); + if ((0, c.Ag)(s3)) + for (let t4 of s3.split("/")) { + let r4 = c.Wz.find((e4) => t4.startsWith(e4)); + if (r4) { + "(..)(..)" === r4 ? (e3.params["0"] = "(..)", e3.params["1"] = "(..)") : e3.params["0"] = r4; + break; + } + } + try { + let [r4, n5] = (t3 = m3(e3.params)).split("#", 2); + o2.hostname = b2(e3.params), o2.pathname = r4, o2.hash = (n5 ? "#" : "") + (n5 || ""), delete o2.search; + } catch (e4) { + if (e4.message.match(/Expected .*? to not repeat, but got an array/)) + throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"); + throw e4; + } + return o2.query = { ...r3, ...o2.query }, { newUrl: t3, destQuery: a3, parsedDestination: o2 }; + }({ appendParamsToQuery: true, destination: h2.destination, params: g3, query: a2.query }); + if (r2.protocol) + return true; + if (Object.assign(s2, n3, g3), Object.assign(a2.query, r2.query), delete r2.query, Object.assign(a2, r2), y2 = a2.pathname, m2 && (y2 = y2.replace(RegExp(`^${m2}`), "") || "/"), t2) { + let e3 = (0, o.h)(y2, t2.locales); + y2 = e3.pathname, a2.query.nextInternalLocale = e3.detectedLocale || g3.nextInternalLocale; + } + if (y2 === e2) + return true; + if (S && _) { + let e3 = _(y2); + if (e3) + return a2.query = { ...a2.query, ...e3 }, true; + } + } + return false; + }; + for (let e3 of b.beforeFiles || []) + g2(e3); + if (y2 !== e2) { + let t3 = false; + for (let e3 of b.afterFiles || []) + if (t3 = g2(e3)) + break; + if (!t3 && !(() => { + let t4 = (0, h.Q)(y2 || ""); + return t4 === (0, h.Q)(e2) || (null == _ ? void 0 : _(t4)); + })()) { + for (let e3 of b.fallback || []) + if (t3 = g2(e3)) + break; + } + } + return s2; + }, defaultRouteRegex: E, dynamicRouteMatcher: _, defaultRouteMatches: C, getParamsFromRouteMatches: function(e3, r2, n2) { + return (0, s.t)(function() { + let { groups: e4, routeKeys: o2 } = E; + return { re: { exec: (i2) => { + let a2 = Object.fromEntries(new URLSearchParams(i2)), s2 = t2 && n2 && a2["1"] === n2; + for (let e5 of Object.keys(a2)) { + let t3 = a2[e5]; + e5 !== g.dN && e5.startsWith(g.dN) && (a2[e5.substring(g.dN.length)] = t3, delete a2[e5]); + } + let u2 = Object.keys(o2 || {}), l2 = (e5) => { + if (t2) { + let o3 = Array.isArray(e5), i3 = o3 ? e5[0] : e5; + if ("string" == typeof i3 && t2.locales.some((e6) => e6.toLowerCase() === i3.toLowerCase() && (n2 = e6, r2.locale = n2, true))) + return o3 && e5.splice(0, 1), !o3 || 0 === e5.length; + } + return false; + }; + return u2.every((e5) => a2[e5]) ? u2.reduce((t3, r3) => { + let n3 = null == o2 ? void 0 : o2[r3]; + return n3 && !l2(a2[r3]) && (t3[e4[n3].pos] = a2[r3]), t3; + }, {}) : Object.keys(a2).reduce((e5, t3) => { + if (!l2(a2[t3])) { + let r3 = t3; + return s2 && (r3 = parseInt(t3, 10) - 1 + ""), Object.assign(e5, { [r3]: a2[t3] }); + } + return e5; + }, {}); + } }, groups: e4 }; + }())(e3.headers["x-now-route-matches"]); + }, normalizeDynamicRouteParams: (e3, t3) => { + var r2, n2, o2; + let i2; + return r2 = e3, n2 = E, o2 = C, i2 = true, n2 ? { params: r2 = Object.keys(n2.groups).reduce((e4, a2) => { + let s2 = r2[a2]; + "string" == typeof s2 && (s2 = (0, y.b)(s2)), Array.isArray(s2) && (s2 = s2.map((e5) => ("string" == typeof e5 && (e5 = (0, y.b)(e5)), e5))); + let u2 = o2[a2], l2 = n2.groups[a2].optional; + return ((Array.isArray(u2) ? u2.some((e5) => Array.isArray(s2) ? s2.some((t4) => t4.includes(e5)) : null == s2 ? void 0 : s2.includes(e5)) : null == s2 ? void 0 : s2.includes(u2)) || void 0 === s2 && !(l2 && t3)) && (i2 = false), l2 && (!s2 || Array.isArray(s2) && 1 === s2.length && ("index" === s2[0] || s2[0] === `[[...${a2}]]`)) && (s2 = void 0, delete r2[a2]), s2 && "string" == typeof s2 && n2.groups[a2].repeat && (s2 = s2.split("/")), s2 && (e4[a2] = s2), e4; + }, {}), hasValidParams: i2 } : { params: r2, hasValidParams: false }; + }, normalizeVercelUrl: (e3, t3, r2) => function(e4, t4, r3, o2, i2) { + if (o2 && t4 && i2) { + let t5 = (0, n.parse)(e4.url, true); + for (let e5 of (delete t5.search, Object.keys(t5.query))) { + let n2 = e5 !== g.dN && e5.startsWith(g.dN), o3 = e5 !== g.u7 && e5.startsWith(g.u7); + (n2 || o3 || (r3 || Object.keys(i2.groups)).includes(e5)) && delete t5.query[e5]; + } + e4.url = (0, n.format)(t5); + } + }(e3, t3, r2, S, E), interpolateDynamicPath: (e3, t3) => v(e3, t3, E) }; + } + }; + __namedExportsObject4["__chunk_28195"] = (e, t, r) => { + "use strict"; + var n; + r.d(t, { x: () => n }), function(e2) { + e2.PAGES = "PAGES", e2.PAGES_API = "PAGES_API", e2.APP_PAGE = "APP_PAGE", e2.APP_ROUTE = "APP_ROUTE", e2.IMAGE = "IMAGE"; + }(n || (n = {})); + }; + __namedExportsObject4["__chunk_5099"] = (e, t, r) => { + "use strict"; + var n, o; + r.d(t, { HD: () => n, i7: () => o }), function(e2) { + e2.APP_PAGE = "APP_PAGE", e2.APP_ROUTE = "APP_ROUTE", e2.PAGES = "PAGES", e2.FETCH = "FETCH", e2.REDIRECT = "REDIRECT", e2.IMAGE = "IMAGE"; + }(n || (n = {})), function(e2) { + e2.APP_PAGE = "APP_PAGE", e2.APP_ROUTE = "APP_ROUTE", e2.PAGES = "PAGES", e2.FETCH = "FETCH", e2.IMAGE = "IMAGE"; + }(o || (o = {})), r(43825), Symbol.for("NextInternalRequestMeta"), r(87352), r(67534), r(8155), r(83748), r(26195).Buffer, r(28195); + }; + __namedExportsObject4["__chunk_87206"] = (e, t, r) => { + "use strict"; + r.d(t, { BE: () => l, ET: () => u, N5: () => a, U6: () => s, _K: () => o }); + var n = r(87915); + function o(e2) { + let t2 = Promise.resolve(e2); + return t2.status = "fulfilled", t2.value = e2, t2; + } + let i = /^[A-Za-z_$][A-Za-z0-9_$]*$/; + function a(e2, t2) { + return i.test(t2) ? `\`${e2}.${t2}\`` : `\`${e2}[${JSON.stringify(t2)}]\``; + } + function s(e2, t2) { + let r2 = JSON.stringify(t2); + return `\`Reflect.has(${e2}, ${r2})\`, \`${r2} in ${e2}\`, or similar`; + } + function u(e2, t2) { + throw new n.G(`Route ${e2} with \`dynamic = "error"\` couldn't be rendered statically because it used ${t2}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`); + } + let l = /* @__PURE__ */ new Set(["hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toString", "valueOf", "toLocaleString", "then", "catch", "finally", "status", "toJSON", "$$typeof", "__esModule"]); + }; + __namedExportsObject4["__chunk_41534"] = (e, t, r) => { + "use strict"; + r.d(t, { LV: () => c, XH: () => d, p5: () => f, qj: () => l }); + var n = r(12991), o = r(49216), i = r(83336), a = r(87206), s = r(45933), u = r(85491); + let l = f; + function c(e2, t2) { + return t2.isStaticGeneration ? p(e2, t2) : y(e2); + } + function f(e2, t2) { + return t2.isStaticGeneration ? p(e2, t2) : y(e2); + } + function d(e2, t2) { + let r2 = o.S.getStore(); + if (r2 && "prerender" === r2.type) { + let n2 = t2.fallbackRouteParams; + if (n2) { + for (let t3 in e2) + if (n2.has(t3)) + return (0, s.R)(r2.renderSignal, "`params`"); + } + } + return (0, a._K)(e2); + } + function p(e2, t2) { + let r2 = t2.fallbackRouteParams; + if (r2) { + let u2 = false; + for (let t3 in e2) + if (r2.has(t3)) { + u2 = true; + break; + } + if (u2) { + let u3 = o.S.getStore(); + if (u3) { + if ("prerender" === u3.type) + return function(e3, t3, r3) { + let o2 = h.get(e3); + if (o2) + return o2; + let i2 = (0, s.R)(r3.renderSignal, "`params`"); + return h.set(e3, i2), Object.keys(e3).forEach((e4) => { + a.BE.has(e4) || Object.defineProperty(i2, e4, { get() { + let o3 = (0, a.N5)("params", e4), i3 = Error(`Route "${t3}" used ${o3}. \`params\` is now a Promise and should be \`awaited\` before accessing param values. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-params`); + (0, n.SD)(t3, o3, i3, r3); + }, set(t4) { + Object.defineProperty(i2, e4, { value: t4, writable: true, enumerable: true }); + }, enumerable: true, configurable: true }); + }), i2; + }(e2, t2.route, u3); + if ("prerender-legacy" === u3.type || "prerender-ppr" === u3.type) + return function(e3, t3, r3, o2) { + let i2 = h.get(e3); + if (i2) + return i2; + let s2 = { ...e3 }, u4 = Promise.resolve(s2); + return h.set(e3, u4), Object.keys(e3).forEach((i3) => { + a.BE.has(i3) || (t3.has(i3) ? (Object.defineProperty(s2, i3, { get() { + let e4 = (0, a.N5)("params", i3); + "prerender-ppr" === o2.type ? (0, n.$T)(r3.route, e4, o2.dynamicTracking) : (0, n.j6)(e4, r3, o2); + }, enumerable: true }), Object.defineProperty(u4, i3, { get() { + let e4 = (0, a.N5)("params", i3); + "prerender-ppr" === o2.type ? (0, n.$T)(r3.route, e4, o2.dynamicTracking) : (0, n.j6)(e4, r3, o2); + }, set(e4) { + Object.defineProperty(u4, i3, { value: e4, writable: true, enumerable: true }); + }, enumerable: true, configurable: true })) : u4[i3] = e3[i3]); + }), u4; + }(e2, r2, t2, u3); + } + throw new i.e("createPrerenderParams called without a prerenderStore in scope. This is a bug in Next.js"); + } + } + return y(e2); + } + let h = /* @__PURE__ */ new WeakMap(); + function y(e2) { + let t2 = h.get(e2); + if (t2) + return t2; + let r2 = Promise.resolve(e2); + return h.set(e2, r2), Object.keys(e2).forEach((t3) => { + a.BE.has(t3) || (r2[t3] = e2[t3]); + }), r2; + } + (0, u.R)(function(e2, t2) { + let r2 = e2 ? ` In route ${e2} a ` : "A "; + return Error(`${r2}param property was accessed directly with ${t2}. \`params\` should be awaited before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + }), (0, u.R)(function(e2, t2) { + let r2 = e2 ? ` In route ${e2} ` : ""; + if (!t2.length) + return Error(`${r2}params are being enumerated. \`params\` should be awaited before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + { + let e3 = function(e4) { + switch (e4.length) { + case 0: + throw new i.e("Expected describeListOfPropertyNames to be called with a non-empty list of strings."); + case 1: + return `\`${e4[0]}\``; + case 2: + return `\`${e4[0]}\` and \`${e4[1]}\``; + default: { + let t3 = ""; + for (let r3 = 0; r3 < e4.length - 1; r3++) + t3 += `\`${e4[r3]}\`, `; + return t3 + `, and \`${e4[e4.length - 1]}\``; + } + } + }(t2); + return Error(`${r2}params are being enumerated incompletely missing these properties: ${e3}. \`params\` should be awaited before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + } + }); + }; + __namedExportsObject4["__chunk_8155"] = (e, t, r) => { + "use strict"; + let n; + r.d(t, { MU: () => c, Yz: () => S }); + var o = r(83748), i = r(85820); + let { context: a, propagation: s, trace: u, SpanStatusCode: l, SpanKind: c, ROOT_CONTEXT: f } = n = r(65151); + class d extends Error { + constructor(e2, t2) { + super(), this.bubble = e2, this.result = t2; + } + } + let p = (e2, t2) => { + (function(e3) { + return "object" == typeof e3 && null !== e3 && e3 instanceof d; + })(t2) && t2.bubble ? e2.setAttribute("next.bubble", true) : (t2 && e2.recordException(t2), e2.setStatus({ code: l.ERROR, message: null == t2 ? void 0 : t2.message })), e2.end(); + }, h = /* @__PURE__ */ new Map(), y = n.createContextKey("next.rootSpanId"), g = 0, v = () => g++, m = { set(e2, t2, r2) { + e2.push({ key: t2, value: r2 }); + } }; + class b { + getTracerInstance() { + return u.getTracer("next.js", "0.0.1"); + } + getContext() { + return a; + } + getTracePropagationData() { + let e2 = a.active(), t2 = []; + return s.inject(e2, t2, m), t2; + } + getActiveScopeSpan() { + return u.getSpan(null == a ? void 0 : a.active()); + } + withPropagatedContext(e2, t2, r2) { + let n2 = a.active(); + if (u.getSpanContext(n2)) + return t2(); + let o2 = s.extract(n2, e2, r2); + return a.with(o2, t2); + } + trace(...e2) { + var t2; + let [r2, n2, s2] = e2, { fn: l2, options: c2 } = "function" == typeof n2 ? { fn: n2, options: {} } : { fn: s2, options: { ...n2 } }, d2 = c2.spanName ?? r2; + if (!o.lw.includes(r2) && "1" !== 0 || c2.hideSpan) + return l2(); + let g2 = this.getSpanContext((null == c2 ? void 0 : c2.parentSpan) ?? this.getActiveScopeSpan()), m2 = false; + g2 ? (null == (t2 = u.getSpanContext(g2)) ? void 0 : t2.isRemote) && (m2 = true) : (g2 = (null == a ? void 0 : a.active()) ?? f, m2 = true); + let b2 = v(); + return c2.attributes = { "next.span_name": d2, "next.span_type": r2, ...c2.attributes }, a.with(g2.setValue(y, b2), () => this.getTracerInstance().startActiveSpan(d2, c2, (e3) => { + let t3 = "performance" in globalThis2 && "measure" in performance ? globalThis2.performance.now() : void 0, n3 = () => { + h.delete(b2), t3 && ""; + }; + m2 && h.set(b2, new Map(Object.entries(c2.attributes ?? {}))); + try { + if (l2.length > 1) + return l2(e3, (t5) => p(e3, t5)); + let t4 = l2(e3); + if ((0, i.J)(t4)) + return t4.then((t5) => (e3.end(), t5)).catch((t5) => { + throw p(e3, t5), t5; + }).finally(n3); + return e3.end(), n3(), t4; + } catch (t4) { + throw p(e3, t4), n3(), t4; + } + })); + } + wrap(...e2) { + let t2 = this, [r2, n2, i2] = 3 === e2.length ? e2 : [e2[0], {}, e2[1]]; + return o.lw.includes(r2) || "1" === 0 ? function() { + let e3 = n2; + "function" == typeof e3 && "function" == typeof i2 && (e3 = e3.apply(this, arguments)); + let o2 = arguments.length - 1, s2 = arguments[o2]; + if ("function" != typeof s2) + return t2.trace(r2, e3, () => i2.apply(this, arguments)); + { + let n3 = t2.getContext().bind(a.active(), s2); + return t2.trace(r2, e3, (e4, t3) => (arguments[o2] = function(e5) { + return null == t3 || t3(e5), n3.apply(this, arguments); + }, i2.apply(this, arguments))); + } + } : i2; + } + startSpan(...e2) { + let [t2, r2] = e2, n2 = this.getSpanContext((null == r2 ? void 0 : r2.parentSpan) ?? this.getActiveScopeSpan()); + return this.getTracerInstance().startSpan(t2, r2, n2); + } + getSpanContext(e2) { + return e2 ? u.setSpan(a.active(), e2) : void 0; + } + getRootSpanAttributes() { + let e2 = a.active().getValue(y); + return h.get(e2); + } + setRootSpanAttribute(e2, t2) { + let r2 = a.active().getValue(y), n2 = h.get(r2); + n2 && n2.set(e2, t2); + } + } + let S = (() => { + let e2 = new b(); + return () => e2; + })(); + }; + __namedExportsObject4["__chunk_83748"] = (e, t, r) => { + "use strict"; + var n, o, i, a, s, u, l, c, f, d, p, h; + r.d(t, { PB: () => d, Xy: () => a, _s: () => p, dI: () => h, hT: () => g, k0: () => l, lw: () => y }), function(e2) { + e2.handleRequest = "BaseServer.handleRequest", e2.run = "BaseServer.run", e2.pipe = "BaseServer.pipe", e2.getStaticHTML = "BaseServer.getStaticHTML", e2.render = "BaseServer.render", e2.renderToResponseWithComponents = "BaseServer.renderToResponseWithComponents", e2.renderToResponse = "BaseServer.renderToResponse", e2.renderToHTML = "BaseServer.renderToHTML", e2.renderError = "BaseServer.renderError", e2.renderErrorToResponse = "BaseServer.renderErrorToResponse", e2.renderErrorToHTML = "BaseServer.renderErrorToHTML", e2.render404 = "BaseServer.render404"; + }(n || (n = {})), function(e2) { + e2.loadDefaultErrorComponents = "LoadComponents.loadDefaultErrorComponents", e2.loadComponents = "LoadComponents.loadComponents"; + }(o || (o = {})), function(e2) { + e2.getRequestHandler = "NextServer.getRequestHandler", e2.getServer = "NextServer.getServer", e2.getServerRequestHandler = "NextServer.getServerRequestHandler", e2.createServer = "createServer.createServer"; + }(i || (i = {})), function(e2) { + e2.compression = "NextNodeServer.compression", e2.getBuildId = "NextNodeServer.getBuildId", e2.createComponentTree = "NextNodeServer.createComponentTree", e2.clientComponentLoading = "NextNodeServer.clientComponentLoading", e2.getLayoutOrPageModule = "NextNodeServer.getLayoutOrPageModule", e2.generateStaticRoutes = "NextNodeServer.generateStaticRoutes", e2.generateFsStaticRoutes = "NextNodeServer.generateFsStaticRoutes", e2.generatePublicRoutes = "NextNodeServer.generatePublicRoutes", e2.generateImageRoutes = "NextNodeServer.generateImageRoutes.route", e2.sendRenderResult = "NextNodeServer.sendRenderResult", e2.proxyRequest = "NextNodeServer.proxyRequest", e2.runApi = "NextNodeServer.runApi", e2.render = "NextNodeServer.render", e2.renderHTML = "NextNodeServer.renderHTML", e2.imageOptimizer = "NextNodeServer.imageOptimizer", e2.getPagePath = "NextNodeServer.getPagePath", e2.getRoutesManifest = "NextNodeServer.getRoutesManifest", e2.findPageComponents = "NextNodeServer.findPageComponents", e2.getFontManifest = "NextNodeServer.getFontManifest", e2.getServerComponentManifest = "NextNodeServer.getServerComponentManifest", e2.getRequestHandler = "NextNodeServer.getRequestHandler", e2.renderToHTML = "NextNodeServer.renderToHTML", e2.renderError = "NextNodeServer.renderError", e2.renderErrorToHTML = "NextNodeServer.renderErrorToHTML", e2.render404 = "NextNodeServer.render404", e2.startResponse = "NextNodeServer.startResponse", e2.route = "route", e2.onProxyReq = "onProxyReq", e2.apiResolver = "apiResolver", e2.internalFetch = "internalFetch"; + }(a || (a = {})), (s || (s = {})).startServer = "startServer.startServer", function(e2) { + e2.getServerSideProps = "Render.getServerSideProps", e2.getStaticProps = "Render.getStaticProps", e2.renderToString = "Render.renderToString", e2.renderDocument = "Render.renderDocument", e2.createBodyResult = "Render.createBodyResult"; + }(u || (u = {})), function(e2) { + e2.renderToString = "AppRender.renderToString", e2.renderToReadableStream = "AppRender.renderToReadableStream", e2.getBodyResult = "AppRender.getBodyResult", e2.fetch = "AppRender.fetch"; + }(l || (l = {})), (c || (c = {})).executeRoute = "Router.executeRoute", (f || (f = {})).runHandler = "Node.runHandler", (d || (d = {})).runHandler = "AppRouteRouteHandlers.runHandler", function(e2) { + e2.generateMetadata = "ResolveMetadata.generateMetadata", e2.generateViewport = "ResolveMetadata.generateViewport"; + }(p || (p = {})), (h || (h = {})).execute = "Middleware.execute"; + let y = ["Middleware.execute", "BaseServer.handleRequest", "Render.getServerSideProps", "Render.getStaticProps", "AppRender.fetch", "AppRender.getBodyResult", "Render.renderDocument", "Node.runHandler", "AppRouteRouteHandlers.runHandler", "ResolveMetadata.generateMetadata", "ResolveMetadata.generateViewport", "NextNodeServer.createComponentTree", "NextNodeServer.findPageComponents", "NextNodeServer.getLayoutOrPageModule", "NextNodeServer.startResponse", "NextNodeServer.clientComponentLoading"], g = ["NextNodeServer.findPageComponents", "NextNodeServer.createComponentTree", "NextNodeServer.clientComponentLoading"]; + }; + __namedExportsObject4["__chunk_88420"] = (e, t, r) => { + "use strict"; + r.d(t, { XH: () => g, Z6: () => p, ny: () => h }); + var n = r(83748), o = r(8155), i = r(12758), a = r(12991), s = r(45933), u = r(23034), l = r(5099), c = r(51388), f = r(26195).Buffer; + let d = Symbol.for("next-patch"); + function p(e2, t2) { + try { + let r2; + if (false === e2) + r2 = i.Gl; + else if ("number" == typeof e2 && !isNaN(e2) && e2 > -1) + r2 = e2; + else if (void 0 !== e2) + throw Error(`Invalid revalidate value "${e2}" on "${t2}", must be a non-negative number or false`); + return r2; + } catch (e3) { + if (e3 instanceof Error && e3.message.includes("Invalid revalidate")) + throw e3; + return; + } + } + function h(e2, t2) { + let r2 = [], n2 = []; + for (let o2 = 0; o2 < e2.length; o2++) { + let a2 = e2[o2]; + if ("string" != typeof a2 ? n2.push({ tag: a2, reason: "invalid type, must be a string" }) : a2.length > i.Ho ? n2.push({ tag: a2, reason: `exceeded max length of ${i.Ho}` }) : r2.push(a2), r2.length > i.cv) { + console.warn(`Warning: exceeded max tag count for ${t2}, dropped tags:`, e2.slice(o2).join(", ")); + break; + } + } + if (n2.length > 0) + for (let { tag: e3, reason: r3 } of (console.warn(`Warning: invalid tags passed to ${t2}: `), n2)) + console.log(`tag: "${e3}" ${r3}`); + return r2; + } + function y(e2, t2) { + var r2; + e2 && (null == (r2 = e2.requestEndedState) || !r2.ended) && (process.env.NEXT_DEBUG_BUILD || "1" === process.env.NEXT_SSG_FETCH_METRICS) && e2.isStaticGeneration && (e2.fetchMetrics ??= [], e2.fetchMetrics.push({ ...t2, end: performance.timeOrigin + performance.now(), idx: e2.nextFetchId || 0 })); + } + function g(e2) { + if (true === globalThis2[d]) + return; + let t2 = function(e3) { + let t3 = u.cache((e4) => []); + return function(r2, n2) { + let o2, i2, a2; + if (n2 && n2.signal) + return e3(r2, n2); + if ("string" != typeof r2 || n2) { + let t4 = "string" == typeof r2 || r2 instanceof URL ? new Request(r2, n2) : r2; + if ("GET" !== t4.method && "HEAD" !== t4.method || t4.keepalive) + return e3(r2, n2); + i2 = JSON.stringify([t4.method, Array.from(t4.headers.entries()), null, t4.redirect, null, t4.referrer, t4.referrerPolicy, null]), o2 = t4.url; + } else + i2 = '["GET",[],null,"follow",null,null,null,null]', o2 = r2; + let s2 = t3(o2); + if (0 === s2.length) + a2 = e3(r2, n2), s2.push(i2, a2); + else { + for (let e4 = 0, t4 = s2.length; e4 < t4; e4 += 2) { + let t5 = s2[e4], r3 = s2[e4 + 1]; + if (t5 === i2) + return (a2 = r3).then((e5) => e5.clone()); + } + a2 = e3(r2, n2), s2.push(i2, a2); + } + return a2.then((e4) => e4.clone()); + }; + }(globalThis2.fetch); + globalThis2.fetch = function(e3, { workAsyncStorage: t3, workUnitAsyncStorage: r2 }) { + let u2 = async (u3, d2) => { + var g2, v; + let m; + try { + (m = new URL(u3 instanceof Request ? u3.url : u3)).username = "", m.password = ""; + } catch { + m = void 0; + } + let b = (null == m ? void 0 : m.href) ?? "", S = (null == d2 ? void 0 : null == (g2 = d2.method) ? void 0 : g2.toUpperCase()) || "GET", w = (null == d2 ? void 0 : null == (v = d2.next) ? void 0 : v.internal) === true, x = false, E = w ? void 0 : performance.timeOrigin + performance.now(), _ = t3.getStore(), C = r2.getStore(), R = C && "prerender" === C.type ? C.cacheSignal : null; + R && R.beginRead(); + let A = (0, o.Yz)().trace(w ? n.Xy.internalFetch : n.k0.fetch, { hideSpan: x, kind: o.MU.CLIENT, spanName: ["fetch", S, b].filter(Boolean).join(" "), attributes: { "http.url": b, "http.method": S, "net.peer.name": null == m ? void 0 : m.hostname, "net.peer.port": (null == m ? void 0 : m.port) || void 0 } }, async () => { + var t4; + let r3, n2, o2, g3; + if (w || !_ || _.isDraftMode) + return e3(u3, d2); + let v2 = u3 && "object" == typeof u3 && "string" == typeof u3.method, m2 = (e4) => (null == d2 ? void 0 : d2[e4]) || (v2 ? u3[e4] : null), S2 = (e4) => { + var t5, r4, n3; + return void 0 !== (null == d2 ? void 0 : null == (t5 = d2.next) ? void 0 : t5[e4]) ? null == d2 ? void 0 : null == (r4 = d2.next) ? void 0 : r4[e4] : v2 ? null == (n3 = u3.next) ? void 0 : n3[e4] : void 0; + }, x2 = S2("revalidate"), A2 = h(S2("tags") || [], `fetch ${u3.toString()}`); + if (C && ("cache" === C.type || "prerender" === C.type || "prerender-ppr" === C.type || "prerender-legacy" === C.type) && Array.isArray(A2)) { + let e4 = C.tags ?? (C.tags = []); + for (let t5 of A2) + e4.includes(t5) || e4.push(t5); + } + let k = C && "unstable-cache" !== C.type ? C.implicitTags : [], T = C && "unstable-cache" === C.type ? "force-no-store" : _.fetchCache, P = !!_.isUnstableNoStore, $ = m2("cache"), O = ""; + "string" == typeof $ && void 0 !== x2 && (v2 && "default" === $ || (r3 = `Specified "cache: ${$}" and "revalidate: ${x2}", only one should be specified.`), $ = void 0), "force-cache" === $ ? x2 = false : ("no-cache" === $ || "no-store" === $ || "force-no-store" === T || "only-no-store" === T || !T && _.forceDynamic) && (x2 = 0), ("no-cache" === $ || "no-store" === $) && (O = `cache: ${$}`), g3 = p(x2, _.route); + let N = m2("headers"), j = "function" == typeof (null == N ? void 0 : N.get) ? N : new Headers(N || {}), I = j.get("authorization") || j.get("cookie"), L = !["get", "head"].includes((null == (t4 = m2("method")) ? void 0 : t4.toLowerCase()) || "get"), M = C && ("cache" === C.type || "prerender" === C.type || "prerender-ppr" === C.type || "prerender-legacy" === C.type) ? C : void 0, D = void 0 == T && (void 0 == $ || "default" === $) && void 0 == x2, U = D && !_.isPrerendering || (I || L) && M && 0 === M.revalidate; + if (D && void 0 !== C && "prerender" === C.type) + return R && (R.endRead(), R = null), (0, s.R)(C.renderSignal, "fetch()"); + switch (T) { + case "force-no-store": + O = "fetchCache = force-no-store"; + break; + case "only-no-store": + if ("force-cache" === $ || void 0 !== g3 && g3 > 0) + throw Error(`cache: 'force-cache' used on fetch for ${b} with 'export const fetchCache = 'only-no-store'`); + O = "fetchCache = only-no-store"; + break; + case "only-cache": + if ("no-store" === $) + throw Error(`cache: 'no-store' used on fetch for ${b} with 'export const fetchCache = 'only-cache'`); + break; + case "force-cache": + (void 0 === x2 || 0 === x2) && (O = "fetchCache = force-cache", g3 = i.Gl); + } + if (void 0 === g3 ? "default-cache" !== T || P ? "default-no-store" === T ? (g3 = 0, O = "fetchCache = default-no-store") : P ? (g3 = 0, O = "noStore call") : U ? (g3 = 0, O = "auto no cache") : (O = "auto cache", g3 = M ? M.revalidate : i.Gl) : (g3 = i.Gl, O = "fetchCache = default-cache") : O || (O = `revalidate: ${g3}`), !(_.forceStatic && 0 === g3) && !U && M && g3 < M.revalidate) { + if (0 === g3) { + if (C && "prerender" === C.type) + return R && (R.endRead(), R = null), (0, s.R)(C.renderSignal, "fetch()"); + (0, a.Zk)(_, C, `revalidate: 0 fetch ${u3} ${_.route}`); + } + M && (M.revalidate = g3); + } + let H = "number" == typeof g3 && g3 > 0, { incrementalCache: B } = _, q = void 0 !== C && "request" === C.type ? C : void 0; + if (B && (H || (null == q ? void 0 : q.serverComponentsHmrCache))) + try { + n2 = await B.generateCacheKey(b, v2 ? u3 : d2); + } catch (e4) { + console.error("Failed to generate cache key for", u3); + } + let F = _.nextFetchId ?? 1; + _.nextFetchId = F + 1; + let G = () => Promise.resolve(), W = async (t5, o3) => { + let a2 = ["credentials", "headers", "integrity", "keepalive", "method", "mode", "redirect", "referrer", "referrerPolicy", "window", "duplex", ...t5 ? [] : ["signal"]]; + if (v2) { + let e4 = u3, t6 = { body: e4._ogBody || e4.body }; + for (let r4 of a2) + t6[r4] = e4[r4]; + u3 = new Request(e4.url, t6); + } else if (d2) { + let { _ogBody: e4, body: r4, signal: n3, ...o4 } = d2; + d2 = { ...o4, body: e4 || r4, signal: t5 ? void 0 : n3 }; + } + let s2 = { ...d2, next: { ...null == d2 ? void 0 : d2.next, fetchType: "origin", fetchIdx: F } }; + return e3(u3, s2).then(async (e4) => { + if (!t5 && E && y(_, { start: E, url: b, cacheReason: o3 || O, cacheStatus: 0 === g3 || o3 ? "skip" : "miss", cacheWarning: r3, status: e4.status, method: s2.method || "GET" }), 200 === e4.status && B && n2 && (H || (null == q ? void 0 : q.serverComponentsHmrCache))) { + let t6 = g3 >= i.Gl ? i.BR : g3, r4 = !(g3 >= i.Gl) && g3; + if (!C || "prerender" !== C.type) + return e4.clone().arrayBuffer().then(async (o4) => { + var i2; + let a3 = f.from(o4), s3 = { headers: Object.fromEntries(e4.headers.entries()), body: a3.toString("base64"), status: e4.status, url: e4.url }; + null == q || null == (i2 = q.serverComponentsHmrCache) || i2.set(n2, s3), H && await B.set(n2, { kind: l.HD.FETCH, data: s3, revalidate: t6 }, { fetchCache: true, revalidate: r4, fetchUrl: b, fetchIdx: F, tags: A2 }); + }).catch((e5) => console.warn("Failed to set fetch cache", u3, e5)).finally(G), e4; + { + let o4 = await e4.arrayBuffer(), i2 = { headers: Object.fromEntries(e4.headers.entries()), body: f.from(o4).toString("base64"), status: e4.status, url: e4.url }; + return await B.set(n2, { kind: l.HD.FETCH, data: i2, revalidate: t6 }, { fetchCache: true, revalidate: r4, fetchUrl: b, fetchIdx: F, tags: A2 }), await G(), new Response(o4, { headers: e4.headers, status: e4.status, statusText: e4.statusText }); + } + } + return await G(), e4; + }); + }, V = false, z = false; + if (n2 && B) { + let e4; + if ((null == q ? void 0 : q.isHmrRefresh) && q.serverComponentsHmrCache && (e4 = q.serverComponentsHmrCache.get(n2), z = true), H && !e4) { + G = await B.lock(n2); + let t5 = _.isOnDemandRevalidate ? null : await B.get(n2, { kind: l.i7.FETCH, revalidate: g3, fetchUrl: b, fetchIdx: F, tags: A2, softTags: k, isFallback: false }); + D && C && "prerender" === C.type && await (0, c.ux)(), t5 ? await G() : o2 = "cache-control: no-cache (hard refresh)", (null == t5 ? void 0 : t5.value) && t5.value.kind === l.HD.FETCH && (_.isRevalidate && t5.isStale ? V = true : (t5.isStale && (_.pendingRevalidates ??= {}, _.pendingRevalidates[n2] || (_.pendingRevalidates[n2] = W(true).catch(console.error).finally(() => { + _.pendingRevalidates ??= {}, delete _.pendingRevalidates[n2 || ""]; + }))), e4 = t5.value.data)); + } + if (e4) { + E && y(_, { start: E, url: b, cacheReason: O, cacheStatus: z ? "hmr" : "hit", cacheWarning: r3, status: e4.status || 200, method: (null == d2 ? void 0 : d2.method) || "GET" }); + let t5 = new Response(f.from(e4.body, "base64"), { headers: e4.headers, status: e4.status }); + return Object.defineProperty(t5, "url", { value: e4.url }), t5; + } + } + if (_.isStaticGeneration && d2 && "object" == typeof d2) { + let { cache: e4 } = d2; + if (delete d2.cache, "no-store" === e4) { + if (C && "prerender" === C.type) + return R && (R.endRead(), R = null), (0, s.R)(C.renderSignal, "fetch()"); + (0, a.Zk)(_, C, `no-store fetch ${u3} ${_.route}`); + } + let t5 = "next" in d2, { next: r4 = {} } = d2; + if ("number" == typeof r4.revalidate && M && r4.revalidate < M.revalidate) { + if (0 === r4.revalidate) { + if (C && "prerender" === C.type) + return (0, s.R)(C.renderSignal, "fetch()"); + (0, a.Zk)(_, C, `revalidate: 0 fetch ${u3} ${_.route}`); + } + _.forceStatic && 0 === r4.revalidate || (M.revalidate = r4.revalidate); + } + t5 && delete d2.next; + } + if (!n2 || !V) + return W(false, o2); + { + let e4 = n2; + _.pendingRevalidates ??= {}; + let t5 = _.pendingRevalidates[e4]; + if (t5) { + let e5 = await t5; + return new Response(e5.body, { headers: e5.headers, status: e5.status, statusText: e5.statusText }); + } + let r4 = W(true, o2), i2 = r4.then(async (e5) => { + let t6 = e5.clone(); + return { body: await t6.arrayBuffer(), headers: t6.headers, status: t6.status, statusText: t6.statusText }; + }).finally(() => { + var t6; + (null == (t6 = _.pendingRevalidates) ? void 0 : t6[e4]) && delete _.pendingRevalidates[e4]; + }); + return i2.catch(() => { + }), _.pendingRevalidates[e4] = i2, r4; + } + }); + if (R) + try { + return await A; + } finally { + R && R.endRead(); + } + return A; + }; + return u2.__nextPatched = true, u2.__nextGetStaticStore = () => t3, u2._nextOriginalFetch = e3, globalThis2[d] = true, u2; + }(t2, e2); + } + }; + __namedExportsObject4["__chunk_76851"] = (e, t, r) => { + "use strict"; + r.d(t, { Ag: () => i, CK: () => a, Wz: () => o }); + var n = r(54889); + let o = ["(..)(..)", "(.)", "(..)", "(...)"]; + function i(e2) { + return void 0 !== e2.split("/").find((e3) => o.find((t2) => e3.startsWith(t2))); + } + function a(e2) { + let t2, r2, i2; + for (let n2 of e2.split("/")) + if (r2 = o.find((e3) => n2.startsWith(e3))) { + [t2, i2] = e2.split(r2, 2); + break; + } + if (!t2 || !r2 || !i2) + throw Error(`Invalid interception route: ${e2}. Must be in the format //(..|...|..)(..)/`); + switch (t2 = (0, n.w)(t2), r2) { + case "(.)": + i2 = "/" === t2 ? `/${i2}` : t2 + "/" + i2; + break; + case "(..)": + if ("/" === t2) + throw Error(`Invalid interception route: ${e2}. Cannot use (..) marker at the root level, use (.) instead.`); + i2 = t2.split("/").slice(0, -1).concat(i2).join("/"); + break; + case "(...)": + i2 = "/" + i2; + break; + case "(..)(..)": + let a2 = t2.split("/"); + if (a2.length <= 2) + throw Error(`Invalid interception route: ${e2}. Cannot use (..)(..) marker at the root level or one level up.`); + i2 = a2.slice(0, -2).concat(i2).join("/"); + break; + default: + throw Error("Invariant: unexpected marker"); + } + return { interceptingRoute: t2, interceptedRoute: i2 }; + } + }; + __namedExportsObject4["__chunk_45933"] = (e, t, r) => { + "use strict"; + function n(e2, t2) { + let r2 = new Promise((r3, n2) => { + e2.addEventListener("abort", () => { + n2(Error(`During prerendering, ${t2} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${t2} to a different context by using \`setTimeout\`, \`unstable_after\`, or similar functions you may observe this error and you should handle it in that context.`)); + }); + }); + return r2.catch(() => { + }), r2; + } + r.d(t, { R: () => n }); + }; + __namedExportsObject4["__chunk_85491"] = (e, t, r) => { + "use strict"; + r.d(t, { R: () => i }); + var n = r(23034); + let o = { current: null }; + function i(e2) { + return function(...t2) { + console.error(e2(...t2)); + }; + } + ("function" == typeof n.cache ? n.cache : (e2) => e2)((e2) => { + try { + console.error(o.current); + } finally { + o.current = null; + } + }); + }; + __namedExportsObject4["__chunk_12991"] = (e, t, r) => { + "use strict"; + r.d(t, { hQ: () => h, SD: () => p, Lb: () => S, q_: () => u, TY: () => l, GZ: () => b, Zk: () => c, $T: () => y, j6: () => f, tS: () => d }); + var n = r(23034), o = r(88334), i = r(87915), a = r(49216); + r(57418); + let s = "function" == typeof n.unstable_postpone; + function u(e2) { + return { isDebugDynamicAccesses: e2, dynamicAccesses: [], syncDynamicExpression: void 0, syncDynamicErrorWithStack: null }; + } + function l(e2) { + var t2; + return null == (t2 = e2.dynamicAccesses[0]) ? void 0 : t2.expression; + } + function c(e2, t2, r2) { + if ((!t2 || "cache" !== t2.type && "unstable-cache" !== t2.type) && !e2.forceDynamic && !e2.forceStatic) { + if (e2.dynamicShouldError) + throw new i.G(`Route ${e2.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${r2}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`); + if (t2) { + if ("prerender-ppr" === t2.type) + y(e2.route, r2, t2.dynamicTracking); + else if ("prerender-legacy" === t2.type) { + t2.revalidate = 0; + let n2 = new o.DynamicServerError(`Route ${e2.route} couldn't be rendered statically because it used ${r2}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`); + throw e2.dynamicUsageDescription = r2, e2.dynamicUsageStack = n2.stack, n2; + } + } + } + } + function f(e2, t2, r2) { + let n2 = new o.DynamicServerError(`Route ${t2.route} couldn't be rendered statically because it used \`${e2}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`); + throw r2.revalidate = 0, t2.dynamicUsageDescription = e2, t2.dynamicUsageStack = n2.stack, n2; + } + function d(e2, t2) { + t2 && "cache" !== t2.type && "unstable-cache" !== t2.type && ("prerender" === t2.type || "prerender-legacy" === t2.type) && (t2.revalidate = 0); + } + function p(e2, t2, r2, n2) { + let o2 = n2.dynamicTracking; + throw o2 && null === o2.syncDynamicErrorWithStack && (o2.syncDynamicExpression = t2, o2.syncDynamicErrorWithStack = r2), function(e3, t3, r3) { + let n3 = m(`Route ${e3} needs to bail out of prerendering at this point because it used ${t3}.`); + r3.controller && r3.controller.abort(n3); + let o3 = r3.dynamicTracking; + o3 && o3.dynamicAccesses.push({ stack: o3.isDebugDynamicAccesses ? Error().stack : void 0, expression: t3 }); + }(e2, t2, n2), m(`Route ${e2} needs to bail out of prerendering at this point because it used ${t2}.`); + } + function h({ reason: e2, route: t2 }) { + let r2 = a.S.getStore(); + y(t2, e2, r2 && "prerender-ppr" === r2.type ? r2.dynamicTracking : null); + } + function y(e2, t2, r2) { + (function() { + if (!s) + throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"); + })(), r2 && r2.dynamicAccesses.push({ stack: r2.isDebugDynamicAccesses ? Error().stack : void 0, expression: t2 }), n.unstable_postpone(g(e2, t2)); + } + function g(e2, t2) { + return `Route ${e2} needs to bail out of prerendering at this point because it used ${t2}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`; + } + if (false === function(e2) { + return e2.includes("needs to bail out of prerendering at this point because it used") && e2.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error"); + }(g("%%%", "^^^"))) + throw Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"); + let v = "NEXT_PRERENDER_INTERRUPTED"; + function m(e2) { + let t2 = Error(e2); + return t2.digest = v, t2; + } + function b(e2) { + return "object" == typeof e2 && null !== e2 && e2.digest === v && "name" in e2 && "message" in e2 && e2 instanceof Error; + } + function S(e2, t2) { + let r2 = t2.dynamicTracking; + r2 && r2.dynamicAccesses.push({ stack: r2.isDebugDynamicAccesses ? Error().stack : void 0, expression: e2 }); + } + RegExp(`\\n\\s+at __next_metadata_boundary__[\\n\\s]`), RegExp(`\\n\\s+at __next_viewport_boundary__[\\n\\s]`), RegExp(`\\n\\s+at __next_outlet_boundary__[\\n\\s]`); + }; + __namedExportsObject4["__chunk_51388"] = (e, t, r) => { + "use strict"; + r.d(t, { Rk: () => n, ux: () => o }); + let n = (e2) => { + setTimeout(e2, 0); + }; + function o() { + return new Promise((e2) => setTimeout(e2, 0)); + } + }; + __namedExportsObject4["__chunk_12758"] = (e, t, r) => { + "use strict"; + r.d(t, { Ar: () => d, BR: () => b, EX: () => c, Et: () => f, Gl: () => S, Ho: () => g, JT: () => l, Qq: () => a, Sx: () => s, X_: () => h, cv: () => y, dN: () => n, hd: () => u, of: () => p, u7: () => o, ux: () => v, y3: () => i, zt: () => m }); + let n = "nxtP", o = "nxtI", i = "x-prerender-revalidate", a = "x-prerender-revalidate-if-generated", s = ".prefetch.rsc", u = ".rsc", l = ".json", c = ".meta", f = "x-next-cache-tags", d = "x-next-cache-soft-tags", p = "x-next-revalidated-tags", h = "x-next-revalidate-tag-token", y = 64, g = 256, v = 1024, m = "_N_T_", b = 31536e3, S = 4294967294, w = { shared: "shared", reactServerComponents: "rsc", serverSideRendering: "ssr", actionBrowser: "action-browser", api: "api", middleware: "middleware", instrument: "instrument", edgeAsset: "edge-asset", appPagesBrowser: "app-pages-browser", appMetadataRoute: "app-metadata-route" }; + ({ ...w, GROUP: { builtinReact: [w.reactServerComponents, w.actionBrowser, w.appMetadataRoute], serverOnly: [w.reactServerComponents, w.actionBrowser, w.appMetadataRoute, w.instrument, w.middleware], neutralTarget: [w.api], clientOnly: [w.serverSideRendering, w.appPagesBrowser], bundled: [w.reactServerComponents, w.actionBrowser, w.appMetadataRoute, w.serverSideRendering, w.appPagesBrowser, w.shared, w.instrument], appPages: [w.reactServerComponents, w.serverSideRendering, w.appPagesBrowser, w.actionBrowser] } }); + }; + __namedExportsObject4["__chunk_87915"] = (e, t, r) => { + "use strict"; + r.d(t, { G: () => n }); + class n extends Error { + constructor(...e2) { + super(...e2), this.code = "NEXT_STATIC_GEN_BAILOUT"; + } + } + }; + __namedExportsObject4["__chunk_51182"] = (e, t, r) => { + "use strict"; + r.d(t, { X: () => i, v: () => o }); + let n = "NEXT_NOT_FOUND"; + function o() { + let e2 = Error(n); + throw e2.digest = n, e2; + } + function i(e2) { + return "object" == typeof e2 && null !== e2 && "digest" in e2 && e2.digest === n; + } + }; + __namedExportsObject4["__chunk_88334"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { DynamicServerError: () => o, isDynamicServerError: () => i }); + let n = "DYNAMIC_SERVER_USAGE"; + class o extends Error { + constructor(e2) { + super("Dynamic server usage: " + e2), this.description = e2, this.digest = n; + } + } + function i(e2) { + return "object" == typeof e2 && null !== e2 && "digest" in e2 && "string" == typeof e2.digest && e2.digest === n; + } + }; + __namedExportsObject4["__chunk_56225"] = (e, t, r) => { + "use strict"; + r.d(t, { Dl: () => i, H4: () => a, fI: () => n, qw: () => o }); + let n = "Next-Action", o = "Next-Router-Prefetch", i = ["RSC", "Next-Router-State-Tree", o, "Next-HMR-Refresh", "Next-Router-Segment-Prefetch"], a = "_rsc"; + }; + __namedExportsObject4["__chunk_63861"] = (e, t, r) => { + "use strict"; + r.d(t, { D: () => n }); + let n = r(71676).QT; + }; + __namedExportsObject4["__chunk_9720"] = (e, t, r) => { + "use strict"; + var n; + r.d(t, { ZK: () => v, O4: () => b }); + let { env: o, stdout: i } = (null == (n = globalThis2) ? void 0 : n.process) ?? {}, a = o && !o.NO_COLOR && (o.FORCE_COLOR || (null == i ? void 0 : i.isTTY) && !o.CI && "dumb" !== o.TERM), s = (e2, t2, r2, n2) => { + let o2 = e2.substring(0, n2) + r2, i2 = e2.substring(n2 + t2.length), a2 = i2.indexOf(t2); + return ~a2 ? o2 + s(i2, t2, r2, a2) : o2 + i2; + }, u = (e2, t2, r2 = e2) => a ? (n2) => { + let o2 = "" + n2, i2 = o2.indexOf(t2, e2.length); + return ~i2 ? e2 + s(o2, t2, r2, i2) + t2 : e2 + o2 + t2; + } : String, l = u("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"); + u("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"), u("\x1B[3m", "\x1B[23m"), u("\x1B[4m", "\x1B[24m"), u("\x1B[7m", "\x1B[27m"), u("\x1B[8m", "\x1B[28m"), u("\x1B[9m", "\x1B[29m"), u("\x1B[30m", "\x1B[39m"); + let c = u("\x1B[31m", "\x1B[39m"), f = u("\x1B[32m", "\x1B[39m"), d = u("\x1B[33m", "\x1B[39m"); + u("\x1B[34m", "\x1B[39m"); + let p = u("\x1B[35m", "\x1B[39m"); + u("\x1B[38;2;173;127;168m", "\x1B[39m"), u("\x1B[36m", "\x1B[39m"); + let h = u("\x1B[37m", "\x1B[39m"); + u("\x1B[90m", "\x1B[39m"), u("\x1B[40m", "\x1B[49m"), u("\x1B[41m", "\x1B[49m"), u("\x1B[42m", "\x1B[49m"), u("\x1B[43m", "\x1B[49m"), u("\x1B[44m", "\x1B[49m"), u("\x1B[45m", "\x1B[49m"), u("\x1B[46m", "\x1B[49m"), u("\x1B[47m", "\x1B[49m"); + let y = { wait: h(l("\u25CB")), error: c(l("\u2A2F")), warn: d(l("\u26A0")), ready: "\u25B2", info: h(l(" ")), event: f(l("\u2713")), trace: p(l("\xBB")) }, g = { log: "log", warn: "warn", error: "error" }; + function v(...e2) { + !function(e3, ...t2) { + ("" === t2[0] || void 0 === t2[0]) && 1 === t2.length && t2.shift(); + let r2 = e3 in g ? g[e3] : "log", n2 = y[e3]; + 0 === t2.length ? console[r2]("") : console[r2](" " + n2, ...t2); + }("warn", ...e2); + } + let m = /* @__PURE__ */ new Set(); + function b(...e2) { + m.has(e2[0]) || (m.add(e2.join(" ")), v(...e2)); + } + }; + __namedExportsObject4["__chunk_23034"] = (e, t, r) => { + "use strict"; + e.exports = r(74980); + }; + __namedExportsObject4["__chunk_74980"] = (e, t) => { + "use strict"; + var r = { H: null, A: null }; + function n(e2) { + var t2 = "https://react.dev/errors/" + e2; + if (1 < arguments.length) { + t2 += "?args[]=" + encodeURIComponent(arguments[1]); + for (var r2 = 2; r2 < arguments.length; r2++) + t2 += "&args[]=" + encodeURIComponent(arguments[r2]); + } + return "Minified React error #" + e2 + "; visit " + t2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; + } + var o = Array.isArray, i = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), c = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), d = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), h = Symbol.iterator, y = Object.prototype.hasOwnProperty, g = Object.assign; + function v(e2, t2, r2, n2, o2, a2, s2) { + return { $$typeof: i, type: e2, key: t2, ref: void 0 !== (r2 = s2.ref) ? r2 : null, props: s2 }; + } + function m(e2) { + return "object" == typeof e2 && null !== e2 && e2.$$typeof === i; + } + var b = /\/+/g; + function S(e2, t2) { + var r2, n2; + return "object" == typeof e2 && null !== e2 && null != e2.key ? (r2 = "" + e2.key, n2 = { "=": "=0", ":": "=2" }, "$" + r2.replace(/[=:]/g, function(e3) { + return n2[e3]; + })) : t2.toString(36); + } + function w() { + } + function x(e2, t2, r2) { + if (null == e2) + return e2; + var s2 = [], u2 = 0; + return !function e3(t3, r3, s3, u3, l2) { + var c2, f2, d2, y2 = typeof t3; + ("undefined" === y2 || "boolean" === y2) && (t3 = null); + var g2 = false; + if (null === t3) + g2 = true; + else + switch (y2) { + case "bigint": + case "string": + case "number": + g2 = true; + break; + case "object": + switch (t3.$$typeof) { + case i: + case a: + g2 = true; + break; + case p: + return e3((g2 = t3._init)(t3._payload), r3, s3, u3, l2); + } + } + if (g2) + return l2 = l2(t3), g2 = "" === u3 ? "." + S(t3, 0) : u3, o(l2) ? (s3 = "", null != g2 && (s3 = g2.replace(b, "$&/") + "/"), e3(l2, r3, s3, "", function(e4) { + return e4; + })) : null != l2 && (m(l2) && (c2 = l2, f2 = s3 + (null == l2.key || t3 && t3.key === l2.key ? "" : ("" + l2.key).replace(b, "$&/") + "/") + g2, l2 = v(c2.type, f2, null, void 0, void 0, void 0, c2.props)), r3.push(l2)), 1; + g2 = 0; + var x2 = "" === u3 ? "." : u3 + ":"; + if (o(t3)) + for (var E2 = 0; E2 < t3.length; E2++) + y2 = x2 + S(u3 = t3[E2], E2), g2 += e3(u3, r3, s3, y2, l2); + else if ("function" == typeof (E2 = null === (d2 = t3) || "object" != typeof d2 ? null : "function" == typeof (d2 = h && d2[h] || d2["@@iterator"]) ? d2 : null)) + for (t3 = E2.call(t3), E2 = 0; !(u3 = t3.next()).done; ) + y2 = x2 + S(u3 = u3.value, E2++), g2 += e3(u3, r3, s3, y2, l2); + else if ("object" === y2) { + if ("function" == typeof t3.then) + return e3(function(e4) { + switch (e4.status) { + case "fulfilled": + return e4.value; + case "rejected": + throw e4.reason; + default: + switch ("string" == typeof e4.status ? e4.then(w, w) : (e4.status = "pending", e4.then(function(t4) { + "pending" === e4.status && (e4.status = "fulfilled", e4.value = t4); + }, function(t4) { + "pending" === e4.status && (e4.status = "rejected", e4.reason = t4); + })), e4.status) { + case "fulfilled": + return e4.value; + case "rejected": + throw e4.reason; + } + } + throw e4; + }(t3), r3, s3, u3, l2); + throw Error(n(31, "[object Object]" === (r3 = String(t3)) ? "object with keys {" + Object.keys(t3).join(", ") + "}" : r3)); + } + return g2; + }(e2, s2, "", "", function(e3) { + return t2.call(r2, e3, u2++); + }), s2; + } + function E(e2) { + if (-1 === e2._status) { + var t2 = e2._result; + (t2 = t2()).then(function(t3) { + (0 === e2._status || -1 === e2._status) && (e2._status = 1, e2._result = t3); + }, function(t3) { + (0 === e2._status || -1 === e2._status) && (e2._status = 2, e2._result = t3); + }), -1 === e2._status && (e2._status = 0, e2._result = t2); + } + if (1 === e2._status) + return e2._result.default; + throw e2._result; + } + function _() { + return /* @__PURE__ */ new WeakMap(); + } + function C() { + return { s: 0, v: void 0, o: null, p: null }; + } + t.Children = { map: x, forEach: function(e2, t2, r2) { + x(e2, function() { + t2.apply(this, arguments); + }, r2); + }, count: function(e2) { + var t2 = 0; + return x(e2, function() { + t2++; + }), t2; + }, toArray: function(e2) { + return x(e2, function(e3) { + return e3; + }) || []; + }, only: function(e2) { + if (!m(e2)) + throw Error(n(143)); + return e2; + } }, t.Fragment = s, t.Profiler = l, t.StrictMode = u, t.Suspense = f, t.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = r, t.cache = function(e2) { + return function() { + var t2 = r.A; + if (!t2) + return e2.apply(null, arguments); + var n2 = t2.getCacheForType(_); + void 0 === (t2 = n2.get(e2)) && (t2 = C(), n2.set(e2, t2)), n2 = 0; + for (var o2 = arguments.length; n2 < o2; n2++) { + var i2 = arguments[n2]; + if ("function" == typeof i2 || "object" == typeof i2 && null !== i2) { + var a2 = t2.o; + null === a2 && (t2.o = a2 = /* @__PURE__ */ new WeakMap()), void 0 === (t2 = a2.get(i2)) && (t2 = C(), a2.set(i2, t2)); + } else + null === (a2 = t2.p) && (t2.p = a2 = /* @__PURE__ */ new Map()), void 0 === (t2 = a2.get(i2)) && (t2 = C(), a2.set(i2, t2)); + } + if (1 === t2.s) + return t2.v; + if (2 === t2.s) + throw t2.v; + try { + var s2 = e2.apply(null, arguments); + return (n2 = t2).s = 1, n2.v = s2; + } catch (e3) { + throw (s2 = t2).s = 2, s2.v = e3, e3; + } + }; + }, t.cloneElement = function(e2, t2, r2) { + if (null == e2) + throw Error(n(267, e2)); + var o2 = g({}, e2.props), i2 = e2.key, a2 = void 0; + if (null != t2) + for (s2 in void 0 !== t2.ref && (a2 = void 0), void 0 !== t2.key && (i2 = "" + t2.key), t2) + y.call(t2, s2) && "key" !== s2 && "__self" !== s2 && "__source" !== s2 && ("ref" !== s2 || void 0 !== t2.ref) && (o2[s2] = t2[s2]); + var s2 = arguments.length - 2; + if (1 === s2) + o2.children = r2; + else if (1 < s2) { + for (var u2 = Array(s2), l2 = 0; l2 < s2; l2++) + u2[l2] = arguments[l2 + 2]; + o2.children = u2; + } + return v(e2.type, i2, null, void 0, void 0, a2, o2); + }, t.createElement = function(e2, t2, r2) { + var n2, o2 = {}, i2 = null; + if (null != t2) + for (n2 in void 0 !== t2.key && (i2 = "" + t2.key), t2) + y.call(t2, n2) && "key" !== n2 && "__self" !== n2 && "__source" !== n2 && (o2[n2] = t2[n2]); + var a2 = arguments.length - 2; + if (1 === a2) + o2.children = r2; + else if (1 < a2) { + for (var s2 = Array(a2), u2 = 0; u2 < a2; u2++) + s2[u2] = arguments[u2 + 2]; + o2.children = s2; + } + if (e2 && e2.defaultProps) + for (n2 in a2 = e2.defaultProps) + void 0 === o2[n2] && (o2[n2] = a2[n2]); + return v(e2, i2, null, void 0, void 0, null, o2); + }, t.createRef = function() { + return { current: null }; + }, t.forwardRef = function(e2) { + return { $$typeof: c, render: e2 }; + }, t.isValidElement = m, t.lazy = function(e2) { + return { $$typeof: p, _payload: { _status: -1, _result: e2 }, _init: E }; + }, t.memo = function(e2, t2) { + return { $$typeof: d, type: e2, compare: void 0 === t2 ? null : t2 }; + }, t.use = function(e2) { + return r.H.use(e2); + }, t.useCallback = function(e2, t2) { + return r.H.useCallback(e2, t2); + }, t.useDebugValue = function() { + }, t.useId = function() { + return r.H.useId(); + }, t.useMemo = function(e2, t2) { + return r.H.useMemo(e2, t2); + }, t.version = "19.0.0-rc-bf7e210c-20241017"; + }; + __namedExportsObject4["__chunk_71676"] = (e, t, r) => { + "use strict"; + var n; + n = r(75851), t.aW = n.renderToReadableStream, t.kf = n.decodeReply, t.Hs = n.decodeAction, t.dH = n.decodeFormState, t.jF = n.registerServerReference, n.registerClientReference, t.QT = n.createClientModuleProxy, t.u7 = n.createTemporaryReferenceSet; + }; + __namedExportsObject4["__chunk_75851"] = (e, t, r) => { + "use strict"; + var n = r(2844), o = r(23034); + function i(e10) { + tv(function() { + throw e10; + }); + } + var a = Promise, s = "function" == typeof queueMicrotask ? queueMicrotask : function(e10) { + a.resolve(null).then(e10).catch(i); + }, u = null, l = 0; + function c(e10, t2) { + if (0 !== t2.byteLength) { + if (2048 < t2.byteLength) + 0 < l && (e10.enqueue(new Uint8Array(u.buffer, 0, l)), u = new Uint8Array(2048), l = 0), e10.enqueue(t2); + else { + var r2 = u.length - l; + r2 < t2.byteLength && (0 === r2 ? e10.enqueue(u) : (u.set(t2.subarray(0, r2), l), e10.enqueue(u), t2 = t2.subarray(r2)), u = new Uint8Array(2048), l = 0), u.set(t2, l), l += t2.byteLength; + } + } + return true; + } + var f = new TextEncoder(); + function d(e10) { + return f.encode(e10); + } + function p(e10) { + return e10.byteLength; + } + function h(e10, t2) { + "function" == typeof e10.error ? e10.error(t2) : e10.close(); + } + var y = Symbol.for("react.client.reference"), g = Symbol.for("react.server.reference"); + function v(e10, t2, r2) { + return Object.defineProperties(e10, { $$typeof: { value: y }, $$id: { value: t2 }, $$async: { value: r2 } }); + } + var m = Function.prototype.bind, b = Array.prototype.slice; + function S() { + var e10 = m.apply(this, arguments); + if (this.$$typeof === g) { + var t2 = b.call(arguments, 1); + return Object.defineProperties(e10, { $$typeof: { value: g }, $$id: { value: this.$$id }, $$bound: t2 = { value: this.$$bound ? this.$$bound.concat(t2) : t2 }, bind: { value: S, configurable: true } }); + } + return e10; + } + var w = Promise.prototype, x = { get: function(e10, t2) { + switch (t2) { + case "$$typeof": + return e10.$$typeof; + case "$$id": + return e10.$$id; + case "$$async": + return e10.$$async; + case "name": + return e10.name; + case "displayName": + case "defaultProps": + case "toJSON": + return; + case Symbol.toPrimitive: + return Object.prototype[Symbol.toPrimitive]; + case Symbol.toStringTag: + return Object.prototype[Symbol.toStringTag]; + case "Provider": + throw Error("Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."); + case "then": + throw Error("Cannot await or return from a thenable. You cannot await a client module from a server component."); + } + throw Error("Cannot access " + String(e10.name) + "." + String(t2) + " on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."); + }, set: function() { + throw Error("Cannot assign to a client module from a server module."); + } }; + function E(e10, t2) { + switch (t2) { + case "$$typeof": + return e10.$$typeof; + case "$$id": + return e10.$$id; + case "$$async": + return e10.$$async; + case "name": + return e10.name; + case "defaultProps": + case "toJSON": + return; + case Symbol.toPrimitive: + return Object.prototype[Symbol.toPrimitive]; + case Symbol.toStringTag: + return Object.prototype[Symbol.toStringTag]; + case "__esModule": + var r2 = e10.$$id; + return e10.default = v(function() { + throw Error("Attempted to call the default export of " + r2 + " from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); + }, e10.$$id + "#", e10.$$async), true; + case "then": + if (e10.then) + return e10.then; + if (e10.$$async) + return; + var n2 = v({}, e10.$$id, true), o2 = new Proxy(n2, _); + return e10.status = "fulfilled", e10.value = o2, e10.then = v(function(e11) { + return Promise.resolve(e11(o2)); + }, e10.$$id + "#then", false); + } + if ("symbol" == typeof t2) + throw Error("Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."); + return (n2 = e10[t2]) || (Object.defineProperty(n2 = v(function() { + throw Error("Attempted to call " + String(t2) + "() from the server but " + String(t2) + " is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); + }, e10.$$id + "#" + t2, e10.$$async), "name", { value: t2 }), n2 = e10[t2] = new Proxy(n2, x)), n2; + } + var _ = { get: function(e10, t2) { + return E(e10, t2); + }, getOwnPropertyDescriptor: function(e10, t2) { + var r2 = Object.getOwnPropertyDescriptor(e10, t2); + return r2 || (r2 = { value: E(e10, t2), writable: false, configurable: false, enumerable: false }, Object.defineProperty(e10, t2, r2)), r2; + }, getPrototypeOf: function() { + return w; + }, set: function() { + throw Error("Cannot assign to a client module from a server module."); + } }, C = n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, R = C.d; + function A(e10) { + if (null == e10) + return null; + var t2, r2 = false, n2 = {}; + for (t2 in e10) + null != e10[t2] && (r2 = true, n2[t2] = e10[t2]); + return r2 ? n2 : null; + } + C.d = { f: R.f, r: R.r, D: function(e10) { + if ("string" == typeof e10 && e10) { + var t2 = em(); + if (t2) { + var r2 = t2.hints, n2 = "D|" + e10; + r2.has(n2) || (r2.add(n2), eS(t2, "D", e10)); + } else + R.D(e10); + } + }, C: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = em(); + if (r2) { + var n2 = r2.hints, o2 = "C|" + (null == t2 ? "null" : t2) + "|" + e10; + n2.has(o2) || (n2.add(o2), "string" == typeof t2 ? eS(r2, "C", [e10, t2]) : eS(r2, "C", e10)); + } else + R.C(e10, t2); + } + }, L: function(e10, t2, r2) { + if ("string" == typeof e10) { + var n2 = em(); + if (n2) { + var o2 = n2.hints, i2 = "L"; + if ("image" === t2 && r2) { + var a2 = r2.imageSrcSet, s2 = r2.imageSizes, u2 = ""; + "string" == typeof a2 && "" !== a2 ? (u2 += "[" + a2 + "]", "string" == typeof s2 && (u2 += "[" + s2 + "]")) : u2 += "[][]" + e10, i2 += "[image]" + u2; + } else + i2 += "[" + t2 + "]" + e10; + o2.has(i2) || (o2.add(i2), (r2 = A(r2)) ? eS(n2, "L", [e10, t2, r2]) : eS(n2, "L", [e10, t2])); + } else + R.L(e10, t2, r2); + } + }, m: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = em(); + if (r2) { + var n2 = r2.hints, o2 = "m|" + e10; + if (n2.has(o2)) + return; + return n2.add(o2), (t2 = A(t2)) ? eS(r2, "m", [e10, t2]) : eS(r2, "m", e10); + } + R.m(e10, t2); + } + }, X: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = em(); + if (r2) { + var n2 = r2.hints, o2 = "X|" + e10; + if (n2.has(o2)) + return; + return n2.add(o2), (t2 = A(t2)) ? eS(r2, "X", [e10, t2]) : eS(r2, "X", e10); + } + R.X(e10, t2); + } + }, S: function(e10, t2, r2) { + if ("string" == typeof e10) { + var n2 = em(); + if (n2) { + var o2 = n2.hints, i2 = "S|" + e10; + if (o2.has(i2)) + return; + return o2.add(i2), (r2 = A(r2)) ? eS(n2, "S", [e10, "string" == typeof t2 ? t2 : 0, r2]) : "string" == typeof t2 ? eS(n2, "S", [e10, t2]) : eS(n2, "S", e10); + } + R.S(e10, t2, r2); + } + }, M: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = em(); + if (r2) { + var n2 = r2.hints, o2 = "M|" + e10; + if (n2.has(o2)) + return; + return n2.add(o2), (t2 = A(t2)) ? eS(r2, "M", [e10, t2]) : eS(r2, "M", e10); + } + R.M(e10, t2); + } + } }; + var k = "function" == typeof AsyncLocalStorage, T = k ? new AsyncLocalStorage() : null; + "object" == typeof async_hooks && async_hooks.createHook, "object" == typeof async_hooks && async_hooks.executionAsyncId; + var P = Symbol.for("react.temporary.reference"), $ = { get: function(e10, t2) { + switch (t2) { + case "$$typeof": + return e10.$$typeof; + case "name": + case "displayName": + case "defaultProps": + case "toJSON": + return; + case Symbol.toPrimitive: + return Object.prototype[Symbol.toPrimitive]; + case Symbol.toStringTag: + return Object.prototype[Symbol.toStringTag]; + case "Provider": + throw Error("Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."); + } + throw Error("Cannot access " + String(t2) + " on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through to the client."); + }, set: function() { + throw Error("Cannot assign to a temporary client reference from a server module."); + } }, O = Symbol.for("react.element"), N = Symbol.for("react.transitional.element"), j = Symbol.for("react.fragment"), I = Symbol.for("react.context"), L = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), U = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), B = Symbol.for("react.memo_cache_sentinel"); + Symbol.for("react.postpone"); + var q = Symbol.iterator; + function F(e10) { + return null === e10 || "object" != typeof e10 ? null : "function" == typeof (e10 = q && e10[q] || e10["@@iterator"]) ? e10 : null; + } + var G = Symbol.asyncIterator, W = Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"); + function V() { + } + var z = null; + function X() { + if (null === z) + throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue."); + var e10 = z; + return z = null, e10; + } + var J = null, Y = 0, K = null; + function Q() { + var e10 = K || []; + return K = null, e10; + } + var Z = { useMemo: function(e10) { + return e10(); + }, useCallback: function(e10) { + return e10; + }, useDebugValue: function() { + }, useDeferredValue: ee, useTransition: ee, readContext: er, useContext: er, useReducer: ee, useRef: ee, useState: ee, useInsertionEffect: ee, useLayoutEffect: ee, useImperativeHandle: ee, useEffect: ee, useId: function() { + if (null === J) + throw Error("useId can only be used while React is rendering"); + var e10 = J.identifierCount++; + return ":" + J.identifierPrefix + "S" + e10.toString(32) + ":"; + }, useSyncExternalStore: ee, useCacheRefresh: function() { + return et; + }, useMemoCache: function(e10) { + for (var t2 = Array(e10), r2 = 0; r2 < e10; r2++) + t2[r2] = B; + return t2; + }, use: function(e10) { + if (null !== e10 && "object" == typeof e10 || "function" == typeof e10) { + if ("function" == typeof e10.then) { + var t2 = Y; + return Y += 1, null === K && (K = []), function(e11, t3, r2) { + switch (void 0 === (r2 = e11[r2]) ? e11.push(t3) : r2 !== t3 && (t3.then(V, V), t3 = r2), t3.status) { + case "fulfilled": + return t3.value; + case "rejected": + throw t3.reason; + default: + switch ("string" == typeof t3.status ? t3.then(V, V) : ((e11 = t3).status = "pending", e11.then(function(e12) { + if ("pending" === t3.status) { + var r3 = t3; + r3.status = "fulfilled", r3.value = e12; + } + }, function(e12) { + if ("pending" === t3.status) { + var r3 = t3; + r3.status = "rejected", r3.reason = e12; + } + })), t3.status) { + case "fulfilled": + return t3.value; + case "rejected": + throw t3.reason; + } + throw z = t3, W; + } + }(K, e10, t2); + } + e10.$$typeof === I && er(); + } + if (e10.$$typeof === y) { + if (null != e10.value && e10.value.$$typeof === I) + throw Error("Cannot read a Client Context from a Server Component."); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error("An unsupported type was passed to use(): " + String(e10)); + } }; + function ee() { + throw Error("This Hook is not supported in Server Components."); + } + function et() { + throw Error("Refreshing the cache is not supported in Server Components."); + } + function er() { + throw Error("Cannot read a Client Context from a Server Component."); + } + var en = { getCacheForType: function(e10) { + var t2 = (t2 = em()) ? t2.cache : /* @__PURE__ */ new Map(), r2 = t2.get(e10); + return void 0 === r2 && (r2 = e10(), t2.set(e10, r2)), r2; + } }, eo = o.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + if (!eo) + throw Error('The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'); + var ei = Array.isArray, ea = Object.getPrototypeOf; + function es(e10) { + return Object.prototype.toString.call(e10).replace(/^\[object (.*)\]$/, function(e11, t2) { + return t2; + }); + } + function eu(e10) { + switch (typeof e10) { + case "string": + return JSON.stringify(10 >= e10.length ? e10 : e10.slice(0, 10) + "..."); + case "object": + if (ei(e10)) + return "[...]"; + if (null !== e10 && e10.$$typeof === el) + return "client"; + return "Object" === (e10 = es(e10)) ? "{...}" : e10; + case "function": + return e10.$$typeof === el ? "client" : (e10 = e10.displayName || e10.name) ? "function " + e10 : "function"; + default: + return String(e10); + } + } + var el = Symbol.for("react.client.reference"); + function ec(e10, t2) { + var r2 = es(e10); + if ("Object" !== r2 && "Array" !== r2) + return r2; + r2 = -1; + var n2 = 0; + if (ei(e10)) { + for (var o2 = "[", i2 = 0; i2 < e10.length; i2++) { + 0 < i2 && (o2 += ", "); + var a2 = e10[i2]; + a2 = "object" == typeof a2 && null !== a2 ? ec(a2) : eu(a2), "" + i2 === t2 ? (r2 = o2.length, n2 = a2.length, o2 += a2) : o2 = 10 > a2.length && 40 > o2.length + a2.length ? o2 + a2 : o2 + "..."; + } + o2 += "]"; + } else if (e10.$$typeof === N) + o2 = "<" + function e11(t3) { + if ("string" == typeof t3) + return t3; + switch (t3) { + case M: + return "Suspense"; + case D: + return "SuspenseList"; + } + if ("object" == typeof t3) + switch (t3.$$typeof) { + case L: + return e11(t3.render); + case U: + return e11(t3.type); + case H: + var r3 = t3._payload; + t3 = t3._init; + try { + return e11(t3(r3)); + } catch (e12) { + } + } + return ""; + }(e10.type) + "/>"; + else { + if (e10.$$typeof === el) + return "client"; + for (a2 = 0, o2 = "{", i2 = Object.keys(e10); a2 < i2.length; a2++) { + 0 < a2 && (o2 += ", "); + var s2 = i2[a2], u2 = JSON.stringify(s2); + o2 += ('"' + s2 + '"' === u2 ? s2 : u2) + ": ", u2 = "object" == typeof (u2 = e10[s2]) && null !== u2 ? ec(u2) : eu(u2), s2 === t2 ? (r2 = o2.length, n2 = u2.length, o2 += u2) : o2 = 10 > u2.length && 40 > o2.length + u2.length ? o2 + u2 : o2 + "..."; + } + o2 += "}"; + } + return void 0 === t2 ? o2 : -1 < r2 && 0 < n2 ? "\n " + o2 + "\n " + (e10 = " ".repeat(r2) + "^".repeat(n2)) : "\n " + o2; + } + var ef = Object.prototype, ed = JSON.stringify; + function ep(e10) { + console.error(e10); + } + function eh() { + } + function ey(e10, t2, r2, n2, o2, i2, a2, s2, u2, l2, c2) { + if (null !== eo.A && eo.A !== en) + throw Error("Currently React only supports one RSC renderer at a time."); + eo.A = en, u2 = /* @__PURE__ */ new Set(), s2 = []; + var f2 = /* @__PURE__ */ new Set(); + this.type = e10, this.status = 10, this.flushScheduled = false, this.destination = this.fatalError = null, this.bundlerConfig = r2, this.cache = /* @__PURE__ */ new Map(), this.pendingChunks = this.nextChunkId = 0, this.hints = f2, this.abortListeners = /* @__PURE__ */ new Set(), this.abortableTasks = u2, this.pingedTasks = s2, this.completedImportChunks = [], this.completedHintChunks = [], this.completedRegularChunks = [], this.completedErrorChunks = [], this.writtenSymbols = /* @__PURE__ */ new Map(), this.writtenClientReferences = /* @__PURE__ */ new Map(), this.writtenServerReferences = /* @__PURE__ */ new Map(), this.writtenObjects = /* @__PURE__ */ new WeakMap(), this.temporaryReferences = a2, this.identifierPrefix = o2 || "", this.identifierCount = 1, this.taintCleanupQueue = [], this.onError = void 0 === n2 ? ep : n2, this.onPostpone = void 0 === i2 ? eh : i2, this.onAllReady = l2, this.onFatalError = c2, e10 = eR(this, t2, null, false, u2), s2.push(e10); + } + function eg() { + } + var ev = null; + function em() { + if (ev) + return ev; + if (k) { + var e10 = T.getStore(); + if (e10) + return e10; + } + return null; + } + function eb(e10, t2, r2) { + var n2 = eR(e10, null, t2.keyPath, t2.implicitSlot, e10.abortableTasks); + switch (r2.status) { + case "fulfilled": + return n2.model = r2.value, eC(e10, n2), n2.id; + case "rejected": + return t2 = ej(e10, r2.reason, null), eL(e10, n2.id, t2), n2.status = 4, e10.abortableTasks.delete(n2), n2.id; + default: + if (12 === e10.status) + return e10.abortableTasks.delete(n2), n2.status = 3, t2 = ed(eA(e10.fatalError)), eM(e10, n2.id, t2), n2.id; + "string" != typeof r2.status && (r2.status = "pending", r2.then(function(e11) { + "pending" === r2.status && (r2.status = "fulfilled", r2.value = e11); + }, function(e11) { + "pending" === r2.status && (r2.status = "rejected", r2.reason = e11); + })); + } + return r2.then(function(t3) { + n2.model = t3, eC(e10, n2); + }, function(t3) { + 0 === n2.status && (t3 = ej(e10, t3, n2), eL(e10, n2.id, t3), n2.status = 4, e10.abortableTasks.delete(n2), eW(e10)); + }), n2.id; + } + function eS(e10, t2, r2) { + r2 = ed(r2), t2 = "H" + t2, r2 = d((t2 = (e10.nextChunkId++).toString(16) + ":" + t2) + r2 + "\n"), e10.completedHintChunks.push(r2), eW(e10); + } + function ew(e10) { + if ("fulfilled" === e10.status) + return e10.value; + if ("rejected" === e10.status) + throw e10.reason; + throw e10; + } + function ex() { + } + function eE(e10, t2, r2, n2, o2) { + var i2 = t2.thenableState; + if (t2.thenableState = null, Y = 0, K = i2, n2 = n2(o2, void 0), 12 === e10.status) + throw "object" == typeof n2 && null !== n2 && "function" == typeof n2.then && n2.$$typeof !== y && n2.then(ex, ex), null; + if ("object" == typeof n2 && null !== n2 && n2.$$typeof !== y) { + if ("function" == typeof n2.then) { + if ("fulfilled" === (o2 = n2).status) + return o2.value; + n2 = function(e11) { + switch (e11.status) { + case "fulfilled": + case "rejected": + break; + default: + "string" != typeof e11.status && (e11.status = "pending", e11.then(function(t3) { + "pending" === e11.status && (e11.status = "fulfilled", e11.value = t3); + }, function(t3) { + "pending" === e11.status && (e11.status = "rejected", e11.reason = t3); + })); + } + return { $$typeof: H, _payload: e11, _init: ew }; + }(n2); + } + var a2 = F(n2); + if (a2) { + var s2 = n2; + (n2 = {})[Symbol.iterator] = function() { + return a2.call(s2); + }; + } else if (!("function" != typeof n2[G] || "function" == typeof ReadableStream && n2 instanceof ReadableStream)) { + var u2 = n2; + (n2 = {})[G] = function() { + return u2[G](); + }; + } + } + return o2 = t2.keyPath, i2 = t2.implicitSlot, null !== r2 ? t2.keyPath = null === o2 ? r2 : o2 + "," + r2 : null === o2 && (t2.implicitSlot = true), e10 = eN(e10, t2, eB, "", n2), t2.keyPath = o2, t2.implicitSlot = i2, e10; + } + function e_(e10, t2, r2) { + return null !== t2.keyPath ? (e10 = [N, j, t2.keyPath, { children: r2 }], t2.implicitSlot ? [e10] : e10) : r2; + } + function eC(e10, t2) { + var r2 = e10.pingedTasks; + r2.push(t2), 1 === r2.length && (e10.flushScheduled = null !== e10.destination, 21 === e10.type || 10 === e10.status ? s(function() { + return eF(e10); + }) : tv(function() { + return eF(e10); + }, 0)); + } + function eR(e10, t2, r2, n2, o2) { + e10.pendingChunks++; + var i2 = e10.nextChunkId++; + "object" != typeof t2 || null === t2 || null !== r2 || n2 || e10.writtenObjects.set(t2, eA(i2)); + var a2 = { id: i2, status: 0, model: t2, keyPath: r2, implicitSlot: n2, ping: function() { + return eC(e10, a2); + }, toJSON: function(t3, r3) { + var n3 = a2.keyPath, o3 = a2.implicitSlot; + try { + var i3 = eN(e10, a2, this, t3, r3); + } catch (u2) { + if (t3 = "object" == typeof (t3 = a2.model) && null !== t3 && (t3.$$typeof === N || t3.$$typeof === H), 12 === e10.status) + a2.status = 3, n3 = e10.fatalError, i3 = t3 ? "$L" + n3.toString(16) : eA(n3); + else if ("object" == typeof (r3 = u2 === W ? X() : u2) && null !== r3 && "function" == typeof r3.then) { + var s2 = (i3 = eR(e10, a2.model, a2.keyPath, a2.implicitSlot, e10.abortableTasks)).ping; + r3.then(s2, s2), i3.thenableState = Q(), a2.keyPath = n3, a2.implicitSlot = o3, i3 = t3 ? "$L" + i3.id.toString(16) : eA(i3.id); + } else + a2.keyPath = n3, a2.implicitSlot = o3, e10.pendingChunks++, n3 = e10.nextChunkId++, o3 = ej(e10, r3, a2), eL(e10, n3, o3), i3 = t3 ? "$L" + n3.toString(16) : eA(n3); + } + return i3; + }, thenableState: null }; + return o2.add(a2), a2; + } + function eA(e10) { + return "$" + e10.toString(16); + } + function ek(e10, t2, r2) { + return e10 = ed(r2), d(t2 = t2.toString(16) + ":" + e10 + "\n"); + } + function eT(e10, t2, r2, n2) { + var o2 = n2.$$async ? n2.$$id + "#async" : n2.$$id, i2 = e10.writtenClientReferences, a2 = i2.get(o2); + if (void 0 !== a2) + return t2[0] === N && "1" === r2 ? "$L" + a2.toString(16) : eA(a2); + try { + var s2 = e10.bundlerConfig, u2 = n2.$$id; + a2 = ""; + var l2 = s2[u2]; + if (l2) + a2 = l2.name; + else { + var c2 = u2.lastIndexOf("#"); + if (-1 !== c2 && (a2 = u2.slice(c2 + 1), l2 = s2[u2.slice(0, c2)]), !l2) + throw Error('Could not find the module "' + u2 + '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'); + } + if (true === l2.async && true === n2.$$async) + throw Error('The module "' + u2 + '" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'); + var f2 = true === l2.async || true === n2.$$async ? [l2.id, l2.chunks, a2, 1] : [l2.id, l2.chunks, a2]; + e10.pendingChunks++; + var p2 = e10.nextChunkId++, h2 = ed(f2), y2 = p2.toString(16) + ":I" + h2 + "\n", g2 = d(y2); + return e10.completedImportChunks.push(g2), i2.set(o2, p2), t2[0] === N && "1" === r2 ? "$L" + p2.toString(16) : eA(p2); + } catch (n3) { + return e10.pendingChunks++, t2 = e10.nextChunkId++, r2 = ej(e10, n3, null), eL(e10, t2, r2), eA(t2); + } + } + function eP(e10, t2) { + return t2 = eR(e10, t2, null, false, e10.abortableTasks), eq(e10, t2), t2.id; + } + function e$(e10, t2, r2) { + e10.pendingChunks++; + var n2 = e10.nextChunkId++; + return eD(e10, n2, t2, r2), eA(n2); + } + var eO = false; + function eN(e10, t2, r2, n2, o2) { + if (t2.model = o2, o2 === N) + return "$"; + if (null === o2) + return null; + if ("object" == typeof o2) { + switch (o2.$$typeof) { + case N: + var i2 = null, a2 = e10.writtenObjects; + if (null === t2.keyPath && !t2.implicitSlot) { + var s2 = a2.get(o2); + if (void 0 !== s2) { + if (eO !== o2) + return s2; + eO = null; + } else + -1 === n2.indexOf(":") && void 0 !== (r2 = a2.get(r2)) && (i2 = r2 + ":" + n2, a2.set(o2, i2)); + } + return r2 = (n2 = o2.props).ref, "object" == typeof (e10 = function e11(t3, r3, n3, o3, i3, a3) { + if (null != i3) + throw Error("Refs cannot be used in Server Components, nor passed to Client Components."); + if ("function" == typeof n3 && n3.$$typeof !== y && n3.$$typeof !== P) + return eE(t3, r3, o3, n3, a3); + if (n3 === j && null === o3) + return n3 = r3.implicitSlot, null === r3.keyPath && (r3.implicitSlot = true), a3 = eN(t3, r3, eB, "", a3.children), r3.implicitSlot = n3, a3; + if (null != n3 && "object" == typeof n3 && n3.$$typeof !== y) + switch (n3.$$typeof) { + case H: + if (n3 = (0, n3._init)(n3._payload), 12 === t3.status) + throw null; + return e11(t3, r3, n3, o3, i3, a3); + case L: + return eE(t3, r3, o3, n3.render, a3); + case U: + return e11(t3, r3, n3.type, o3, i3, a3); + } + return t3 = o3, o3 = r3.keyPath, null === t3 ? t3 = o3 : null !== o3 && (t3 = o3 + "," + t3), a3 = [N, n3, t3, a3], r3 = r3.implicitSlot && null !== t3 ? [a3] : a3; + }(e10, t2, o2.type, o2.key, void 0 !== r2 ? r2 : null, n2)) && null !== e10 && null !== i2 && (a2.has(e10) || a2.set(e10, i2)), e10; + case H: + if (t2.thenableState = null, o2 = (n2 = o2._init)(o2._payload), 12 === e10.status) + throw null; + return eN(e10, t2, eB, "", o2); + case O: + throw Error('A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'); + } + if (o2.$$typeof === y) + return eT(e10, r2, n2, o2); + if (void 0 !== e10.temporaryReferences && void 0 !== (i2 = e10.temporaryReferences.get(o2))) + return "$T" + i2; + if (a2 = (i2 = e10.writtenObjects).get(o2), "function" == typeof o2.then) { + if (void 0 !== a2) { + if (null !== t2.keyPath || t2.implicitSlot) + return "$@" + eb(e10, t2, o2).toString(16); + if (eO !== o2) + return a2; + eO = null; + } + return e10 = "$@" + eb(e10, t2, o2).toString(16), i2.set(o2, e10), e10; + } + if (void 0 !== a2) { + if (eO !== o2) + return a2; + eO = null; + } else if (-1 === n2.indexOf(":") && void 0 !== (a2 = i2.get(r2))) { + if (s2 = n2, ei(r2) && r2[0] === N) + switch (n2) { + case "1": + s2 = "type"; + break; + case "2": + s2 = "key"; + break; + case "3": + s2 = "props"; + break; + case "4": + s2 = "_owner"; + } + i2.set(o2, a2 + ":" + s2); + } + if (ei(o2)) + return e_(e10, t2, o2); + if (o2 instanceof Map) + return "$Q" + eP(e10, o2 = Array.from(o2)).toString(16); + if (o2 instanceof Set) + return "$W" + eP(e10, o2 = Array.from(o2)).toString(16); + if ("function" == typeof FormData && o2 instanceof FormData) + return "$K" + eP(e10, o2 = Array.from(o2.entries())).toString(16); + if (o2 instanceof Error) + return "$Z"; + if (o2 instanceof ArrayBuffer) + return e$(e10, "A", new Uint8Array(o2)); + if (o2 instanceof Int8Array) + return e$(e10, "O", o2); + if (o2 instanceof Uint8Array) + return e$(e10, "o", o2); + if (o2 instanceof Uint8ClampedArray) + return e$(e10, "U", o2); + if (o2 instanceof Int16Array) + return e$(e10, "S", o2); + if (o2 instanceof Uint16Array) + return e$(e10, "s", o2); + if (o2 instanceof Int32Array) + return e$(e10, "L", o2); + if (o2 instanceof Uint32Array) + return e$(e10, "l", o2); + if (o2 instanceof Float32Array) + return e$(e10, "G", o2); + if (o2 instanceof Float64Array) + return e$(e10, "g", o2); + if (o2 instanceof BigInt64Array) + return e$(e10, "M", o2); + if (o2 instanceof BigUint64Array) + return e$(e10, "m", o2); + if (o2 instanceof DataView) + return e$(e10, "V", o2); + if ("function" == typeof Blob && o2 instanceof Blob) + return function(e11, t3) { + function r3(t4) { + if (!s3) { + s3 = true, e11.abortListeners.delete(n3); + var o4 = ej(e11, t4, i3); + eL(e11, i3.id, o4), eW(e11), a3.cancel(t4).then(r3, r3); + } + } + function n3(t4) { + if (!s3) { + s3 = true, e11.abortListeners.delete(n3); + var o4 = ej(e11, t4, i3); + eL(e11, i3.id, o4), eW(e11), a3.cancel(t4).then(r3, r3); + } + } + var o3 = [t3.type], i3 = eR(e11, o3, null, false, e11.abortableTasks), a3 = t3.stream().getReader(), s3 = false; + return e11.abortListeners.add(n3), a3.read().then(function t4(u2) { + if (!s3) { + if (!u2.done) + return o3.push(u2.value), a3.read().then(t4).catch(r3); + e11.abortListeners.delete(n3), s3 = true, eC(e11, i3); + } + }).catch(r3), "$B" + i3.id.toString(16); + }(e10, o2); + if (i2 = F(o2)) + return (n2 = i2.call(o2)) === o2 ? "$i" + eP(e10, Array.from(n2)).toString(16) : e_(e10, t2, Array.from(n2)); + if ("function" == typeof ReadableStream && o2 instanceof ReadableStream) + return function(e11, t3, r3) { + function n3(t4) { + if (!u2) { + u2 = true, e11.abortListeners.delete(o3); + var r4 = ej(e11, t4, s3); + eL(e11, s3.id, r4), eW(e11), a3.cancel(t4).then(n3, n3); + } + } + function o3(t4) { + if (!u2) { + u2 = true, e11.abortListeners.delete(o3); + var r4 = ej(e11, t4, s3); + eL(e11, s3.id, r4), eW(e11), a3.cancel(t4).then(n3, n3); + } + } + var i3 = r3.supportsBYOB; + if (void 0 === i3) + try { + r3.getReader({ mode: "byob" }).releaseLock(), i3 = true; + } catch (e12) { + i3 = false; + } + var a3 = r3.getReader(), s3 = eR(e11, t3.model, t3.keyPath, t3.implicitSlot, e11.abortableTasks); + e11.abortableTasks.delete(s3), e11.pendingChunks++, t3 = s3.id.toString(16) + ":" + (i3 ? "r" : "R") + "\n", e11.completedRegularChunks.push(d(t3)); + var u2 = false; + return e11.abortListeners.add(o3), a3.read().then(function t4(r4) { + if (!u2) { + if (r4.done) + e11.abortListeners.delete(o3), r4 = s3.id.toString(16) + ":C\n", e11.completedRegularChunks.push(d(r4)), eW(e11), u2 = true; + else + try { + s3.model = r4.value, e11.pendingChunks++, eH(e11, s3, s3.model), eW(e11), a3.read().then(t4, n3); + } catch (e12) { + n3(e12); + } + } + }, n3), eA(s3.id); + }(e10, t2, o2); + if ("function" == typeof (i2 = o2[G])) + return null !== t2.keyPath ? (e10 = [N, j, t2.keyPath, { children: o2 }], e10 = t2.implicitSlot ? [e10] : e10) : (n2 = i2.call(o2), e10 = function(e11, t3, r3, n3) { + function o3(t4) { + if (!s3) { + s3 = true, e11.abortListeners.delete(i3); + var r4 = ej(e11, t4, a3); + eL(e11, a3.id, r4), eW(e11), "function" == typeof n3.throw && n3.throw(t4).then(o3, o3); + } + } + function i3(t4) { + if (!s3) { + s3 = true, e11.abortListeners.delete(i3); + var r4 = ej(e11, t4, a3); + eL(e11, a3.id, r4), eW(e11), "function" == typeof n3.throw && n3.throw(t4).then(o3, o3); + } + } + r3 = r3 === n3; + var a3 = eR(e11, t3.model, t3.keyPath, t3.implicitSlot, e11.abortableTasks); + e11.abortableTasks.delete(a3), e11.pendingChunks++, t3 = a3.id.toString(16) + ":" + (r3 ? "x" : "X") + "\n", e11.completedRegularChunks.push(d(t3)); + var s3 = false; + return e11.abortListeners.add(i3), n3.next().then(function t4(r4) { + if (!s3) { + if (r4.done) { + if (e11.abortListeners.delete(i3), void 0 === r4.value) + var u2 = a3.id.toString(16) + ":C\n"; + else + try { + var l2 = eP(e11, r4.value); + u2 = a3.id.toString(16) + ":C" + ed(eA(l2)) + "\n"; + } catch (e12) { + o3(e12); + return; + } + e11.completedRegularChunks.push(d(u2)), eW(e11), s3 = true; + } else + try { + a3.model = r4.value, e11.pendingChunks++, eH(e11, a3, a3.model), eW(e11), n3.next().then(t4, o3); + } catch (e12) { + o3(e12); + } + } + }, o3), eA(a3.id); + }(e10, t2, o2, n2)), e10; + if (o2 instanceof Date) + return "$D" + o2.toJSON(); + if ((e10 = ea(o2)) !== ef && (null === e10 || null !== ea(e10))) + throw Error("Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported." + ec(r2, n2)); + return o2; + } + if ("string" == typeof o2) + return "Z" === o2[o2.length - 1] && r2[n2] instanceof Date ? "$D" + o2 : 1024 <= o2.length && null !== p ? (e10.pendingChunks++, t2 = e10.nextChunkId++, eU(e10, t2, o2), eA(t2)) : e10 = "$" === o2[0] ? "$" + o2 : o2; + if ("boolean" == typeof o2) + return o2; + if ("number" == typeof o2) + return Number.isFinite(o2) ? 0 === o2 && -1 / 0 == 1 / o2 ? "$-0" : o2 : 1 / 0 === o2 ? "$Infinity" : -1 / 0 === o2 ? "$-Infinity" : "$NaN"; + if (void 0 === o2) + return "$undefined"; + if ("function" == typeof o2) { + if (o2.$$typeof === y) + return eT(e10, r2, n2, o2); + if (o2.$$typeof === g) + return void 0 !== (n2 = (t2 = e10.writtenServerReferences).get(o2)) ? e10 = "$F" + n2.toString(16) : (n2 = null === (n2 = o2.$$bound) ? null : Promise.resolve(n2), e10 = eP(e10, { id: o2.$$id, bound: n2 }), t2.set(o2, e10), e10 = "$F" + e10.toString(16)), e10; + if (void 0 !== e10.temporaryReferences && void 0 !== (e10 = e10.temporaryReferences.get(o2))) + return "$T" + e10; + if (o2.$$typeof === P) + throw Error("Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."); + if (/^on[A-Z]/.test(n2)) + throw Error("Event handlers cannot be passed to Client Component props." + ec(r2, n2) + "\nIf you need interactivity, consider converting part of this to a Client Component."); + throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' + ec(r2, n2)); + } + if ("symbol" == typeof o2) { + if (void 0 !== (i2 = (t2 = e10.writtenSymbols).get(o2))) + return eA(i2); + if (Symbol.for(i2 = o2.description) !== o2) + throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" + o2.description + ") cannot be found among global symbols." + ec(r2, n2)); + return e10.pendingChunks++, n2 = e10.nextChunkId++, r2 = ek(e10, n2, "$S" + i2), e10.completedImportChunks.push(r2), t2.set(o2, n2), eA(n2); + } + if ("bigint" == typeof o2) + return "$n" + o2.toString(10); + throw Error("Type " + typeof o2 + " is not supported in Client Component props." + ec(r2, n2)); + } + function ej(e10, t2) { + var r2 = ev; + ev = null; + try { + var n2 = e10.onError, o2 = k ? T.run(void 0, n2, t2) : n2(t2); + } finally { + ev = r2; + } + if (null != o2 && "string" != typeof o2) + throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + typeof o2 + '" instead'); + return o2 || ""; + } + function eI(e10, t2) { + (0, e10.onFatalError)(t2), null !== e10.destination ? (e10.status = 14, h(e10.destination, t2)) : (e10.status = 13, e10.fatalError = t2); + } + function eL(e10, t2, r2) { + r2 = { digest: r2 }, t2 = d(t2 = t2.toString(16) + ":E" + ed(r2) + "\n"), e10.completedErrorChunks.push(t2); + } + function eM(e10, t2, r2) { + t2 = d(t2 = t2.toString(16) + ":" + r2 + "\n"), e10.completedRegularChunks.push(t2); + } + function eD(e10, t2, r2, n2) { + e10.pendingChunks++; + var o2 = new Uint8Array(n2.buffer, n2.byteOffset, n2.byteLength); + o2 = (n2 = 2048 < n2.byteLength ? o2.slice() : o2).byteLength, t2 = d(t2 = t2.toString(16) + ":" + r2 + o2.toString(16) + ","), e10.completedRegularChunks.push(t2, n2); + } + function eU(e10, t2, r2) { + if (null === p) + throw Error("Existence of byteLengthOfChunk should have already been checked. This is a bug in React."); + e10.pendingChunks++; + var n2 = (r2 = d(r2)).byteLength; + t2 = d(t2 = t2.toString(16) + ":T" + n2.toString(16) + ","), e10.completedRegularChunks.push(t2, r2); + } + function eH(e10, t2, r2) { + var n2 = t2.id; + "string" == typeof r2 && null !== p ? eU(e10, n2, r2) : r2 instanceof ArrayBuffer ? eD(e10, n2, "A", new Uint8Array(r2)) : r2 instanceof Int8Array ? eD(e10, n2, "O", r2) : r2 instanceof Uint8Array ? eD(e10, n2, "o", r2) : r2 instanceof Uint8ClampedArray ? eD(e10, n2, "U", r2) : r2 instanceof Int16Array ? eD(e10, n2, "S", r2) : r2 instanceof Uint16Array ? eD(e10, n2, "s", r2) : r2 instanceof Int32Array ? eD(e10, n2, "L", r2) : r2 instanceof Uint32Array ? eD(e10, n2, "l", r2) : r2 instanceof Float32Array ? eD(e10, n2, "G", r2) : r2 instanceof Float64Array ? eD(e10, n2, "g", r2) : r2 instanceof BigInt64Array ? eD(e10, n2, "M", r2) : r2 instanceof BigUint64Array ? eD(e10, n2, "m", r2) : r2 instanceof DataView ? eD(e10, n2, "V", r2) : (r2 = ed(r2, t2.toJSON), eM(e10, t2.id, r2)); + } + var eB = {}; + function eq(e10, t2) { + if (0 === t2.status) { + t2.status = 5; + try { + eO = t2.model; + var r2 = eN(e10, t2, eB, "", t2.model); + if (eO = r2, t2.keyPath = null, t2.implicitSlot = false, "object" == typeof r2 && null !== r2) + e10.writtenObjects.set(r2, eA(t2.id)), eH(e10, t2, r2); + else { + var n2 = ed(r2); + eM(e10, t2.id, n2); + } + e10.abortableTasks.delete(t2), t2.status = 1; + } catch (r3) { + if (12 === e10.status) { + e10.abortableTasks.delete(t2), t2.status = 3; + var o2 = ed(eA(e10.fatalError)); + eM(e10, t2.id, o2); + } else { + var i2 = r3 === W ? X() : r3; + if ("object" == typeof i2 && null !== i2 && "function" == typeof i2.then) { + t2.status = 0, t2.thenableState = Q(); + var a2 = t2.ping; + i2.then(a2, a2); + } else { + e10.abortableTasks.delete(t2), t2.status = 4; + var s2 = ej(e10, i2, t2); + eL(e10, t2.id, s2); + } + } + } finally { + } + } + } + function eF(e10) { + var t2 = eo.H; + eo.H = Z; + var r2 = ev; + J = ev = e10; + var n2 = 0 < e10.abortableTasks.size; + try { + var o2 = e10.pingedTasks; + e10.pingedTasks = []; + for (var i2 = 0; i2 < o2.length; i2++) + eq(e10, o2[i2]); + null !== e10.destination && eG(e10, e10.destination), n2 && 0 === e10.abortableTasks.size && (0, e10.onAllReady)(); + } catch (t3) { + ej(e10, t3, null), eI(e10, t3); + } finally { + eo.H = t2, J = null, ev = r2; + } + } + function eG(e10, t2) { + u = new Uint8Array(2048), l = 0; + try { + for (var r2 = e10.completedImportChunks, n2 = 0; n2 < r2.length; n2++) + e10.pendingChunks--, c(t2, r2[n2]); + r2.splice(0, n2); + var o2 = e10.completedHintChunks; + for (n2 = 0; n2 < o2.length; n2++) + c(t2, o2[n2]); + o2.splice(0, n2); + var i2 = e10.completedRegularChunks; + for (n2 = 0; n2 < i2.length; n2++) + e10.pendingChunks--, c(t2, i2[n2]); + i2.splice(0, n2); + var a2 = e10.completedErrorChunks; + for (n2 = 0; n2 < a2.length; n2++) + e10.pendingChunks--, c(t2, a2[n2]); + a2.splice(0, n2); + } finally { + e10.flushScheduled = false, u && 0 < l && (t2.enqueue(new Uint8Array(u.buffer, 0, l)), u = null, l = 0); + } + 0 === e10.pendingChunks && (e10.status = 14, t2.close(), e10.destination = null); + } + function eW(e10) { + false === e10.flushScheduled && 0 === e10.pingedTasks.length && null !== e10.destination && (e10.flushScheduled = true, tv(function() { + e10.flushScheduled = false; + var t2 = e10.destination; + t2 && eG(e10, t2); + }, 0)); + } + function eV(e10, t2) { + try { + 11 >= e10.status && (e10.status = 12); + var r2 = e10.abortableTasks; + if (0 < r2.size) { + var n2 = void 0 === t2 ? Error("The render was aborted by the server without a reason.") : "object" == typeof t2 && null !== t2 && "function" == typeof t2.then ? Error("The render was aborted by the server with a promise.") : t2, o2 = ej(e10, n2, null), i2 = e10.nextChunkId++; + e10.fatalError = i2, e10.pendingChunks++, eL(e10, i2, o2, n2), r2.forEach(function(t3) { + if (5 !== t3.status) { + t3.status = 3; + var r3 = eA(i2); + t3 = ek(e10, t3.id, r3), e10.completedErrorChunks.push(t3); + } + }), r2.clear(), (0, e10.onAllReady)(); + } + var a2 = e10.abortListeners; + if (0 < a2.size) { + var s2 = void 0 === t2 ? Error("The render was aborted by the server without a reason.") : "object" == typeof t2 && null !== t2 && "function" == typeof t2.then ? Error("The render was aborted by the server with a promise.") : t2; + a2.forEach(function(e11) { + return e11(s2); + }), a2.clear(); + } + null !== e10.destination && eG(e10, e10.destination); + } catch (t3) { + ej(e10, t3, null), eI(e10, t3); + } + } + function ez(e10, t2) { + var r2 = "", n2 = e10[t2]; + if (n2) + r2 = n2.name; + else { + var o2 = t2.lastIndexOf("#"); + if (-1 !== o2 && (r2 = t2.slice(o2 + 1), n2 = e10[t2.slice(0, o2)]), !n2) + throw Error('Could not find the module "' + t2 + '" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'); + } + return [n2.id, n2.chunks, r2]; + } + var eX = /* @__PURE__ */ new Map(); + function eJ(e10) { + var t2 = globalThis2.__next_require__(e10); + return "function" != typeof t2.then || "fulfilled" === t2.status ? null : (t2.then(function(e11) { + t2.status = "fulfilled", t2.value = e11; + }, function(e11) { + t2.status = "rejected", t2.reason = e11; + }), t2); + } + function eY() { + } + function eK(e10) { + for (var t2 = e10[1], n2 = [], o2 = 0; o2 < t2.length; ) { + var i2 = t2[o2++]; + t2[o2++]; + var a2 = eX.get(i2); + if (void 0 === a2) { + a2 = r.e(i2), n2.push(a2); + var s2 = eX.set.bind(eX, i2, null); + a2.then(s2, eY), eX.set(i2, a2); + } else + null !== a2 && n2.push(a2); + } + return 4 === e10.length ? 0 === n2.length ? eJ(e10[0]) : Promise.all(n2).then(function() { + return eJ(e10[0]); + }) : 0 < n2.length ? Promise.all(n2) : null; + } + function eQ(e10) { + var t2 = globalThis2.__next_require__(e10[0]); + if (4 === e10.length && "function" == typeof t2.then) { + if ("fulfilled" === t2.status) + t2 = t2.value; + else + throw t2.reason; + } + return "*" === e10[2] ? t2 : "" === e10[2] ? t2.__esModule ? t2.default : t2 : t2[e10[2]]; + } + var eZ = Object.prototype.hasOwnProperty; + function e0(e10, t2, r2, n2) { + this.status = e10, this.value = t2, this.reason = r2, this._response = n2; + } + function e1(e10) { + return new e0("pending", null, null, e10); + } + function e2(e10, t2) { + for (var r2 = 0; r2 < e10.length; r2++) + (0, e10[r2])(t2); + } + function e4(e10, t2) { + if ("pending" !== e10.status && "blocked" !== e10.status) + e10.reason.error(t2); + else { + var r2 = e10.reason; + e10.status = "rejected", e10.reason = t2, null !== r2 && e2(r2, t2); + } + } + function e6(e10, t2, r2) { + if ("pending" !== e10.status) + e10 = e10.reason, "C" === t2[0] ? e10.close("C" === t2 ? '"$undefined"' : t2.slice(1)) : e10.enqueueModel(t2); + else { + var n2 = e10.value, o2 = e10.reason; + if (e10.status = "resolved_model", e10.value = t2, e10.reason = r2, null !== n2) + switch (e9(e10), e10.status) { + case "fulfilled": + e2(n2, e10.value); + break; + case "pending": + case "blocked": + case "cyclic": + if (e10.value) + for (t2 = 0; t2 < n2.length; t2++) + e10.value.push(n2[t2]); + else + e10.value = n2; + if (e10.reason) { + if (o2) + for (t2 = 0; t2 < o2.length; t2++) + e10.reason.push(o2[t2]); + } else + e10.reason = o2; + break; + case "rejected": + o2 && e2(o2, e10.reason); + } + } + } + function e3(e10, t2, r2) { + return new e0("resolved_model", (r2 ? '{"done":true,"value":' : '{"done":false,"value":') + t2 + "}", -1, e10); + } + function e8(e10, t2, r2) { + e6(e10, (r2 ? '{"done":true,"value":' : '{"done":false,"value":') + t2 + "}", -1); + } + e0.prototype = Object.create(Promise.prototype), e0.prototype.then = function(e10, t2) { + switch ("resolved_model" === this.status && e9(this), this.status) { + case "fulfilled": + e10(this.value); + break; + case "pending": + case "blocked": + case "cyclic": + e10 && (null === this.value && (this.value = []), this.value.push(e10)), t2 && (null === this.reason && (this.reason = []), this.reason.push(t2)); + break; + default: + t2(this.reason); + } + }; + var e5 = null, e7 = null; + function e9(e10) { + var t2 = e5, r2 = e7; + e5 = e10, e7 = null; + var n2 = -1 === e10.reason ? void 0 : e10.reason.toString(16), o2 = e10.value; + e10.status = "cyclic", e10.value = null, e10.reason = null; + try { + var i2 = JSON.parse(o2), a2 = function e11(t3, r3, n3, o3, i3) { + if ("string" == typeof o3) + return function(e12, t4, r4, n4, o4) { + if ("$" === n4[0]) { + switch (n4[1]) { + case "$": + return n4.slice(1); + case "@": + return te(e12, t4 = parseInt(n4.slice(2), 16)); + case "F": + return n4 = tn(e12, n4 = n4.slice(2), t4, r4, ts), function(e13, t5, r5, n5, o5, i5) { + var a5 = ez(e13._bundlerConfig, t5); + if (t5 = eK(a5), r5) + r5 = Promise.all([r5, t5]).then(function(e14) { + e14 = e14[0]; + var t6 = eQ(a5); + return t6.bind.apply(t6, [null].concat(e14)); + }); + else { + if (!t5) + return eQ(a5); + r5 = Promise.resolve(t5).then(function() { + return eQ(a5); + }); + } + return r5.then(tt(n5, o5, i5, false, e13, ts, []), tr(n5)), null; + }(e12, n4.id, n4.bound, e5, t4, r4); + case "T": + var i4, a4; + if (void 0 === o4 || void 0 === e12._temporaryReferences) + throw Error("Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."); + return i4 = e12._temporaryReferences, a4 = new Proxy(a4 = Object.defineProperties(function() { + throw Error("Attempted to call a temporary Client Reference from the server but it is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); + }, { $$typeof: { value: P } }), $), i4.set(a4, o4), a4; + case "Q": + return tn(e12, n4 = n4.slice(2), t4, r4, to); + case "W": + return tn(e12, n4 = n4.slice(2), t4, r4, ti); + case "K": + t4 = n4.slice(2); + var s3 = e12._prefix + t4 + "_", u2 = new FormData(); + return e12._formData.forEach(function(e13, t5) { + t5.startsWith(s3) && u2.append(t5.slice(s3.length), e13); + }), u2; + case "i": + return tn(e12, n4 = n4.slice(2), t4, r4, ta); + case "I": + return 1 / 0; + case "-": + return "$-0" === n4 ? -0 : -1 / 0; + case "N": + return NaN; + case "u": + return; + case "D": + return new Date(Date.parse(n4.slice(2))); + case "n": + return BigInt(n4.slice(2)); + } + switch (n4[1]) { + case "A": + return tu(e12, n4, ArrayBuffer, 1, t4, r4); + case "O": + return tu(e12, n4, Int8Array, 1, t4, r4); + case "o": + return tu(e12, n4, Uint8Array, 1, t4, r4); + case "U": + return tu(e12, n4, Uint8ClampedArray, 1, t4, r4); + case "S": + return tu(e12, n4, Int16Array, 2, t4, r4); + case "s": + return tu(e12, n4, Uint16Array, 2, t4, r4); + case "L": + return tu(e12, n4, Int32Array, 4, t4, r4); + case "l": + return tu(e12, n4, Uint32Array, 4, t4, r4); + case "G": + return tu(e12, n4, Float32Array, 4, t4, r4); + case "g": + return tu(e12, n4, Float64Array, 8, t4, r4); + case "M": + return tu(e12, n4, BigInt64Array, 8, t4, r4); + case "m": + return tu(e12, n4, BigUint64Array, 8, t4, r4); + case "V": + return tu(e12, n4, DataView, 1, t4, r4); + case "B": + return t4 = parseInt(n4.slice(2), 16), e12._formData.get(e12._prefix + t4); + } + switch (n4[1]) { + case "R": + return tc(e12, n4, void 0); + case "r": + return tc(e12, n4, "bytes"); + case "X": + return td(e12, n4, false); + case "x": + return td(e12, n4, true); + } + return tn(e12, n4 = n4.slice(1), t4, r4, ts); + } + return n4; + }(t3, r3, n3, o3, i3); + if ("object" == typeof o3 && null !== o3) { + if (void 0 !== i3 && void 0 !== t3._temporaryReferences && t3._temporaryReferences.set(o3, i3), Array.isArray(o3)) + for (var a3 = 0; a3 < o3.length; a3++) + o3[a3] = e11(t3, o3, "" + a3, o3[a3], void 0 !== i3 ? i3 + ":" + a3 : void 0); + else + for (a3 in o3) + eZ.call(o3, a3) && (r3 = void 0 !== i3 && -1 === a3.indexOf(":") ? i3 + ":" + a3 : void 0, void 0 !== (r3 = e11(t3, o3, a3, o3[a3], r3)) ? o3[a3] = r3 : delete o3[a3]); + } + return o3; + }(e10._response, { "": i2 }, "", i2, n2); + if (null !== e7 && 0 < e7.deps) + e7.value = a2, e10.status = "blocked"; + else { + var s2 = e10.value; + e10.status = "fulfilled", e10.value = a2, null !== s2 && e2(s2, a2); + } + } catch (t3) { + e10.status = "rejected", e10.reason = t3; + } finally { + e5 = t2, e7 = r2; + } + } + function te(e10, t2) { + var r2 = e10._chunks, n2 = r2.get(t2); + return n2 || (n2 = null != (n2 = e10._formData.get(e10._prefix + t2)) ? new e0("resolved_model", n2, t2, e10) : e1(e10), r2.set(t2, n2)), n2; + } + function tt(e10, t2, r2, n2, o2, i2, a2) { + if (e7) { + var s2 = e7; + n2 || s2.deps++; + } else + s2 = e7 = { deps: n2 ? 0 : 1, value: null }; + return function(n3) { + for (var u2 = 1; u2 < a2.length; u2++) + n3 = n3[a2[u2]]; + t2[r2] = i2(o2, n3), "" === r2 && null === s2.value && (s2.value = t2[r2]), s2.deps--, 0 === s2.deps && "blocked" === e10.status && (n3 = e10.value, e10.status = "fulfilled", e10.value = s2.value, null !== n3 && e2(n3, s2.value)); + }; + } + function tr(e10) { + return function(t2) { + return e4(e10, t2); + }; + } + function tn(e10, t2, r2, n2, o2) { + var i2 = parseInt((t2 = t2.split(":"))[0], 16); + switch ("resolved_model" === (i2 = te(e10, i2)).status && e9(i2), i2.status) { + case "fulfilled": + for (n2 = 1, r2 = i2.value; n2 < t2.length; n2++) + r2 = r2[t2[n2]]; + return o2(e10, r2); + case "pending": + case "blocked": + case "cyclic": + var a2 = e5; + return i2.then(tt(a2, r2, n2, "cyclic" === i2.status, e10, o2, t2), tr(a2)), null; + default: + throw i2.reason; + } + } + function to(e10, t2) { + return new Map(t2); + } + function ti(e10, t2) { + return new Set(t2); + } + function ta(e10, t2) { + return t2[Symbol.iterator](); + } + function ts(e10, t2) { + return t2; + } + function tu(e10, t2, r2, n2, o2, i2) { + return t2 = parseInt(t2.slice(2), 16), t2 = e10._formData.get(e10._prefix + t2), t2 = r2 === ArrayBuffer ? t2.arrayBuffer() : t2.arrayBuffer().then(function(e11) { + return new r2(e11); + }), n2 = e5, t2.then(tt(n2, o2, i2, false, e10, ts, []), tr(n2)), null; + } + function tl(e10, t2, r2, n2) { + var o2 = e10._chunks; + for (r2 = new e0("fulfilled", r2, n2, e10), o2.set(t2, r2), e10 = e10._formData.getAll(e10._prefix + t2), t2 = 0; t2 < e10.length; t2++) + "C" === (o2 = e10[t2])[0] ? n2.close("C" === o2 ? '"$undefined"' : o2.slice(1)) : n2.enqueueModel(o2); + } + function tc(e10, t2, r2) { + t2 = parseInt(t2.slice(2), 16); + var n2 = null; + r2 = new ReadableStream({ type: r2, start: function(e11) { + n2 = e11; + } }); + var o2 = null; + return tl(e10, t2, r2, { enqueueModel: function(t3) { + if (null === o2) { + var r3 = new e0("resolved_model", t3, -1, e10); + e9(r3), "fulfilled" === r3.status ? n2.enqueue(r3.value) : (r3.then(function(e11) { + return n2.enqueue(e11); + }, function(e11) { + return n2.error(e11); + }), o2 = r3); + } else { + r3 = o2; + var i2 = e1(e10); + i2.then(function(e11) { + return n2.enqueue(e11); + }, function(e11) { + return n2.error(e11); + }), o2 = i2, r3.then(function() { + o2 === i2 && (o2 = null), e6(i2, t3, -1); + }); + } + }, close: function() { + if (null === o2) + n2.close(); + else { + var e11 = o2; + o2 = null, e11.then(function() { + return n2.close(); + }); + } + }, error: function(e11) { + if (null === o2) + n2.error(e11); + else { + var t3 = o2; + o2 = null, t3.then(function() { + return n2.error(e11); + }); + } + } }), r2; + } + function tf() { + return this; + } + function td(e10, t2, r2) { + t2 = parseInt(t2.slice(2), 16); + var n2 = [], o2 = false, i2 = 0, a2 = {}; + return a2[G] = function() { + var t3, r3 = 0; + return (t3 = { next: t3 = function(t4) { + if (void 0 !== t4) + throw Error("Values cannot be passed to next() of AsyncIterables passed to Client Components."); + if (r3 === n2.length) { + if (o2) + return new e0("fulfilled", { done: true, value: void 0 }, null, e10); + n2[r3] = e1(e10); + } + return n2[r3++]; + } })[G] = tf, t3; + }, tl(e10, t2, r2 = r2 ? a2[G]() : a2, { enqueueModel: function(t3) { + i2 === n2.length ? n2[i2] = e3(e10, t3, false) : e8(n2[i2], t3, false), i2++; + }, close: function(t3) { + for (o2 = true, i2 === n2.length ? n2[i2] = e3(e10, t3, true) : e8(n2[i2], t3, true), i2++; i2 < n2.length; ) + e8(n2[i2++], '"$undefined"', true); + }, error: function(t3) { + for (o2 = true, i2 === n2.length && (n2[i2] = e1(e10)); i2 < n2.length; ) + e4(n2[i2++], t3); + } }), r2; + } + function tp(e10, t2, r2) { + var n2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : new FormData(); + return { _bundlerConfig: e10, _prefix: t2, _formData: n2, _chunks: /* @__PURE__ */ new Map(), _temporaryReferences: r2 }; + } + function th(e10) { + !function(e11, t2) { + e11._chunks.forEach(function(e12) { + "pending" === e12.status && e4(e12, t2); + }); + }(e10, Error("Connection closed.")); + } + function ty(e10, t2, r2) { + var n2 = ez(e10, t2); + return e10 = eK(n2), r2 ? Promise.all([r2, e10]).then(function(e11) { + e11 = e11[0]; + var t3 = eQ(n2); + return t3.bind.apply(t3, [null].concat(e11)); + }) : e10 ? Promise.resolve(e10).then(function() { + return eQ(n2); + }) : Promise.resolve(eQ(n2)); + } + function tg(e10, t2, r2) { + if (th(e10 = tp(t2, r2, void 0, e10)), (e10 = te(e10, 0)).then(function() { + }), "fulfilled" !== e10.status) + throw e10.reason; + return e10.value; + } + t.createClientModuleProxy = function(e10) { + return new Proxy(e10 = v({}, e10, false), _); + }, t.createTemporaryReferenceSet = function() { + return /* @__PURE__ */ new WeakMap(); + }, t.decodeAction = function(e10, t2) { + var r2 = new FormData(), n2 = null; + return e10.forEach(function(o2, i2) { + i2.startsWith("$ACTION_") ? i2.startsWith("$ACTION_REF_") ? (o2 = tg(e10, t2, o2 = "$ACTION_" + i2.slice(12) + ":"), n2 = ty(t2, o2.id, o2.bound)) : i2.startsWith("$ACTION_ID_") && (n2 = ty(t2, o2 = i2.slice(11), null)) : r2.append(i2, o2); + }), null === n2 ? null : n2.then(function(e11) { + return e11.bind(null, r2); + }); + }, t.decodeFormState = function(e10, t2, r2) { + var n2 = t2.get("$ACTION_KEY"); + if ("string" != typeof n2) + return Promise.resolve(null); + var o2 = null; + if (t2.forEach(function(e11, n3) { + n3.startsWith("$ACTION_REF_") && (o2 = tg(t2, r2, "$ACTION_" + n3.slice(12) + ":")); + }), null === o2) + return Promise.resolve(null); + var i2 = o2.id; + return Promise.resolve(o2.bound).then(function(t3) { + return null === t3 ? null : [e10, n2, i2, t3.length - 1]; + }); + }, t.decodeReply = function(e10, t2, r2) { + if ("string" == typeof e10) { + var n2 = new FormData(); + n2.append("0", e10), e10 = n2; + } + return t2 = te(e10 = tp(t2, "", r2 ? r2.temporaryReferences : void 0, e10), 0), th(e10), t2; + }, t.registerClientReference = function(e10, t2, r2) { + return v(e10, t2 + "#" + r2, false); + }, t.registerServerReference = function(e10, t2, r2) { + return Object.defineProperties(e10, { $$typeof: { value: g }, $$id: { value: null === r2 ? t2 : t2 + "#" + r2, configurable: true }, $$bound: { value: null, configurable: true }, bind: { value: S, configurable: true } }); + }; + let tv = "function" == typeof globalThis2.setImmediate && globalThis2.propertyIsEnumerable("setImmediate") ? globalThis2.setImmediate : setTimeout; + t.renderToReadableStream = function(e10, t2, r2) { + var n2 = new ey(20, e10, t2, r2 ? r2.onError : void 0, r2 ? r2.identifierPrefix : void 0, r2 ? r2.onPostpone : void 0, r2 ? r2.temporaryReferences : void 0, void 0, void 0, eg, eg); + if (r2 && r2.signal) { + var o2 = r2.signal; + if (o2.aborted) + eV(n2, o2.reason); + else { + var i2 = function() { + eV(n2, o2.reason), o2.removeEventListener("abort", i2); + }; + o2.addEventListener("abort", i2); + } + } + return new ReadableStream({ type: "bytes", start: function() { + n2.flushScheduled = null !== n2.destination, k ? s(function() { + T.run(n2, eF, n2); + }) : s(function() { + return eF(n2); + }), tv(function() { + 10 === n2.status && (n2.status = 11); + }, 0); + }, pull: function(e11) { + if (13 === n2.status) + n2.status = 14, h(e11, n2.fatalError); + else if (14 !== n2.status && null === n2.destination) { + n2.destination = e11; + try { + eG(n2, e11); + } catch (e12) { + ej(n2, e12, null), eI(n2, e12); + } + } + }, cancel: function(e11) { + n2.destination = null, eV(n2, e11); + } }, { highWaterMark: 0 }); + }; + }; + __namedExportsObject4["__chunk_2844"] = (e, t, r) => { + "use strict"; + e.exports = r(43894); + }; + __namedExportsObject4["__chunk_43894"] = (e, t, r) => { + "use strict"; + var n = r(23034); + function o() { + } + var i = { d: { f: o, r: function() { + throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React."); + }, D: o, C: o, L: o, m: o, X: o, S: o, M: o }, p: 0, findDOMNode: null }; + if (!n.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) + throw Error('The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'); + function a(e2, t2) { + return "font" === e2 ? "" : "string" == typeof t2 ? "use-credentials" === t2 ? t2 : "" : void 0; + } + t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = i, t.preconnect = function(e2, t2) { + "string" == typeof e2 && (t2 = t2 ? "string" == typeof (t2 = t2.crossOrigin) ? "use-credentials" === t2 ? t2 : "" : void 0 : null, i.d.C(e2, t2)); + }, t.prefetchDNS = function(e2) { + "string" == typeof e2 && i.d.D(e2); + }, t.preinit = function(e2, t2) { + if ("string" == typeof e2 && t2 && "string" == typeof t2.as) { + var r2 = t2.as, n2 = a(r2, t2.crossOrigin), o2 = "string" == typeof t2.integrity ? t2.integrity : void 0, s = "string" == typeof t2.fetchPriority ? t2.fetchPriority : void 0; + "style" === r2 ? i.d.S(e2, "string" == typeof t2.precedence ? t2.precedence : void 0, { crossOrigin: n2, integrity: o2, fetchPriority: s }) : "script" === r2 && i.d.X(e2, { crossOrigin: n2, integrity: o2, fetchPriority: s, nonce: "string" == typeof t2.nonce ? t2.nonce : void 0 }); + } + }, t.preinitModule = function(e2, t2) { + if ("string" == typeof e2) { + if ("object" == typeof t2 && null !== t2) { + if (null == t2.as || "script" === t2.as) { + var r2 = a(t2.as, t2.crossOrigin); + i.d.M(e2, { crossOrigin: r2, integrity: "string" == typeof t2.integrity ? t2.integrity : void 0, nonce: "string" == typeof t2.nonce ? t2.nonce : void 0 }); + } + } else + null == t2 && i.d.M(e2); + } + }, t.preload = function(e2, t2) { + if ("string" == typeof e2 && "object" == typeof t2 && null !== t2 && "string" == typeof t2.as) { + var r2 = t2.as, n2 = a(r2, t2.crossOrigin); + i.d.L(e2, r2, { crossOrigin: n2, integrity: "string" == typeof t2.integrity ? t2.integrity : void 0, nonce: "string" == typeof t2.nonce ? t2.nonce : void 0, type: "string" == typeof t2.type ? t2.type : void 0, fetchPriority: "string" == typeof t2.fetchPriority ? t2.fetchPriority : void 0, referrerPolicy: "string" == typeof t2.referrerPolicy ? t2.referrerPolicy : void 0, imageSrcSet: "string" == typeof t2.imageSrcSet ? t2.imageSrcSet : void 0, imageSizes: "string" == typeof t2.imageSizes ? t2.imageSizes : void 0, media: "string" == typeof t2.media ? t2.media : void 0 }); + } + }, t.preloadModule = function(e2, t2) { + if ("string" == typeof e2) { + if (t2) { + var r2 = a(t2.as, t2.crossOrigin); + i.d.m(e2, { as: "string" == typeof t2.as && "script" !== t2.as ? t2.as : void 0, crossOrigin: r2, integrity: "string" == typeof t2.integrity ? t2.integrity : void 0 }); + } else + i.d.m(e2); + } + }, t.version = "19.0.0-rc-bf7e210c-20241017"; + }; + __namedExportsObject4["__chunk_70323"] = (e) => { + !function() { + "use strict"; + var t = { 815: function(e2) { + e2.exports = function(e3, r2, n2, o2) { + r2 = r2 || "&", n2 = n2 || "="; + var i = {}; + if ("string" != typeof e3 || 0 === e3.length) + return i; + var a = /\+/g; + e3 = e3.split(r2); + var s = 1e3; + o2 && "number" == typeof o2.maxKeys && (s = o2.maxKeys); + var u = e3.length; + s > 0 && u > s && (u = s); + for (var l = 0; l < u; ++l) { + var c, f, d, p, h = e3[l].replace(a, "%20"), y = h.indexOf(n2); + (y >= 0 ? (c = h.substr(0, y), f = h.substr(y + 1)) : (c = h, f = ""), d = decodeURIComponent(c), p = decodeURIComponent(f), Object.prototype.hasOwnProperty.call(i, d)) ? t2(i[d]) ? i[d].push(p) : i[d] = [i[d], p] : i[d] = p; + } + return i; + }; + var t2 = Array.isArray || function(e3) { + return "[object Array]" === Object.prototype.toString.call(e3); + }; + }, 577: function(e2) { + var t2 = function(e3) { + switch (typeof e3) { + case "string": + return e3; + case "boolean": + return e3 ? "true" : "false"; + case "number": + return isFinite(e3) ? e3 : ""; + default: + return ""; + } + }; + e2.exports = function(e3, i, a, s) { + return (i = i || "&", a = a || "=", null === e3 && (e3 = void 0), "object" == typeof e3) ? n2(o2(e3), function(o3) { + var s2 = encodeURIComponent(t2(o3)) + a; + return r2(e3[o3]) ? n2(e3[o3], function(e4) { + return s2 + encodeURIComponent(t2(e4)); + }).join(i) : s2 + encodeURIComponent(t2(e3[o3])); + }).join(i) : s ? encodeURIComponent(t2(s)) + a + encodeURIComponent(t2(e3)) : ""; + }; + var r2 = Array.isArray || function(e3) { + return "[object Array]" === Object.prototype.toString.call(e3); + }; + function n2(e3, t3) { + if (e3.map) + return e3.map(t3); + for (var r3 = [], n3 = 0; n3 < e3.length; n3++) + r3.push(t3(e3[n3], n3)); + return r3; + } + var o2 = Object.keys || function(e3) { + var t3 = []; + for (var r3 in e3) + Object.prototype.hasOwnProperty.call(e3, r3) && t3.push(r3); + return t3; + }; + } }, r = {}; + function n(e2) { + var o2 = r[e2]; + if (void 0 !== o2) + return o2.exports; + var i = r[e2] = { exports: {} }, a = true; + try { + t[e2](i, i.exports, n), a = false; + } finally { + a && delete r[e2]; + } + return i.exports; + } + n.ab = "//"; + var o = {}; + o.decode = o.parse = n(815), o.encode = o.stringify = n(577), e.exports = o; + }(); + }; + __namedExportsObject4["__chunk_7666"] = (e) => { + (() => { + "use strict"; + "undefined" != typeof __nccwpck_require__ && (__nccwpck_require__.ab = "//"); + var t = {}; + (() => { + function e2(e3, t2) { + void 0 === t2 && (t2 = {}); + for (var r2 = function(e4) { + for (var t3 = [], r3 = 0; r3 < e4.length; ) { + var n3 = e4[r3]; + if ("*" === n3 || "+" === n3 || "?" === n3) { + t3.push({ type: "MODIFIER", index: r3, value: e4[r3++] }); + continue; + } + if ("\\" === n3) { + t3.push({ type: "ESCAPED_CHAR", index: r3++, value: e4[r3++] }); + continue; + } + if ("{" === n3) { + t3.push({ type: "OPEN", index: r3, value: e4[r3++] }); + continue; + } + if ("}" === n3) { + t3.push({ type: "CLOSE", index: r3, value: e4[r3++] }); + continue; + } + if (":" === n3) { + for (var o2 = "", i3 = r3 + 1; i3 < e4.length; ) { + var a3 = e4.charCodeAt(i3); + if (a3 >= 48 && a3 <= 57 || a3 >= 65 && a3 <= 90 || a3 >= 97 && a3 <= 122 || 95 === a3) { + o2 += e4[i3++]; + continue; + } + break; + } + if (!o2) + throw TypeError("Missing parameter name at " + r3); + t3.push({ type: "NAME", index: r3, value: o2 }), r3 = i3; + continue; + } + if ("(" === n3) { + var s3 = 1, u2 = "", i3 = r3 + 1; + if ("?" === e4[i3]) + throw TypeError('Pattern cannot start with "?" at ' + i3); + for (; i3 < e4.length; ) { + if ("\\" === e4[i3]) { + u2 += e4[i3++] + e4[i3++]; + continue; + } + if (")" === e4[i3]) { + if (0 == --s3) { + i3++; + break; + } + } else if ("(" === e4[i3] && (s3++, "?" !== e4[i3 + 1])) + throw TypeError("Capturing groups are not allowed at " + i3); + u2 += e4[i3++]; + } + if (s3) + throw TypeError("Unbalanced pattern at " + r3); + if (!u2) + throw TypeError("Missing pattern at " + r3); + t3.push({ type: "PATTERN", index: r3, value: u2 }), r3 = i3; + continue; + } + t3.push({ type: "CHAR", index: r3, value: e4[r3++] }); + } + return t3.push({ type: "END", index: r3, value: "" }), t3; + }(e3), n2 = t2.prefixes, i2 = void 0 === n2 ? "./" : n2, a2 = "[^" + o(t2.delimiter || "/#?") + "]+?", s2 = [], u = 0, l = 0, c = "", f = function(e4) { + if (l < r2.length && r2[l].type === e4) + return r2[l++].value; + }, d = function(e4) { + var t3 = f(e4); + if (void 0 !== t3) + return t3; + var n3 = r2[l]; + throw TypeError("Unexpected " + n3.type + " at " + n3.index + ", expected " + e4); + }, p = function() { + for (var e4, t3 = ""; e4 = f("CHAR") || f("ESCAPED_CHAR"); ) + t3 += e4; + return t3; + }; l < r2.length; ) { + var h = f("CHAR"), y = f("NAME"), g = f("PATTERN"); + if (y || g) { + var v = h || ""; + -1 === i2.indexOf(v) && (c += v, v = ""), c && (s2.push(c), c = ""), s2.push({ name: y || u++, prefix: v, suffix: "", pattern: g || a2, modifier: f("MODIFIER") || "" }); + continue; + } + var m = h || f("ESCAPED_CHAR"); + if (m) { + c += m; + continue; + } + if (c && (s2.push(c), c = ""), f("OPEN")) { + var v = p(), b = f("NAME") || "", S = f("PATTERN") || "", w = p(); + d("CLOSE"), s2.push({ name: b || (S ? u++ : ""), pattern: b && !S ? a2 : S, prefix: v, suffix: w, modifier: f("MODIFIER") || "" }); + continue; + } + d("END"); + } + return s2; + } + function r(e3, t2) { + void 0 === t2 && (t2 = {}); + var r2 = i(t2), n2 = t2.encode, o2 = void 0 === n2 ? function(e4) { + return e4; + } : n2, a2 = t2.validate, s2 = void 0 === a2 || a2, u = e3.map(function(e4) { + if ("object" == typeof e4) + return RegExp("^(?:" + e4.pattern + ")$", r2); + }); + return function(t3) { + for (var r3 = "", n3 = 0; n3 < e3.length; n3++) { + var i2 = e3[n3]; + if ("string" == typeof i2) { + r3 += i2; + continue; + } + var a3 = t3 ? t3[i2.name] : void 0, l = "?" === i2.modifier || "*" === i2.modifier, c = "*" === i2.modifier || "+" === i2.modifier; + if (Array.isArray(a3)) { + if (!c) + throw TypeError('Expected "' + i2.name + '" to not repeat, but got an array'); + if (0 === a3.length) { + if (l) + continue; + throw TypeError('Expected "' + i2.name + '" to not be empty'); + } + for (var f = 0; f < a3.length; f++) { + var d = o2(a3[f], i2); + if (s2 && !u[n3].test(d)) + throw TypeError('Expected all "' + i2.name + '" to match "' + i2.pattern + '", but got "' + d + '"'); + r3 += i2.prefix + d + i2.suffix; + } + continue; + } + if ("string" == typeof a3 || "number" == typeof a3) { + var d = o2(String(a3), i2); + if (s2 && !u[n3].test(d)) + throw TypeError('Expected "' + i2.name + '" to match "' + i2.pattern + '", but got "' + d + '"'); + r3 += i2.prefix + d + i2.suffix; + continue; + } + if (!l) { + var p = c ? "an array" : "a string"; + throw TypeError('Expected "' + i2.name + '" to be ' + p); + } + } + return r3; + }; + } + function n(e3, t2, r2) { + void 0 === r2 && (r2 = {}); + var n2 = r2.decode, o2 = void 0 === n2 ? function(e4) { + return e4; + } : n2; + return function(r3) { + var n3 = e3.exec(r3); + if (!n3) + return false; + for (var i2 = n3[0], a2 = n3.index, s2 = /* @__PURE__ */ Object.create(null), u = 1; u < n3.length; u++) + !function(e4) { + if (void 0 !== n3[e4]) { + var r4 = t2[e4 - 1]; + "*" === r4.modifier || "+" === r4.modifier ? s2[r4.name] = n3[e4].split(r4.prefix + r4.suffix).map(function(e5) { + return o2(e5, r4); + }) : s2[r4.name] = o2(n3[e4], r4); + } + }(u); + return { path: i2, index: a2, params: s2 }; + }; + } + function o(e3) { + return e3.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); + } + function i(e3) { + return e3 && e3.sensitive ? "" : "i"; + } + function a(e3, t2, r2) { + void 0 === r2 && (r2 = {}); + for (var n2 = r2.strict, a2 = void 0 !== n2 && n2, s2 = r2.start, u = r2.end, l = r2.encode, c = void 0 === l ? function(e4) { + return e4; + } : l, f = "[" + o(r2.endsWith || "") + "]|$", d = "[" + o(r2.delimiter || "/#?") + "]", p = void 0 === s2 || s2 ? "^" : "", h = 0; h < e3.length; h++) { + var y = e3[h]; + if ("string" == typeof y) + p += o(c(y)); + else { + var g = o(c(y.prefix)), v = o(c(y.suffix)); + if (y.pattern) { + if (t2 && t2.push(y), g || v) { + if ("+" === y.modifier || "*" === y.modifier) { + var m = "*" === y.modifier ? "?" : ""; + p += "(?:" + g + "((?:" + y.pattern + ")(?:" + v + g + "(?:" + y.pattern + "))*)" + v + ")" + m; + } else + p += "(?:" + g + "(" + y.pattern + ")" + v + ")" + y.modifier; + } else + p += "(" + y.pattern + ")" + y.modifier; + } else + p += "(?:" + g + v + ")" + y.modifier; + } + } + if (void 0 === u || u) + a2 || (p += d + "?"), p += r2.endsWith ? "(?=" + f + ")" : "$"; + else { + var b = e3[e3.length - 1], S = "string" == typeof b ? d.indexOf(b[b.length - 1]) > -1 : void 0 === b; + a2 || (p += "(?:" + d + "(?=" + f + "))?"), S || (p += "(?=" + d + "|" + f + ")"); + } + return new RegExp(p, i(r2)); + } + function s(t2, r2, n2) { + return t2 instanceof RegExp ? function(e3, t3) { + if (!t3) + return e3; + var r3 = e3.source.match(/\((?!\?)/g); + if (r3) + for (var n3 = 0; n3 < r3.length; n3++) + t3.push({ name: n3, prefix: "", suffix: "", modifier: "", pattern: "" }); + return e3; + }(t2, r2) : Array.isArray(t2) ? RegExp("(?:" + t2.map(function(e3) { + return s(e3, r2, n2).source; + }).join("|") + ")", i(n2)) : a(e2(t2, n2), r2, n2); + } + Object.defineProperty(t, "__esModule", { value: true }), t.parse = e2, t.compile = function(t2, n2) { + return r(e2(t2, n2), n2); + }, t.tokensToFunction = r, t.match = function(e3, t2) { + var r2 = []; + return n(s(e3, r2, t2), r2, t2); + }, t.regexpToFunction = n, t.tokensToRegexp = a, t.pathToRegexp = s; + })(), e.exports = t; + })(); + }; + __namedExportsObject4["__chunk_61940"] = (e) => { + !function() { + "use strict"; + var t = { 114: function(e2) { + function t2(e3) { + if ("string" != typeof e3) + throw TypeError("Path must be a string. Received " + JSON.stringify(e3)); + } + function r2(e3, t3) { + for (var r3, n3 = "", o2 = 0, i = -1, a = 0, s = 0; s <= e3.length; ++s) { + if (s < e3.length) + r3 = e3.charCodeAt(s); + else if (47 === r3) + break; + else + r3 = 47; + if (47 === r3) { + if (i === s - 1 || 1 === a) + ; + else if (i !== s - 1 && 2 === a) { + if (n3.length < 2 || 2 !== o2 || 46 !== n3.charCodeAt(n3.length - 1) || 46 !== n3.charCodeAt(n3.length - 2)) { + if (n3.length > 2) { + var u = n3.lastIndexOf("/"); + if (u !== n3.length - 1) { + -1 === u ? (n3 = "", o2 = 0) : o2 = (n3 = n3.slice(0, u)).length - 1 - n3.lastIndexOf("/"), i = s, a = 0; + continue; + } + } else if (2 === n3.length || 1 === n3.length) { + n3 = "", o2 = 0, i = s, a = 0; + continue; + } + } + t3 && (n3.length > 0 ? n3 += "/.." : n3 = "..", o2 = 2); + } else + n3.length > 0 ? n3 += "/" + e3.slice(i + 1, s) : n3 = e3.slice(i + 1, s), o2 = s - i - 1; + i = s, a = 0; + } else + 46 === r3 && -1 !== a ? ++a : a = -1; + } + return n3; + } + var n2 = { resolve: function() { + for (var e3, n3, o2 = "", i = false, a = arguments.length - 1; a >= -1 && !i; a--) + a >= 0 ? n3 = arguments[a] : (void 0 === e3 && (e3 = ""), n3 = e3), t2(n3), 0 !== n3.length && (o2 = n3 + "/" + o2, i = 47 === n3.charCodeAt(0)); + return (o2 = r2(o2, !i), i) ? o2.length > 0 ? "/" + o2 : "/" : o2.length > 0 ? o2 : "."; + }, normalize: function(e3) { + if (t2(e3), 0 === e3.length) + return "."; + var n3 = 47 === e3.charCodeAt(0), o2 = 47 === e3.charCodeAt(e3.length - 1); + return (0 !== (e3 = r2(e3, !n3)).length || n3 || (e3 = "."), e3.length > 0 && o2 && (e3 += "/"), n3) ? "/" + e3 : e3; + }, isAbsolute: function(e3) { + return t2(e3), e3.length > 0 && 47 === e3.charCodeAt(0); + }, join: function() { + if (0 == arguments.length) + return "."; + for (var e3, r3 = 0; r3 < arguments.length; ++r3) { + var o2 = arguments[r3]; + t2(o2), o2.length > 0 && (void 0 === e3 ? e3 = o2 : e3 += "/" + o2); + } + return void 0 === e3 ? "." : n2.normalize(e3); + }, relative: function(e3, r3) { + if (t2(e3), t2(r3), e3 === r3 || (e3 = n2.resolve(e3)) === (r3 = n2.resolve(r3))) + return ""; + for (var o2 = 1; o2 < e3.length && 47 === e3.charCodeAt(o2); ++o2) + ; + for (var i = e3.length, a = i - o2, s = 1; s < r3.length && 47 === r3.charCodeAt(s); ++s) + ; + for (var u = r3.length - s, l = a < u ? a : u, c = -1, f = 0; f <= l; ++f) { + if (f === l) { + if (u > l) { + if (47 === r3.charCodeAt(s + f)) + return r3.slice(s + f + 1); + if (0 === f) + return r3.slice(s + f); + } else + a > l && (47 === e3.charCodeAt(o2 + f) ? c = f : 0 === f && (c = 0)); + break; + } + var d = e3.charCodeAt(o2 + f); + if (d !== r3.charCodeAt(s + f)) + break; + 47 === d && (c = f); + } + var p = ""; + for (f = o2 + c + 1; f <= i; ++f) + (f === i || 47 === e3.charCodeAt(f)) && (0 === p.length ? p += ".." : p += "/.."); + return p.length > 0 ? p + r3.slice(s + c) : (s += c, 47 === r3.charCodeAt(s) && ++s, r3.slice(s)); + }, _makeLong: function(e3) { + return e3; + }, dirname: function(e3) { + if (t2(e3), 0 === e3.length) + return "."; + for (var r3 = e3.charCodeAt(0), n3 = 47 === r3, o2 = -1, i = true, a = e3.length - 1; a >= 1; --a) + if (47 === (r3 = e3.charCodeAt(a))) { + if (!i) { + o2 = a; + break; + } + } else + i = false; + return -1 === o2 ? n3 ? "/" : "." : n3 && 1 === o2 ? "//" : e3.slice(0, o2); + }, basename: function(e3, r3) { + if (void 0 !== r3 && "string" != typeof r3) + throw TypeError('"ext" argument must be a string'); + t2(e3); + var n3, o2 = 0, i = -1, a = true; + if (void 0 !== r3 && r3.length > 0 && r3.length <= e3.length) { + if (r3.length === e3.length && r3 === e3) + return ""; + var s = r3.length - 1, u = -1; + for (n3 = e3.length - 1; n3 >= 0; --n3) { + var l = e3.charCodeAt(n3); + if (47 === l) { + if (!a) { + o2 = n3 + 1; + break; + } + } else + -1 === u && (a = false, u = n3 + 1), s >= 0 && (l === r3.charCodeAt(s) ? -1 == --s && (i = n3) : (s = -1, i = u)); + } + return o2 === i ? i = u : -1 === i && (i = e3.length), e3.slice(o2, i); + } + for (n3 = e3.length - 1; n3 >= 0; --n3) + if (47 === e3.charCodeAt(n3)) { + if (!a) { + o2 = n3 + 1; + break; + } + } else + -1 === i && (a = false, i = n3 + 1); + return -1 === i ? "" : e3.slice(o2, i); + }, extname: function(e3) { + t2(e3); + for (var r3 = -1, n3 = 0, o2 = -1, i = true, a = 0, s = e3.length - 1; s >= 0; --s) { + var u = e3.charCodeAt(s); + if (47 === u) { + if (!i) { + n3 = s + 1; + break; + } + continue; + } + -1 === o2 && (i = false, o2 = s + 1), 46 === u ? -1 === r3 ? r3 = s : 1 !== a && (a = 1) : -1 !== r3 && (a = -1); + } + return -1 === r3 || -1 === o2 || 0 === a || 1 === a && r3 === o2 - 1 && r3 === n3 + 1 ? "" : e3.slice(r3, o2); + }, format: function(e3) { + var t3, r3; + if (null === e3 || "object" != typeof e3) + throw TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e3); + return t3 = e3.dir || e3.root, r3 = e3.base || (e3.name || "") + (e3.ext || ""), t3 ? t3 === e3.root ? t3 + r3 : t3 + "/" + r3 : r3; + }, parse: function(e3) { + t2(e3); + var r3, n3 = { root: "", dir: "", base: "", ext: "", name: "" }; + if (0 === e3.length) + return n3; + var o2 = e3.charCodeAt(0), i = 47 === o2; + i ? (n3.root = "/", r3 = 1) : r3 = 0; + for (var a = -1, s = 0, u = -1, l = true, c = e3.length - 1, f = 0; c >= r3; --c) { + if (47 === (o2 = e3.charCodeAt(c))) { + if (!l) { + s = c + 1; + break; + } + continue; + } + -1 === u && (l = false, u = c + 1), 46 === o2 ? -1 === a ? a = c : 1 !== f && (f = 1) : -1 !== a && (f = -1); + } + return -1 === a || -1 === u || 0 === f || 1 === f && a === u - 1 && a === s + 1 ? -1 !== u && (0 === s && i ? n3.base = n3.name = e3.slice(1, u) : n3.base = n3.name = e3.slice(s, u)) : (0 === s && i ? (n3.name = e3.slice(1, a), n3.base = e3.slice(1, u)) : (n3.name = e3.slice(s, a), n3.base = e3.slice(s, u)), n3.ext = e3.slice(a, u)), s > 0 ? n3.dir = e3.slice(0, s - 1) : i && (n3.dir = "/"), n3; + }, sep: "/", delimiter: ":", win32: null, posix: null }; + n2.posix = n2, e2.exports = n2; + } }, r = {}; + function n(e2) { + var o2 = r[e2]; + if (void 0 !== o2) + return o2.exports; + var i = r[e2] = { exports: {} }, a = true; + try { + t[e2](i, i.exports, n), a = false; + } finally { + a && delete r[e2]; + } + return i.exports; + } + n.ab = "//"; + var o = n(114); + e.exports = o; + }(); + }; + __namedExportsObject4["__chunk_64755"] = (e, t, r) => { + !function() { + var t2 = { 452: function(e2) { + "use strict"; + e2.exports = r(70323); + } }, n = {}; + function o(e2) { + var r2 = n[e2]; + if (void 0 !== r2) + return r2.exports; + var i2 = n[e2] = { exports: {} }, a = true; + try { + t2[e2](i2, i2.exports, o), a = false; + } finally { + a && delete n[e2]; + } + return i2.exports; + } + o.ab = "//"; + var i = {}; + !function() { + var e2, t3 = (e2 = o(452)) && "object" == typeof e2 && "default" in e2 ? e2.default : e2, r2 = /https?|ftp|gopher|file/; + function n2(e3) { + "string" == typeof e3 && (e3 = v(e3)); + var n3, o2, i2, a2, s2, u2, l2, c2, f2, d2 = (o2 = (n3 = e3).auth, i2 = n3.hostname, a2 = n3.protocol || "", s2 = n3.pathname || "", u2 = n3.hash || "", l2 = n3.query || "", c2 = false, o2 = o2 ? encodeURIComponent(o2).replace(/%3A/i, ":") + "@" : "", n3.host ? c2 = o2 + n3.host : i2 && (c2 = o2 + (~i2.indexOf(":") ? "[" + i2 + "]" : i2), n3.port && (c2 += ":" + n3.port)), l2 && "object" == typeof l2 && (l2 = t3.encode(l2)), f2 = n3.search || l2 && "?" + l2 || "", a2 && ":" !== a2.substr(-1) && (a2 += ":"), n3.slashes || (!a2 || r2.test(a2)) && false !== c2 ? (c2 = "//" + (c2 || ""), s2 && "/" !== s2[0] && (s2 = "/" + s2)) : c2 || (c2 = ""), u2 && "#" !== u2[0] && (u2 = "#" + u2), f2 && "?" !== f2[0] && (f2 = "?" + f2), { protocol: a2, host: c2, pathname: s2 = s2.replace(/[?#]/g, encodeURIComponent), search: f2 = f2.replace("#", "%23"), hash: u2 }); + return "" + d2.protocol + d2.host + d2.pathname + d2.search + d2.hash; + } + var a = "http://", s = a + "w.w", u = /^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i, l = /https?|ftp|gopher|file/; + function c(e3, t4) { + var r3 = "string" == typeof e3 ? v(e3) : e3; + e3 = "object" == typeof e3 ? n2(e3) : e3; + var o2 = v(t4), i2 = ""; + r3.protocol && !r3.slashes && (i2 = r3.protocol, e3 = e3.replace(r3.protocol, ""), i2 += "/" === t4[0] || "/" === e3[0] ? "/" : ""), i2 && o2.protocol && (i2 = "", o2.slashes || (i2 = o2.protocol, t4 = t4.replace(o2.protocol, ""))); + var c2 = e3.match(u); + c2 && !o2.protocol && (e3 = e3.substr((i2 = c2[1] + (c2[2] || "")).length), /^\/\/[^/]/.test(t4) && (i2 = i2.slice(0, -1))); + var f2 = new URL(e3, s + "/"), d2 = new URL(t4, f2).toString().replace(s, ""), p2 = o2.protocol || r3.protocol; + return p2 += r3.slashes || o2.slashes ? "//" : "", !i2 && p2 ? d2 = d2.replace(a, p2) : i2 && (d2 = d2.replace(a, "")), l.test(d2) || ~t4.indexOf(".") || "/" === e3.slice(-1) || "/" === t4.slice(-1) || "/" !== d2.slice(-1) || (d2 = d2.slice(0, -1)), i2 && (d2 = i2 + ("/" === d2[0] ? d2.substr(1) : d2)), d2; + } + function f() { + } + f.prototype.parse = v, f.prototype.format = n2, f.prototype.resolve = c, f.prototype.resolveObject = c; + var d = /^https?|ftp|gopher|file/, p = /^(.*?)([#?].*)/, h = /^([a-z0-9.+-]*:)(\/{0,3})(.*)/i, y = /^([a-z0-9.+-]*:)?\/\/\/*/i, g = /^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i; + function v(e3, r3, o2) { + if (void 0 === r3 && (r3 = false), void 0 === o2 && (o2 = false), e3 && "object" == typeof e3 && e3 instanceof f) + return e3; + var i2 = (e3 = e3.trim()).match(p); + e3 = i2 ? i2[1].replace(/\\/g, "/") + i2[2] : e3.replace(/\\/g, "/"), g.test(e3) && "/" !== e3.slice(-1) && (e3 += "/"); + var a2 = !/(^javascript)/.test(e3) && e3.match(h), u2 = y.test(e3), l2 = ""; + a2 && (d.test(a2[1]) || (l2 = a2[1].toLowerCase(), e3 = "" + a2[2] + a2[3]), a2[2] || (u2 = false, d.test(a2[1]) ? (l2 = a2[1], e3 = "" + a2[3]) : e3 = "//" + a2[3]), 3 !== a2[2].length && 1 !== a2[2].length || (l2 = a2[1], e3 = "/" + a2[3])); + var c2, v2 = (i2 ? i2[1] : e3).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/), m = v2 && v2[1], b = new f(), S = "", w = ""; + try { + c2 = new URL(e3); + } catch (t4) { + S = t4, l2 || o2 || !/^\/\//.test(e3) || /^\/\/.+[@.]/.test(e3) || (w = "/", e3 = e3.substr(1)); + try { + c2 = new URL(e3, s); + } catch (e4) { + return b.protocol = l2, b.href = l2, b; + } + } + b.slashes = u2 && !w, b.host = "w.w" === c2.host ? "" : c2.host, b.hostname = "w.w" === c2.hostname ? "" : c2.hostname.replace(/(\[|\])/g, ""), b.protocol = S ? l2 || null : c2.protocol, b.search = c2.search.replace(/\\/g, "%5C"), b.hash = c2.hash.replace(/\\/g, "%5C"); + var x = e3.split("#"); + !b.search && ~x[0].indexOf("?") && (b.search = "?"), b.hash || "" !== x[1] || (b.hash = "#"), b.query = r3 ? t3.decode(c2.search.substr(1)) : b.search.substr(1), b.pathname = w + (a2 ? c2.pathname.replace(/['^|`]/g, function(e4) { + return "%" + e4.charCodeAt().toString(16).toUpperCase(); + }).replace(/((?:%[0-9A-F]{2})+)/g, function(e4, t4) { + try { + return decodeURIComponent(t4).split("").map(function(e5) { + var t5 = e5.charCodeAt(); + return t5 > 256 || /^[a-z0-9]$/i.test(e5) ? e5 : "%" + t5.toString(16).toUpperCase(); + }).join(""); + } catch (e5) { + return t4; + } + }) : c2.pathname), "about:" === b.protocol && "blank" === b.pathname && (b.protocol = "", b.pathname = ""), S && "/" !== e3[0] && (b.pathname = b.pathname.substr(1)), l2 && !d.test(l2) && "/" !== e3.slice(-1) && "/" === b.pathname && (b.pathname = ""), b.path = b.pathname + b.search, b.auth = [c2.username, c2.password].map(decodeURIComponent).filter(Boolean).join(":"), b.port = c2.port, m && !b.host.endsWith(m) && (b.host += m, b.port = m.slice(1)), b.href = w ? "" + b.pathname + b.search + b.hash : n2(b); + var E = /^(file)/.test(b.href) ? ["host", "hostname"] : []; + return Object.keys(b).forEach(function(e4) { + ~E.indexOf(e4) || (b[e4] = b[e4] || null); + }), b; + } + i.parse = v, i.format = n2, i.resolve = c, i.resolveObject = function(e3, t4) { + return v(c(e3, t4)); + }, i.Url = f; + }(), e.exports = i; + }(); + }; + __namedExportsObject4["__chunk_13776"] = (e) => { + (() => { + "use strict"; + "undefined" != typeof __nccwpck_require__ && (__nccwpck_require__.ab = "//"); + var t = {}; + (() => { + t.parse = function(t2, r2) { + if ("string" != typeof t2) + throw TypeError("argument str must be a string"); + for (var o2 = {}, i = t2.split(n), a = (r2 || {}).decode || e2, s = 0; s < i.length; s++) { + var u = i[s], l = u.indexOf("="); + if (!(l < 0)) { + var c = u.substr(0, l).trim(), f = u.substr(++l, u.length).trim(); + '"' == f[0] && (f = f.slice(1, -1)), void 0 == o2[c] && (o2[c] = function(e3, t3) { + try { + return t3(e3); + } catch (t4) { + return e3; + } + }(f, a)); + } + } + return o2; + }, t.serialize = function(e3, t2, n2) { + var i = n2 || {}, a = i.encode || r; + if ("function" != typeof a) + throw TypeError("option encode is invalid"); + if (!o.test(e3)) + throw TypeError("argument name is invalid"); + var s = a(t2); + if (s && !o.test(s)) + throw TypeError("argument val is invalid"); + var u = e3 + "=" + s; + if (null != i.maxAge) { + var l = i.maxAge - 0; + if (isNaN(l) || !isFinite(l)) + throw TypeError("option maxAge is invalid"); + u += "; Max-Age=" + Math.floor(l); + } + if (i.domain) { + if (!o.test(i.domain)) + throw TypeError("option domain is invalid"); + u += "; Domain=" + i.domain; + } + if (i.path) { + if (!o.test(i.path)) + throw TypeError("option path is invalid"); + u += "; Path=" + i.path; + } + if (i.expires) { + if ("function" != typeof i.expires.toUTCString) + throw TypeError("option expires is invalid"); + u += "; Expires=" + i.expires.toUTCString(); + } + if (i.httpOnly && (u += "; HttpOnly"), i.secure && (u += "; Secure"), i.sameSite) + switch ("string" == typeof i.sameSite ? i.sameSite.toLowerCase() : i.sameSite) { + case true: + case "strict": + u += "; SameSite=Strict"; + break; + case "lax": + u += "; SameSite=Lax"; + break; + case "none": + u += "; SameSite=None"; + break; + default: + throw TypeError("option sameSite is invalid"); + } + return u; + }; + var e2 = decodeURIComponent, r = encodeURIComponent, n = /; */, o = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; + })(), e.exports = t; + })(); + }; + __namedExportsObject4["__chunk_20601"] = (e) => { + "use strict"; + var t = Object.defineProperty, r = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, i = {}; + function a(e2) { + var t2; + let r2 = ["path" in e2 && e2.path && `Path=${e2.path}`, "expires" in e2 && (e2.expires || 0 === e2.expires) && `Expires=${("number" == typeof e2.expires ? new Date(e2.expires) : e2.expires).toUTCString()}`, "maxAge" in e2 && "number" == typeof e2.maxAge && `Max-Age=${e2.maxAge}`, "domain" in e2 && e2.domain && `Domain=${e2.domain}`, "secure" in e2 && e2.secure && "Secure", "httpOnly" in e2 && e2.httpOnly && "HttpOnly", "sameSite" in e2 && e2.sameSite && `SameSite=${e2.sameSite}`, "partitioned" in e2 && e2.partitioned && "Partitioned", "priority" in e2 && e2.priority && `Priority=${e2.priority}`].filter(Boolean), n2 = `${e2.name}=${encodeURIComponent(null != (t2 = e2.value) ? t2 : "")}`; + return 0 === r2.length ? n2 : `${n2}; ${r2.join("; ")}`; + } + function s(e2) { + let t2 = /* @__PURE__ */ new Map(); + for (let r2 of e2.split(/; */)) { + if (!r2) + continue; + let e3 = r2.indexOf("="); + if (-1 === e3) { + t2.set(r2, "true"); + continue; + } + let [n2, o2] = [r2.slice(0, e3), r2.slice(e3 + 1)]; + try { + t2.set(n2, decodeURIComponent(null != o2 ? o2 : "true")); + } catch { + } + } + return t2; + } + function u(e2) { + var t2, r2; + if (!e2) + return; + let [[n2, o2], ...i2] = s(e2), { domain: a2, expires: u2, httponly: f2, maxage: d2, path: p, samesite: h, secure: y, partitioned: g, priority: v } = Object.fromEntries(i2.map(([e3, t3]) => [e3.toLowerCase(), t3])); + return function(e3) { + let t3 = {}; + for (let r3 in e3) + e3[r3] && (t3[r3] = e3[r3]); + return t3; + }({ name: n2, value: decodeURIComponent(o2), domain: a2, ...u2 && { expires: new Date(u2) }, ...f2 && { httpOnly: true }, ..."string" == typeof d2 && { maxAge: Number(d2) }, path: p, ...h && { sameSite: l.includes(t2 = (t2 = h).toLowerCase()) ? t2 : void 0 }, ...y && { secure: true }, ...v && { priority: c.includes(r2 = (r2 = v).toLowerCase()) ? r2 : void 0 }, ...g && { partitioned: true } }); + } + ((e2, r2) => { + for (var n2 in r2) + t(e2, n2, { get: r2[n2], enumerable: true }); + })(i, { RequestCookies: () => f, ResponseCookies: () => d, parseCookie: () => s, parseSetCookie: () => u, stringifyCookie: () => a }), e.exports = ((e2, i2, a2, s2) => { + if (i2 && "object" == typeof i2 || "function" == typeof i2) + for (let u2 of n(i2)) + o.call(e2, u2) || u2 === a2 || t(e2, u2, { get: () => i2[u2], enumerable: !(s2 = r(i2, u2)) || s2.enumerable }); + return e2; + })(t({}, "__esModule", { value: true }), i); + var l = ["strict", "lax", "none"], c = ["low", "medium", "high"], f = class { + constructor(e2) { + this._parsed = /* @__PURE__ */ new Map(), this._headers = e2; + let t2 = e2.get("cookie"); + if (t2) + for (let [e3, r2] of s(t2)) + this._parsed.set(e3, { name: e3, value: r2 }); + } + [Symbol.iterator]() { + return this._parsed[Symbol.iterator](); + } + get size() { + return this._parsed.size; + } + get(...e2) { + let t2 = "string" == typeof e2[0] ? e2[0] : e2[0].name; + return this._parsed.get(t2); + } + getAll(...e2) { + var t2; + let r2 = Array.from(this._parsed); + if (!e2.length) + return r2.map(([e3, t3]) => t3); + let n2 = "string" == typeof e2[0] ? e2[0] : null == (t2 = e2[0]) ? void 0 : t2.name; + return r2.filter(([e3]) => e3 === n2).map(([e3, t3]) => t3); + } + has(e2) { + return this._parsed.has(e2); + } + set(...e2) { + let [t2, r2] = 1 === e2.length ? [e2[0].name, e2[0].value] : e2, n2 = this._parsed; + return n2.set(t2, { name: t2, value: r2 }), this._headers.set("cookie", Array.from(n2).map(([e3, t3]) => a(t3)).join("; ")), this; + } + delete(e2) { + let t2 = this._parsed, r2 = Array.isArray(e2) ? e2.map((e3) => t2.delete(e3)) : t2.delete(e2); + return this._headers.set("cookie", Array.from(t2).map(([e3, t3]) => a(t3)).join("; ")), r2; + } + clear() { + return this.delete(Array.from(this._parsed.keys())), this; + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`; + } + toString() { + return [...this._parsed.values()].map((e2) => `${e2.name}=${encodeURIComponent(e2.value)}`).join("; "); + } + }, d = class { + constructor(e2) { + var t2, r2, n2; + this._parsed = /* @__PURE__ */ new Map(), this._headers = e2; + let o2 = null != (n2 = null != (r2 = null == (t2 = e2.getSetCookie) ? void 0 : t2.call(e2)) ? r2 : e2.get("set-cookie")) ? n2 : []; + for (let e3 of Array.isArray(o2) ? o2 : function(e4) { + if (!e4) + return []; + var t3, r3, n3, o3, i2, a2 = [], s2 = 0; + function u2() { + for (; s2 < e4.length && /\s/.test(e4.charAt(s2)); ) + s2 += 1; + return s2 < e4.length; + } + for (; s2 < e4.length; ) { + for (t3 = s2, i2 = false; u2(); ) + if ("," === (r3 = e4.charAt(s2))) { + for (n3 = s2, s2 += 1, u2(), o3 = s2; s2 < e4.length && "=" !== (r3 = e4.charAt(s2)) && ";" !== r3 && "," !== r3; ) + s2 += 1; + s2 < e4.length && "=" === e4.charAt(s2) ? (i2 = true, s2 = o3, a2.push(e4.substring(t3, n3)), t3 = s2) : s2 = n3 + 1; + } else + s2 += 1; + (!i2 || s2 >= e4.length) && a2.push(e4.substring(t3, e4.length)); + } + return a2; + }(o2)) { + let t3 = u(e3); + t3 && this._parsed.set(t3.name, t3); + } + } + get(...e2) { + let t2 = "string" == typeof e2[0] ? e2[0] : e2[0].name; + return this._parsed.get(t2); + } + getAll(...e2) { + var t2; + let r2 = Array.from(this._parsed.values()); + if (!e2.length) + return r2; + let n2 = "string" == typeof e2[0] ? e2[0] : null == (t2 = e2[0]) ? void 0 : t2.name; + return r2.filter((e3) => e3.name === n2); + } + has(e2) { + return this._parsed.has(e2); + } + set(...e2) { + let [t2, r2, n2] = 1 === e2.length ? [e2[0].name, e2[0].value, e2[0]] : e2, o2 = this._parsed; + return o2.set(t2, function(e3 = { name: "", value: "" }) { + return "number" == typeof e3.expires && (e3.expires = new Date(e3.expires)), e3.maxAge && (e3.expires = new Date(Date.now() + 1e3 * e3.maxAge)), (null === e3.path || void 0 === e3.path) && (e3.path = "/"), e3; + }({ name: t2, value: r2, ...n2 })), function(e3, t3) { + for (let [, r3] of (t3.delete("set-cookie"), e3)) { + let e4 = a(r3); + t3.append("set-cookie", e4); + } + }(o2, this._headers), this; + } + delete(...e2) { + let [t2, r2, n2] = "string" == typeof e2[0] ? [e2[0]] : [e2[0].name, e2[0].path, e2[0].domain]; + return this.set({ name: t2, path: r2, domain: n2, value: "", expires: /* @__PURE__ */ new Date(0) }); + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`; + } + toString() { + return [...this._parsed.values()].map(a).join("; "); + } + }; + }; + __namedExportsObject4["__chunk_65151"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { DiagConsoleLogger: () => j, DiagLogLevel: () => n, INVALID_SPANID: () => ef, INVALID_SPAN_CONTEXT: () => ep, INVALID_TRACEID: () => ed, ProxyTracer: () => e$, ProxyTracerProvider: () => eN, ROOT_CONTEXT: () => O, SamplingDecision: () => a, SpanKind: () => s, SpanStatusCode: () => u, TraceFlags: () => i, ValueType: () => o, baggageEntryMetadataFromString: () => P, context: () => eH, createContextKey: () => $, createNoopMeter: () => ee, createTraceState: () => eU, default: () => e2, defaultTextMapGetter: () => et, defaultTextMapSetter: () => er, diag: () => eB, isSpanContextValid: () => eR, isValidSpanId: () => eC, isValidTraceId: () => e_, metrics: () => eG, propagation: () => eZ, trace: () => e1 }); + var n, o, i, a, s, u, l = "object" == typeof globalThis2 ? globalThis2 : "object" == typeof self ? self : "object" == typeof window ? window : "object" == typeof r.g ? r.g : {}, c = "1.9.0", f = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/, d = function(e3) { + var t2 = /* @__PURE__ */ new Set([e3]), r2 = /* @__PURE__ */ new Set(), n2 = e3.match(f); + if (!n2) + return function() { + return false; + }; + var o2 = { major: +n2[1], minor: +n2[2], patch: +n2[3], prerelease: n2[4] }; + if (null != o2.prerelease) + return function(t3) { + return t3 === e3; + }; + function i2(e4) { + return r2.add(e4), false; + } + return function(e4) { + if (t2.has(e4)) + return true; + if (r2.has(e4)) + return false; + var n3 = e4.match(f); + if (!n3) + return i2(e4); + var a2 = { major: +n3[1], minor: +n3[2], patch: +n3[3], prerelease: n3[4] }; + return null != a2.prerelease || o2.major !== a2.major ? i2(e4) : 0 === o2.major ? o2.minor === a2.minor && o2.patch <= a2.patch ? (t2.add(e4), true) : i2(e4) : o2.minor <= a2.minor ? (t2.add(e4), true) : i2(e4); + }; + }(c), p = Symbol.for("opentelemetry.js.api." + c.split(".")[0]); + function h(e3, t2, r2, n2) { + void 0 === n2 && (n2 = false); + var o2, i2 = l[p] = null !== (o2 = l[p]) && void 0 !== o2 ? o2 : { version: c }; + if (!n2 && i2[e3]) { + var a2 = Error("@opentelemetry/api: Attempted duplicate registration of API: " + e3); + return r2.error(a2.stack || a2.message), false; + } + if (i2.version !== c) { + var a2 = Error("@opentelemetry/api: Registration of version v" + i2.version + " for " + e3 + " does not match previously registered API v" + c); + return r2.error(a2.stack || a2.message), false; + } + return i2[e3] = t2, r2.debug("@opentelemetry/api: Registered a global for " + e3 + " v" + c + "."), true; + } + function y(e3) { + var t2, r2, n2 = null === (t2 = l[p]) || void 0 === t2 ? void 0 : t2.version; + if (n2 && d(n2)) + return null === (r2 = l[p]) || void 0 === r2 ? void 0 : r2[e3]; + } + function g(e3, t2) { + t2.debug("@opentelemetry/api: Unregistering a global for " + e3 + " v" + c + "."); + var r2 = l[p]; + r2 && delete r2[e3]; + } + var v = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, o2, i2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = i2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + o2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = i2.return) && r2.call(i2); + } finally { + if (o2) + throw o2.error; + } + } + return a2; + }, m = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, o2 = 0, i2 = t2.length; o2 < i2; o2++) + !n2 && o2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, o2)), n2[o2] = t2[o2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, b = function() { + function e3(e4) { + this._namespace = e4.namespace || "DiagComponentLogger"; + } + return e3.prototype.debug = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return S("debug", this._namespace, e4); + }, e3.prototype.error = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return S("error", this._namespace, e4); + }, e3.prototype.info = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return S("info", this._namespace, e4); + }, e3.prototype.warn = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return S("warn", this._namespace, e4); + }, e3.prototype.verbose = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return S("verbose", this._namespace, e4); + }, e3; + }(); + function S(e3, t2, r2) { + var n2 = y("diag"); + if (n2) + return r2.unshift(t2), n2[e3].apply(n2, m([], v(r2), false)); + } + !function(e3) { + e3[e3.NONE = 0] = "NONE", e3[e3.ERROR = 30] = "ERROR", e3[e3.WARN = 50] = "WARN", e3[e3.INFO = 60] = "INFO", e3[e3.DEBUG = 70] = "DEBUG", e3[e3.VERBOSE = 80] = "VERBOSE", e3[e3.ALL = 9999] = "ALL"; + }(n || (n = {})); + var w = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, o2, i2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = i2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + o2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = i2.return) && r2.call(i2); + } finally { + if (o2) + throw o2.error; + } + } + return a2; + }, x = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, o2 = 0, i2 = t2.length; o2 < i2; o2++) + !n2 && o2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, o2)), n2[o2] = t2[o2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, E = function() { + function e3() { + function e4(e5) { + return function() { + for (var t3 = [], r2 = 0; r2 < arguments.length; r2++) + t3[r2] = arguments[r2]; + var n2 = y("diag"); + if (n2) + return n2[e5].apply(n2, x([], w(t3), false)); + }; + } + var t2 = this; + t2.setLogger = function(e5, r2) { + if (void 0 === r2 && (r2 = { logLevel: n.INFO }), e5 === t2) { + var o2, i2, a2, s2 = Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); + return t2.error(null !== (o2 = s2.stack) && void 0 !== o2 ? o2 : s2.message), false; + } + "number" == typeof r2 && (r2 = { logLevel: r2 }); + var u2 = y("diag"), l2 = function(e6, t3) { + function r3(r4, n2) { + var o3 = t3[r4]; + return "function" == typeof o3 && e6 >= n2 ? o3.bind(t3) : function() { + }; + } + return e6 < n.NONE ? e6 = n.NONE : e6 > n.ALL && (e6 = n.ALL), t3 = t3 || {}, { error: r3("error", n.ERROR), warn: r3("warn", n.WARN), info: r3("info", n.INFO), debug: r3("debug", n.DEBUG), verbose: r3("verbose", n.VERBOSE) }; + }(null !== (i2 = r2.logLevel) && void 0 !== i2 ? i2 : n.INFO, e5); + if (u2 && !r2.suppressOverrideMessage) { + var c2 = null !== (a2 = Error().stack) && void 0 !== a2 ? a2 : ""; + u2.warn("Current logger will be overwritten from " + c2), l2.warn("Current logger will overwrite one already registered from " + c2); + } + return h("diag", l2, t2, true); + }, t2.disable = function() { + g("diag", t2); + }, t2.createComponentLogger = function(e5) { + return new b(e5); + }, t2.verbose = e4("verbose"), t2.debug = e4("debug"), t2.info = e4("info"), t2.warn = e4("warn"), t2.error = e4("error"); + } + return e3.instance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3; + }(), _ = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, o2, i2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = i2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + o2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = i2.return) && r2.call(i2); + } finally { + if (o2) + throw o2.error; + } + } + return a2; + }, C = function(e3) { + var t2 = "function" == typeof Symbol && Symbol.iterator, r2 = t2 && e3[t2], n2 = 0; + if (r2) + return r2.call(e3); + if (e3 && "number" == typeof e3.length) + return { next: function() { + return e3 && n2 >= e3.length && (e3 = void 0), { value: e3 && e3[n2++], done: !e3 }; + } }; + throw TypeError(t2 ? "Object is not iterable." : "Symbol.iterator is not defined."); + }, R = function() { + function e3(e4) { + this._entries = e4 ? new Map(e4) : /* @__PURE__ */ new Map(); + } + return e3.prototype.getEntry = function(e4) { + var t2 = this._entries.get(e4); + if (t2) + return Object.assign({}, t2); + }, e3.prototype.getAllEntries = function() { + return Array.from(this._entries.entries()).map(function(e4) { + var t2 = _(e4, 2); + return [t2[0], t2[1]]; + }); + }, e3.prototype.setEntry = function(t2, r2) { + var n2 = new e3(this._entries); + return n2._entries.set(t2, r2), n2; + }, e3.prototype.removeEntry = function(t2) { + var r2 = new e3(this._entries); + return r2._entries.delete(t2), r2; + }, e3.prototype.removeEntries = function() { + for (var t2, r2, n2 = [], o2 = 0; o2 < arguments.length; o2++) + n2[o2] = arguments[o2]; + var i2 = new e3(this._entries); + try { + for (var a2 = C(n2), s2 = a2.next(); !s2.done; s2 = a2.next()) { + var u2 = s2.value; + i2._entries.delete(u2); + } + } catch (e4) { + t2 = { error: e4 }; + } finally { + try { + s2 && !s2.done && (r2 = a2.return) && r2.call(a2); + } finally { + if (t2) + throw t2.error; + } + } + return i2; + }, e3.prototype.clear = function() { + return new e3(); + }, e3; + }(), A = Symbol("BaggageEntryMetadata"), k = E.instance(); + function T(e3) { + return void 0 === e3 && (e3 = {}), new R(new Map(Object.entries(e3))); + } + function P(e3) { + return "string" != typeof e3 && (k.error("Cannot create baggage metadata from unknown type: " + typeof e3), e3 = ""), { __TYPE__: A, toString: function() { + return e3; + } }; + } + function $(e3) { + return Symbol.for(e3); + } + var O = new function e3(t2) { + var r2 = this; + r2._currentContext = t2 ? new Map(t2) : /* @__PURE__ */ new Map(), r2.getValue = function(e4) { + return r2._currentContext.get(e4); + }, r2.setValue = function(t3, n2) { + var o2 = new e3(r2._currentContext); + return o2._currentContext.set(t3, n2), o2; + }, r2.deleteValue = function(t3) { + var n2 = new e3(r2._currentContext); + return n2._currentContext.delete(t3), n2; + }; + }(), N = [{ n: "error", c: "error" }, { n: "warn", c: "warn" }, { n: "info", c: "info" }, { n: "debug", c: "debug" }, { n: "verbose", c: "trace" }], j = function() { + for (var e3 = 0; e3 < N.length; e3++) + this[N[e3].n] = /* @__PURE__ */ function(e4) { + return function() { + for (var t2 = [], r2 = 0; r2 < arguments.length; r2++) + t2[r2] = arguments[r2]; + if (console) { + var n2 = console[e4]; + if ("function" != typeof n2 && (n2 = console.log), "function" == typeof n2) + return n2.apply(console, t2); + } + }; + }(N[e3].c); + }, I = /* @__PURE__ */ function() { + var e3 = function(t2, r2) { + return (e3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e4, t3) { + e4.__proto__ = t3; + } || function(e4, t3) { + for (var r3 in t3) + Object.prototype.hasOwnProperty.call(t3, r3) && (e4[r3] = t3[r3]); + })(t2, r2); + }; + return function(t2, r2) { + if ("function" != typeof r2 && null !== r2) + throw TypeError("Class extends value " + String(r2) + " is not a constructor or null"); + function n2() { + this.constructor = t2; + } + e3(t2, r2), t2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); + }; + }(), L = function() { + function e3() { + } + return e3.prototype.createGauge = function(e4, t2) { + return X; + }, e3.prototype.createHistogram = function(e4, t2) { + return J; + }, e3.prototype.createCounter = function(e4, t2) { + return z; + }, e3.prototype.createUpDownCounter = function(e4, t2) { + return Y; + }, e3.prototype.createObservableGauge = function(e4, t2) { + return Q; + }, e3.prototype.createObservableCounter = function(e4, t2) { + return K; + }, e3.prototype.createObservableUpDownCounter = function(e4, t2) { + return Z; + }, e3.prototype.addBatchObservableCallback = function(e4, t2) { + }, e3.prototype.removeBatchObservableCallback = function(e4) { + }, e3; + }(), M = function() { + }, D = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return I(t2, e3), t2.prototype.add = function(e4, t3) { + }, t2; + }(M), U = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return I(t2, e3), t2.prototype.add = function(e4, t3) { + }, t2; + }(M), H = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return I(t2, e3), t2.prototype.record = function(e4, t3) { + }, t2; + }(M), B = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return I(t2, e3), t2.prototype.record = function(e4, t3) { + }, t2; + }(M), q = function() { + function e3() { + } + return e3.prototype.addCallback = function(e4) { + }, e3.prototype.removeCallback = function(e4) { + }, e3; + }(), F = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return I(t2, e3), t2; + }(q), G = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return I(t2, e3), t2; + }(q), W = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return I(t2, e3), t2; + }(q), V = new L(), z = new D(), X = new H(), J = new B(), Y = new U(), K = new F(), Q = new G(), Z = new W(); + function ee() { + return V; + } + !function(e3) { + e3[e3.INT = 0] = "INT", e3[e3.DOUBLE = 1] = "DOUBLE"; + }(o || (o = {})); + var et = { get: function(e3, t2) { + if (null != e3) + return e3[t2]; + }, keys: function(e3) { + return null == e3 ? [] : Object.keys(e3); + } }, er = { set: function(e3, t2, r2) { + null != e3 && (e3[t2] = r2); + } }, en = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, o2, i2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = i2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + o2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = i2.return) && r2.call(i2); + } finally { + if (o2) + throw o2.error; + } + } + return a2; + }, eo = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, o2 = 0, i2 = t2.length; o2 < i2; o2++) + !n2 && o2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, o2)), n2[o2] = t2[o2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, ei = function() { + function e3() { + } + return e3.prototype.active = function() { + return O; + }, e3.prototype.with = function(e4, t2, r2) { + for (var n2 = [], o2 = 3; o2 < arguments.length; o2++) + n2[o2 - 3] = arguments[o2]; + return t2.call.apply(t2, eo([r2], en(n2), false)); + }, e3.prototype.bind = function(e4, t2) { + return t2; + }, e3.prototype.enable = function() { + return this; + }, e3.prototype.disable = function() { + return this; + }, e3; + }(), ea = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, o2, i2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = i2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + o2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = i2.return) && r2.call(i2); + } finally { + if (o2) + throw o2.error; + } + } + return a2; + }, es = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, o2 = 0, i2 = t2.length; o2 < i2; o2++) + !n2 && o2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, o2)), n2[o2] = t2[o2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, eu = "context", el = new ei(), ec = function() { + function e3() { + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalContextManager = function(e4) { + return h(eu, e4, E.instance()); + }, e3.prototype.active = function() { + return this._getContextManager().active(); + }, e3.prototype.with = function(e4, t2, r2) { + for (var n2, o2 = [], i2 = 3; i2 < arguments.length; i2++) + o2[i2 - 3] = arguments[i2]; + return (n2 = this._getContextManager()).with.apply(n2, es([e4, t2, r2], ea(o2), false)); + }, e3.prototype.bind = function(e4, t2) { + return this._getContextManager().bind(e4, t2); + }, e3.prototype._getContextManager = function() { + return y(eu) || el; + }, e3.prototype.disable = function() { + this._getContextManager().disable(), g(eu, E.instance()); + }, e3; + }(); + !function(e3) { + e3[e3.NONE = 0] = "NONE", e3[e3.SAMPLED = 1] = "SAMPLED"; + }(i || (i = {})); + var ef = "0000000000000000", ed = "00000000000000000000000000000000", ep = { traceId: ed, spanId: ef, traceFlags: i.NONE }, eh = function() { + function e3(e4) { + void 0 === e4 && (e4 = ep), this._spanContext = e4; + } + return e3.prototype.spanContext = function() { + return this._spanContext; + }, e3.prototype.setAttribute = function(e4, t2) { + return this; + }, e3.prototype.setAttributes = function(e4) { + return this; + }, e3.prototype.addEvent = function(e4, t2) { + return this; + }, e3.prototype.addLink = function(e4) { + return this; + }, e3.prototype.addLinks = function(e4) { + return this; + }, e3.prototype.setStatus = function(e4) { + return this; + }, e3.prototype.updateName = function(e4) { + return this; + }, e3.prototype.end = function(e4) { + }, e3.prototype.isRecording = function() { + return false; + }, e3.prototype.recordException = function(e4, t2) { + }, e3; + }(), ey = $("OpenTelemetry Context Key SPAN"); + function eg(e3) { + return e3.getValue(ey) || void 0; + } + function ev() { + return eg(ec.getInstance().active()); + } + function em(e3, t2) { + return e3.setValue(ey, t2); + } + function eb(e3) { + return e3.deleteValue(ey); + } + function eS(e3, t2) { + return em(e3, new eh(t2)); + } + function ew(e3) { + var t2; + return null === (t2 = eg(e3)) || void 0 === t2 ? void 0 : t2.spanContext(); + } + var ex = /^([0-9a-f]{32})$/i, eE = /^[0-9a-f]{16}$/i; + function e_(e3) { + return ex.test(e3) && e3 !== ed; + } + function eC(e3) { + return eE.test(e3) && e3 !== ef; + } + function eR(e3) { + return e_(e3.traceId) && eC(e3.spanId); + } + function eA(e3) { + return new eh(e3); + } + var ek = ec.getInstance(), eT = function() { + function e3() { + } + return e3.prototype.startSpan = function(e4, t2, r2) { + if (void 0 === r2 && (r2 = ek.active()), null == t2 ? void 0 : t2.root) + return new eh(); + var n2 = r2 && ew(r2); + return "object" == typeof n2 && "string" == typeof n2.spanId && "string" == typeof n2.traceId && "number" == typeof n2.traceFlags && eR(n2) ? new eh(n2) : new eh(); + }, e3.prototype.startActiveSpan = function(e4, t2, r2, n2) { + if (!(arguments.length < 2)) { + 2 == arguments.length ? a2 = t2 : 3 == arguments.length ? (o2 = t2, a2 = r2) : (o2 = t2, i2 = r2, a2 = n2); + var o2, i2, a2, s2 = null != i2 ? i2 : ek.active(), u2 = this.startSpan(e4, o2, s2), l2 = em(s2, u2); + return ek.with(l2, a2, void 0, u2); + } + }, e3; + }(), eP = new eT(), e$ = function() { + function e3(e4, t2, r2, n2) { + this._provider = e4, this.name = t2, this.version = r2, this.options = n2; + } + return e3.prototype.startSpan = function(e4, t2, r2) { + return this._getTracer().startSpan(e4, t2, r2); + }, e3.prototype.startActiveSpan = function(e4, t2, r2, n2) { + var o2 = this._getTracer(); + return Reflect.apply(o2.startActiveSpan, o2, arguments); + }, e3.prototype._getTracer = function() { + if (this._delegate) + return this._delegate; + var e4 = this._provider.getDelegateTracer(this.name, this.version, this.options); + return e4 ? (this._delegate = e4, this._delegate) : eP; + }, e3; + }(), eO = new (function() { + function e3() { + } + return e3.prototype.getTracer = function(e4, t2, r2) { + return new eT(); + }, e3; + }())(), eN = function() { + function e3() { + } + return e3.prototype.getTracer = function(e4, t2, r2) { + var n2; + return null !== (n2 = this.getDelegateTracer(e4, t2, r2)) && void 0 !== n2 ? n2 : new e$(this, e4, t2, r2); + }, e3.prototype.getDelegate = function() { + var e4; + return null !== (e4 = this._delegate) && void 0 !== e4 ? e4 : eO; + }, e3.prototype.setDelegate = function(e4) { + this._delegate = e4; + }, e3.prototype.getDelegateTracer = function(e4, t2, r2) { + var n2; + return null === (n2 = this._delegate) || void 0 === n2 ? void 0 : n2.getTracer(e4, t2, r2); + }, e3; + }(); + !function(e3) { + e3[e3.NOT_RECORD = 0] = "NOT_RECORD", e3[e3.RECORD = 1] = "RECORD", e3[e3.RECORD_AND_SAMPLED = 2] = "RECORD_AND_SAMPLED"; + }(a || (a = {})), function(e3) { + e3[e3.INTERNAL = 0] = "INTERNAL", e3[e3.SERVER = 1] = "SERVER", e3[e3.CLIENT = 2] = "CLIENT", e3[e3.PRODUCER = 3] = "PRODUCER", e3[e3.CONSUMER = 4] = "CONSUMER"; + }(s || (s = {})), function(e3) { + e3[e3.UNSET = 0] = "UNSET", e3[e3.OK = 1] = "OK", e3[e3.ERROR = 2] = "ERROR"; + }(u || (u = {})); + var ej = "[_0-9a-z-*/]", eI = RegExp("^(?:[a-z]" + ej + "{0,255}|" + ("[a-z0-9]" + ej) + "{0,240}@[a-z]" + ej + "{0,13})$"), eL = /^[ -~]{0,255}[!-~]$/, eM = /,|=/, eD = function() { + function e3(e4) { + this._internalState = /* @__PURE__ */ new Map(), e4 && this._parse(e4); + } + return e3.prototype.set = function(e4, t2) { + var r2 = this._clone(); + return r2._internalState.has(e4) && r2._internalState.delete(e4), r2._internalState.set(e4, t2), r2; + }, e3.prototype.unset = function(e4) { + var t2 = this._clone(); + return t2._internalState.delete(e4), t2; + }, e3.prototype.get = function(e4) { + return this._internalState.get(e4); + }, e3.prototype.serialize = function() { + var e4 = this; + return this._keys().reduce(function(t2, r2) { + return t2.push(r2 + "=" + e4.get(r2)), t2; + }, []).join(","); + }, e3.prototype._parse = function(e4) { + !(e4.length > 512) && (this._internalState = e4.split(",").reverse().reduce(function(e5, t2) { + var r2 = t2.trim(), n2 = r2.indexOf("="); + if (-1 !== n2) { + var o2 = r2.slice(0, n2), i2 = r2.slice(n2 + 1, t2.length); + eI.test(o2) && eL.test(i2) && !eM.test(i2) && e5.set(o2, i2); + } + return e5; + }, /* @__PURE__ */ new Map()), this._internalState.size > 32 && (this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, 32)))); + }, e3.prototype._keys = function() { + return Array.from(this._internalState.keys()).reverse(); + }, e3.prototype._clone = function() { + var t2 = new e3(); + return t2._internalState = new Map(this._internalState), t2; + }, e3; + }(); + function eU(e3) { + return new eD(e3); + } + var eH = ec.getInstance(), eB = E.instance(), eq = new (function() { + function e3() { + } + return e3.prototype.getMeter = function(e4, t2, r2) { + return V; + }, e3; + }())(), eF = "metrics", eG = function() { + function e3() { + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalMeterProvider = function(e4) { + return h(eF, e4, E.instance()); + }, e3.prototype.getMeterProvider = function() { + return y(eF) || eq; + }, e3.prototype.getMeter = function(e4, t2, r2) { + return this.getMeterProvider().getMeter(e4, t2, r2); + }, e3.prototype.disable = function() { + g(eF, E.instance()); + }, e3; + }().getInstance(), eW = function() { + function e3() { + } + return e3.prototype.inject = function(e4, t2) { + }, e3.prototype.extract = function(e4, t2) { + return e4; + }, e3.prototype.fields = function() { + return []; + }, e3; + }(), eV = $("OpenTelemetry Baggage Key"); + function ez(e3) { + return e3.getValue(eV) || void 0; + } + function eX() { + return ez(ec.getInstance().active()); + } + function eJ(e3, t2) { + return e3.setValue(eV, t2); + } + function eY(e3) { + return e3.deleteValue(eV); + } + var eK = "propagation", eQ = new eW(), eZ = function() { + function e3() { + this.createBaggage = T, this.getBaggage = ez, this.getActiveBaggage = eX, this.setBaggage = eJ, this.deleteBaggage = eY; + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalPropagator = function(e4) { + return h(eK, e4, E.instance()); + }, e3.prototype.inject = function(e4, t2, r2) { + return void 0 === r2 && (r2 = er), this._getGlobalPropagator().inject(e4, t2, r2); + }, e3.prototype.extract = function(e4, t2, r2) { + return void 0 === r2 && (r2 = et), this._getGlobalPropagator().extract(e4, t2, r2); + }, e3.prototype.fields = function() { + return this._getGlobalPropagator().fields(); + }, e3.prototype.disable = function() { + g(eK, E.instance()); + }, e3.prototype._getGlobalPropagator = function() { + return y(eK) || eQ; + }, e3; + }().getInstance(), e0 = "trace", e1 = function() { + function e3() { + this._proxyTracerProvider = new eN(), this.wrapSpanContext = eA, this.isSpanContextValid = eR, this.deleteSpan = eb, this.getSpan = eg, this.getActiveSpan = ev, this.getSpanContext = ew, this.setSpan = em, this.setSpanContext = eS; + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalTracerProvider = function(e4) { + var t2 = h(e0, this._proxyTracerProvider, E.instance()); + return t2 && this._proxyTracerProvider.setDelegate(e4), t2; + }, e3.prototype.getTracerProvider = function() { + return y(e0) || this._proxyTracerProvider; + }, e3.prototype.getTracer = function(e4, t2) { + return this.getTracerProvider().getTracer(e4, t2); + }, e3.prototype.disable = function() { + g(e0, E.instance()), this._proxyTracerProvider = new eN(); + }, e3; + }().getInstance(); + let e2 = { context: eH, diag: eB, metrics: eG, propagation: eZ, trace: e1 }; + }; + return __namedExportsObject4; + }; + } +}); +var __namedExportsObject5; +var __getNamedExports5; +var init_be62e6b52013db5be75c05af221c = __esm({ + ".vercel/output/static/_worker.js/__next-on-fleek-dist__/webpack/4237be62e6b52013db5be75c05af221c.js"() { + "use strict"; + __namedExportsObject5 = {}; + __getNamedExports5 = (self, globalThis2, global) => { + __namedExportsObject5["__chunk_52683"] = () => { + }; + __namedExportsObject5["__chunk_55856"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { default: () => n }); + var t = r(40186); + let n = (e2) => [{ type: "image/png", width: 1014, height: 508, url: (0, t.Sg)(".", e2.params, "opengraph-image.png") + "?b099cfa18629a0de" }]; + }; + __namedExportsObject5["__chunk_98075"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { default: () => n }); + var t = r(40186); + let n = (e2) => [{ type: "image/x-icon", sizes: "64x64", url: (0, t.Sg)(".", e2.params, "favicon.ico") + "" }]; + }; + __namedExportsObject5["__chunk_23863"] = (e, s, r) => { + "use strict"; + r.d(s, { cZ: () => c, dv: () => o, xu: () => i }); + var t = r(32817), n = r(30347), l = r(33447); + let a = l.z.array(l.z.object({ productSlug: l.z.string(), quantity: l.z.number() })); + async function i(e2) { + (await (0, n.Qk)()).set("cart", JSON.stringify(e2), { httpOnly: true, secure: true, sameSite: "strict", maxAge: 604800 }); + } + async function o() { + let e2 = (await (0, n.Qk)()).get("cart"); + if (!e2) + return []; + try { + return a.parse(JSON.parse(e2.value)); + } catch { + return console.error("Failed to parse cart cookie"), []; + } + } + async function c() { + let e2 = await o(); + return (await t.db.query.products.findMany({ where: (s2, { inArray: r2 }) => r2(s2.slug, e2.map((e3) => e3.productSlug)), with: { subcategory: { with: { subcollection: true } } } })).map((s2) => ({ ...s2, quantity: e2.find((e3) => e3.productSlug === s2.slug)?.quantity ?? 0 })); + } + }; + __namedExportsObject5["__chunk_15807"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { categories: () => m, categoriesRelations: () => y, collections: () => f, collectionsRelations: () => b, products: () => x, productsRelations: () => _, subcategories: () => h, subcategoriesRelations: () => w, subcollectionRelations: () => v, subcollections: () => p, users: () => N }); + var t = r(62640), n = r(11445), l = r(9070), a = r(33617), i = r(37957), o = r(70129), c = r(82806), u = r(99076), d = r(27442), g = r(75389); + let f = (0, n.af)("collections", { id: (0, l.eP)("id").primaryKey(), name: (0, a.fL)("name").notNull(), slug: (0, a.fL)("slug").notNull() }), m = (0, n.af)("categories", { slug: (0, a.fL)("slug").notNull().primaryKey(), name: (0, a.fL)("name").notNull(), collection_id: (0, i._L)("collection_id").notNull().references(() => f.id, { onDelete: "cascade" }), image_url: (0, a.fL)("image_url") }, (e2) => ({ collectionIdIdx: (0, o.Kz)("categories_collection_id_idx").on(e2.collection_id) })), p = (0, n.af)("subcollections", { id: (0, l.eP)("id").primaryKey(), name: (0, a.fL)("name").notNull(), category_slug: (0, a.fL)("category_slug").notNull().references(() => m.slug, { onDelete: "cascade" }) }, (e2) => ({ categorySlugIdx: (0, o.Kz)("subcollections_category_slug_idx").on(e2.category_slug) })), h = (0, n.af)("subcategories", { slug: (0, a.fL)("slug").notNull().primaryKey(), name: (0, a.fL)("name").notNull(), subcollection_id: (0, i._L)("subcollection_id").notNull().references(() => p.id, { onDelete: "cascade" }), image_url: (0, a.fL)("image_url") }, (e2) => ({ subcollectionIdIdx: (0, o.Kz)("subcategories_subcollection_id_idx").on(e2.subcollection_id) })), x = (0, n.af)("products", { slug: (0, a.fL)("slug").notNull().primaryKey(), name: (0, a.fL)("name").notNull(), description: (0, a.fL)("description").notNull(), price: (0, c.uR)("price").notNull(), subcategory_slug: (0, a.fL)("subcategory_slug").notNull().references(() => h.slug, { onDelete: "cascade" }), image_url: (0, a.fL)("image_url") }, (e2) => ({ nameSearchIndex: (0, o.Kz)("name_search_index").using("gin", (0, t.i6)`to_tsvector('english', ${e2.name})`), nameTrgmIndex: (0, o.Kz)("name_trgm_index").using("gin", (0, t.i6)`${e2.name} gin_trgm_ops`).concurrently(), subcategorySlugIdx: (0, o.Kz)("products_subcategory_slug_idx").on(e2.subcategory_slug) })), b = (0, g.lE)(f, ({ many: e2 }) => ({ categories: e2(m) })), y = (0, g.lE)(m, ({ one: e2, many: s2 }) => ({ collection: e2(f, { fields: [m.collection_id], references: [f.id] }), subcollections: s2(p) })), v = (0, g.lE)(p, ({ one: e2, many: s2 }) => ({ category: e2(m, { fields: [p.category_slug], references: [m.slug] }), subcategories: s2(h) })), w = (0, g.lE)(h, ({ one: e2, many: s2 }) => ({ subcollection: e2(p, { fields: [h.subcollection_id], references: [p.id] }), products: s2(x) })), _ = (0, g.lE)(x, ({ one: e2 }) => ({ subcategory: e2(h, { fields: [x.subcategory_slug], references: [h.slug] }) })), N = (0, n.af)("users", { id: (0, l.eP)("id").primaryKey(), username: (0, u.L7)("username", { length: 100 }).notNull().unique(), passwordHash: (0, a.fL)("password_hash").notNull(), createdAt: (0, d.AB)("created_at").notNull().defaultNow(), updatedAt: (0, d.AB)("updated_at").notNull().defaultNow() }); + }; + __namedExportsObject5["__chunk_6252"] = (e, s, r) => { + "use strict"; + r.d(s, { db: () => i }); + var t = r(14199), n = r(59454), l = r(15807); + let a = (0, n.qn)("postgresql://nextjs-test_owner:r96IADoHqnMF@ep-ancient-sunset-a505d15y-pooler.us-east-2.aws.neon.tech/nextjs-test?sslmode"), i = (0, t.tS)({ client: a, schema: l }); + }; + __namedExportsObject5["__chunk_10791"] = (e, s, r) => { + "use strict"; + r.d(s, { r: () => t }); + let t = (0, r(63861).D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/src/components/ui/link.tsx`).Link; + }; + __namedExportsObject5["__chunk_5811"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { default: () => n }); + var t = r(21158); + function n() { + return (0, t.jsx)("div", { children: "404 - Not Found" }); + } + }; + __namedExportsObject5["__chunk_49989"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { default: () => j, metadata: () => w, revalidate: () => _, runtime: () => N }); + var t = r(21158), n = r(38226), l = r.n(n), a = r(19473), i = r.n(a), o = r(58593), c = r.n(o); + r(52683); + var u = r(63861); + let d = (0, u.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/src/components/search-dropdown.tsx`).SearchDropdownComponent; + var g = r(55535), f = r(23034), m = r(23863); + async function p() { + let e2 = await (0, m.dv)(); + if (0 == e2.length) + return null; + let s2 = e2.reduce((e3, s3) => e3 + s3.quantity, 0); + return (0, t.jsx)("div", { className: "absolute -right-3 -top-1 rounded-full bg-yellow-300 px-1 text-xs text-green-800", children: s2 }); + } + var h = r(24792), x = r(10791), b = r(94051), y = r(77063); + let v = (0, u.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/src/app/welcome-toast.tsx`).WelcomeToast, w = { title: { template: "%s | FleekMaster", default: "FleekMaster" }, description: "A performant site built with Next.js" }, _ = 86400, N = "edge"; + async function j({ children: e2 }) { + return (0, t.jsx)("html", { lang: "en", className: "h-full", children: (0, t.jsxs)("body", { className: `${l().variable} ${i().variable} ${c().variable} flex flex-col antialiased`, children: [(0, t.jsxs)("div", { children: [(0, t.jsx)("header", { className: "z-10 flex flex-grow items-center justify-between gap-4 border-b-2 border-yellow-300 bg-background p-2 pb-[4px] pt-2 font-futura sm:flex-row sm:p-4 sm:pb-[4px] sm:pt-0", children: (0, t.jsxs)("div", { className: "flex flex-grow flex-col", children: [(0, t.jsx)("div", { className: "absolute right-2 top-2 flex justify-end pt-2 font-sans text-sm hover:underline sm:relative sm:right-0 sm:top-0", children: (0, t.jsx)(f.Suspense, { fallback: (0, t.jsxs)("button", { className: "flex flex-row items-center gap-1", children: [(0, t.jsx)("div", { className: "h-[20px]" }), (0, t.jsx)("svg", { viewBox: "0 0 10 6", className: "h-[6px] w-[10px]", children: (0, t.jsx)("polygon", { points: "0,0 5,6 10,0" }) })] }), children: (0, t.jsx)(h.m, {}) }) }), (0, t.jsxs)("div", { className: "flex w-full flex-col items-start justify-center gap-2 sm:w-auto sm:flex-row sm:items-center", children: [(0, t.jsx)(x.r, { prefetch: true, href: "/", className: "text-4xl font-bold text-green-800", children: "FleekMaster" }), (0, t.jsxs)("div", { className: "items flex w-full flex-row items-center justify-between gap-4", children: [(0, t.jsx)("div", { className: "mx-0 flex-grow sm:mx-auto sm:flex-grow-0", children: (0, t.jsx)(d, {}) }), (0, t.jsxs)("div", { className: "flex flex-row justify-between space-x-4", children: [(0, t.jsxs)("div", { className: "relative", children: [(0, t.jsx)(x.r, { prefetch: true, href: "/order", className: "text-lg text-green-800 hover:underline", children: "ORDER" }), (0, t.jsx)(f.Suspense, { children: (0, t.jsx)(p, {}) })] }), (0, t.jsx)(x.r, { prefetch: true, href: "/order-history", className: "hidden text-lg text-green-800 hover:underline md:block", children: "ORDER HISTORY" }), (0, t.jsx)(x.r, { prefetch: true, href: "/order-history", "aria-label": "Order History", className: "block text-lg text-green-800 hover:underline md:hidden", children: (0, t.jsx)(g.Z, {}) })] })] })] })] }) }), e2] }), (0, t.jsxs)("footer", { className: "flex h-[8px] flex-col items-center justify-between space-y-2 border-t border-gray-400 bg-background px-4 font-helvetica text-[11px] sm:h-6 sm:flex-row sm:space-y-0", children: [(0, t.jsxs)("div", { className: "flex flex-wrap justify-center space-x-2 pt-2 sm:justify-start", children: [(0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Home" }), (0, t.jsx)("span", { children: "|" }), (0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Location" }), (0, t.jsx)("span", { children: "|" }), (0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Returns" }), (0, t.jsx)("span", { children: "|" }), (0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Careers" }), (0, t.jsx)("span", { children: "|" }), (0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Mobile App" }), (0, t.jsx)("span", { children: "|" }), (0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Solidworks Add-In" }), (0, t.jsx)("span", { children: "|" }), (0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Help" }), (0, t.jsx)("span", { children: "|" }), (0, t.jsx)("span", { className: "hover:bg-yellow-100 hover:underline", children: "Settings" })] }), (0, t.jsxs)("div", { className: "text-center sm:text-right", children: ["By using this website, you agree to check out the", " ", (0, t.jsx)(x.r, { href: "https://github.com/ethanniser/FleekMaster", className: "font-bold hover:underline", target: "_blank", children: "Source Code" })] })] }), (0, t.jsxs)(f.Suspense, { fallback: null, children: [(0, t.jsx)(y.x7, { closeButton: true }), (0, t.jsx)(v, {})] }), (0, t.jsx)(b.c, { scriptSrc: "/insights/events.js", endpoint: "/hfi/events" })] }) }); + } + }; + __namedExportsObject5["__chunk_15778"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { default: () => t }); + let t = (0, r(63861).D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/src/app/error.tsx`).default; + }; + __namedExportsObject5["__chunk_24792"] = (e, s, r) => { + "use strict"; + r.d(s, { m: () => c, x: () => u }); + var t = r(21158), n = r(6945); + let l = (0, r(63861).D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/src/app/auth.client.tsx`), a = l.LoginForm, i = l.SignInSignUp, o = l.SignOut; + async function c() { + let e2 = await (0, n.PR)(); + return e2 ? (0, t.jsx)(o, { username: e2.username }) : (0, t.jsx)(i, {}); + } + async function u() { + return await (0, n.PR)() ? null : (0, t.jsxs)(t.Fragment, { children: [(0, t.jsx)("p", { className: "font-semibold text-green-800", children: "Log in to place an order" }), (0, t.jsx)(a, {})] }); + } + }; + __namedExportsObject5["__chunk_3938"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { signIn: () => S, signOut: () => L, signUp: () => j }); + var t = r(33499); + r(40109); + var n = r(55033), l = r(33920), a = r(42629); + function i(e2, s2) { + return async (r2, t2) => { + let n2 = e2.safeParse(Object.fromEntries(t2)); + return n2.success ? s2(n2.data, t2) : { error: n2.error.errors[0].message }; + }; + } + var o = r(6252), c = r(15807), u = r(59504), d = r(86977); + let g = new TextEncoder().encode("secret"); + async function f(e2) { + return (0, u.hash)(e2, 10); + } + async function m(e2, s2) { + return (0, u.compare)(e2, s2); + } + async function p(e2) { + return await new d.N(e2).setProtectedHeader({ alg: "HS256" }).setIssuedAt().setExpirationTime("1 day from now").sign(g); + } + async function h(e2) { + let s2 = new Date(Date.now() + 864e5), r2 = { user: { id: e2.id }, expires: s2.toISOString() }, t2 = await p(r2); + (await (0, a.Qk)()).set("session", t2, { expires: s2, httpOnly: true, secure: true, sameSite: "lax" }); + } + var x = r(66913), b = r(64760); + if (!process.env.KV_REST_API_URL || !process.env.KV_REST_API_TOKEN) + throw Error("Please link a Vercel KV instance or populate `KV_REST_API_URL` and `KV_REST_API_TOKEN`"); + let y = new b.s({ url: process.env.KV_REST_API_URL, token: process.env.KV_REST_API_TOKEN }), v = new x.Ratelimit({ redis: y, limiter: x.Ratelimit.slidingWindow(5, "15 m"), analytics: true, prefix: "ratelimit:auth" }), w = new x.Ratelimit({ redis: y, limiter: x.Ratelimit.slidingWindow(1, "15 m"), analytics: true, prefix: "ratelimit:signup" }); + var _ = r(3491); + let N = n.z.object({ username: n.z.string().min(1), password: n.z.string().min(1) }), j = i(N, async (e2) => { + let { username: s2, password: r2 } = e2, t2 = (await (0, a.A)()).get("x-real-ip") ?? "local"; + if (!(await w.limit(t2)).success) + return { error: { code: "AUTH_ERROR", message: "Too many signups. Try again later" } }; + if ((await o.db.select().from(c.users).where((0, l.eq)(c.users.username, s2)).limit(1)).length > 0) + return { error: "Username already taken. Please try again." }; + let n2 = await f(r2), [i2] = await o.db.insert(c.users).values({ username: s2, passwordHash: n2 }).returning(); + if (!i2) + return { error: "Failed to create user. Please try again." }; + await h(i2); + }), S = i(N, async (e2) => { + let { username: s2, password: r2 } = e2, t2 = (await (0, a.A)()).get("x-real-ip") ?? "local"; + if (!(await v.limit(t2)).success) + return { error: { code: "AUTH_ERROR", message: "Too many attempts. Try again later" } }; + let n2 = await o.db.select({ user: c.users }).from(c.users).where((0, l.eq)(c.users.username, s2)).limit(1); + if (0 === n2.length) + return { error: "Invalid username or password. Please try again." }; + let { user: i2 } = n2[0]; + if (!await m(r2, i2.passwordHash)) + return { error: "Invalid username or password. Please try again." }; + await h(i2); + }); + async function L() { + let e2 = await (0, a.Qk)(); + e2.getAll().forEach((s2) => e2.delete(s2.name)); + } + (0, _.h)([j, S, L]), (0, t.j)(j, "8fd11345410fd70a6b93f7a85a181aa32d29db46", null), (0, t.j)(S, "9bb9d577eddd038999f60ce48b2f1fbe87a8d7ab", null), (0, t.j)(L, "69628d0c5ad9a69bc20b72992b2a9f15e2aa4452", null); + }; + __namedExportsObject5["__chunk_25784"] = (e, s, r) => { + "use strict"; + r.d(s, { cn: () => l }); + var t = r(18137), n = r(97475); + function l(...e2) { + return (0, n.m6)((0, t.W)(e2)); + } + }; + __namedExportsObject5["__chunk_13972"] = (e, s, r) => { + "use strict"; + r.d(s, { Link: () => c }); + var t = r(73435), n = r(72210), l = r(55533), a = r(49398); + async function i(e2) { + if (!e2.startsWith("/") || e2.startsWith("/order") || "/" === e2) + return []; + let s2 = new URL(e2, window.location.href), r2 = await fetch(`/api/prefetch-images${s2.pathname}`, { priority: "low" }); + r2.ok; + let { images: t2 } = await r2.json(); + return t2; + } + let o = /* @__PURE__ */ new Set(), c = ({ children: e2, ...s2 }) => { + let [r2, c2] = (0, a.useState)([]), [u, d] = (0, a.useState)([]), g = (0, a.useRef)(null), f = (0, l.tv)(), m = null; + return (0, a.useEffect)(() => { + if (false === s2.prefetch) + return; + let e3 = g.current; + if (!e3) + return; + let r3 = new IntersectionObserver((e4) => { + let t2 = e4[0]; + t2.isIntersecting ? m = setTimeout(async () => { + f.prefetch(String(s2.href)), await new Promise((e5) => setTimeout(e5, 0)), i(String(s2.href)).then((e5) => { + c2(e5); + }, console.error), r3.unobserve(t2.target); + }, 300) : m && (clearTimeout(m), m = null); + }, { rootMargin: "0px", threshold: 0.1 }); + return r3.observe(e3), () => { + r3.disconnect(), m && clearTimeout(m); + }; + }, [s2.href, s2.prefetch]), (0, t.jsx)(n.Z, { ref: g, prefetch: false, onMouseEnter: () => { + if (f.prefetch(String(s2.href)), u.length) + return; + let e3 = []; + for (let s3 of r2) { + let r3 = function(e4) { + if ("lazy" === e4.loading || o.has(e4.srcset)) + return; + let s4 = new Image(); + s4.decoding = "async", s4.fetchPriority = "low", s4.sizes = e4.sizes, o.add(e4.srcset), s4.srcset = e4.srcset, s4.src = e4.src, s4.alt = e4.alt; + let r4 = false; + return s4.onload = s4.onerror = () => { + r4 = true; + }, () => { + r4 || (s4.src = s4.srcset = "", o.delete(e4.srcset)); + }; + }(s3); + r3 && e3.push(r3); + } + d(e3); + }, onMouseLeave: () => { + for (let e3 of u) + e3(); + d([]); + }, onMouseDown: (e3) => { + new URL(String(s2.href), window.location.href).origin !== window.location.origin || 0 !== e3.button || e3.altKey || e3.ctrlKey || e3.metaKey || e3.shiftKey || (e3.preventDefault(), f.push(String(s2.href))); + }, ...s2, children: e2 }); + }; + }; + __namedExportsObject5["__chunk_27337"] = (e, s, r) => { + "use strict"; + r.d(s, { I: () => a }); + var t = r(73435), n = r(49398), l = r(25784); + let a = n.forwardRef(({ className: e2, type: s2, ...r2 }, n2) => (0, t.jsx)("input", { type: s2, className: (0, l.cn)("flex h-9 w-full border border-gray-500 bg-transparent px-3 py-1 text-sm outline-none", e2), ref: n2, ...r2 })); + a.displayName = "Input"; + }; + __namedExportsObject5["__chunk_5967"] = (e, s, r) => { + "use strict"; + r.d(s, { SearchDropdownComponent: () => m }); + var t = r(73435), n = r(49398), l = r(27337), a = r(72340), i = r(25784); + let o = n.forwardRef(({ className: e2, children: s2, ...r2 }, n2) => (0, t.jsxs)(a.fC, { ref: n2, className: (0, i.cn)("relative overflow-hidden", e2), ...r2, children: [(0, t.jsx)(a.l_, { className: "h-full w-full rounded-[inherit]", children: s2 }), (0, t.jsx)(c, {}), (0, t.jsx)(a.Ns, {})] })); + o.displayName = a.fC.displayName; + let c = n.forwardRef(({ className: e2, orientation: s2 = "vertical", ...r2 }, n2) => (0, t.jsx)(a.gb, { ref: n2, orientation: s2, className: (0, i.cn)("flex touch-none select-none transition-colors", "vertical" === s2 && "h-full w-2.5 border-l border-l-transparent p-[1px]", "horizontal" === s2 && "h-2.5 flex-col border-t border-t-transparent p-[1px]", e2), ...r2, children: (0, t.jsx)(a.q4, { className: "relative flex-1 rounded-full bg-border" }) })); + c.displayName = a.gb.displayName; + var u = r(89764), d = r(15197), g = r(13972), f = r(55533); + function m() { + let [e2, s2] = (0, n.useState)(""), [r2, a2] = (0, n.useState)([]), [c2, m2] = (0, n.useState)(false), [p, h] = (0, n.useState)(-1), [x, b] = (0, n.useState)(false), y = (0, f.tv)(), v = (0, n.useRef)(null), w = (0, n.useRef)(null); + return (0, f.UO)(), (0, t.jsx)("div", { className: "font-sans", ref: w, children: (0, t.jsxs)("div", { className: "relative flex-grow", children: [(0, t.jsxs)("div", { className: "relative", children: [(0, t.jsx)(l.I, { ref: v, autoCapitalize: "off", autoCorrect: "off", type: "text", placeholder: "Search...", value: e2, onChange: (e3) => { + s2(e3.target.value), m2(e3.target.value.length > 0), h(-1); + }, onKeyDown: (e3) => { + "ArrowDown" === e3.key ? h((e4) => e4 < r2.length - 1 ? e4 + 1 : 0) : "ArrowUp" === e3.key ? h((e4) => e4 > 0 ? e4 - 1 : r2.length - 1) : "Enter" === e3.key && p >= 0 && (y.push(r2[p].href), s2(r2[p].name), m2(false), v.current?.blur()); + }, className: "font-sans font-medium sm:w-[300px] md:w-[375px]" }), (0, t.jsx)(u.Z, { className: (0, i.cn)("absolute right-7 top-2 h-5 w-5 text-muted-foreground", { hidden: !c2 }), onClick: () => { + s2(""), m2(false); + } })] }), c2 && (0, t.jsx)("div", { className: "absolute z-10 w-full border border-gray-200 bg-white shadow-lg", children: (0, t.jsx)(o, { className: "h-[300px]", children: r2.length > 0 ? r2.map((e3, r3) => (0, t.jsx)(g.Link, { href: e3.href, prefetch: true, children: (0, t.jsxs)("div", { className: (0, i.cn)("flex cursor-pointer items-center p-2", { "bg-gray-100": r3 === p }), onMouseEnter: () => h(r3), onClick: () => { + s2(e3.name), m2(false), v.current?.blur(); + }, children: [(0, t.jsx)(d.Z, { loading: "eager", decoding: "sync", src: e3.image_url ?? "/placeholder.svg", alt: "", className: "h-10 w-10 pr-2", height: 40, width: 40, quality: 65 }), (0, t.jsx)("span", { className: "text-sm", children: e3.name })] }) }, e3.slug)) : x ? (0, t.jsx)("div", { className: "flex h-full items-center justify-center", children: (0, t.jsx)("p", { className: "text-sm text-gray-500", children: "Loading..." }) }) : (0, t.jsx)("div", { className: "flex h-full items-center justify-center", children: (0, t.jsx)("p", { className: "text-sm text-gray-500", children: "No results found" }) }) }) })] }) }); + } + }; + __namedExportsObject5["__chunk_62461"] = (e, s, r) => { + "use strict"; + function t() { + return null; + } + r.d(s, { WelcomeToast: () => t }), r(73435), r(49398), r(8865); + }; + __namedExportsObject5["__chunk_15160"] = (e, s, r) => { + "use strict"; + r.r(s), r.d(s, { default: () => n }); + var t = r(73435); + function n() { + return (0, t.jsx)("div", { children: "Error" }); + } + }; + __namedExportsObject5["__chunk_8046"] = (e, s, r) => { + "use strict"; + r.d(s, { LoginForm: () => v, SignInSignUp: () => w, SignOut: () => _ }); + var t = r(73435), n = r(27337), l = r(49398), a = r(71281), i = r(25784); + let o = a.fC, c = a.xz; + a.ee; + let u = l.forwardRef(({ className: e2, align: s2 = "center", sideOffset: r2 = 4, ...n2 }, l2) => (0, t.jsx)(a.h_, { children: (0, t.jsx)(a.VY, { ref: l2, align: s2, sideOffset: r2, className: (0, i.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none duration-75 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", e2), ...n2 }) })); + u.displayName = a.VY.displayName; + var d = r(97704), g = r(39319), f = r(85966); + let m = (0, d.$E)("9bb9d577eddd038999f60ce48b2f1fbe87a8d7ab", g.g, void 0, f.Z, "signIn"), p = (0, d.$E)("8fd11345410fd70a6b93f7a85a181aa32d29db46", g.g, void 0, f.Z, "signUp"); + var h = r(87796); + let x = (0, r(44877).j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", { variants: { variant: { default: "bg-primary text-primary-foreground shadow hover:bg-primary/90", destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline" }, size: { default: "h-9 px-4 py-2", sm: "h-8 rounded-md px-3 text-xs", lg: "h-10 rounded-md px-8", icon: "h-9 w-9" } }, defaultVariants: { variant: "default", size: "default" } }), b = l.forwardRef(({ className: e2, variant: s2, size: r2, asChild: n2 = false, ...l2 }, a2) => { + let o2 = n2 ? h.g7 : "button"; + return (0, t.jsx)(o2, { className: (0, i.cn)(x({ variant: s2, size: r2, className: e2 })), ref: a2, ...l2 }); + }); + b.displayName = "Button"; + let y = (0, d.$E)("69628d0c5ad9a69bc20b72992b2a9f15e2aa4452", g.g, void 0, f.Z, "signOut"); + function v() { + let [e2, s2, r2] = (0, l.useActionState)(m, { error: "" }), [a2, i2, o2] = (0, l.useActionState)(p, { error: "" }), c2 = r2 || o2, u2 = e2.error ? e2 : a2; + return (0, t.jsxs)("form", { className: "flex flex-col space-y-6", children: [(0, t.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, t.jsx)("div", { className: "mt-1", children: (0, t.jsx)(n.I, { id: "username", name: "username", "aria-label": "Username", type: "text", autoCapitalize: "off", autoComplete: "username", spellCheck: false, required: true, maxLength: 50, className: "relative block w-full appearance-none rounded-[1px] border px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-orange-500 focus:outline-none focus:ring-orange-500 sm:text-sm", placeholder: "Username" }) }), (0, t.jsx)("div", { children: (0, t.jsx)("div", { className: "mt-1", children: (0, t.jsx)(n.I, { id: "password", name: "password", "aria-label": "Password", type: "password", required: true, maxLength: 100, className: "relative block w-full appearance-none rounded-[1px] border px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-orange-500 focus:outline-none focus:ring-orange-500 sm:text-sm", placeholder: "Password" }) }) }), (0, t.jsx)(b, { type: "submit", className: "rounded-[1px] bg-green-800 px-4 py-2 text-xs font-semibold text-white shadow-sm hover:bg-green-900 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2", disabled: c2, formAction: s2, children: "Log in" }), (0, t.jsx)(b, { type: "submit", variant: "ghost", className: "rounded-[2px] border-[1px] border-green-800 bg-white px-4 py-2 text-xs font-semibold text-green-800", disabled: c2, formAction: i2, children: "Create login" })] }), u2?.error && (0, t.jsx)("div", { className: "text-sm text-red-500", children: u2.error })] }); + } + function w() { + return (0, t.jsxs)(o, { children: [(0, t.jsxs)(c, { className: "flex flex-row items-center gap-1", children: ["Log in", " ", (0, t.jsx)("svg", { viewBox: "0 0 10 6", className: "h-[6px] w-[10px]", children: (0, t.jsx)("polygon", { points: "0,0 5,6 10,0" }) })] }), (0, t.jsxs)(u, { className: "px-8 py-4", children: [(0, t.jsx)("span", { className: "text-sm font-semibold text-green-800", children: "Log in" }), (0, t.jsx)(v, {})] })] }); + } + function _(e2) { + return (0, t.jsxs)(o, { children: [(0, t.jsxs)(c, { className: "flex flex-row items-center gap-1", children: [e2.username, " ", (0, t.jsx)("svg", { viewBox: "0 0 10 6", className: "h-[6px] w-[10px]", children: (0, t.jsx)("polygon", { points: "0,0 5,6 10,0" }) })] }), (0, t.jsx)(u, { className: "flex w-32 flex-col items-center px-8 py-4", children: (0, t.jsx)("form", { children: (0, t.jsx)(b, { formAction: y, variant: "ghost", className: "rounded-[2px] border-[1px] border-green-800 bg-white px-4 py-2 text-xs font-semibold text-green-800", children: "Sign Out" }) }) })] }); + } + }; + __namedExportsObject5["__chunk_38972"] = (e, s, r) => { + Promise.resolve().then(r.bind(r, 15160)); + }; + __namedExportsObject5["__chunk_75979"] = (e, s, r) => { + Promise.resolve().then(r.bind(r, 65252)), Promise.resolve().then(r.bind(r, 66866)), Promise.resolve().then(r.bind(r, 20175)), Promise.resolve().then(r.bind(r, 64908)), Promise.resolve().then(r.bind(r, 52897)), Promise.resolve().then(r.bind(r, 40494)), Promise.resolve().then(r.bind(r, 30439)), Promise.resolve().then(r.bind(r, 65402)), Promise.resolve().then(r.bind(r, 17731)), Promise.resolve().then(r.bind(r, 46587)), Promise.resolve().then(r.bind(r, 75040)), Promise.resolve().then(r.bind(r, 5565)); + }; + __namedExportsObject5["__chunk_88452"] = (e, s, r) => { + Promise.resolve().then(r.bind(r, 18561)), Promise.resolve().then(r.bind(r, 8865)), Promise.resolve().then(r.bind(r, 8046)), Promise.resolve().then(r.bind(r, 62461)), Promise.resolve().then(r.bind(r, 5967)), Promise.resolve().then(r.bind(r, 13972)); + }; + __namedExportsObject5["__chunk_91054"] = () => { + }; + __namedExportsObject5["__chunk_33447"] = (e, t, r) => { + "use strict"; + let n; + r.d(t, { z: () => ti }), function(e10) { + e10.assertEqual = (e11) => e11, e10.assertIs = function(e11) { + }, e10.assertNever = function(e11) { + throw Error(); + }, e10.arrayToEnum = (e11) => { + let t2 = {}; + for (let r2 of e11) + t2[r2] = r2; + return t2; + }, e10.getValidEnumValues = (t2) => { + let r2 = e10.objectKeys(t2).filter((e11) => "number" != typeof t2[t2[e11]]), n2 = {}; + for (let e11 of r2) + n2[e11] = t2[e11]; + return e10.objectValues(n2); + }, e10.objectValues = (t2) => e10.objectKeys(t2).map(function(e11) { + return t2[e11]; + }), e10.objectKeys = "function" == typeof Object.keys ? (e11) => Object.keys(e11) : (e11) => { + let t2 = []; + for (let r2 in e11) + Object.prototype.hasOwnProperty.call(e11, r2) && t2.push(r2); + return t2; + }, e10.find = (e11, t2) => { + for (let r2 of e11) + if (t2(r2)) + return r2; + }, e10.isInteger = "function" == typeof Number.isInteger ? (e11) => Number.isInteger(e11) : (e11) => "number" == typeof e11 && isFinite(e11) && Math.floor(e11) === e11, e10.joinValues = function(e11, t2 = " | ") { + return e11.map((e12) => "string" == typeof e12 ? `'${e12}'` : e12).join(t2); + }, e10.jsonStringifyReplacer = (e11, t2) => "bigint" == typeof t2 ? t2.toString() : t2; + }(e9 || (e9 = {})), (e7 || (e7 = {})).mergeShapes = (e10, t2) => ({ ...e10, ...t2 }); + let i = e9.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]), s = (e10) => { + switch (typeof e10) { + case "undefined": + return i.undefined; + case "string": + return i.string; + case "number": + return isNaN(e10) ? i.nan : i.number; + case "boolean": + return i.boolean; + case "function": + return i.function; + case "bigint": + return i.bigint; + case "symbol": + return i.symbol; + case "object": + if (Array.isArray(e10)) + return i.array; + if (null === e10) + return i.null; + if (e10.then && "function" == typeof e10.then && e10.catch && "function" == typeof e10.catch) + return i.promise; + if ("undefined" != typeof Map && e10 instanceof Map) + return i.map; + if ("undefined" != typeof Set && e10 instanceof Set) + return i.set; + if ("undefined" != typeof Date && e10 instanceof Date) + return i.date; + return i.object; + default: + return i.unknown; + } + }, a = e9.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of", "not_finite"]); + class o extends Error { + constructor(e10) { + super(), this.issues = [], this.addIssue = (e11) => { + this.issues = [...this.issues, e11]; + }, this.addIssues = (e11 = []) => { + this.issues = [...this.issues, ...e11]; + }; + let t2 = new.target.prototype; + Object.setPrototypeOf ? Object.setPrototypeOf(this, t2) : this.__proto__ = t2, this.name = "ZodError", this.issues = e10; + } + get errors() { + return this.issues; + } + format(e10) { + let t2 = e10 || function(e11) { + return e11.message; + }, r2 = { _errors: [] }, n2 = (e11) => { + for (let i2 of e11.issues) + if ("invalid_union" === i2.code) + i2.unionErrors.map(n2); + else if ("invalid_return_type" === i2.code) + n2(i2.returnTypeError); + else if ("invalid_arguments" === i2.code) + n2(i2.argumentsError); + else if (0 === i2.path.length) + r2._errors.push(t2(i2)); + else { + let e12 = r2, n3 = 0; + for (; n3 < i2.path.length; ) { + let r3 = i2.path[n3]; + n3 === i2.path.length - 1 ? (e12[r3] = e12[r3] || { _errors: [] }, e12[r3]._errors.push(t2(i2))) : e12[r3] = e12[r3] || { _errors: [] }, e12 = e12[r3], n3++; + } + } + }; + return n2(this), r2; + } + static assert(e10) { + if (!(e10 instanceof o)) + throw Error(`Not a ZodError: ${e10}`); + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, e9.jsonStringifyReplacer, 2); + } + get isEmpty() { + return 0 === this.issues.length; + } + flatten(e10 = (e11) => e11.message) { + let t2 = {}, r2 = []; + for (let n2 of this.issues) + n2.path.length > 0 ? (t2[n2.path[0]] = t2[n2.path[0]] || [], t2[n2.path[0]].push(e10(n2))) : r2.push(e10(n2)); + return { formErrors: r2, fieldErrors: t2 }; + } + get formErrors() { + return this.flatten(); + } + } + o.create = (e10) => new o(e10); + let l = (e10, t2) => { + let r2; + switch (e10.code) { + case a.invalid_type: + r2 = e10.received === i.undefined ? "Required" : `Expected ${e10.expected}, received ${e10.received}`; + break; + case a.invalid_literal: + r2 = `Invalid literal value, expected ${JSON.stringify(e10.expected, e9.jsonStringifyReplacer)}`; + break; + case a.unrecognized_keys: + r2 = `Unrecognized key(s) in object: ${e9.joinValues(e10.keys, ", ")}`; + break; + case a.invalid_union: + r2 = "Invalid input"; + break; + case a.invalid_union_discriminator: + r2 = `Invalid discriminator value. Expected ${e9.joinValues(e10.options)}`; + break; + case a.invalid_enum_value: + r2 = `Invalid enum value. Expected ${e9.joinValues(e10.options)}, received '${e10.received}'`; + break; + case a.invalid_arguments: + r2 = "Invalid function arguments"; + break; + case a.invalid_return_type: + r2 = "Invalid function return type"; + break; + case a.invalid_date: + r2 = "Invalid date"; + break; + case a.invalid_string: + "object" == typeof e10.validation ? "includes" in e10.validation ? (r2 = `Invalid input: must include "${e10.validation.includes}"`, "number" == typeof e10.validation.position && (r2 = `${r2} at one or more positions greater than or equal to ${e10.validation.position}`)) : "startsWith" in e10.validation ? r2 = `Invalid input: must start with "${e10.validation.startsWith}"` : "endsWith" in e10.validation ? r2 = `Invalid input: must end with "${e10.validation.endsWith}"` : e9.assertNever(e10.validation) : r2 = "regex" !== e10.validation ? `Invalid ${e10.validation}` : "Invalid"; + break; + case a.too_small: + r2 = "array" === e10.type ? `Array must contain ${e10.exact ? "exactly" : e10.inclusive ? "at least" : "more than"} ${e10.minimum} element(s)` : "string" === e10.type ? `String must contain ${e10.exact ? "exactly" : e10.inclusive ? "at least" : "over"} ${e10.minimum} character(s)` : "number" === e10.type ? `Number must be ${e10.exact ? "exactly equal to " : e10.inclusive ? "greater than or equal to " : "greater than "}${e10.minimum}` : "date" === e10.type ? `Date must be ${e10.exact ? "exactly equal to " : e10.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(e10.minimum))}` : "Invalid input"; + break; + case a.too_big: + r2 = "array" === e10.type ? `Array must contain ${e10.exact ? "exactly" : e10.inclusive ? "at most" : "less than"} ${e10.maximum} element(s)` : "string" === e10.type ? `String must contain ${e10.exact ? "exactly" : e10.inclusive ? "at most" : "under"} ${e10.maximum} character(s)` : "number" === e10.type ? `Number must be ${e10.exact ? "exactly" : e10.inclusive ? "less than or equal to" : "less than"} ${e10.maximum}` : "bigint" === e10.type ? `BigInt must be ${e10.exact ? "exactly" : e10.inclusive ? "less than or equal to" : "less than"} ${e10.maximum}` : "date" === e10.type ? `Date must be ${e10.exact ? "exactly" : e10.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(e10.maximum))}` : "Invalid input"; + break; + case a.custom: + r2 = "Invalid input"; + break; + case a.invalid_intersection_types: + r2 = "Intersection results could not be merged"; + break; + case a.not_multiple_of: + r2 = `Number must be a multiple of ${e10.multipleOf}`; + break; + case a.not_finite: + r2 = "Number must be finite"; + break; + default: + r2 = t2.defaultError, e9.assertNever(e10); + } + return { message: r2 }; + }, c = l; + function u() { + return c; + } + let d = (e10) => { + let { data: t2, path: r2, errorMaps: n2, issueData: i2 } = e10, s2 = [...r2, ...i2.path || []], a2 = { ...i2, path: s2 }; + if (void 0 !== i2.message) + return { ...i2, path: s2, message: i2.message }; + let o2 = ""; + for (let e11 of n2.filter((e12) => !!e12).slice().reverse()) + o2 = e11(a2, { data: t2, defaultError: o2 }).message; + return { ...i2, path: s2, message: o2 }; + }; + function h(e10, t2) { + let r2 = u(), n2 = d({ issueData: t2, data: e10.data, path: e10.path, errorMaps: [e10.common.contextualErrorMap, e10.schemaErrorMap, r2, r2 === l ? void 0 : l].filter((e11) => !!e11) }); + e10.common.issues.push(n2); + } + class f { + constructor() { + this.value = "valid"; + } + dirty() { + "valid" === this.value && (this.value = "dirty"); + } + abort() { + "aborted" !== this.value && (this.value = "aborted"); + } + static mergeArray(e10, t2) { + let r2 = []; + for (let n2 of t2) { + if ("aborted" === n2.status) + return p; + "dirty" === n2.status && e10.dirty(), r2.push(n2.value); + } + return { status: e10.value, value: r2 }; + } + static async mergeObjectAsync(e10, t2) { + let r2 = []; + for (let e11 of t2) { + let t3 = await e11.key, n2 = await e11.value; + r2.push({ key: t3, value: n2 }); + } + return f.mergeObjectSync(e10, r2); + } + static mergeObjectSync(e10, t2) { + let r2 = {}; + for (let n2 of t2) { + let { key: t3, value: i2 } = n2; + if ("aborted" === t3.status || "aborted" === i2.status) + return p; + "dirty" === t3.status && e10.dirty(), "dirty" === i2.status && e10.dirty(), "__proto__" !== t3.value && (void 0 !== i2.value || n2.alwaysSet) && (r2[t3.value] = i2.value); + } + return { status: e10.value, value: r2 }; + } + } + let p = Object.freeze({ status: "aborted" }), m = (e10) => ({ status: "dirty", value: e10 }), g = (e10) => ({ status: "valid", value: e10 }), y = (e10) => "aborted" === e10.status, v = (e10) => "dirty" === e10.status, b = (e10) => "valid" === e10.status, w = (e10) => "undefined" != typeof Promise && e10 instanceof Promise; + function x(e10, t2, r2, n2) { + if ("a" === r2 && !n2) + throw TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t2 ? e10 !== t2 || !n2 : !t2.has(e10)) + throw TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === r2 ? n2 : "a" === r2 ? n2.call(e10) : n2 ? n2.value : t2.get(e10); + } + function S(e10, t2, r2, n2, i2) { + if ("m" === n2) + throw TypeError("Private method is not writable"); + if ("a" === n2 && !i2) + throw TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t2 ? e10 !== t2 || !i2 : !t2.has(e10)) + throw TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n2 ? i2.call(e10, r2) : i2 ? i2.value = r2 : t2.set(e10, r2), r2; + } + "function" == typeof SuppressedError && SuppressedError, function(e10) { + e10.errToObj = (e11) => "string" == typeof e11 ? { message: e11 } : e11 || {}, e10.toString = (e11) => "string" == typeof e11 ? e11 : null == e11 ? void 0 : e11.message; + }(te || (te = {})); + class _ { + constructor(e10, t2, r2, n2) { + this._cachedPath = [], this.parent = e10, this.data = t2, this._path = r2, this._key = n2; + } + get path() { + return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath; + } + } + let E = (e10, t2) => { + if (b(t2)) + return { success: true, data: t2.value }; + if (!e10.common.issues.length) + throw Error("Validation failed but no issues detected."); + return { success: false, get error() { + if (this._error) + return this._error; + let t3 = new o(e10.common.issues); + return this._error = t3, this._error; + } }; + }; + function k(e10) { + if (!e10) + return {}; + let { errorMap: t2, invalid_type_error: r2, required_error: n2, description: i2 } = e10; + if (t2 && (r2 || n2)) + throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + return t2 ? { errorMap: t2, description: i2 } : { errorMap: (t3, i3) => { + var s2, a2; + let { message: o2 } = e10; + return "invalid_enum_value" === t3.code ? { message: null != o2 ? o2 : i3.defaultError } : void 0 === i3.data ? { message: null !== (s2 = null != o2 ? o2 : n2) && void 0 !== s2 ? s2 : i3.defaultError } : "invalid_type" !== t3.code ? { message: i3.defaultError } : { message: null !== (a2 = null != o2 ? o2 : r2) && void 0 !== a2 ? a2 : i3.defaultError }; + }, description: i2 }; + } + class C { + constructor(e10) { + this.spa = this.safeParseAsync, this._def = e10, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this); + } + get description() { + return this._def.description; + } + _getType(e10) { + return s(e10.data); + } + _getOrReturnCtx(e10, t2) { + return t2 || { common: e10.parent.common, data: e10.data, parsedType: s(e10.data), schemaErrorMap: this._def.errorMap, path: e10.path, parent: e10.parent }; + } + _processInputParams(e10) { + return { status: new f(), ctx: { common: e10.parent.common, data: e10.data, parsedType: s(e10.data), schemaErrorMap: this._def.errorMap, path: e10.path, parent: e10.parent } }; + } + _parseSync(e10) { + let t2 = this._parse(e10); + if (w(t2)) + throw Error("Synchronous parse encountered promise."); + return t2; + } + _parseAsync(e10) { + return Promise.resolve(this._parse(e10)); + } + parse(e10, t2) { + let r2 = this.safeParse(e10, t2); + if (r2.success) + return r2.data; + throw r2.error; + } + safeParse(e10, t2) { + var r2; + let n2 = { common: { issues: [], async: null !== (r2 = null == t2 ? void 0 : t2.async) && void 0 !== r2 && r2, contextualErrorMap: null == t2 ? void 0 : t2.errorMap }, path: (null == t2 ? void 0 : t2.path) || [], schemaErrorMap: this._def.errorMap, parent: null, data: e10, parsedType: s(e10) }, i2 = this._parseSync({ data: e10, path: n2.path, parent: n2 }); + return E(n2, i2); + } + async parseAsync(e10, t2) { + let r2 = await this.safeParseAsync(e10, t2); + if (r2.success) + return r2.data; + throw r2.error; + } + async safeParseAsync(e10, t2) { + let r2 = { common: { issues: [], contextualErrorMap: null == t2 ? void 0 : t2.errorMap, async: true }, path: (null == t2 ? void 0 : t2.path) || [], schemaErrorMap: this._def.errorMap, parent: null, data: e10, parsedType: s(e10) }, n2 = this._parse({ data: e10, path: r2.path, parent: r2 }); + return E(r2, await (w(n2) ? n2 : Promise.resolve(n2))); + } + refine(e10, t2) { + let r2 = (e11) => "string" == typeof t2 || void 0 === t2 ? { message: t2 } : "function" == typeof t2 ? t2(e11) : t2; + return this._refinement((t3, n2) => { + let i2 = e10(t3), s2 = () => n2.addIssue({ code: a.custom, ...r2(t3) }); + return "undefined" != typeof Promise && i2 instanceof Promise ? i2.then((e11) => !!e11 || (s2(), false)) : !!i2 || (s2(), false); + }); + } + refinement(e10, t2) { + return this._refinement((r2, n2) => !!e10(r2) || (n2.addIssue("function" == typeof t2 ? t2(r2, n2) : t2), false)); + } + _refinement(e10) { + return new eg({ schema: this, typeName: tn.ZodEffects, effect: { type: "refinement", refinement: e10 } }); + } + superRefine(e10) { + return this._refinement(e10); + } + optional() { + return ey.create(this, this._def); + } + nullable() { + return ev.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return X.create(this, this._def); + } + promise() { + return em.create(this, this._def); + } + or(e10) { + return et.create([this, e10], this._def); + } + and(e10) { + return ei.create(this, e10, this._def); + } + transform(e10) { + return new eg({ ...k(this._def), schema: this, typeName: tn.ZodEffects, effect: { type: "transform", transform: e10 } }); + } + default(e10) { + return new eb({ ...k(this._def), innerType: this, defaultValue: "function" == typeof e10 ? e10 : () => e10, typeName: tn.ZodDefault }); + } + brand() { + return new e_({ typeName: tn.ZodBranded, type: this, ...k(this._def) }); + } + catch(e10) { + return new ew({ ...k(this._def), innerType: this, catchValue: "function" == typeof e10 ? e10 : () => e10, typeName: tn.ZodCatch }); + } + describe(e10) { + return new this.constructor({ ...this._def, description: e10 }); + } + pipe(e10) { + return eE.create(this, e10); + } + readonly() { + return ek.create(this); + } + isOptional() { + return this.safeParse(void 0).success; + } + isNullable() { + return this.safeParse(null).success; + } + } + let R = /^c[^\s-]{8,}$/i, P = /^[0-9a-z]+$/, T = /^[0-9A-HJKMNP-TV-Z]{26}$/, A = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, O = /^[a-z0-9_-]{21}$/i, I = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, N = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, M = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, $ = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, L = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, j = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", D = RegExp(`^${j}$`); + function F(e10) { + let t2 = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d"; + return e10.precision ? t2 = `${t2}\\.\\d{${e10.precision}}` : null == e10.precision && (t2 = `${t2}(\\.\\d+)?`), t2; + } + function B(e10) { + let t2 = `${j}T${F(e10)}`, r2 = []; + return r2.push(e10.local ? "Z?" : "Z"), e10.offset && r2.push("([+-]\\d{2}:?\\d{2})"), t2 = `${t2}(${r2.join("|")})`, RegExp(`^${t2}$`); + } + class U extends C { + _parse(e10) { + var t2, r2; + let s2; + if (this._def.coerce && (e10.data = String(e10.data)), this._getType(e10) !== i.string) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.string, received: t3.parsedType }), p; + } + let o2 = new f(); + for (let i2 of this._def.checks) + if ("min" === i2.kind) + e10.data.length < i2.value && (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.too_small, minimum: i2.value, type: "string", inclusive: true, exact: false, message: i2.message }), o2.dirty()); + else if ("max" === i2.kind) + e10.data.length > i2.value && (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.too_big, maximum: i2.value, type: "string", inclusive: true, exact: false, message: i2.message }), o2.dirty()); + else if ("length" === i2.kind) { + let t3 = e10.data.length > i2.value, r3 = e10.data.length < i2.value; + (t3 || r3) && (s2 = this._getOrReturnCtx(e10, s2), t3 ? h(s2, { code: a.too_big, maximum: i2.value, type: "string", inclusive: true, exact: true, message: i2.message }) : r3 && h(s2, { code: a.too_small, minimum: i2.value, type: "string", inclusive: true, exact: true, message: i2.message }), o2.dirty()); + } else if ("email" === i2.kind) + N.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "email", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("emoji" === i2.kind) + n || (n = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), n.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "emoji", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("uuid" === i2.kind) + A.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "uuid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("nanoid" === i2.kind) + O.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "nanoid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("cuid" === i2.kind) + R.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "cuid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("cuid2" === i2.kind) + P.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "cuid2", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("ulid" === i2.kind) + T.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "ulid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("url" === i2.kind) + try { + new URL(e10.data); + } catch (t3) { + h(s2 = this._getOrReturnCtx(e10, s2), { validation: "url", code: a.invalid_string, message: i2.message }), o2.dirty(); + } + else + "regex" === i2.kind ? (i2.regex.lastIndex = 0, i2.regex.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "regex", code: a.invalid_string, message: i2.message }), o2.dirty())) : "trim" === i2.kind ? e10.data = e10.data.trim() : "includes" === i2.kind ? e10.data.includes(i2.value, i2.position) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: { includes: i2.value, position: i2.position }, message: i2.message }), o2.dirty()) : "toLowerCase" === i2.kind ? e10.data = e10.data.toLowerCase() : "toUpperCase" === i2.kind ? e10.data = e10.data.toUpperCase() : "startsWith" === i2.kind ? e10.data.startsWith(i2.value) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: { startsWith: i2.value }, message: i2.message }), o2.dirty()) : "endsWith" === i2.kind ? e10.data.endsWith(i2.value) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: { endsWith: i2.value }, message: i2.message }), o2.dirty()) : "datetime" === i2.kind ? B(i2).test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: "datetime", message: i2.message }), o2.dirty()) : "date" === i2.kind ? D.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: "date", message: i2.message }), o2.dirty()) : "time" === i2.kind ? RegExp(`^${F(i2)}$`).test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: "time", message: i2.message }), o2.dirty()) : "duration" === i2.kind ? I.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "duration", code: a.invalid_string, message: i2.message }), o2.dirty()) : "ip" === i2.kind ? (t2 = e10.data, ("v4" === (r2 = i2.version) || !r2) && M.test(t2) || ("v6" === r2 || !r2) && $.test(t2) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "ip", code: a.invalid_string, message: i2.message }), o2.dirty())) : "base64" === i2.kind ? L.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "base64", code: a.invalid_string, message: i2.message }), o2.dirty()) : e9.assertNever(i2); + return { status: o2.value, value: e10.data }; + } + _regex(e10, t2, r2) { + return this.refinement((t3) => e10.test(t3), { validation: t2, code: a.invalid_string, ...te.errToObj(r2) }); + } + _addCheck(e10) { + return new U({ ...this._def, checks: [...this._def.checks, e10] }); + } + email(e10) { + return this._addCheck({ kind: "email", ...te.errToObj(e10) }); + } + url(e10) { + return this._addCheck({ kind: "url", ...te.errToObj(e10) }); + } + emoji(e10) { + return this._addCheck({ kind: "emoji", ...te.errToObj(e10) }); + } + uuid(e10) { + return this._addCheck({ kind: "uuid", ...te.errToObj(e10) }); + } + nanoid(e10) { + return this._addCheck({ kind: "nanoid", ...te.errToObj(e10) }); + } + cuid(e10) { + return this._addCheck({ kind: "cuid", ...te.errToObj(e10) }); + } + cuid2(e10) { + return this._addCheck({ kind: "cuid2", ...te.errToObj(e10) }); + } + ulid(e10) { + return this._addCheck({ kind: "ulid", ...te.errToObj(e10) }); + } + base64(e10) { + return this._addCheck({ kind: "base64", ...te.errToObj(e10) }); + } + ip(e10) { + return this._addCheck({ kind: "ip", ...te.errToObj(e10) }); + } + datetime(e10) { + var t2, r2; + return "string" == typeof e10 ? this._addCheck({ kind: "datetime", precision: null, offset: false, local: false, message: e10 }) : this._addCheck({ kind: "datetime", precision: void 0 === (null == e10 ? void 0 : e10.precision) ? null : null == e10 ? void 0 : e10.precision, offset: null !== (t2 = null == e10 ? void 0 : e10.offset) && void 0 !== t2 && t2, local: null !== (r2 = null == e10 ? void 0 : e10.local) && void 0 !== r2 && r2, ...te.errToObj(null == e10 ? void 0 : e10.message) }); + } + date(e10) { + return this._addCheck({ kind: "date", message: e10 }); + } + time(e10) { + return "string" == typeof e10 ? this._addCheck({ kind: "time", precision: null, message: e10 }) : this._addCheck({ kind: "time", precision: void 0 === (null == e10 ? void 0 : e10.precision) ? null : null == e10 ? void 0 : e10.precision, ...te.errToObj(null == e10 ? void 0 : e10.message) }); + } + duration(e10) { + return this._addCheck({ kind: "duration", ...te.errToObj(e10) }); + } + regex(e10, t2) { + return this._addCheck({ kind: "regex", regex: e10, ...te.errToObj(t2) }); + } + includes(e10, t2) { + return this._addCheck({ kind: "includes", value: e10, position: null == t2 ? void 0 : t2.position, ...te.errToObj(null == t2 ? void 0 : t2.message) }); + } + startsWith(e10, t2) { + return this._addCheck({ kind: "startsWith", value: e10, ...te.errToObj(t2) }); + } + endsWith(e10, t2) { + return this._addCheck({ kind: "endsWith", value: e10, ...te.errToObj(t2) }); + } + min(e10, t2) { + return this._addCheck({ kind: "min", value: e10, ...te.errToObj(t2) }); + } + max(e10, t2) { + return this._addCheck({ kind: "max", value: e10, ...te.errToObj(t2) }); + } + length(e10, t2) { + return this._addCheck({ kind: "length", value: e10, ...te.errToObj(t2) }); + } + nonempty(e10) { + return this.min(1, te.errToObj(e10)); + } + trim() { + return new U({ ...this._def, checks: [...this._def.checks, { kind: "trim" }] }); + } + toLowerCase() { + return new U({ ...this._def, checks: [...this._def.checks, { kind: "toLowerCase" }] }); + } + toUpperCase() { + return new U({ ...this._def, checks: [...this._def.checks, { kind: "toUpperCase" }] }); + } + get isDatetime() { + return !!this._def.checks.find((e10) => "datetime" === e10.kind); + } + get isDate() { + return !!this._def.checks.find((e10) => "date" === e10.kind); + } + get isTime() { + return !!this._def.checks.find((e10) => "time" === e10.kind); + } + get isDuration() { + return !!this._def.checks.find((e10) => "duration" === e10.kind); + } + get isEmail() { + return !!this._def.checks.find((e10) => "email" === e10.kind); + } + get isURL() { + return !!this._def.checks.find((e10) => "url" === e10.kind); + } + get isEmoji() { + return !!this._def.checks.find((e10) => "emoji" === e10.kind); + } + get isUUID() { + return !!this._def.checks.find((e10) => "uuid" === e10.kind); + } + get isNANOID() { + return !!this._def.checks.find((e10) => "nanoid" === e10.kind); + } + get isCUID() { + return !!this._def.checks.find((e10) => "cuid" === e10.kind); + } + get isCUID2() { + return !!this._def.checks.find((e10) => "cuid2" === e10.kind); + } + get isULID() { + return !!this._def.checks.find((e10) => "ulid" === e10.kind); + } + get isIP() { + return !!this._def.checks.find((e10) => "ip" === e10.kind); + } + get isBase64() { + return !!this._def.checks.find((e10) => "base64" === e10.kind); + } + get minLength() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return e10; + } + get maxLength() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return e10; + } + } + U.create = (e10) => { + var t2; + return new U({ checks: [], typeName: tn.ZodString, coerce: null !== (t2 = null == e10 ? void 0 : e10.coerce) && void 0 !== t2 && t2, ...k(e10) }); + }; + class q extends C { + constructor() { + super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf; + } + _parse(e10) { + let t2; + if (this._def.coerce && (e10.data = Number(e10.data)), this._getType(e10) !== i.number) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.number, received: t3.parsedType }), p; + } + let r2 = new f(); + for (let n2 of this._def.checks) + "int" === n2.kind ? e9.isInteger(e10.data) || (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.invalid_type, expected: "integer", received: "float", message: n2.message }), r2.dirty()) : "min" === n2.kind ? (n2.inclusive ? e10.data < n2.value : e10.data <= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_small, minimum: n2.value, type: "number", inclusive: n2.inclusive, exact: false, message: n2.message }), r2.dirty()) : "max" === n2.kind ? (n2.inclusive ? e10.data > n2.value : e10.data >= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_big, maximum: n2.value, type: "number", inclusive: n2.inclusive, exact: false, message: n2.message }), r2.dirty()) : "multipleOf" === n2.kind ? 0 !== function(e11, t3) { + let r3 = (e11.toString().split(".")[1] || "").length, n3 = (t3.toString().split(".")[1] || "").length, i2 = r3 > n3 ? r3 : n3; + return parseInt(e11.toFixed(i2).replace(".", "")) % parseInt(t3.toFixed(i2).replace(".", "")) / Math.pow(10, i2); + }(e10.data, n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.not_multiple_of, multipleOf: n2.value, message: n2.message }), r2.dirty()) : "finite" === n2.kind ? Number.isFinite(e10.data) || (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.not_finite, message: n2.message }), r2.dirty()) : e9.assertNever(n2); + return { status: r2.value, value: e10.data }; + } + gte(e10, t2) { + return this.setLimit("min", e10, true, te.toString(t2)); + } + gt(e10, t2) { + return this.setLimit("min", e10, false, te.toString(t2)); + } + lte(e10, t2) { + return this.setLimit("max", e10, true, te.toString(t2)); + } + lt(e10, t2) { + return this.setLimit("max", e10, false, te.toString(t2)); + } + setLimit(e10, t2, r2, n2) { + return new q({ ...this._def, checks: [...this._def.checks, { kind: e10, value: t2, inclusive: r2, message: te.toString(n2) }] }); + } + _addCheck(e10) { + return new q({ ...this._def, checks: [...this._def.checks, e10] }); + } + int(e10) { + return this._addCheck({ kind: "int", message: te.toString(e10) }); + } + positive(e10) { + return this._addCheck({ kind: "min", value: 0, inclusive: false, message: te.toString(e10) }); + } + negative(e10) { + return this._addCheck({ kind: "max", value: 0, inclusive: false, message: te.toString(e10) }); + } + nonpositive(e10) { + return this._addCheck({ kind: "max", value: 0, inclusive: true, message: te.toString(e10) }); + } + nonnegative(e10) { + return this._addCheck({ kind: "min", value: 0, inclusive: true, message: te.toString(e10) }); + } + multipleOf(e10, t2) { + return this._addCheck({ kind: "multipleOf", value: e10, message: te.toString(t2) }); + } + finite(e10) { + return this._addCheck({ kind: "finite", message: te.toString(e10) }); + } + safe(e10) { + return this._addCheck({ kind: "min", inclusive: true, value: Number.MIN_SAFE_INTEGER, message: te.toString(e10) })._addCheck({ kind: "max", inclusive: true, value: Number.MAX_SAFE_INTEGER, message: te.toString(e10) }); + } + get minValue() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return e10; + } + get maxValue() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return e10; + } + get isInt() { + return !!this._def.checks.find((e10) => "int" === e10.kind || "multipleOf" === e10.kind && e9.isInteger(e10.value)); + } + get isFinite() { + let e10 = null, t2 = null; + for (let r2 of this._def.checks) { + if ("finite" === r2.kind || "int" === r2.kind || "multipleOf" === r2.kind) + return true; + "min" === r2.kind ? (null === t2 || r2.value > t2) && (t2 = r2.value) : "max" === r2.kind && (null === e10 || r2.value < e10) && (e10 = r2.value); + } + return Number.isFinite(t2) && Number.isFinite(e10); + } + } + q.create = (e10) => new q({ checks: [], typeName: tn.ZodNumber, coerce: (null == e10 ? void 0 : e10.coerce) || false, ...k(e10) }); + class z extends C { + constructor() { + super(...arguments), this.min = this.gte, this.max = this.lte; + } + _parse(e10) { + let t2; + if (this._def.coerce && (e10.data = BigInt(e10.data)), this._getType(e10) !== i.bigint) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.bigint, received: t3.parsedType }), p; + } + let r2 = new f(); + for (let n2 of this._def.checks) + "min" === n2.kind ? (n2.inclusive ? e10.data < n2.value : e10.data <= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_small, type: "bigint", minimum: n2.value, inclusive: n2.inclusive, message: n2.message }), r2.dirty()) : "max" === n2.kind ? (n2.inclusive ? e10.data > n2.value : e10.data >= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_big, type: "bigint", maximum: n2.value, inclusive: n2.inclusive, message: n2.message }), r2.dirty()) : "multipleOf" === n2.kind ? e10.data % n2.value !== BigInt(0) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.not_multiple_of, multipleOf: n2.value, message: n2.message }), r2.dirty()) : e9.assertNever(n2); + return { status: r2.value, value: e10.data }; + } + gte(e10, t2) { + return this.setLimit("min", e10, true, te.toString(t2)); + } + gt(e10, t2) { + return this.setLimit("min", e10, false, te.toString(t2)); + } + lte(e10, t2) { + return this.setLimit("max", e10, true, te.toString(t2)); + } + lt(e10, t2) { + return this.setLimit("max", e10, false, te.toString(t2)); + } + setLimit(e10, t2, r2, n2) { + return new z({ ...this._def, checks: [...this._def.checks, { kind: e10, value: t2, inclusive: r2, message: te.toString(n2) }] }); + } + _addCheck(e10) { + return new z({ ...this._def, checks: [...this._def.checks, e10] }); + } + positive(e10) { + return this._addCheck({ kind: "min", value: BigInt(0), inclusive: false, message: te.toString(e10) }); + } + negative(e10) { + return this._addCheck({ kind: "max", value: BigInt(0), inclusive: false, message: te.toString(e10) }); + } + nonpositive(e10) { + return this._addCheck({ kind: "max", value: BigInt(0), inclusive: true, message: te.toString(e10) }); + } + nonnegative(e10) { + return this._addCheck({ kind: "min", value: BigInt(0), inclusive: true, message: te.toString(e10) }); + } + multipleOf(e10, t2) { + return this._addCheck({ kind: "multipleOf", value: e10, message: te.toString(t2) }); + } + get minValue() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return e10; + } + get maxValue() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return e10; + } + } + z.create = (e10) => { + var t2; + return new z({ checks: [], typeName: tn.ZodBigInt, coerce: null !== (t2 = null == e10 ? void 0 : e10.coerce) && void 0 !== t2 && t2, ...k(e10) }); + }; + class H extends C { + _parse(e10) { + if (this._def.coerce && (e10.data = !!e10.data), this._getType(e10) !== i.boolean) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.boolean, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + H.create = (e10) => new H({ typeName: tn.ZodBoolean, coerce: (null == e10 ? void 0 : e10.coerce) || false, ...k(e10) }); + class W extends C { + _parse(e10) { + let t2; + if (this._def.coerce && (e10.data = new Date(e10.data)), this._getType(e10) !== i.date) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.date, received: t3.parsedType }), p; + } + if (isNaN(e10.data.getTime())) + return h(this._getOrReturnCtx(e10), { code: a.invalid_date }), p; + let r2 = new f(); + for (let n2 of this._def.checks) + "min" === n2.kind ? e10.data.getTime() < n2.value && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_small, message: n2.message, inclusive: true, exact: false, minimum: n2.value, type: "date" }), r2.dirty()) : "max" === n2.kind ? e10.data.getTime() > n2.value && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_big, message: n2.message, inclusive: true, exact: false, maximum: n2.value, type: "date" }), r2.dirty()) : e9.assertNever(n2); + return { status: r2.value, value: new Date(e10.data.getTime()) }; + } + _addCheck(e10) { + return new W({ ...this._def, checks: [...this._def.checks, e10] }); + } + min(e10, t2) { + return this._addCheck({ kind: "min", value: e10.getTime(), message: te.toString(t2) }); + } + max(e10, t2) { + return this._addCheck({ kind: "max", value: e10.getTime(), message: te.toString(t2) }); + } + get minDate() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return null != e10 ? new Date(e10) : null; + } + get maxDate() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return null != e10 ? new Date(e10) : null; + } + } + W.create = (e10) => new W({ checks: [], coerce: (null == e10 ? void 0 : e10.coerce) || false, typeName: tn.ZodDate, ...k(e10) }); + class Q extends C { + _parse(e10) { + if (this._getType(e10) !== i.symbol) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.symbol, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + Q.create = (e10) => new Q({ typeName: tn.ZodSymbol, ...k(e10) }); + class V extends C { + _parse(e10) { + if (this._getType(e10) !== i.undefined) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.undefined, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + V.create = (e10) => new V({ typeName: tn.ZodUndefined, ...k(e10) }); + class G extends C { + _parse(e10) { + if (this._getType(e10) !== i.null) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.null, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + G.create = (e10) => new G({ typeName: tn.ZodNull, ...k(e10) }); + class Z extends C { + constructor() { + super(...arguments), this._any = true; + } + _parse(e10) { + return g(e10.data); + } + } + Z.create = (e10) => new Z({ typeName: tn.ZodAny, ...k(e10) }); + class K extends C { + constructor() { + super(...arguments), this._unknown = true; + } + _parse(e10) { + return g(e10.data); + } + } + K.create = (e10) => new K({ typeName: tn.ZodUnknown, ...k(e10) }); + class J extends C { + _parse(e10) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.never, received: t2.parsedType }), p; + } + } + J.create = (e10) => new J({ typeName: tn.ZodNever, ...k(e10) }); + class Y extends C { + _parse(e10) { + if (this._getType(e10) !== i.undefined) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.void, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + Y.create = (e10) => new Y({ typeName: tn.ZodVoid, ...k(e10) }); + class X extends C { + _parse(e10) { + let { ctx: t2, status: r2 } = this._processInputParams(e10), n2 = this._def; + if (t2.parsedType !== i.array) + return h(t2, { code: a.invalid_type, expected: i.array, received: t2.parsedType }), p; + if (null !== n2.exactLength) { + let e11 = t2.data.length > n2.exactLength.value, i2 = t2.data.length < n2.exactLength.value; + (e11 || i2) && (h(t2, { code: e11 ? a.too_big : a.too_small, minimum: i2 ? n2.exactLength.value : void 0, maximum: e11 ? n2.exactLength.value : void 0, type: "array", inclusive: true, exact: true, message: n2.exactLength.message }), r2.dirty()); + } + if (null !== n2.minLength && t2.data.length < n2.minLength.value && (h(t2, { code: a.too_small, minimum: n2.minLength.value, type: "array", inclusive: true, exact: false, message: n2.minLength.message }), r2.dirty()), null !== n2.maxLength && t2.data.length > n2.maxLength.value && (h(t2, { code: a.too_big, maximum: n2.maxLength.value, type: "array", inclusive: true, exact: false, message: n2.maxLength.message }), r2.dirty()), t2.common.async) + return Promise.all([...t2.data].map((e11, r3) => n2.type._parseAsync(new _(t2, e11, t2.path, r3)))).then((e11) => f.mergeArray(r2, e11)); + let s2 = [...t2.data].map((e11, r3) => n2.type._parseSync(new _(t2, e11, t2.path, r3))); + return f.mergeArray(r2, s2); + } + get element() { + return this._def.type; + } + min(e10, t2) { + return new X({ ...this._def, minLength: { value: e10, message: te.toString(t2) } }); + } + max(e10, t2) { + return new X({ ...this._def, maxLength: { value: e10, message: te.toString(t2) } }); + } + length(e10, t2) { + return new X({ ...this._def, exactLength: { value: e10, message: te.toString(t2) } }); + } + nonempty(e10) { + return this.min(1, e10); + } + } + X.create = (e10, t2) => new X({ type: e10, minLength: null, maxLength: null, exactLength: null, typeName: tn.ZodArray, ...k(t2) }); + class ee extends C { + constructor() { + super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend; + } + _getCached() { + if (null !== this._cached) + return this._cached; + let e10 = this._def.shape(), t2 = e9.objectKeys(e10); + return this._cached = { shape: e10, keys: t2 }; + } + _parse(e10) { + if (this._getType(e10) !== i.object) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.object, received: t3.parsedType }), p; + } + let { status: t2, ctx: r2 } = this._processInputParams(e10), { shape: n2, keys: s2 } = this._getCached(), o2 = []; + if (!(this._def.catchall instanceof J && "strip" === this._def.unknownKeys)) + for (let e11 in r2.data) + s2.includes(e11) || o2.push(e11); + let l2 = []; + for (let e11 of s2) { + let t3 = n2[e11], i2 = r2.data[e11]; + l2.push({ key: { status: "valid", value: e11 }, value: t3._parse(new _(r2, i2, r2.path, e11)), alwaysSet: e11 in r2.data }); + } + if (this._def.catchall instanceof J) { + let e11 = this._def.unknownKeys; + if ("passthrough" === e11) + for (let e12 of o2) + l2.push({ key: { status: "valid", value: e12 }, value: { status: "valid", value: r2.data[e12] } }); + else if ("strict" === e11) + o2.length > 0 && (h(r2, { code: a.unrecognized_keys, keys: o2 }), t2.dirty()); + else if ("strip" === e11) + ; + else + throw Error("Internal ZodObject error: invalid unknownKeys value."); + } else { + let e11 = this._def.catchall; + for (let t3 of o2) { + let n3 = r2.data[t3]; + l2.push({ key: { status: "valid", value: t3 }, value: e11._parse(new _(r2, n3, r2.path, t3)), alwaysSet: t3 in r2.data }); + } + } + return r2.common.async ? Promise.resolve().then(async () => { + let e11 = []; + for (let t3 of l2) { + let r3 = await t3.key, n3 = await t3.value; + e11.push({ key: r3, value: n3, alwaysSet: t3.alwaysSet }); + } + return e11; + }).then((e11) => f.mergeObjectSync(t2, e11)) : f.mergeObjectSync(t2, l2); + } + get shape() { + return this._def.shape(); + } + strict(e10) { + return te.errToObj, new ee({ ...this._def, unknownKeys: "strict", ...void 0 !== e10 ? { errorMap: (t2, r2) => { + var n2, i2, s2, a2; + let o2 = null !== (s2 = null === (i2 = (n2 = this._def).errorMap) || void 0 === i2 ? void 0 : i2.call(n2, t2, r2).message) && void 0 !== s2 ? s2 : r2.defaultError; + return "unrecognized_keys" === t2.code ? { message: null !== (a2 = te.errToObj(e10).message) && void 0 !== a2 ? a2 : o2 } : { message: o2 }; + } } : {} }); + } + strip() { + return new ee({ ...this._def, unknownKeys: "strip" }); + } + passthrough() { + return new ee({ ...this._def, unknownKeys: "passthrough" }); + } + extend(e10) { + return new ee({ ...this._def, shape: () => ({ ...this._def.shape(), ...e10 }) }); + } + merge(e10) { + return new ee({ unknownKeys: e10._def.unknownKeys, catchall: e10._def.catchall, shape: () => ({ ...this._def.shape(), ...e10._def.shape() }), typeName: tn.ZodObject }); + } + setKey(e10, t2) { + return this.augment({ [e10]: t2 }); + } + catchall(e10) { + return new ee({ ...this._def, catchall: e10 }); + } + pick(e10) { + let t2 = {}; + return e9.objectKeys(e10).forEach((r2) => { + e10[r2] && this.shape[r2] && (t2[r2] = this.shape[r2]); + }), new ee({ ...this._def, shape: () => t2 }); + } + omit(e10) { + let t2 = {}; + return e9.objectKeys(this.shape).forEach((r2) => { + e10[r2] || (t2[r2] = this.shape[r2]); + }), new ee({ ...this._def, shape: () => t2 }); + } + deepPartial() { + return function e10(t2) { + if (t2 instanceof ee) { + let r2 = {}; + for (let n2 in t2.shape) { + let i2 = t2.shape[n2]; + r2[n2] = ey.create(e10(i2)); + } + return new ee({ ...t2._def, shape: () => r2 }); + } + return t2 instanceof X ? new X({ ...t2._def, type: e10(t2.element) }) : t2 instanceof ey ? ey.create(e10(t2.unwrap())) : t2 instanceof ev ? ev.create(e10(t2.unwrap())) : t2 instanceof es ? es.create(t2.items.map((t3) => e10(t3))) : t2; + }(this); + } + partial(e10) { + let t2 = {}; + return e9.objectKeys(this.shape).forEach((r2) => { + let n2 = this.shape[r2]; + e10 && !e10[r2] ? t2[r2] = n2 : t2[r2] = n2.optional(); + }), new ee({ ...this._def, shape: () => t2 }); + } + required(e10) { + let t2 = {}; + return e9.objectKeys(this.shape).forEach((r2) => { + if (e10 && !e10[r2]) + t2[r2] = this.shape[r2]; + else { + let e11 = this.shape[r2]; + for (; e11 instanceof ey; ) + e11 = e11._def.innerType; + t2[r2] = e11; + } + }), new ee({ ...this._def, shape: () => t2 }); + } + keyof() { + return eh(e9.objectKeys(this.shape)); + } + } + ee.create = (e10, t2) => new ee({ shape: () => e10, unknownKeys: "strip", catchall: J.create(), typeName: tn.ZodObject, ...k(t2) }), ee.strictCreate = (e10, t2) => new ee({ shape: () => e10, unknownKeys: "strict", catchall: J.create(), typeName: tn.ZodObject, ...k(t2) }), ee.lazycreate = (e10, t2) => new ee({ shape: e10, unknownKeys: "strip", catchall: J.create(), typeName: tn.ZodObject, ...k(t2) }); + class et extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = this._def.options; + if (t2.common.async) + return Promise.all(r2.map(async (e11) => { + let r3 = { ...t2, common: { ...t2.common, issues: [] }, parent: null }; + return { result: await e11._parseAsync({ data: t2.data, path: t2.path, parent: r3 }), ctx: r3 }; + })).then(function(e11) { + for (let t3 of e11) + if ("valid" === t3.result.status) + return t3.result; + for (let r4 of e11) + if ("dirty" === r4.result.status) + return t2.common.issues.push(...r4.ctx.common.issues), r4.result; + let r3 = e11.map((e12) => new o(e12.ctx.common.issues)); + return h(t2, { code: a.invalid_union, unionErrors: r3 }), p; + }); + { + let e11; + let n2 = []; + for (let i3 of r2) { + let r3 = { ...t2, common: { ...t2.common, issues: [] }, parent: null }, s2 = i3._parseSync({ data: t2.data, path: t2.path, parent: r3 }); + if ("valid" === s2.status) + return s2; + "dirty" !== s2.status || e11 || (e11 = { result: s2, ctx: r3 }), r3.common.issues.length && n2.push(r3.common.issues); + } + if (e11) + return t2.common.issues.push(...e11.ctx.common.issues), e11.result; + let i2 = n2.map((e12) => new o(e12)); + return h(t2, { code: a.invalid_union, unionErrors: i2 }), p; + } + } + get options() { + return this._def.options; + } + } + et.create = (e10, t2) => new et({ options: e10, typeName: tn.ZodUnion, ...k(t2) }); + let er = (e10) => { + if (e10 instanceof eu) + return er(e10.schema); + if (e10 instanceof eg) + return er(e10.innerType()); + if (e10 instanceof ed) + return [e10.value]; + if (e10 instanceof ef) + return e10.options; + if (e10 instanceof ep) + return e9.objectValues(e10.enum); + if (e10 instanceof eb) + return er(e10._def.innerType); + if (e10 instanceof V) + return [void 0]; + else if (e10 instanceof G) + return [null]; + else if (e10 instanceof ey) + return [void 0, ...er(e10.unwrap())]; + else if (e10 instanceof ev) + return [null, ...er(e10.unwrap())]; + else if (e10 instanceof e_) + return er(e10.unwrap()); + else if (e10 instanceof ek) + return er(e10.unwrap()); + else if (e10 instanceof ew) + return er(e10._def.innerType); + else + return []; + }; + class en extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + if (t2.parsedType !== i.object) + return h(t2, { code: a.invalid_type, expected: i.object, received: t2.parsedType }), p; + let r2 = this.discriminator, n2 = t2.data[r2], s2 = this.optionsMap.get(n2); + return s2 ? t2.common.async ? s2._parseAsync({ data: t2.data, path: t2.path, parent: t2 }) : s2._parseSync({ data: t2.data, path: t2.path, parent: t2 }) : (h(t2, { code: a.invalid_union_discriminator, options: Array.from(this.optionsMap.keys()), path: [r2] }), p); + } + get discriminator() { + return this._def.discriminator; + } + get options() { + return this._def.options; + } + get optionsMap() { + return this._def.optionsMap; + } + static create(e10, t2, r2) { + let n2 = /* @__PURE__ */ new Map(); + for (let r3 of t2) { + let t3 = er(r3.shape[e10]); + if (!t3.length) + throw Error(`A discriminator value for key \`${e10}\` could not be extracted from all schema options`); + for (let i2 of t3) { + if (n2.has(i2)) + throw Error(`Discriminator property ${String(e10)} has duplicate value ${String(i2)}`); + n2.set(i2, r3); + } + } + return new en({ typeName: tn.ZodDiscriminatedUnion, discriminator: e10, options: t2, optionsMap: n2, ...k(r2) }); + } + } + class ei extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10), n2 = (e11, n3) => { + if (y(e11) || y(n3)) + return p; + let o2 = function e12(t3, r3) { + let n4 = s(t3), a2 = s(r3); + if (t3 === r3) + return { valid: true, data: t3 }; + if (n4 === i.object && a2 === i.object) { + let n5 = e9.objectKeys(r3), i2 = e9.objectKeys(t3).filter((e13) => -1 !== n5.indexOf(e13)), s2 = { ...t3, ...r3 }; + for (let n6 of i2) { + let i3 = e12(t3[n6], r3[n6]); + if (!i3.valid) + return { valid: false }; + s2[n6] = i3.data; + } + return { valid: true, data: s2 }; + } + if (n4 === i.array && a2 === i.array) { + if (t3.length !== r3.length) + return { valid: false }; + let n5 = []; + for (let i2 = 0; i2 < t3.length; i2++) { + let s2 = e12(t3[i2], r3[i2]); + if (!s2.valid) + return { valid: false }; + n5.push(s2.data); + } + return { valid: true, data: n5 }; + } + return n4 === i.date && a2 === i.date && +t3 == +r3 ? { valid: true, data: t3 } : { valid: false }; + }(e11.value, n3.value); + return o2.valid ? ((v(e11) || v(n3)) && t2.dirty(), { status: t2.value, value: o2.data }) : (h(r2, { code: a.invalid_intersection_types }), p); + }; + return r2.common.async ? Promise.all([this._def.left._parseAsync({ data: r2.data, path: r2.path, parent: r2 }), this._def.right._parseAsync({ data: r2.data, path: r2.path, parent: r2 })]).then(([e11, t3]) => n2(e11, t3)) : n2(this._def.left._parseSync({ data: r2.data, path: r2.path, parent: r2 }), this._def.right._parseSync({ data: r2.data, path: r2.path, parent: r2 })); + } + } + ei.create = (e10, t2, r2) => new ei({ left: e10, right: t2, typeName: tn.ZodIntersection, ...k(r2) }); + class es extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.array) + return h(r2, { code: a.invalid_type, expected: i.array, received: r2.parsedType }), p; + if (r2.data.length < this._def.items.length) + return h(r2, { code: a.too_small, minimum: this._def.items.length, inclusive: true, exact: false, type: "array" }), p; + !this._def.rest && r2.data.length > this._def.items.length && (h(r2, { code: a.too_big, maximum: this._def.items.length, inclusive: true, exact: false, type: "array" }), t2.dirty()); + let n2 = [...r2.data].map((e11, t3) => { + let n3 = this._def.items[t3] || this._def.rest; + return n3 ? n3._parse(new _(r2, e11, r2.path, t3)) : null; + }).filter((e11) => !!e11); + return r2.common.async ? Promise.all(n2).then((e11) => f.mergeArray(t2, e11)) : f.mergeArray(t2, n2); + } + get items() { + return this._def.items; + } + rest(e10) { + return new es({ ...this._def, rest: e10 }); + } + } + es.create = (e10, t2) => { + if (!Array.isArray(e10)) + throw Error("You must pass an array of schemas to z.tuple([ ... ])"); + return new es({ items: e10, typeName: tn.ZodTuple, rest: null, ...k(t2) }); + }; + class ea extends C { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.object) + return h(r2, { code: a.invalid_type, expected: i.object, received: r2.parsedType }), p; + let n2 = [], s2 = this._def.keyType, o2 = this._def.valueType; + for (let e11 in r2.data) + n2.push({ key: s2._parse(new _(r2, e11, r2.path, e11)), value: o2._parse(new _(r2, r2.data[e11], r2.path, e11)), alwaysSet: e11 in r2.data }); + return r2.common.async ? f.mergeObjectAsync(t2, n2) : f.mergeObjectSync(t2, n2); + } + get element() { + return this._def.valueType; + } + static create(e10, t2, r2) { + return new ea(t2 instanceof C ? { keyType: e10, valueType: t2, typeName: tn.ZodRecord, ...k(r2) } : { keyType: U.create(), valueType: e10, typeName: tn.ZodRecord, ...k(t2) }); + } + } + class eo extends C { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.map) + return h(r2, { code: a.invalid_type, expected: i.map, received: r2.parsedType }), p; + let n2 = this._def.keyType, s2 = this._def.valueType, o2 = [...r2.data.entries()].map(([e11, t3], i2) => ({ key: n2._parse(new _(r2, e11, r2.path, [i2, "key"])), value: s2._parse(new _(r2, t3, r2.path, [i2, "value"])) })); + if (r2.common.async) { + let e11 = /* @__PURE__ */ new Map(); + return Promise.resolve().then(async () => { + for (let r3 of o2) { + let n3 = await r3.key, i2 = await r3.value; + if ("aborted" === n3.status || "aborted" === i2.status) + return p; + ("dirty" === n3.status || "dirty" === i2.status) && t2.dirty(), e11.set(n3.value, i2.value); + } + return { status: t2.value, value: e11 }; + }); + } + { + let e11 = /* @__PURE__ */ new Map(); + for (let r3 of o2) { + let n3 = r3.key, i2 = r3.value; + if ("aborted" === n3.status || "aborted" === i2.status) + return p; + ("dirty" === n3.status || "dirty" === i2.status) && t2.dirty(), e11.set(n3.value, i2.value); + } + return { status: t2.value, value: e11 }; + } + } + } + eo.create = (e10, t2, r2) => new eo({ valueType: t2, keyType: e10, typeName: tn.ZodMap, ...k(r2) }); + class el extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.set) + return h(r2, { code: a.invalid_type, expected: i.set, received: r2.parsedType }), p; + let n2 = this._def; + null !== n2.minSize && r2.data.size < n2.minSize.value && (h(r2, { code: a.too_small, minimum: n2.minSize.value, type: "set", inclusive: true, exact: false, message: n2.minSize.message }), t2.dirty()), null !== n2.maxSize && r2.data.size > n2.maxSize.value && (h(r2, { code: a.too_big, maximum: n2.maxSize.value, type: "set", inclusive: true, exact: false, message: n2.maxSize.message }), t2.dirty()); + let s2 = this._def.valueType; + function o2(e11) { + let r3 = /* @__PURE__ */ new Set(); + for (let n3 of e11) { + if ("aborted" === n3.status) + return p; + "dirty" === n3.status && t2.dirty(), r3.add(n3.value); + } + return { status: t2.value, value: r3 }; + } + let l2 = [...r2.data.values()].map((e11, t3) => s2._parse(new _(r2, e11, r2.path, t3))); + return r2.common.async ? Promise.all(l2).then((e11) => o2(e11)) : o2(l2); + } + min(e10, t2) { + return new el({ ...this._def, minSize: { value: e10, message: te.toString(t2) } }); + } + max(e10, t2) { + return new el({ ...this._def, maxSize: { value: e10, message: te.toString(t2) } }); + } + size(e10, t2) { + return this.min(e10, t2).max(e10, t2); + } + nonempty(e10) { + return this.min(1, e10); + } + } + el.create = (e10, t2) => new el({ valueType: e10, minSize: null, maxSize: null, typeName: tn.ZodSet, ...k(t2) }); + class ec extends C { + constructor() { + super(...arguments), this.validate = this.implement; + } + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + if (t2.parsedType !== i.function) + return h(t2, { code: a.invalid_type, expected: i.function, received: t2.parsedType }), p; + function r2(e11, r3) { + return d({ data: e11, path: t2.path, errorMaps: [t2.common.contextualErrorMap, t2.schemaErrorMap, u(), l].filter((e12) => !!e12), issueData: { code: a.invalid_arguments, argumentsError: r3 } }); + } + function n2(e11, r3) { + return d({ data: e11, path: t2.path, errorMaps: [t2.common.contextualErrorMap, t2.schemaErrorMap, u(), l].filter((e12) => !!e12), issueData: { code: a.invalid_return_type, returnTypeError: r3 } }); + } + let s2 = { errorMap: t2.common.contextualErrorMap }, c2 = t2.data; + if (this._def.returns instanceof em) { + let e11 = this; + return g(async function(...t3) { + let i2 = new o([]), a2 = await e11._def.args.parseAsync(t3, s2).catch((e12) => { + throw i2.addIssue(r2(t3, e12)), i2; + }), l2 = await Reflect.apply(c2, this, a2); + return await e11._def.returns._def.type.parseAsync(l2, s2).catch((e12) => { + throw i2.addIssue(n2(l2, e12)), i2; + }); + }); + } + { + let e11 = this; + return g(function(...t3) { + let i2 = e11._def.args.safeParse(t3, s2); + if (!i2.success) + throw new o([r2(t3, i2.error)]); + let a2 = Reflect.apply(c2, this, i2.data), l2 = e11._def.returns.safeParse(a2, s2); + if (!l2.success) + throw new o([n2(a2, l2.error)]); + return l2.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...e10) { + return new ec({ ...this._def, args: es.create(e10).rest(K.create()) }); + } + returns(e10) { + return new ec({ ...this._def, returns: e10 }); + } + implement(e10) { + return this.parse(e10); + } + strictImplement(e10) { + return this.parse(e10); + } + static create(e10, t2, r2) { + return new ec({ args: e10 || es.create([]).rest(K.create()), returns: t2 || K.create(), typeName: tn.ZodFunction, ...k(r2) }); + } + } + class eu extends C { + get schema() { + return this._def.getter(); + } + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + return this._def.getter()._parse({ data: t2.data, path: t2.path, parent: t2 }); + } + } + eu.create = (e10, t2) => new eu({ getter: e10, typeName: tn.ZodLazy, ...k(t2) }); + class ed extends C { + _parse(e10) { + if (e10.data !== this._def.value) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { received: t2.data, code: a.invalid_literal, expected: this._def.value }), p; + } + return { status: "valid", value: e10.data }; + } + get value() { + return this._def.value; + } + } + function eh(e10, t2) { + return new ef({ values: e10, typeName: tn.ZodEnum, ...k(t2) }); + } + ed.create = (e10, t2) => new ed({ value: e10, typeName: tn.ZodLiteral, ...k(t2) }); + class ef extends C { + constructor() { + super(...arguments), tt.set(this, void 0); + } + _parse(e10) { + if ("string" != typeof e10.data) { + let t2 = this._getOrReturnCtx(e10), r2 = this._def.values; + return h(t2, { expected: e9.joinValues(r2), received: t2.parsedType, code: a.invalid_type }), p; + } + if (x(this, tt, "f") || S(this, tt, new Set(this._def.values), "f"), !x(this, tt, "f").has(e10.data)) { + let t2 = this._getOrReturnCtx(e10), r2 = this._def.values; + return h(t2, { received: t2.data, code: a.invalid_enum_value, options: r2 }), p; + } + return g(e10.data); + } + get options() { + return this._def.values; + } + get enum() { + let e10 = {}; + for (let t2 of this._def.values) + e10[t2] = t2; + return e10; + } + get Values() { + let e10 = {}; + for (let t2 of this._def.values) + e10[t2] = t2; + return e10; + } + get Enum() { + let e10 = {}; + for (let t2 of this._def.values) + e10[t2] = t2; + return e10; + } + extract(e10, t2 = this._def) { + return ef.create(e10, { ...this._def, ...t2 }); + } + exclude(e10, t2 = this._def) { + return ef.create(this.options.filter((t3) => !e10.includes(t3)), { ...this._def, ...t2 }); + } + } + tt = /* @__PURE__ */ new WeakMap(), ef.create = eh; + class ep extends C { + constructor() { + super(...arguments), tr.set(this, void 0); + } + _parse(e10) { + let t2 = e9.getValidEnumValues(this._def.values), r2 = this._getOrReturnCtx(e10); + if (r2.parsedType !== i.string && r2.parsedType !== i.number) { + let e11 = e9.objectValues(t2); + return h(r2, { expected: e9.joinValues(e11), received: r2.parsedType, code: a.invalid_type }), p; + } + if (x(this, tr, "f") || S(this, tr, new Set(e9.getValidEnumValues(this._def.values)), "f"), !x(this, tr, "f").has(e10.data)) { + let e11 = e9.objectValues(t2); + return h(r2, { received: r2.data, code: a.invalid_enum_value, options: e11 }), p; + } + return g(e10.data); + } + get enum() { + return this._def.values; + } + } + tr = /* @__PURE__ */ new WeakMap(), ep.create = (e10, t2) => new ep({ values: e10, typeName: tn.ZodNativeEnum, ...k(t2) }); + class em extends C { + unwrap() { + return this._def.type; + } + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + return t2.parsedType !== i.promise && false === t2.common.async ? (h(t2, { code: a.invalid_type, expected: i.promise, received: t2.parsedType }), p) : g((t2.parsedType === i.promise ? t2.data : Promise.resolve(t2.data)).then((e11) => this._def.type.parseAsync(e11, { path: t2.path, errorMap: t2.common.contextualErrorMap }))); + } + } + em.create = (e10, t2) => new em({ type: e10, typeName: tn.ZodPromise, ...k(t2) }); + class eg extends C { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === tn.ZodEffects ? this._def.schema.sourceType() : this._def.schema; + } + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10), n2 = this._def.effect || null, i2 = { addIssue: (e11) => { + h(r2, e11), e11.fatal ? t2.abort() : t2.dirty(); + }, get path() { + return r2.path; + } }; + if (i2.addIssue = i2.addIssue.bind(i2), "preprocess" === n2.type) { + let e11 = n2.transform(r2.data, i2); + if (r2.common.async) + return Promise.resolve(e11).then(async (e12) => { + if ("aborted" === t2.value) + return p; + let n3 = await this._def.schema._parseAsync({ data: e12, path: r2.path, parent: r2 }); + return "aborted" === n3.status ? p : "dirty" === n3.status || "dirty" === t2.value ? m(n3.value) : n3; + }); + { + if ("aborted" === t2.value) + return p; + let n3 = this._def.schema._parseSync({ data: e11, path: r2.path, parent: r2 }); + return "aborted" === n3.status ? p : "dirty" === n3.status || "dirty" === t2.value ? m(n3.value) : n3; + } + } + if ("refinement" === n2.type) { + let e11 = (e12) => { + let t3 = n2.refinement(e12, i2); + if (r2.common.async) + return Promise.resolve(t3); + if (t3 instanceof Promise) + throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); + return e12; + }; + if (false !== r2.common.async) + return this._def.schema._parseAsync({ data: r2.data, path: r2.path, parent: r2 }).then((r3) => "aborted" === r3.status ? p : ("dirty" === r3.status && t2.dirty(), e11(r3.value).then(() => ({ status: t2.value, value: r3.value })))); + { + let n3 = this._def.schema._parseSync({ data: r2.data, path: r2.path, parent: r2 }); + return "aborted" === n3.status ? p : ("dirty" === n3.status && t2.dirty(), e11(n3.value), { status: t2.value, value: n3.value }); + } + } + if ("transform" === n2.type) { + if (false !== r2.common.async) + return this._def.schema._parseAsync({ data: r2.data, path: r2.path, parent: r2 }).then((e11) => b(e11) ? Promise.resolve(n2.transform(e11.value, i2)).then((e12) => ({ status: t2.value, value: e12 })) : e11); + { + let e11 = this._def.schema._parseSync({ data: r2.data, path: r2.path, parent: r2 }); + if (!b(e11)) + return e11; + let s2 = n2.transform(e11.value, i2); + if (s2 instanceof Promise) + throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead."); + return { status: t2.value, value: s2 }; + } + } + e9.assertNever(n2); + } + } + eg.create = (e10, t2, r2) => new eg({ schema: e10, typeName: tn.ZodEffects, effect: t2, ...k(r2) }), eg.createWithPreprocess = (e10, t2, r2) => new eg({ schema: t2, effect: { type: "preprocess", transform: e10 }, typeName: tn.ZodEffects, ...k(r2) }); + class ey extends C { + _parse(e10) { + return this._getType(e10) === i.undefined ? g(void 0) : this._def.innerType._parse(e10); + } + unwrap() { + return this._def.innerType; + } + } + ey.create = (e10, t2) => new ey({ innerType: e10, typeName: tn.ZodOptional, ...k(t2) }); + class ev extends C { + _parse(e10) { + return this._getType(e10) === i.null ? g(null) : this._def.innerType._parse(e10); + } + unwrap() { + return this._def.innerType; + } + } + ev.create = (e10, t2) => new ev({ innerType: e10, typeName: tn.ZodNullable, ...k(t2) }); + class eb extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = t2.data; + return t2.parsedType === i.undefined && (r2 = this._def.defaultValue()), this._def.innerType._parse({ data: r2, path: t2.path, parent: t2 }); + } + removeDefault() { + return this._def.innerType; + } + } + eb.create = (e10, t2) => new eb({ innerType: e10, typeName: tn.ZodDefault, defaultValue: "function" == typeof t2.default ? t2.default : () => t2.default, ...k(t2) }); + class ew extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = { ...t2, common: { ...t2.common, issues: [] } }, n2 = this._def.innerType._parse({ data: r2.data, path: r2.path, parent: { ...r2 } }); + return w(n2) ? n2.then((e11) => ({ status: "valid", value: "valid" === e11.status ? e11.value : this._def.catchValue({ get error() { + return new o(r2.common.issues); + }, input: r2.data }) })) : { status: "valid", value: "valid" === n2.status ? n2.value : this._def.catchValue({ get error() { + return new o(r2.common.issues); + }, input: r2.data }) }; + } + removeCatch() { + return this._def.innerType; + } + } + ew.create = (e10, t2) => new ew({ innerType: e10, typeName: tn.ZodCatch, catchValue: "function" == typeof t2.catch ? t2.catch : () => t2.catch, ...k(t2) }); + class ex extends C { + _parse(e10) { + if (this._getType(e10) !== i.nan) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.nan, received: t2.parsedType }), p; + } + return { status: "valid", value: e10.data }; + } + } + ex.create = (e10) => new ex({ typeName: tn.ZodNaN, ...k(e10) }); + let eS = Symbol("zod_brand"); + class e_ extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = t2.data; + return this._def.type._parse({ data: r2, path: t2.path, parent: t2 }); + } + unwrap() { + return this._def.type; + } + } + class eE extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.common.async) + return (async () => { + let e11 = await this._def.in._parseAsync({ data: r2.data, path: r2.path, parent: r2 }); + return "aborted" === e11.status ? p : "dirty" === e11.status ? (t2.dirty(), m(e11.value)) : this._def.out._parseAsync({ data: e11.value, path: r2.path, parent: r2 }); + })(); + { + let e11 = this._def.in._parseSync({ data: r2.data, path: r2.path, parent: r2 }); + return "aborted" === e11.status ? p : "dirty" === e11.status ? (t2.dirty(), { status: "dirty", value: e11.value }) : this._def.out._parseSync({ data: e11.value, path: r2.path, parent: r2 }); + } + } + static create(e10, t2) { + return new eE({ in: e10, out: t2, typeName: tn.ZodPipeline }); + } + } + class ek extends C { + _parse(e10) { + let t2 = this._def.innerType._parse(e10), r2 = (e11) => (b(e11) && (e11.value = Object.freeze(e11.value)), e11); + return w(t2) ? t2.then((e11) => r2(e11)) : r2(t2); + } + unwrap() { + return this._def.innerType; + } + } + function eC(e10, t2 = {}, r2) { + return e10 ? Z.create().superRefine((n2, i2) => { + var s2, a2; + if (!e10(n2)) { + let e11 = "function" == typeof t2 ? t2(n2) : "string" == typeof t2 ? { message: t2 } : t2, o2 = null === (a2 = null !== (s2 = e11.fatal) && void 0 !== s2 ? s2 : r2) || void 0 === a2 || a2, l2 = "string" == typeof e11 ? { message: e11 } : e11; + i2.addIssue({ code: "custom", ...l2, fatal: o2 }); + } + }) : Z.create(); + } + ek.create = (e10, t2) => new ek({ innerType: e10, typeName: tn.ZodReadonly, ...k(t2) }); + let eR = { object: ee.lazycreate }; + !function(e10) { + e10.ZodString = "ZodString", e10.ZodNumber = "ZodNumber", e10.ZodNaN = "ZodNaN", e10.ZodBigInt = "ZodBigInt", e10.ZodBoolean = "ZodBoolean", e10.ZodDate = "ZodDate", e10.ZodSymbol = "ZodSymbol", e10.ZodUndefined = "ZodUndefined", e10.ZodNull = "ZodNull", e10.ZodAny = "ZodAny", e10.ZodUnknown = "ZodUnknown", e10.ZodNever = "ZodNever", e10.ZodVoid = "ZodVoid", e10.ZodArray = "ZodArray", e10.ZodObject = "ZodObject", e10.ZodUnion = "ZodUnion", e10.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e10.ZodIntersection = "ZodIntersection", e10.ZodTuple = "ZodTuple", e10.ZodRecord = "ZodRecord", e10.ZodMap = "ZodMap", e10.ZodSet = "ZodSet", e10.ZodFunction = "ZodFunction", e10.ZodLazy = "ZodLazy", e10.ZodLiteral = "ZodLiteral", e10.ZodEnum = "ZodEnum", e10.ZodEffects = "ZodEffects", e10.ZodNativeEnum = "ZodNativeEnum", e10.ZodOptional = "ZodOptional", e10.ZodNullable = "ZodNullable", e10.ZodDefault = "ZodDefault", e10.ZodCatch = "ZodCatch", e10.ZodPromise = "ZodPromise", e10.ZodBranded = "ZodBranded", e10.ZodPipeline = "ZodPipeline", e10.ZodReadonly = "ZodReadonly"; + }(tn || (tn = {})); + let eP = U.create, eT = q.create, eA = ex.create, eO = z.create, eI = H.create, eN = W.create, eM = Q.create, e$ = V.create, eL = G.create, ej = Z.create, eD = K.create, eF = J.create, eB = Y.create, eU = X.create, eq = ee.create, ez = ee.strictCreate, eH = et.create, eW = en.create, eQ = ei.create, eV = es.create, eG = ea.create, eZ = eo.create, eK = el.create, eJ = ec.create, eY = eu.create, eX = ed.create, e0 = ef.create, e1 = ep.create, e2 = em.create, e6 = eg.create, e5 = ey.create, e4 = ev.create, e3 = eg.createWithPreprocess, e8 = eE.create; + var e9, e7, te, tt, tr, tn, ti = Object.freeze({ __proto__: null, defaultErrorMap: l, setErrorMap: function(e10) { + c = e10; + }, getErrorMap: u, makeIssue: d, EMPTY_PATH: [], addIssueToContext: h, ParseStatus: f, INVALID: p, DIRTY: m, OK: g, isAborted: y, isDirty: v, isValid: b, isAsync: w, get util() { + return e9; + }, get objectUtil() { + return e7; + }, ZodParsedType: i, getParsedType: s, ZodType: C, datetimeRegex: B, ZodString: U, ZodNumber: q, ZodBigInt: z, ZodBoolean: H, ZodDate: W, ZodSymbol: Q, ZodUndefined: V, ZodNull: G, ZodAny: Z, ZodUnknown: K, ZodNever: J, ZodVoid: Y, ZodArray: X, ZodObject: ee, ZodUnion: et, ZodDiscriminatedUnion: en, ZodIntersection: ei, ZodTuple: es, ZodRecord: ea, ZodMap: eo, ZodSet: el, ZodFunction: ec, ZodLazy: eu, ZodLiteral: ed, ZodEnum: ef, ZodNativeEnum: ep, ZodPromise: em, ZodEffects: eg, ZodTransformer: eg, ZodOptional: ey, ZodNullable: ev, ZodDefault: eb, ZodCatch: ew, ZodNaN: ex, BRAND: eS, ZodBranded: e_, ZodPipeline: eE, ZodReadonly: ek, custom: eC, Schema: C, ZodSchema: C, late: eR, get ZodFirstPartyTypeKind() { + return tn; + }, coerce: { string: (e10) => U.create({ ...e10, coerce: true }), number: (e10) => q.create({ ...e10, coerce: true }), boolean: (e10) => H.create({ ...e10, coerce: true }), bigint: (e10) => z.create({ ...e10, coerce: true }), date: (e10) => W.create({ ...e10, coerce: true }) }, any: ej, array: eU, bigint: eO, boolean: eI, date: eN, discriminatedUnion: eW, effect: e6, enum: e0, function: eJ, instanceof: (e10, t2 = { message: `Input not instance of ${e10.name}` }) => eC((t3) => t3 instanceof e10, t2), intersection: eQ, lazy: eY, literal: eX, map: eZ, nan: eA, nativeEnum: e1, never: eF, null: eL, nullable: e4, number: eT, object: eq, oboolean: () => eI().optional(), onumber: () => eT().optional(), optional: e5, ostring: () => eP().optional(), pipeline: e8, preprocess: e3, promise: e2, record: eG, set: eK, strictObject: ez, string: eP, symbol: eM, transformer: e6, tuple: eV, undefined: e$, union: eH, unknown: eD, void: eB, NEVER: p, ZodIssueCode: a, quotelessJson: (e10) => JSON.stringify(e10, null, 2).replace(/"([^"]+)":/g, "$1:"), ZodError: o }); + }; + __namedExportsObject5["__chunk_55033"] = (e, t, r) => { + "use strict"; + let n; + r.d(t, { z: () => ti }), function(e10) { + e10.assertEqual = (e11) => e11, e10.assertIs = function(e11) { + }, e10.assertNever = function(e11) { + throw Error(); + }, e10.arrayToEnum = (e11) => { + let t2 = {}; + for (let r2 of e11) + t2[r2] = r2; + return t2; + }, e10.getValidEnumValues = (t2) => { + let r2 = e10.objectKeys(t2).filter((e11) => "number" != typeof t2[t2[e11]]), n2 = {}; + for (let e11 of r2) + n2[e11] = t2[e11]; + return e10.objectValues(n2); + }, e10.objectValues = (t2) => e10.objectKeys(t2).map(function(e11) { + return t2[e11]; + }), e10.objectKeys = "function" == typeof Object.keys ? (e11) => Object.keys(e11) : (e11) => { + let t2 = []; + for (let r2 in e11) + Object.prototype.hasOwnProperty.call(e11, r2) && t2.push(r2); + return t2; + }, e10.find = (e11, t2) => { + for (let r2 of e11) + if (t2(r2)) + return r2; + }, e10.isInteger = "function" == typeof Number.isInteger ? (e11) => Number.isInteger(e11) : (e11) => "number" == typeof e11 && isFinite(e11) && Math.floor(e11) === e11, e10.joinValues = function(e11, t2 = " | ") { + return e11.map((e12) => "string" == typeof e12 ? `'${e12}'` : e12).join(t2); + }, e10.jsonStringifyReplacer = (e11, t2) => "bigint" == typeof t2 ? t2.toString() : t2; + }(e9 || (e9 = {})), (e7 || (e7 = {})).mergeShapes = (e10, t2) => ({ ...e10, ...t2 }); + let i = e9.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]), s = (e10) => { + switch (typeof e10) { + case "undefined": + return i.undefined; + case "string": + return i.string; + case "number": + return isNaN(e10) ? i.nan : i.number; + case "boolean": + return i.boolean; + case "function": + return i.function; + case "bigint": + return i.bigint; + case "symbol": + return i.symbol; + case "object": + if (Array.isArray(e10)) + return i.array; + if (null === e10) + return i.null; + if (e10.then && "function" == typeof e10.then && e10.catch && "function" == typeof e10.catch) + return i.promise; + if ("undefined" != typeof Map && e10 instanceof Map) + return i.map; + if ("undefined" != typeof Set && e10 instanceof Set) + return i.set; + if ("undefined" != typeof Date && e10 instanceof Date) + return i.date; + return i.object; + default: + return i.unknown; + } + }, a = e9.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of", "not_finite"]); + class o extends Error { + constructor(e10) { + super(), this.issues = [], this.addIssue = (e11) => { + this.issues = [...this.issues, e11]; + }, this.addIssues = (e11 = []) => { + this.issues = [...this.issues, ...e11]; + }; + let t2 = new.target.prototype; + Object.setPrototypeOf ? Object.setPrototypeOf(this, t2) : this.__proto__ = t2, this.name = "ZodError", this.issues = e10; + } + get errors() { + return this.issues; + } + format(e10) { + let t2 = e10 || function(e11) { + return e11.message; + }, r2 = { _errors: [] }, n2 = (e11) => { + for (let i2 of e11.issues) + if ("invalid_union" === i2.code) + i2.unionErrors.map(n2); + else if ("invalid_return_type" === i2.code) + n2(i2.returnTypeError); + else if ("invalid_arguments" === i2.code) + n2(i2.argumentsError); + else if (0 === i2.path.length) + r2._errors.push(t2(i2)); + else { + let e12 = r2, n3 = 0; + for (; n3 < i2.path.length; ) { + let r3 = i2.path[n3]; + n3 === i2.path.length - 1 ? (e12[r3] = e12[r3] || { _errors: [] }, e12[r3]._errors.push(t2(i2))) : e12[r3] = e12[r3] || { _errors: [] }, e12 = e12[r3], n3++; + } + } + }; + return n2(this), r2; + } + static assert(e10) { + if (!(e10 instanceof o)) + throw Error(`Not a ZodError: ${e10}`); + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, e9.jsonStringifyReplacer, 2); + } + get isEmpty() { + return 0 === this.issues.length; + } + flatten(e10 = (e11) => e11.message) { + let t2 = {}, r2 = []; + for (let n2 of this.issues) + n2.path.length > 0 ? (t2[n2.path[0]] = t2[n2.path[0]] || [], t2[n2.path[0]].push(e10(n2))) : r2.push(e10(n2)); + return { formErrors: r2, fieldErrors: t2 }; + } + get formErrors() { + return this.flatten(); + } + } + o.create = (e10) => new o(e10); + let l = (e10, t2) => { + let r2; + switch (e10.code) { + case a.invalid_type: + r2 = e10.received === i.undefined ? "Required" : `Expected ${e10.expected}, received ${e10.received}`; + break; + case a.invalid_literal: + r2 = `Invalid literal value, expected ${JSON.stringify(e10.expected, e9.jsonStringifyReplacer)}`; + break; + case a.unrecognized_keys: + r2 = `Unrecognized key(s) in object: ${e9.joinValues(e10.keys, ", ")}`; + break; + case a.invalid_union: + r2 = "Invalid input"; + break; + case a.invalid_union_discriminator: + r2 = `Invalid discriminator value. Expected ${e9.joinValues(e10.options)}`; + break; + case a.invalid_enum_value: + r2 = `Invalid enum value. Expected ${e9.joinValues(e10.options)}, received '${e10.received}'`; + break; + case a.invalid_arguments: + r2 = "Invalid function arguments"; + break; + case a.invalid_return_type: + r2 = "Invalid function return type"; + break; + case a.invalid_date: + r2 = "Invalid date"; + break; + case a.invalid_string: + "object" == typeof e10.validation ? "includes" in e10.validation ? (r2 = `Invalid input: must include "${e10.validation.includes}"`, "number" == typeof e10.validation.position && (r2 = `${r2} at one or more positions greater than or equal to ${e10.validation.position}`)) : "startsWith" in e10.validation ? r2 = `Invalid input: must start with "${e10.validation.startsWith}"` : "endsWith" in e10.validation ? r2 = `Invalid input: must end with "${e10.validation.endsWith}"` : e9.assertNever(e10.validation) : r2 = "regex" !== e10.validation ? `Invalid ${e10.validation}` : "Invalid"; + break; + case a.too_small: + r2 = "array" === e10.type ? `Array must contain ${e10.exact ? "exactly" : e10.inclusive ? "at least" : "more than"} ${e10.minimum} element(s)` : "string" === e10.type ? `String must contain ${e10.exact ? "exactly" : e10.inclusive ? "at least" : "over"} ${e10.minimum} character(s)` : "number" === e10.type ? `Number must be ${e10.exact ? "exactly equal to " : e10.inclusive ? "greater than or equal to " : "greater than "}${e10.minimum}` : "date" === e10.type ? `Date must be ${e10.exact ? "exactly equal to " : e10.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(e10.minimum))}` : "Invalid input"; + break; + case a.too_big: + r2 = "array" === e10.type ? `Array must contain ${e10.exact ? "exactly" : e10.inclusive ? "at most" : "less than"} ${e10.maximum} element(s)` : "string" === e10.type ? `String must contain ${e10.exact ? "exactly" : e10.inclusive ? "at most" : "under"} ${e10.maximum} character(s)` : "number" === e10.type ? `Number must be ${e10.exact ? "exactly" : e10.inclusive ? "less than or equal to" : "less than"} ${e10.maximum}` : "bigint" === e10.type ? `BigInt must be ${e10.exact ? "exactly" : e10.inclusive ? "less than or equal to" : "less than"} ${e10.maximum}` : "date" === e10.type ? `Date must be ${e10.exact ? "exactly" : e10.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(e10.maximum))}` : "Invalid input"; + break; + case a.custom: + r2 = "Invalid input"; + break; + case a.invalid_intersection_types: + r2 = "Intersection results could not be merged"; + break; + case a.not_multiple_of: + r2 = `Number must be a multiple of ${e10.multipleOf}`; + break; + case a.not_finite: + r2 = "Number must be finite"; + break; + default: + r2 = t2.defaultError, e9.assertNever(e10); + } + return { message: r2 }; + }, c = l; + function u() { + return c; + } + let d = (e10) => { + let { data: t2, path: r2, errorMaps: n2, issueData: i2 } = e10, s2 = [...r2, ...i2.path || []], a2 = { ...i2, path: s2 }; + if (void 0 !== i2.message) + return { ...i2, path: s2, message: i2.message }; + let o2 = ""; + for (let e11 of n2.filter((e12) => !!e12).slice().reverse()) + o2 = e11(a2, { data: t2, defaultError: o2 }).message; + return { ...i2, path: s2, message: o2 }; + }; + function h(e10, t2) { + let r2 = u(), n2 = d({ issueData: t2, data: e10.data, path: e10.path, errorMaps: [e10.common.contextualErrorMap, e10.schemaErrorMap, r2, r2 === l ? void 0 : l].filter((e11) => !!e11) }); + e10.common.issues.push(n2); + } + class f { + constructor() { + this.value = "valid"; + } + dirty() { + "valid" === this.value && (this.value = "dirty"); + } + abort() { + "aborted" !== this.value && (this.value = "aborted"); + } + static mergeArray(e10, t2) { + let r2 = []; + for (let n2 of t2) { + if ("aborted" === n2.status) + return p; + "dirty" === n2.status && e10.dirty(), r2.push(n2.value); + } + return { status: e10.value, value: r2 }; + } + static async mergeObjectAsync(e10, t2) { + let r2 = []; + for (let e11 of t2) { + let t3 = await e11.key, n2 = await e11.value; + r2.push({ key: t3, value: n2 }); + } + return f.mergeObjectSync(e10, r2); + } + static mergeObjectSync(e10, t2) { + let r2 = {}; + for (let n2 of t2) { + let { key: t3, value: i2 } = n2; + if ("aborted" === t3.status || "aborted" === i2.status) + return p; + "dirty" === t3.status && e10.dirty(), "dirty" === i2.status && e10.dirty(), "__proto__" !== t3.value && (void 0 !== i2.value || n2.alwaysSet) && (r2[t3.value] = i2.value); + } + return { status: e10.value, value: r2 }; + } + } + let p = Object.freeze({ status: "aborted" }), m = (e10) => ({ status: "dirty", value: e10 }), g = (e10) => ({ status: "valid", value: e10 }), y = (e10) => "aborted" === e10.status, v = (e10) => "dirty" === e10.status, b = (e10) => "valid" === e10.status, w = (e10) => "undefined" != typeof Promise && e10 instanceof Promise; + function x(e10, t2, r2, n2) { + if ("a" === r2 && !n2) + throw TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t2 ? e10 !== t2 || !n2 : !t2.has(e10)) + throw TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === r2 ? n2 : "a" === r2 ? n2.call(e10) : n2 ? n2.value : t2.get(e10); + } + function S(e10, t2, r2, n2, i2) { + if ("m" === n2) + throw TypeError("Private method is not writable"); + if ("a" === n2 && !i2) + throw TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t2 ? e10 !== t2 || !i2 : !t2.has(e10)) + throw TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n2 ? i2.call(e10, r2) : i2 ? i2.value = r2 : t2.set(e10, r2), r2; + } + "function" == typeof SuppressedError && SuppressedError, function(e10) { + e10.errToObj = (e11) => "string" == typeof e11 ? { message: e11 } : e11 || {}, e10.toString = (e11) => "string" == typeof e11 ? e11 : null == e11 ? void 0 : e11.message; + }(te || (te = {})); + class _ { + constructor(e10, t2, r2, n2) { + this._cachedPath = [], this.parent = e10, this.data = t2, this._path = r2, this._key = n2; + } + get path() { + return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath; + } + } + let E = (e10, t2) => { + if (b(t2)) + return { success: true, data: t2.value }; + if (!e10.common.issues.length) + throw Error("Validation failed but no issues detected."); + return { success: false, get error() { + if (this._error) + return this._error; + let t3 = new o(e10.common.issues); + return this._error = t3, this._error; + } }; + }; + function k(e10) { + if (!e10) + return {}; + let { errorMap: t2, invalid_type_error: r2, required_error: n2, description: i2 } = e10; + if (t2 && (r2 || n2)) + throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + return t2 ? { errorMap: t2, description: i2 } : { errorMap: (t3, i3) => { + var s2, a2; + let { message: o2 } = e10; + return "invalid_enum_value" === t3.code ? { message: null != o2 ? o2 : i3.defaultError } : void 0 === i3.data ? { message: null !== (s2 = null != o2 ? o2 : n2) && void 0 !== s2 ? s2 : i3.defaultError } : "invalid_type" !== t3.code ? { message: i3.defaultError } : { message: null !== (a2 = null != o2 ? o2 : r2) && void 0 !== a2 ? a2 : i3.defaultError }; + }, description: i2 }; + } + class C { + constructor(e10) { + this.spa = this.safeParseAsync, this._def = e10, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this); + } + get description() { + return this._def.description; + } + _getType(e10) { + return s(e10.data); + } + _getOrReturnCtx(e10, t2) { + return t2 || { common: e10.parent.common, data: e10.data, parsedType: s(e10.data), schemaErrorMap: this._def.errorMap, path: e10.path, parent: e10.parent }; + } + _processInputParams(e10) { + return { status: new f(), ctx: { common: e10.parent.common, data: e10.data, parsedType: s(e10.data), schemaErrorMap: this._def.errorMap, path: e10.path, parent: e10.parent } }; + } + _parseSync(e10) { + let t2 = this._parse(e10); + if (w(t2)) + throw Error("Synchronous parse encountered promise."); + return t2; + } + _parseAsync(e10) { + return Promise.resolve(this._parse(e10)); + } + parse(e10, t2) { + let r2 = this.safeParse(e10, t2); + if (r2.success) + return r2.data; + throw r2.error; + } + safeParse(e10, t2) { + var r2; + let n2 = { common: { issues: [], async: null !== (r2 = null == t2 ? void 0 : t2.async) && void 0 !== r2 && r2, contextualErrorMap: null == t2 ? void 0 : t2.errorMap }, path: (null == t2 ? void 0 : t2.path) || [], schemaErrorMap: this._def.errorMap, parent: null, data: e10, parsedType: s(e10) }, i2 = this._parseSync({ data: e10, path: n2.path, parent: n2 }); + return E(n2, i2); + } + async parseAsync(e10, t2) { + let r2 = await this.safeParseAsync(e10, t2); + if (r2.success) + return r2.data; + throw r2.error; + } + async safeParseAsync(e10, t2) { + let r2 = { common: { issues: [], contextualErrorMap: null == t2 ? void 0 : t2.errorMap, async: true }, path: (null == t2 ? void 0 : t2.path) || [], schemaErrorMap: this._def.errorMap, parent: null, data: e10, parsedType: s(e10) }, n2 = this._parse({ data: e10, path: r2.path, parent: r2 }); + return E(r2, await (w(n2) ? n2 : Promise.resolve(n2))); + } + refine(e10, t2) { + let r2 = (e11) => "string" == typeof t2 || void 0 === t2 ? { message: t2 } : "function" == typeof t2 ? t2(e11) : t2; + return this._refinement((t3, n2) => { + let i2 = e10(t3), s2 = () => n2.addIssue({ code: a.custom, ...r2(t3) }); + return "undefined" != typeof Promise && i2 instanceof Promise ? i2.then((e11) => !!e11 || (s2(), false)) : !!i2 || (s2(), false); + }); + } + refinement(e10, t2) { + return this._refinement((r2, n2) => !!e10(r2) || (n2.addIssue("function" == typeof t2 ? t2(r2, n2) : t2), false)); + } + _refinement(e10) { + return new eg({ schema: this, typeName: tn.ZodEffects, effect: { type: "refinement", refinement: e10 } }); + } + superRefine(e10) { + return this._refinement(e10); + } + optional() { + return ey.create(this, this._def); + } + nullable() { + return ev.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return X.create(this, this._def); + } + promise() { + return em.create(this, this._def); + } + or(e10) { + return et.create([this, e10], this._def); + } + and(e10) { + return ei.create(this, e10, this._def); + } + transform(e10) { + return new eg({ ...k(this._def), schema: this, typeName: tn.ZodEffects, effect: { type: "transform", transform: e10 } }); + } + default(e10) { + return new eb({ ...k(this._def), innerType: this, defaultValue: "function" == typeof e10 ? e10 : () => e10, typeName: tn.ZodDefault }); + } + brand() { + return new e_({ typeName: tn.ZodBranded, type: this, ...k(this._def) }); + } + catch(e10) { + return new ew({ ...k(this._def), innerType: this, catchValue: "function" == typeof e10 ? e10 : () => e10, typeName: tn.ZodCatch }); + } + describe(e10) { + return new this.constructor({ ...this._def, description: e10 }); + } + pipe(e10) { + return eE.create(this, e10); + } + readonly() { + return ek.create(this); + } + isOptional() { + return this.safeParse(void 0).success; + } + isNullable() { + return this.safeParse(null).success; + } + } + let R = /^c[^\s-]{8,}$/i, P = /^[0-9a-z]+$/, T = /^[0-9A-HJKMNP-TV-Z]{26}$/, A = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, O = /^[a-z0-9_-]{21}$/i, I = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, N = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, M = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, $ = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, L = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, j = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", D = RegExp(`^${j}$`); + function F(e10) { + let t2 = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d"; + return e10.precision ? t2 = `${t2}\\.\\d{${e10.precision}}` : null == e10.precision && (t2 = `${t2}(\\.\\d+)?`), t2; + } + function B(e10) { + let t2 = `${j}T${F(e10)}`, r2 = []; + return r2.push(e10.local ? "Z?" : "Z"), e10.offset && r2.push("([+-]\\d{2}:?\\d{2})"), t2 = `${t2}(${r2.join("|")})`, RegExp(`^${t2}$`); + } + class U extends C { + _parse(e10) { + var t2, r2; + let s2; + if (this._def.coerce && (e10.data = String(e10.data)), this._getType(e10) !== i.string) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.string, received: t3.parsedType }), p; + } + let o2 = new f(); + for (let i2 of this._def.checks) + if ("min" === i2.kind) + e10.data.length < i2.value && (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.too_small, minimum: i2.value, type: "string", inclusive: true, exact: false, message: i2.message }), o2.dirty()); + else if ("max" === i2.kind) + e10.data.length > i2.value && (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.too_big, maximum: i2.value, type: "string", inclusive: true, exact: false, message: i2.message }), o2.dirty()); + else if ("length" === i2.kind) { + let t3 = e10.data.length > i2.value, r3 = e10.data.length < i2.value; + (t3 || r3) && (s2 = this._getOrReturnCtx(e10, s2), t3 ? h(s2, { code: a.too_big, maximum: i2.value, type: "string", inclusive: true, exact: true, message: i2.message }) : r3 && h(s2, { code: a.too_small, minimum: i2.value, type: "string", inclusive: true, exact: true, message: i2.message }), o2.dirty()); + } else if ("email" === i2.kind) + N.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "email", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("emoji" === i2.kind) + n || (n = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), n.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "emoji", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("uuid" === i2.kind) + A.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "uuid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("nanoid" === i2.kind) + O.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "nanoid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("cuid" === i2.kind) + R.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "cuid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("cuid2" === i2.kind) + P.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "cuid2", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("ulid" === i2.kind) + T.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "ulid", code: a.invalid_string, message: i2.message }), o2.dirty()); + else if ("url" === i2.kind) + try { + new URL(e10.data); + } catch (t3) { + h(s2 = this._getOrReturnCtx(e10, s2), { validation: "url", code: a.invalid_string, message: i2.message }), o2.dirty(); + } + else + "regex" === i2.kind ? (i2.regex.lastIndex = 0, i2.regex.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "regex", code: a.invalid_string, message: i2.message }), o2.dirty())) : "trim" === i2.kind ? e10.data = e10.data.trim() : "includes" === i2.kind ? e10.data.includes(i2.value, i2.position) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: { includes: i2.value, position: i2.position }, message: i2.message }), o2.dirty()) : "toLowerCase" === i2.kind ? e10.data = e10.data.toLowerCase() : "toUpperCase" === i2.kind ? e10.data = e10.data.toUpperCase() : "startsWith" === i2.kind ? e10.data.startsWith(i2.value) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: { startsWith: i2.value }, message: i2.message }), o2.dirty()) : "endsWith" === i2.kind ? e10.data.endsWith(i2.value) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: { endsWith: i2.value }, message: i2.message }), o2.dirty()) : "datetime" === i2.kind ? B(i2).test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: "datetime", message: i2.message }), o2.dirty()) : "date" === i2.kind ? D.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: "date", message: i2.message }), o2.dirty()) : "time" === i2.kind ? RegExp(`^${F(i2)}$`).test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { code: a.invalid_string, validation: "time", message: i2.message }), o2.dirty()) : "duration" === i2.kind ? I.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "duration", code: a.invalid_string, message: i2.message }), o2.dirty()) : "ip" === i2.kind ? (t2 = e10.data, ("v4" === (r2 = i2.version) || !r2) && M.test(t2) || ("v6" === r2 || !r2) && $.test(t2) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "ip", code: a.invalid_string, message: i2.message }), o2.dirty())) : "base64" === i2.kind ? L.test(e10.data) || (h(s2 = this._getOrReturnCtx(e10, s2), { validation: "base64", code: a.invalid_string, message: i2.message }), o2.dirty()) : e9.assertNever(i2); + return { status: o2.value, value: e10.data }; + } + _regex(e10, t2, r2) { + return this.refinement((t3) => e10.test(t3), { validation: t2, code: a.invalid_string, ...te.errToObj(r2) }); + } + _addCheck(e10) { + return new U({ ...this._def, checks: [...this._def.checks, e10] }); + } + email(e10) { + return this._addCheck({ kind: "email", ...te.errToObj(e10) }); + } + url(e10) { + return this._addCheck({ kind: "url", ...te.errToObj(e10) }); + } + emoji(e10) { + return this._addCheck({ kind: "emoji", ...te.errToObj(e10) }); + } + uuid(e10) { + return this._addCheck({ kind: "uuid", ...te.errToObj(e10) }); + } + nanoid(e10) { + return this._addCheck({ kind: "nanoid", ...te.errToObj(e10) }); + } + cuid(e10) { + return this._addCheck({ kind: "cuid", ...te.errToObj(e10) }); + } + cuid2(e10) { + return this._addCheck({ kind: "cuid2", ...te.errToObj(e10) }); + } + ulid(e10) { + return this._addCheck({ kind: "ulid", ...te.errToObj(e10) }); + } + base64(e10) { + return this._addCheck({ kind: "base64", ...te.errToObj(e10) }); + } + ip(e10) { + return this._addCheck({ kind: "ip", ...te.errToObj(e10) }); + } + datetime(e10) { + var t2, r2; + return "string" == typeof e10 ? this._addCheck({ kind: "datetime", precision: null, offset: false, local: false, message: e10 }) : this._addCheck({ kind: "datetime", precision: void 0 === (null == e10 ? void 0 : e10.precision) ? null : null == e10 ? void 0 : e10.precision, offset: null !== (t2 = null == e10 ? void 0 : e10.offset) && void 0 !== t2 && t2, local: null !== (r2 = null == e10 ? void 0 : e10.local) && void 0 !== r2 && r2, ...te.errToObj(null == e10 ? void 0 : e10.message) }); + } + date(e10) { + return this._addCheck({ kind: "date", message: e10 }); + } + time(e10) { + return "string" == typeof e10 ? this._addCheck({ kind: "time", precision: null, message: e10 }) : this._addCheck({ kind: "time", precision: void 0 === (null == e10 ? void 0 : e10.precision) ? null : null == e10 ? void 0 : e10.precision, ...te.errToObj(null == e10 ? void 0 : e10.message) }); + } + duration(e10) { + return this._addCheck({ kind: "duration", ...te.errToObj(e10) }); + } + regex(e10, t2) { + return this._addCheck({ kind: "regex", regex: e10, ...te.errToObj(t2) }); + } + includes(e10, t2) { + return this._addCheck({ kind: "includes", value: e10, position: null == t2 ? void 0 : t2.position, ...te.errToObj(null == t2 ? void 0 : t2.message) }); + } + startsWith(e10, t2) { + return this._addCheck({ kind: "startsWith", value: e10, ...te.errToObj(t2) }); + } + endsWith(e10, t2) { + return this._addCheck({ kind: "endsWith", value: e10, ...te.errToObj(t2) }); + } + min(e10, t2) { + return this._addCheck({ kind: "min", value: e10, ...te.errToObj(t2) }); + } + max(e10, t2) { + return this._addCheck({ kind: "max", value: e10, ...te.errToObj(t2) }); + } + length(e10, t2) { + return this._addCheck({ kind: "length", value: e10, ...te.errToObj(t2) }); + } + nonempty(e10) { + return this.min(1, te.errToObj(e10)); + } + trim() { + return new U({ ...this._def, checks: [...this._def.checks, { kind: "trim" }] }); + } + toLowerCase() { + return new U({ ...this._def, checks: [...this._def.checks, { kind: "toLowerCase" }] }); + } + toUpperCase() { + return new U({ ...this._def, checks: [...this._def.checks, { kind: "toUpperCase" }] }); + } + get isDatetime() { + return !!this._def.checks.find((e10) => "datetime" === e10.kind); + } + get isDate() { + return !!this._def.checks.find((e10) => "date" === e10.kind); + } + get isTime() { + return !!this._def.checks.find((e10) => "time" === e10.kind); + } + get isDuration() { + return !!this._def.checks.find((e10) => "duration" === e10.kind); + } + get isEmail() { + return !!this._def.checks.find((e10) => "email" === e10.kind); + } + get isURL() { + return !!this._def.checks.find((e10) => "url" === e10.kind); + } + get isEmoji() { + return !!this._def.checks.find((e10) => "emoji" === e10.kind); + } + get isUUID() { + return !!this._def.checks.find((e10) => "uuid" === e10.kind); + } + get isNANOID() { + return !!this._def.checks.find((e10) => "nanoid" === e10.kind); + } + get isCUID() { + return !!this._def.checks.find((e10) => "cuid" === e10.kind); + } + get isCUID2() { + return !!this._def.checks.find((e10) => "cuid2" === e10.kind); + } + get isULID() { + return !!this._def.checks.find((e10) => "ulid" === e10.kind); + } + get isIP() { + return !!this._def.checks.find((e10) => "ip" === e10.kind); + } + get isBase64() { + return !!this._def.checks.find((e10) => "base64" === e10.kind); + } + get minLength() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return e10; + } + get maxLength() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return e10; + } + } + U.create = (e10) => { + var t2; + return new U({ checks: [], typeName: tn.ZodString, coerce: null !== (t2 = null == e10 ? void 0 : e10.coerce) && void 0 !== t2 && t2, ...k(e10) }); + }; + class q extends C { + constructor() { + super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf; + } + _parse(e10) { + let t2; + if (this._def.coerce && (e10.data = Number(e10.data)), this._getType(e10) !== i.number) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.number, received: t3.parsedType }), p; + } + let r2 = new f(); + for (let n2 of this._def.checks) + "int" === n2.kind ? e9.isInteger(e10.data) || (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.invalid_type, expected: "integer", received: "float", message: n2.message }), r2.dirty()) : "min" === n2.kind ? (n2.inclusive ? e10.data < n2.value : e10.data <= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_small, minimum: n2.value, type: "number", inclusive: n2.inclusive, exact: false, message: n2.message }), r2.dirty()) : "max" === n2.kind ? (n2.inclusive ? e10.data > n2.value : e10.data >= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_big, maximum: n2.value, type: "number", inclusive: n2.inclusive, exact: false, message: n2.message }), r2.dirty()) : "multipleOf" === n2.kind ? 0 !== function(e11, t3) { + let r3 = (e11.toString().split(".")[1] || "").length, n3 = (t3.toString().split(".")[1] || "").length, i2 = r3 > n3 ? r3 : n3; + return parseInt(e11.toFixed(i2).replace(".", "")) % parseInt(t3.toFixed(i2).replace(".", "")) / Math.pow(10, i2); + }(e10.data, n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.not_multiple_of, multipleOf: n2.value, message: n2.message }), r2.dirty()) : "finite" === n2.kind ? Number.isFinite(e10.data) || (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.not_finite, message: n2.message }), r2.dirty()) : e9.assertNever(n2); + return { status: r2.value, value: e10.data }; + } + gte(e10, t2) { + return this.setLimit("min", e10, true, te.toString(t2)); + } + gt(e10, t2) { + return this.setLimit("min", e10, false, te.toString(t2)); + } + lte(e10, t2) { + return this.setLimit("max", e10, true, te.toString(t2)); + } + lt(e10, t2) { + return this.setLimit("max", e10, false, te.toString(t2)); + } + setLimit(e10, t2, r2, n2) { + return new q({ ...this._def, checks: [...this._def.checks, { kind: e10, value: t2, inclusive: r2, message: te.toString(n2) }] }); + } + _addCheck(e10) { + return new q({ ...this._def, checks: [...this._def.checks, e10] }); + } + int(e10) { + return this._addCheck({ kind: "int", message: te.toString(e10) }); + } + positive(e10) { + return this._addCheck({ kind: "min", value: 0, inclusive: false, message: te.toString(e10) }); + } + negative(e10) { + return this._addCheck({ kind: "max", value: 0, inclusive: false, message: te.toString(e10) }); + } + nonpositive(e10) { + return this._addCheck({ kind: "max", value: 0, inclusive: true, message: te.toString(e10) }); + } + nonnegative(e10) { + return this._addCheck({ kind: "min", value: 0, inclusive: true, message: te.toString(e10) }); + } + multipleOf(e10, t2) { + return this._addCheck({ kind: "multipleOf", value: e10, message: te.toString(t2) }); + } + finite(e10) { + return this._addCheck({ kind: "finite", message: te.toString(e10) }); + } + safe(e10) { + return this._addCheck({ kind: "min", inclusive: true, value: Number.MIN_SAFE_INTEGER, message: te.toString(e10) })._addCheck({ kind: "max", inclusive: true, value: Number.MAX_SAFE_INTEGER, message: te.toString(e10) }); + } + get minValue() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return e10; + } + get maxValue() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return e10; + } + get isInt() { + return !!this._def.checks.find((e10) => "int" === e10.kind || "multipleOf" === e10.kind && e9.isInteger(e10.value)); + } + get isFinite() { + let e10 = null, t2 = null; + for (let r2 of this._def.checks) { + if ("finite" === r2.kind || "int" === r2.kind || "multipleOf" === r2.kind) + return true; + "min" === r2.kind ? (null === t2 || r2.value > t2) && (t2 = r2.value) : "max" === r2.kind && (null === e10 || r2.value < e10) && (e10 = r2.value); + } + return Number.isFinite(t2) && Number.isFinite(e10); + } + } + q.create = (e10) => new q({ checks: [], typeName: tn.ZodNumber, coerce: (null == e10 ? void 0 : e10.coerce) || false, ...k(e10) }); + class z extends C { + constructor() { + super(...arguments), this.min = this.gte, this.max = this.lte; + } + _parse(e10) { + let t2; + if (this._def.coerce && (e10.data = BigInt(e10.data)), this._getType(e10) !== i.bigint) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.bigint, received: t3.parsedType }), p; + } + let r2 = new f(); + for (let n2 of this._def.checks) + "min" === n2.kind ? (n2.inclusive ? e10.data < n2.value : e10.data <= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_small, type: "bigint", minimum: n2.value, inclusive: n2.inclusive, message: n2.message }), r2.dirty()) : "max" === n2.kind ? (n2.inclusive ? e10.data > n2.value : e10.data >= n2.value) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_big, type: "bigint", maximum: n2.value, inclusive: n2.inclusive, message: n2.message }), r2.dirty()) : "multipleOf" === n2.kind ? e10.data % n2.value !== BigInt(0) && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.not_multiple_of, multipleOf: n2.value, message: n2.message }), r2.dirty()) : e9.assertNever(n2); + return { status: r2.value, value: e10.data }; + } + gte(e10, t2) { + return this.setLimit("min", e10, true, te.toString(t2)); + } + gt(e10, t2) { + return this.setLimit("min", e10, false, te.toString(t2)); + } + lte(e10, t2) { + return this.setLimit("max", e10, true, te.toString(t2)); + } + lt(e10, t2) { + return this.setLimit("max", e10, false, te.toString(t2)); + } + setLimit(e10, t2, r2, n2) { + return new z({ ...this._def, checks: [...this._def.checks, { kind: e10, value: t2, inclusive: r2, message: te.toString(n2) }] }); + } + _addCheck(e10) { + return new z({ ...this._def, checks: [...this._def.checks, e10] }); + } + positive(e10) { + return this._addCheck({ kind: "min", value: BigInt(0), inclusive: false, message: te.toString(e10) }); + } + negative(e10) { + return this._addCheck({ kind: "max", value: BigInt(0), inclusive: false, message: te.toString(e10) }); + } + nonpositive(e10) { + return this._addCheck({ kind: "max", value: BigInt(0), inclusive: true, message: te.toString(e10) }); + } + nonnegative(e10) { + return this._addCheck({ kind: "min", value: BigInt(0), inclusive: true, message: te.toString(e10) }); + } + multipleOf(e10, t2) { + return this._addCheck({ kind: "multipleOf", value: e10, message: te.toString(t2) }); + } + get minValue() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return e10; + } + get maxValue() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return e10; + } + } + z.create = (e10) => { + var t2; + return new z({ checks: [], typeName: tn.ZodBigInt, coerce: null !== (t2 = null == e10 ? void 0 : e10.coerce) && void 0 !== t2 && t2, ...k(e10) }); + }; + class H extends C { + _parse(e10) { + if (this._def.coerce && (e10.data = !!e10.data), this._getType(e10) !== i.boolean) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.boolean, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + H.create = (e10) => new H({ typeName: tn.ZodBoolean, coerce: (null == e10 ? void 0 : e10.coerce) || false, ...k(e10) }); + class W extends C { + _parse(e10) { + let t2; + if (this._def.coerce && (e10.data = new Date(e10.data)), this._getType(e10) !== i.date) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.date, received: t3.parsedType }), p; + } + if (isNaN(e10.data.getTime())) + return h(this._getOrReturnCtx(e10), { code: a.invalid_date }), p; + let r2 = new f(); + for (let n2 of this._def.checks) + "min" === n2.kind ? e10.data.getTime() < n2.value && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_small, message: n2.message, inclusive: true, exact: false, minimum: n2.value, type: "date" }), r2.dirty()) : "max" === n2.kind ? e10.data.getTime() > n2.value && (h(t2 = this._getOrReturnCtx(e10, t2), { code: a.too_big, message: n2.message, inclusive: true, exact: false, maximum: n2.value, type: "date" }), r2.dirty()) : e9.assertNever(n2); + return { status: r2.value, value: new Date(e10.data.getTime()) }; + } + _addCheck(e10) { + return new W({ ...this._def, checks: [...this._def.checks, e10] }); + } + min(e10, t2) { + return this._addCheck({ kind: "min", value: e10.getTime(), message: te.toString(t2) }); + } + max(e10, t2) { + return this._addCheck({ kind: "max", value: e10.getTime(), message: te.toString(t2) }); + } + get minDate() { + let e10 = null; + for (let t2 of this._def.checks) + "min" === t2.kind && (null === e10 || t2.value > e10) && (e10 = t2.value); + return null != e10 ? new Date(e10) : null; + } + get maxDate() { + let e10 = null; + for (let t2 of this._def.checks) + "max" === t2.kind && (null === e10 || t2.value < e10) && (e10 = t2.value); + return null != e10 ? new Date(e10) : null; + } + } + W.create = (e10) => new W({ checks: [], coerce: (null == e10 ? void 0 : e10.coerce) || false, typeName: tn.ZodDate, ...k(e10) }); + class Q extends C { + _parse(e10) { + if (this._getType(e10) !== i.symbol) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.symbol, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + Q.create = (e10) => new Q({ typeName: tn.ZodSymbol, ...k(e10) }); + class V extends C { + _parse(e10) { + if (this._getType(e10) !== i.undefined) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.undefined, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + V.create = (e10) => new V({ typeName: tn.ZodUndefined, ...k(e10) }); + class G extends C { + _parse(e10) { + if (this._getType(e10) !== i.null) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.null, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + G.create = (e10) => new G({ typeName: tn.ZodNull, ...k(e10) }); + class Z extends C { + constructor() { + super(...arguments), this._any = true; + } + _parse(e10) { + return g(e10.data); + } + } + Z.create = (e10) => new Z({ typeName: tn.ZodAny, ...k(e10) }); + class K extends C { + constructor() { + super(...arguments), this._unknown = true; + } + _parse(e10) { + return g(e10.data); + } + } + K.create = (e10) => new K({ typeName: tn.ZodUnknown, ...k(e10) }); + class J extends C { + _parse(e10) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.never, received: t2.parsedType }), p; + } + } + J.create = (e10) => new J({ typeName: tn.ZodNever, ...k(e10) }); + class Y extends C { + _parse(e10) { + if (this._getType(e10) !== i.undefined) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.void, received: t2.parsedType }), p; + } + return g(e10.data); + } + } + Y.create = (e10) => new Y({ typeName: tn.ZodVoid, ...k(e10) }); + class X extends C { + _parse(e10) { + let { ctx: t2, status: r2 } = this._processInputParams(e10), n2 = this._def; + if (t2.parsedType !== i.array) + return h(t2, { code: a.invalid_type, expected: i.array, received: t2.parsedType }), p; + if (null !== n2.exactLength) { + let e11 = t2.data.length > n2.exactLength.value, i2 = t2.data.length < n2.exactLength.value; + (e11 || i2) && (h(t2, { code: e11 ? a.too_big : a.too_small, minimum: i2 ? n2.exactLength.value : void 0, maximum: e11 ? n2.exactLength.value : void 0, type: "array", inclusive: true, exact: true, message: n2.exactLength.message }), r2.dirty()); + } + if (null !== n2.minLength && t2.data.length < n2.minLength.value && (h(t2, { code: a.too_small, minimum: n2.minLength.value, type: "array", inclusive: true, exact: false, message: n2.minLength.message }), r2.dirty()), null !== n2.maxLength && t2.data.length > n2.maxLength.value && (h(t2, { code: a.too_big, maximum: n2.maxLength.value, type: "array", inclusive: true, exact: false, message: n2.maxLength.message }), r2.dirty()), t2.common.async) + return Promise.all([...t2.data].map((e11, r3) => n2.type._parseAsync(new _(t2, e11, t2.path, r3)))).then((e11) => f.mergeArray(r2, e11)); + let s2 = [...t2.data].map((e11, r3) => n2.type._parseSync(new _(t2, e11, t2.path, r3))); + return f.mergeArray(r2, s2); + } + get element() { + return this._def.type; + } + min(e10, t2) { + return new X({ ...this._def, minLength: { value: e10, message: te.toString(t2) } }); + } + max(e10, t2) { + return new X({ ...this._def, maxLength: { value: e10, message: te.toString(t2) } }); + } + length(e10, t2) { + return new X({ ...this._def, exactLength: { value: e10, message: te.toString(t2) } }); + } + nonempty(e10) { + return this.min(1, e10); + } + } + X.create = (e10, t2) => new X({ type: e10, minLength: null, maxLength: null, exactLength: null, typeName: tn.ZodArray, ...k(t2) }); + class ee extends C { + constructor() { + super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend; + } + _getCached() { + if (null !== this._cached) + return this._cached; + let e10 = this._def.shape(), t2 = e9.objectKeys(e10); + return this._cached = { shape: e10, keys: t2 }; + } + _parse(e10) { + if (this._getType(e10) !== i.object) { + let t3 = this._getOrReturnCtx(e10); + return h(t3, { code: a.invalid_type, expected: i.object, received: t3.parsedType }), p; + } + let { status: t2, ctx: r2 } = this._processInputParams(e10), { shape: n2, keys: s2 } = this._getCached(), o2 = []; + if (!(this._def.catchall instanceof J && "strip" === this._def.unknownKeys)) + for (let e11 in r2.data) + s2.includes(e11) || o2.push(e11); + let l2 = []; + for (let e11 of s2) { + let t3 = n2[e11], i2 = r2.data[e11]; + l2.push({ key: { status: "valid", value: e11 }, value: t3._parse(new _(r2, i2, r2.path, e11)), alwaysSet: e11 in r2.data }); + } + if (this._def.catchall instanceof J) { + let e11 = this._def.unknownKeys; + if ("passthrough" === e11) + for (let e12 of o2) + l2.push({ key: { status: "valid", value: e12 }, value: { status: "valid", value: r2.data[e12] } }); + else if ("strict" === e11) + o2.length > 0 && (h(r2, { code: a.unrecognized_keys, keys: o2 }), t2.dirty()); + else if ("strip" === e11) + ; + else + throw Error("Internal ZodObject error: invalid unknownKeys value."); + } else { + let e11 = this._def.catchall; + for (let t3 of o2) { + let n3 = r2.data[t3]; + l2.push({ key: { status: "valid", value: t3 }, value: e11._parse(new _(r2, n3, r2.path, t3)), alwaysSet: t3 in r2.data }); + } + } + return r2.common.async ? Promise.resolve().then(async () => { + let e11 = []; + for (let t3 of l2) { + let r3 = await t3.key, n3 = await t3.value; + e11.push({ key: r3, value: n3, alwaysSet: t3.alwaysSet }); + } + return e11; + }).then((e11) => f.mergeObjectSync(t2, e11)) : f.mergeObjectSync(t2, l2); + } + get shape() { + return this._def.shape(); + } + strict(e10) { + return te.errToObj, new ee({ ...this._def, unknownKeys: "strict", ...void 0 !== e10 ? { errorMap: (t2, r2) => { + var n2, i2, s2, a2; + let o2 = null !== (s2 = null === (i2 = (n2 = this._def).errorMap) || void 0 === i2 ? void 0 : i2.call(n2, t2, r2).message) && void 0 !== s2 ? s2 : r2.defaultError; + return "unrecognized_keys" === t2.code ? { message: null !== (a2 = te.errToObj(e10).message) && void 0 !== a2 ? a2 : o2 } : { message: o2 }; + } } : {} }); + } + strip() { + return new ee({ ...this._def, unknownKeys: "strip" }); + } + passthrough() { + return new ee({ ...this._def, unknownKeys: "passthrough" }); + } + extend(e10) { + return new ee({ ...this._def, shape: () => ({ ...this._def.shape(), ...e10 }) }); + } + merge(e10) { + return new ee({ unknownKeys: e10._def.unknownKeys, catchall: e10._def.catchall, shape: () => ({ ...this._def.shape(), ...e10._def.shape() }), typeName: tn.ZodObject }); + } + setKey(e10, t2) { + return this.augment({ [e10]: t2 }); + } + catchall(e10) { + return new ee({ ...this._def, catchall: e10 }); + } + pick(e10) { + let t2 = {}; + return e9.objectKeys(e10).forEach((r2) => { + e10[r2] && this.shape[r2] && (t2[r2] = this.shape[r2]); + }), new ee({ ...this._def, shape: () => t2 }); + } + omit(e10) { + let t2 = {}; + return e9.objectKeys(this.shape).forEach((r2) => { + e10[r2] || (t2[r2] = this.shape[r2]); + }), new ee({ ...this._def, shape: () => t2 }); + } + deepPartial() { + return function e10(t2) { + if (t2 instanceof ee) { + let r2 = {}; + for (let n2 in t2.shape) { + let i2 = t2.shape[n2]; + r2[n2] = ey.create(e10(i2)); + } + return new ee({ ...t2._def, shape: () => r2 }); + } + return t2 instanceof X ? new X({ ...t2._def, type: e10(t2.element) }) : t2 instanceof ey ? ey.create(e10(t2.unwrap())) : t2 instanceof ev ? ev.create(e10(t2.unwrap())) : t2 instanceof es ? es.create(t2.items.map((t3) => e10(t3))) : t2; + }(this); + } + partial(e10) { + let t2 = {}; + return e9.objectKeys(this.shape).forEach((r2) => { + let n2 = this.shape[r2]; + e10 && !e10[r2] ? t2[r2] = n2 : t2[r2] = n2.optional(); + }), new ee({ ...this._def, shape: () => t2 }); + } + required(e10) { + let t2 = {}; + return e9.objectKeys(this.shape).forEach((r2) => { + if (e10 && !e10[r2]) + t2[r2] = this.shape[r2]; + else { + let e11 = this.shape[r2]; + for (; e11 instanceof ey; ) + e11 = e11._def.innerType; + t2[r2] = e11; + } + }), new ee({ ...this._def, shape: () => t2 }); + } + keyof() { + return eh(e9.objectKeys(this.shape)); + } + } + ee.create = (e10, t2) => new ee({ shape: () => e10, unknownKeys: "strip", catchall: J.create(), typeName: tn.ZodObject, ...k(t2) }), ee.strictCreate = (e10, t2) => new ee({ shape: () => e10, unknownKeys: "strict", catchall: J.create(), typeName: tn.ZodObject, ...k(t2) }), ee.lazycreate = (e10, t2) => new ee({ shape: e10, unknownKeys: "strip", catchall: J.create(), typeName: tn.ZodObject, ...k(t2) }); + class et extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = this._def.options; + if (t2.common.async) + return Promise.all(r2.map(async (e11) => { + let r3 = { ...t2, common: { ...t2.common, issues: [] }, parent: null }; + return { result: await e11._parseAsync({ data: t2.data, path: t2.path, parent: r3 }), ctx: r3 }; + })).then(function(e11) { + for (let t3 of e11) + if ("valid" === t3.result.status) + return t3.result; + for (let r4 of e11) + if ("dirty" === r4.result.status) + return t2.common.issues.push(...r4.ctx.common.issues), r4.result; + let r3 = e11.map((e12) => new o(e12.ctx.common.issues)); + return h(t2, { code: a.invalid_union, unionErrors: r3 }), p; + }); + { + let e11; + let n2 = []; + for (let i3 of r2) { + let r3 = { ...t2, common: { ...t2.common, issues: [] }, parent: null }, s2 = i3._parseSync({ data: t2.data, path: t2.path, parent: r3 }); + if ("valid" === s2.status) + return s2; + "dirty" !== s2.status || e11 || (e11 = { result: s2, ctx: r3 }), r3.common.issues.length && n2.push(r3.common.issues); + } + if (e11) + return t2.common.issues.push(...e11.ctx.common.issues), e11.result; + let i2 = n2.map((e12) => new o(e12)); + return h(t2, { code: a.invalid_union, unionErrors: i2 }), p; + } + } + get options() { + return this._def.options; + } + } + et.create = (e10, t2) => new et({ options: e10, typeName: tn.ZodUnion, ...k(t2) }); + let er = (e10) => { + if (e10 instanceof eu) + return er(e10.schema); + if (e10 instanceof eg) + return er(e10.innerType()); + if (e10 instanceof ed) + return [e10.value]; + if (e10 instanceof ef) + return e10.options; + if (e10 instanceof ep) + return e9.objectValues(e10.enum); + if (e10 instanceof eb) + return er(e10._def.innerType); + if (e10 instanceof V) + return [void 0]; + else if (e10 instanceof G) + return [null]; + else if (e10 instanceof ey) + return [void 0, ...er(e10.unwrap())]; + else if (e10 instanceof ev) + return [null, ...er(e10.unwrap())]; + else if (e10 instanceof e_) + return er(e10.unwrap()); + else if (e10 instanceof ek) + return er(e10.unwrap()); + else if (e10 instanceof ew) + return er(e10._def.innerType); + else + return []; + }; + class en extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + if (t2.parsedType !== i.object) + return h(t2, { code: a.invalid_type, expected: i.object, received: t2.parsedType }), p; + let r2 = this.discriminator, n2 = t2.data[r2], s2 = this.optionsMap.get(n2); + return s2 ? t2.common.async ? s2._parseAsync({ data: t2.data, path: t2.path, parent: t2 }) : s2._parseSync({ data: t2.data, path: t2.path, parent: t2 }) : (h(t2, { code: a.invalid_union_discriminator, options: Array.from(this.optionsMap.keys()), path: [r2] }), p); + } + get discriminator() { + return this._def.discriminator; + } + get options() { + return this._def.options; + } + get optionsMap() { + return this._def.optionsMap; + } + static create(e10, t2, r2) { + let n2 = /* @__PURE__ */ new Map(); + for (let r3 of t2) { + let t3 = er(r3.shape[e10]); + if (!t3.length) + throw Error(`A discriminator value for key \`${e10}\` could not be extracted from all schema options`); + for (let i2 of t3) { + if (n2.has(i2)) + throw Error(`Discriminator property ${String(e10)} has duplicate value ${String(i2)}`); + n2.set(i2, r3); + } + } + return new en({ typeName: tn.ZodDiscriminatedUnion, discriminator: e10, options: t2, optionsMap: n2, ...k(r2) }); + } + } + class ei extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10), n2 = (e11, n3) => { + if (y(e11) || y(n3)) + return p; + let o2 = function e12(t3, r3) { + let n4 = s(t3), a2 = s(r3); + if (t3 === r3) + return { valid: true, data: t3 }; + if (n4 === i.object && a2 === i.object) { + let n5 = e9.objectKeys(r3), i2 = e9.objectKeys(t3).filter((e13) => -1 !== n5.indexOf(e13)), s2 = { ...t3, ...r3 }; + for (let n6 of i2) { + let i3 = e12(t3[n6], r3[n6]); + if (!i3.valid) + return { valid: false }; + s2[n6] = i3.data; + } + return { valid: true, data: s2 }; + } + if (n4 === i.array && a2 === i.array) { + if (t3.length !== r3.length) + return { valid: false }; + let n5 = []; + for (let i2 = 0; i2 < t3.length; i2++) { + let s2 = e12(t3[i2], r3[i2]); + if (!s2.valid) + return { valid: false }; + n5.push(s2.data); + } + return { valid: true, data: n5 }; + } + return n4 === i.date && a2 === i.date && +t3 == +r3 ? { valid: true, data: t3 } : { valid: false }; + }(e11.value, n3.value); + return o2.valid ? ((v(e11) || v(n3)) && t2.dirty(), { status: t2.value, value: o2.data }) : (h(r2, { code: a.invalid_intersection_types }), p); + }; + return r2.common.async ? Promise.all([this._def.left._parseAsync({ data: r2.data, path: r2.path, parent: r2 }), this._def.right._parseAsync({ data: r2.data, path: r2.path, parent: r2 })]).then(([e11, t3]) => n2(e11, t3)) : n2(this._def.left._parseSync({ data: r2.data, path: r2.path, parent: r2 }), this._def.right._parseSync({ data: r2.data, path: r2.path, parent: r2 })); + } + } + ei.create = (e10, t2, r2) => new ei({ left: e10, right: t2, typeName: tn.ZodIntersection, ...k(r2) }); + class es extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.array) + return h(r2, { code: a.invalid_type, expected: i.array, received: r2.parsedType }), p; + if (r2.data.length < this._def.items.length) + return h(r2, { code: a.too_small, minimum: this._def.items.length, inclusive: true, exact: false, type: "array" }), p; + !this._def.rest && r2.data.length > this._def.items.length && (h(r2, { code: a.too_big, maximum: this._def.items.length, inclusive: true, exact: false, type: "array" }), t2.dirty()); + let n2 = [...r2.data].map((e11, t3) => { + let n3 = this._def.items[t3] || this._def.rest; + return n3 ? n3._parse(new _(r2, e11, r2.path, t3)) : null; + }).filter((e11) => !!e11); + return r2.common.async ? Promise.all(n2).then((e11) => f.mergeArray(t2, e11)) : f.mergeArray(t2, n2); + } + get items() { + return this._def.items; + } + rest(e10) { + return new es({ ...this._def, rest: e10 }); + } + } + es.create = (e10, t2) => { + if (!Array.isArray(e10)) + throw Error("You must pass an array of schemas to z.tuple([ ... ])"); + return new es({ items: e10, typeName: tn.ZodTuple, rest: null, ...k(t2) }); + }; + class ea extends C { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.object) + return h(r2, { code: a.invalid_type, expected: i.object, received: r2.parsedType }), p; + let n2 = [], s2 = this._def.keyType, o2 = this._def.valueType; + for (let e11 in r2.data) + n2.push({ key: s2._parse(new _(r2, e11, r2.path, e11)), value: o2._parse(new _(r2, r2.data[e11], r2.path, e11)), alwaysSet: e11 in r2.data }); + return r2.common.async ? f.mergeObjectAsync(t2, n2) : f.mergeObjectSync(t2, n2); + } + get element() { + return this._def.valueType; + } + static create(e10, t2, r2) { + return new ea(t2 instanceof C ? { keyType: e10, valueType: t2, typeName: tn.ZodRecord, ...k(r2) } : { keyType: U.create(), valueType: e10, typeName: tn.ZodRecord, ...k(t2) }); + } + } + class eo extends C { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.map) + return h(r2, { code: a.invalid_type, expected: i.map, received: r2.parsedType }), p; + let n2 = this._def.keyType, s2 = this._def.valueType, o2 = [...r2.data.entries()].map(([e11, t3], i2) => ({ key: n2._parse(new _(r2, e11, r2.path, [i2, "key"])), value: s2._parse(new _(r2, t3, r2.path, [i2, "value"])) })); + if (r2.common.async) { + let e11 = /* @__PURE__ */ new Map(); + return Promise.resolve().then(async () => { + for (let r3 of o2) { + let n3 = await r3.key, i2 = await r3.value; + if ("aborted" === n3.status || "aborted" === i2.status) + return p; + ("dirty" === n3.status || "dirty" === i2.status) && t2.dirty(), e11.set(n3.value, i2.value); + } + return { status: t2.value, value: e11 }; + }); + } + { + let e11 = /* @__PURE__ */ new Map(); + for (let r3 of o2) { + let n3 = r3.key, i2 = r3.value; + if ("aborted" === n3.status || "aborted" === i2.status) + return p; + ("dirty" === n3.status || "dirty" === i2.status) && t2.dirty(), e11.set(n3.value, i2.value); + } + return { status: t2.value, value: e11 }; + } + } + } + eo.create = (e10, t2, r2) => new eo({ valueType: t2, keyType: e10, typeName: tn.ZodMap, ...k(r2) }); + class el extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.parsedType !== i.set) + return h(r2, { code: a.invalid_type, expected: i.set, received: r2.parsedType }), p; + let n2 = this._def; + null !== n2.minSize && r2.data.size < n2.minSize.value && (h(r2, { code: a.too_small, minimum: n2.minSize.value, type: "set", inclusive: true, exact: false, message: n2.minSize.message }), t2.dirty()), null !== n2.maxSize && r2.data.size > n2.maxSize.value && (h(r2, { code: a.too_big, maximum: n2.maxSize.value, type: "set", inclusive: true, exact: false, message: n2.maxSize.message }), t2.dirty()); + let s2 = this._def.valueType; + function o2(e11) { + let r3 = /* @__PURE__ */ new Set(); + for (let n3 of e11) { + if ("aborted" === n3.status) + return p; + "dirty" === n3.status && t2.dirty(), r3.add(n3.value); + } + return { status: t2.value, value: r3 }; + } + let l2 = [...r2.data.values()].map((e11, t3) => s2._parse(new _(r2, e11, r2.path, t3))); + return r2.common.async ? Promise.all(l2).then((e11) => o2(e11)) : o2(l2); + } + min(e10, t2) { + return new el({ ...this._def, minSize: { value: e10, message: te.toString(t2) } }); + } + max(e10, t2) { + return new el({ ...this._def, maxSize: { value: e10, message: te.toString(t2) } }); + } + size(e10, t2) { + return this.min(e10, t2).max(e10, t2); + } + nonempty(e10) { + return this.min(1, e10); + } + } + el.create = (e10, t2) => new el({ valueType: e10, minSize: null, maxSize: null, typeName: tn.ZodSet, ...k(t2) }); + class ec extends C { + constructor() { + super(...arguments), this.validate = this.implement; + } + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + if (t2.parsedType !== i.function) + return h(t2, { code: a.invalid_type, expected: i.function, received: t2.parsedType }), p; + function r2(e11, r3) { + return d({ data: e11, path: t2.path, errorMaps: [t2.common.contextualErrorMap, t2.schemaErrorMap, u(), l].filter((e12) => !!e12), issueData: { code: a.invalid_arguments, argumentsError: r3 } }); + } + function n2(e11, r3) { + return d({ data: e11, path: t2.path, errorMaps: [t2.common.contextualErrorMap, t2.schemaErrorMap, u(), l].filter((e12) => !!e12), issueData: { code: a.invalid_return_type, returnTypeError: r3 } }); + } + let s2 = { errorMap: t2.common.contextualErrorMap }, c2 = t2.data; + if (this._def.returns instanceof em) { + let e11 = this; + return g(async function(...t3) { + let i2 = new o([]), a2 = await e11._def.args.parseAsync(t3, s2).catch((e12) => { + throw i2.addIssue(r2(t3, e12)), i2; + }), l2 = await Reflect.apply(c2, this, a2); + return await e11._def.returns._def.type.parseAsync(l2, s2).catch((e12) => { + throw i2.addIssue(n2(l2, e12)), i2; + }); + }); + } + { + let e11 = this; + return g(function(...t3) { + let i2 = e11._def.args.safeParse(t3, s2); + if (!i2.success) + throw new o([r2(t3, i2.error)]); + let a2 = Reflect.apply(c2, this, i2.data), l2 = e11._def.returns.safeParse(a2, s2); + if (!l2.success) + throw new o([n2(a2, l2.error)]); + return l2.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...e10) { + return new ec({ ...this._def, args: es.create(e10).rest(K.create()) }); + } + returns(e10) { + return new ec({ ...this._def, returns: e10 }); + } + implement(e10) { + return this.parse(e10); + } + strictImplement(e10) { + return this.parse(e10); + } + static create(e10, t2, r2) { + return new ec({ args: e10 || es.create([]).rest(K.create()), returns: t2 || K.create(), typeName: tn.ZodFunction, ...k(r2) }); + } + } + class eu extends C { + get schema() { + return this._def.getter(); + } + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + return this._def.getter()._parse({ data: t2.data, path: t2.path, parent: t2 }); + } + } + eu.create = (e10, t2) => new eu({ getter: e10, typeName: tn.ZodLazy, ...k(t2) }); + class ed extends C { + _parse(e10) { + if (e10.data !== this._def.value) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { received: t2.data, code: a.invalid_literal, expected: this._def.value }), p; + } + return { status: "valid", value: e10.data }; + } + get value() { + return this._def.value; + } + } + function eh(e10, t2) { + return new ef({ values: e10, typeName: tn.ZodEnum, ...k(t2) }); + } + ed.create = (e10, t2) => new ed({ value: e10, typeName: tn.ZodLiteral, ...k(t2) }); + class ef extends C { + constructor() { + super(...arguments), tt.set(this, void 0); + } + _parse(e10) { + if ("string" != typeof e10.data) { + let t2 = this._getOrReturnCtx(e10), r2 = this._def.values; + return h(t2, { expected: e9.joinValues(r2), received: t2.parsedType, code: a.invalid_type }), p; + } + if (x(this, tt, "f") || S(this, tt, new Set(this._def.values), "f"), !x(this, tt, "f").has(e10.data)) { + let t2 = this._getOrReturnCtx(e10), r2 = this._def.values; + return h(t2, { received: t2.data, code: a.invalid_enum_value, options: r2 }), p; + } + return g(e10.data); + } + get options() { + return this._def.values; + } + get enum() { + let e10 = {}; + for (let t2 of this._def.values) + e10[t2] = t2; + return e10; + } + get Values() { + let e10 = {}; + for (let t2 of this._def.values) + e10[t2] = t2; + return e10; + } + get Enum() { + let e10 = {}; + for (let t2 of this._def.values) + e10[t2] = t2; + return e10; + } + extract(e10, t2 = this._def) { + return ef.create(e10, { ...this._def, ...t2 }); + } + exclude(e10, t2 = this._def) { + return ef.create(this.options.filter((t3) => !e10.includes(t3)), { ...this._def, ...t2 }); + } + } + tt = /* @__PURE__ */ new WeakMap(), ef.create = eh; + class ep extends C { + constructor() { + super(...arguments), tr.set(this, void 0); + } + _parse(e10) { + let t2 = e9.getValidEnumValues(this._def.values), r2 = this._getOrReturnCtx(e10); + if (r2.parsedType !== i.string && r2.parsedType !== i.number) { + let e11 = e9.objectValues(t2); + return h(r2, { expected: e9.joinValues(e11), received: r2.parsedType, code: a.invalid_type }), p; + } + if (x(this, tr, "f") || S(this, tr, new Set(e9.getValidEnumValues(this._def.values)), "f"), !x(this, tr, "f").has(e10.data)) { + let e11 = e9.objectValues(t2); + return h(r2, { received: r2.data, code: a.invalid_enum_value, options: e11 }), p; + } + return g(e10.data); + } + get enum() { + return this._def.values; + } + } + tr = /* @__PURE__ */ new WeakMap(), ep.create = (e10, t2) => new ep({ values: e10, typeName: tn.ZodNativeEnum, ...k(t2) }); + class em extends C { + unwrap() { + return this._def.type; + } + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10); + return t2.parsedType !== i.promise && false === t2.common.async ? (h(t2, { code: a.invalid_type, expected: i.promise, received: t2.parsedType }), p) : g((t2.parsedType === i.promise ? t2.data : Promise.resolve(t2.data)).then((e11) => this._def.type.parseAsync(e11, { path: t2.path, errorMap: t2.common.contextualErrorMap }))); + } + } + em.create = (e10, t2) => new em({ type: e10, typeName: tn.ZodPromise, ...k(t2) }); + class eg extends C { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === tn.ZodEffects ? this._def.schema.sourceType() : this._def.schema; + } + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10), n2 = this._def.effect || null, i2 = { addIssue: (e11) => { + h(r2, e11), e11.fatal ? t2.abort() : t2.dirty(); + }, get path() { + return r2.path; + } }; + if (i2.addIssue = i2.addIssue.bind(i2), "preprocess" === n2.type) { + let e11 = n2.transform(r2.data, i2); + if (r2.common.async) + return Promise.resolve(e11).then(async (e12) => { + if ("aborted" === t2.value) + return p; + let n3 = await this._def.schema._parseAsync({ data: e12, path: r2.path, parent: r2 }); + return "aborted" === n3.status ? p : "dirty" === n3.status || "dirty" === t2.value ? m(n3.value) : n3; + }); + { + if ("aborted" === t2.value) + return p; + let n3 = this._def.schema._parseSync({ data: e11, path: r2.path, parent: r2 }); + return "aborted" === n3.status ? p : "dirty" === n3.status || "dirty" === t2.value ? m(n3.value) : n3; + } + } + if ("refinement" === n2.type) { + let e11 = (e12) => { + let t3 = n2.refinement(e12, i2); + if (r2.common.async) + return Promise.resolve(t3); + if (t3 instanceof Promise) + throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); + return e12; + }; + if (false !== r2.common.async) + return this._def.schema._parseAsync({ data: r2.data, path: r2.path, parent: r2 }).then((r3) => "aborted" === r3.status ? p : ("dirty" === r3.status && t2.dirty(), e11(r3.value).then(() => ({ status: t2.value, value: r3.value })))); + { + let n3 = this._def.schema._parseSync({ data: r2.data, path: r2.path, parent: r2 }); + return "aborted" === n3.status ? p : ("dirty" === n3.status && t2.dirty(), e11(n3.value), { status: t2.value, value: n3.value }); + } + } + if ("transform" === n2.type) { + if (false !== r2.common.async) + return this._def.schema._parseAsync({ data: r2.data, path: r2.path, parent: r2 }).then((e11) => b(e11) ? Promise.resolve(n2.transform(e11.value, i2)).then((e12) => ({ status: t2.value, value: e12 })) : e11); + { + let e11 = this._def.schema._parseSync({ data: r2.data, path: r2.path, parent: r2 }); + if (!b(e11)) + return e11; + let s2 = n2.transform(e11.value, i2); + if (s2 instanceof Promise) + throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead."); + return { status: t2.value, value: s2 }; + } + } + e9.assertNever(n2); + } + } + eg.create = (e10, t2, r2) => new eg({ schema: e10, typeName: tn.ZodEffects, effect: t2, ...k(r2) }), eg.createWithPreprocess = (e10, t2, r2) => new eg({ schema: t2, effect: { type: "preprocess", transform: e10 }, typeName: tn.ZodEffects, ...k(r2) }); + class ey extends C { + _parse(e10) { + return this._getType(e10) === i.undefined ? g(void 0) : this._def.innerType._parse(e10); + } + unwrap() { + return this._def.innerType; + } + } + ey.create = (e10, t2) => new ey({ innerType: e10, typeName: tn.ZodOptional, ...k(t2) }); + class ev extends C { + _parse(e10) { + return this._getType(e10) === i.null ? g(null) : this._def.innerType._parse(e10); + } + unwrap() { + return this._def.innerType; + } + } + ev.create = (e10, t2) => new ev({ innerType: e10, typeName: tn.ZodNullable, ...k(t2) }); + class eb extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = t2.data; + return t2.parsedType === i.undefined && (r2 = this._def.defaultValue()), this._def.innerType._parse({ data: r2, path: t2.path, parent: t2 }); + } + removeDefault() { + return this._def.innerType; + } + } + eb.create = (e10, t2) => new eb({ innerType: e10, typeName: tn.ZodDefault, defaultValue: "function" == typeof t2.default ? t2.default : () => t2.default, ...k(t2) }); + class ew extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = { ...t2, common: { ...t2.common, issues: [] } }, n2 = this._def.innerType._parse({ data: r2.data, path: r2.path, parent: { ...r2 } }); + return w(n2) ? n2.then((e11) => ({ status: "valid", value: "valid" === e11.status ? e11.value : this._def.catchValue({ get error() { + return new o(r2.common.issues); + }, input: r2.data }) })) : { status: "valid", value: "valid" === n2.status ? n2.value : this._def.catchValue({ get error() { + return new o(r2.common.issues); + }, input: r2.data }) }; + } + removeCatch() { + return this._def.innerType; + } + } + ew.create = (e10, t2) => new ew({ innerType: e10, typeName: tn.ZodCatch, catchValue: "function" == typeof t2.catch ? t2.catch : () => t2.catch, ...k(t2) }); + class ex extends C { + _parse(e10) { + if (this._getType(e10) !== i.nan) { + let t2 = this._getOrReturnCtx(e10); + return h(t2, { code: a.invalid_type, expected: i.nan, received: t2.parsedType }), p; + } + return { status: "valid", value: e10.data }; + } + } + ex.create = (e10) => new ex({ typeName: tn.ZodNaN, ...k(e10) }); + let eS = Symbol("zod_brand"); + class e_ extends C { + _parse(e10) { + let { ctx: t2 } = this._processInputParams(e10), r2 = t2.data; + return this._def.type._parse({ data: r2, path: t2.path, parent: t2 }); + } + unwrap() { + return this._def.type; + } + } + class eE extends C { + _parse(e10) { + let { status: t2, ctx: r2 } = this._processInputParams(e10); + if (r2.common.async) + return (async () => { + let e11 = await this._def.in._parseAsync({ data: r2.data, path: r2.path, parent: r2 }); + return "aborted" === e11.status ? p : "dirty" === e11.status ? (t2.dirty(), m(e11.value)) : this._def.out._parseAsync({ data: e11.value, path: r2.path, parent: r2 }); + })(); + { + let e11 = this._def.in._parseSync({ data: r2.data, path: r2.path, parent: r2 }); + return "aborted" === e11.status ? p : "dirty" === e11.status ? (t2.dirty(), { status: "dirty", value: e11.value }) : this._def.out._parseSync({ data: e11.value, path: r2.path, parent: r2 }); + } + } + static create(e10, t2) { + return new eE({ in: e10, out: t2, typeName: tn.ZodPipeline }); + } + } + class ek extends C { + _parse(e10) { + let t2 = this._def.innerType._parse(e10), r2 = (e11) => (b(e11) && (e11.value = Object.freeze(e11.value)), e11); + return w(t2) ? t2.then((e11) => r2(e11)) : r2(t2); + } + unwrap() { + return this._def.innerType; + } + } + function eC(e10, t2 = {}, r2) { + return e10 ? Z.create().superRefine((n2, i2) => { + var s2, a2; + if (!e10(n2)) { + let e11 = "function" == typeof t2 ? t2(n2) : "string" == typeof t2 ? { message: t2 } : t2, o2 = null === (a2 = null !== (s2 = e11.fatal) && void 0 !== s2 ? s2 : r2) || void 0 === a2 || a2, l2 = "string" == typeof e11 ? { message: e11 } : e11; + i2.addIssue({ code: "custom", ...l2, fatal: o2 }); + } + }) : Z.create(); + } + ek.create = (e10, t2) => new ek({ innerType: e10, typeName: tn.ZodReadonly, ...k(t2) }); + let eR = { object: ee.lazycreate }; + !function(e10) { + e10.ZodString = "ZodString", e10.ZodNumber = "ZodNumber", e10.ZodNaN = "ZodNaN", e10.ZodBigInt = "ZodBigInt", e10.ZodBoolean = "ZodBoolean", e10.ZodDate = "ZodDate", e10.ZodSymbol = "ZodSymbol", e10.ZodUndefined = "ZodUndefined", e10.ZodNull = "ZodNull", e10.ZodAny = "ZodAny", e10.ZodUnknown = "ZodUnknown", e10.ZodNever = "ZodNever", e10.ZodVoid = "ZodVoid", e10.ZodArray = "ZodArray", e10.ZodObject = "ZodObject", e10.ZodUnion = "ZodUnion", e10.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e10.ZodIntersection = "ZodIntersection", e10.ZodTuple = "ZodTuple", e10.ZodRecord = "ZodRecord", e10.ZodMap = "ZodMap", e10.ZodSet = "ZodSet", e10.ZodFunction = "ZodFunction", e10.ZodLazy = "ZodLazy", e10.ZodLiteral = "ZodLiteral", e10.ZodEnum = "ZodEnum", e10.ZodEffects = "ZodEffects", e10.ZodNativeEnum = "ZodNativeEnum", e10.ZodOptional = "ZodOptional", e10.ZodNullable = "ZodNullable", e10.ZodDefault = "ZodDefault", e10.ZodCatch = "ZodCatch", e10.ZodPromise = "ZodPromise", e10.ZodBranded = "ZodBranded", e10.ZodPipeline = "ZodPipeline", e10.ZodReadonly = "ZodReadonly"; + }(tn || (tn = {})); + let eP = U.create, eT = q.create, eA = ex.create, eO = z.create, eI = H.create, eN = W.create, eM = Q.create, e$ = V.create, eL = G.create, ej = Z.create, eD = K.create, eF = J.create, eB = Y.create, eU = X.create, eq = ee.create, ez = ee.strictCreate, eH = et.create, eW = en.create, eQ = ei.create, eV = es.create, eG = ea.create, eZ = eo.create, eK = el.create, eJ = ec.create, eY = eu.create, eX = ed.create, e0 = ef.create, e1 = ep.create, e2 = em.create, e6 = eg.create, e5 = ey.create, e4 = ev.create, e3 = eg.createWithPreprocess, e8 = eE.create; + var e9, e7, te, tt, tr, tn, ti = Object.freeze({ __proto__: null, defaultErrorMap: l, setErrorMap: function(e10) { + c = e10; + }, getErrorMap: u, makeIssue: d, EMPTY_PATH: [], addIssueToContext: h, ParseStatus: f, INVALID: p, DIRTY: m, OK: g, isAborted: y, isDirty: v, isValid: b, isAsync: w, get util() { + return e9; + }, get objectUtil() { + return e7; + }, ZodParsedType: i, getParsedType: s, ZodType: C, datetimeRegex: B, ZodString: U, ZodNumber: q, ZodBigInt: z, ZodBoolean: H, ZodDate: W, ZodSymbol: Q, ZodUndefined: V, ZodNull: G, ZodAny: Z, ZodUnknown: K, ZodNever: J, ZodVoid: Y, ZodArray: X, ZodObject: ee, ZodUnion: et, ZodDiscriminatedUnion: en, ZodIntersection: ei, ZodTuple: es, ZodRecord: ea, ZodMap: eo, ZodSet: el, ZodFunction: ec, ZodLazy: eu, ZodLiteral: ed, ZodEnum: ef, ZodNativeEnum: ep, ZodPromise: em, ZodEffects: eg, ZodTransformer: eg, ZodOptional: ey, ZodNullable: ev, ZodDefault: eb, ZodCatch: ew, ZodNaN: ex, BRAND: eS, ZodBranded: e_, ZodPipeline: eE, ZodReadonly: ek, custom: eC, Schema: C, ZodSchema: C, late: eR, get ZodFirstPartyTypeKind() { + return tn; + }, coerce: { string: (e10) => U.create({ ...e10, coerce: true }), number: (e10) => q.create({ ...e10, coerce: true }), boolean: (e10) => H.create({ ...e10, coerce: true }), bigint: (e10) => z.create({ ...e10, coerce: true }), date: (e10) => W.create({ ...e10, coerce: true }) }, any: ej, array: eU, bigint: eO, boolean: eI, date: eN, discriminatedUnion: eW, effect: e6, enum: e0, function: eJ, instanceof: (e10, t2 = { message: `Input not instance of ${e10.name}` }) => eC((t3) => t3 instanceof e10, t2), intersection: eQ, lazy: eY, literal: eX, map: eZ, nan: eA, nativeEnum: e1, never: eF, null: eL, nullable: e4, number: eT, object: eq, oboolean: () => eI().optional(), onumber: () => eT().optional(), optional: e5, ostring: () => eP().optional(), pipeline: e8, preprocess: e3, promise: e2, record: eG, set: eK, strictObject: ez, string: eP, symbol: eM, transformer: e6, tuple: eV, undefined: e$, union: eH, unknown: eD, void: eB, NEVER: p, ZodIssueCode: a, quotelessJson: (e10) => JSON.stringify(e10, null, 2).replace(/"([^"]+)":/g, "$1:"), ZodError: o }); + }; + __namedExportsObject5["__chunk_77063"] = (e, t, r) => { + "use strict"; + r.d(t, { x7: () => i }); + let n = (0, r(63861).D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/sonner@1.5.0_e4kbeb3oepbyvs7ql5y74riunu/node_modules/sonner/dist/index.mjs`), i = n.Toaster; + n.toast, n.useSonner; + }; + __namedExportsObject5["__chunk_86977"] = (e, t, r) => { + "use strict"; + let n, i; + r.d(t, { N: () => eo }); + let s = new TextEncoder(), a = new TextDecoder(), o = (e2) => { + let t2 = e2; + "string" == typeof t2 && (t2 = s.encode(t2)); + let r2 = []; + for (let e3 = 0; e3 < t2.length; e3 += 32768) + r2.push(String.fromCharCode.apply(null, t2.subarray(e3, e3 + 32768))); + return btoa(r2.join("")); + }, l = (e2) => o(e2).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"), c = (e2) => { + let t2 = atob(e2), r2 = new Uint8Array(t2.length); + for (let e3 = 0; e3 < t2.length; e3++) + r2[e3] = t2.charCodeAt(e3); + return r2; + }, u = (e2) => { + let t2 = e2; + t2 instanceof Uint8Array && (t2 = a.decode(t2)), t2 = t2.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, ""); + try { + return c(t2); + } catch { + throw TypeError("The input to be decoded is not correctly encoded."); + } + }; + class d extends Error { + constructor(e2, t2) { + super(e2, t2), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor); + } + } + d.code = "ERR_JOSE_GENERIC"; + class h extends d { + constructor(e2, t2, r2 = "unspecified", n2 = "unspecified") { + super(e2, { cause: { claim: r2, reason: n2, payload: t2 } }), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = r2, this.reason = n2, this.payload = t2; + } + } + h.code = "ERR_JWT_CLAIM_VALIDATION_FAILED"; + class f extends d { + constructor(e2, t2, r2 = "unspecified", n2 = "unspecified") { + super(e2, { cause: { claim: r2, reason: n2, payload: t2 } }), this.code = "ERR_JWT_EXPIRED", this.claim = r2, this.reason = n2, this.payload = t2; + } + } + f.code = "ERR_JWT_EXPIRED"; + class p extends d { + constructor() { + super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED"; + } + } + p.code = "ERR_JOSE_ALG_NOT_ALLOWED"; + class m extends d { + constructor() { + super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED"; + } + } + m.code = "ERR_JOSE_NOT_SUPPORTED"; + class g extends d { + constructor(e2 = "decryption operation failed", t2) { + super(e2, t2), this.code = "ERR_JWE_DECRYPTION_FAILED"; + } + } + g.code = "ERR_JWE_DECRYPTION_FAILED"; + class y extends d { + constructor() { + super(...arguments), this.code = "ERR_JWE_INVALID"; + } + } + y.code = "ERR_JWE_INVALID"; + class v extends d { + constructor() { + super(...arguments), this.code = "ERR_JWS_INVALID"; + } + } + v.code = "ERR_JWS_INVALID"; + class b extends d { + constructor() { + super(...arguments), this.code = "ERR_JWT_INVALID"; + } + } + b.code = "ERR_JWT_INVALID"; + class w extends d { + constructor() { + super(...arguments), this.code = "ERR_JWK_INVALID"; + } + } + w.code = "ERR_JWK_INVALID"; + class x extends d { + constructor() { + super(...arguments), this.code = "ERR_JWKS_INVALID"; + } + } + x.code = "ERR_JWKS_INVALID"; + class S extends d { + constructor(e2 = "no applicable key found in the JSON Web Key Set", t2) { + super(e2, t2), this.code = "ERR_JWKS_NO_MATCHING_KEY"; + } + } + S.code = "ERR_JWKS_NO_MATCHING_KEY"; + class _ extends d { + constructor(e2 = "multiple matching keys found in the JSON Web Key Set", t2) { + super(e2, t2), this.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS"; + } + } + Symbol.asyncIterator, _.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS"; + class E extends d { + constructor(e2 = "request timed out", t2) { + super(e2, t2), this.code = "ERR_JWKS_TIMEOUT"; + } + } + E.code = "ERR_JWKS_TIMEOUT"; + class k extends d { + constructor(e2 = "signature verification failed", t2) { + super(e2, t2), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED"; + } + } + k.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED"; + let C = crypto, R = (e2) => e2 instanceof CryptoKey, P = (e2, t2) => { + if (e2.startsWith("RS") || e2.startsWith("PS")) { + let { modulusLength: r2 } = t2.algorithm; + if ("number" != typeof r2 || r2 < 2048) + throw TypeError(`${e2} requires key modulusLength to be 2048 bits or larger`); + } + }; + function T(e2, t2 = "algorithm.name") { + return TypeError(`CryptoKey does not support this operation, its ${t2} must be ${e2}`); + } + function A(e2, t2) { + return e2.name === t2; + } + function O(e2) { + return parseInt(e2.name.slice(4), 10); + } + function I(e2, t2, ...r2) { + if ((r2 = r2.filter(Boolean)).length > 2) { + let t3 = r2.pop(); + e2 += `one of type ${r2.join(", ")}, or ${t3}.`; + } else + 2 === r2.length ? e2 += `one of type ${r2[0]} or ${r2[1]}.` : e2 += `of type ${r2[0]}.`; + return null == t2 ? e2 += ` Received ${t2}` : "function" == typeof t2 && t2.name ? e2 += ` Received function ${t2.name}` : "object" == typeof t2 && null != t2 && t2.constructor?.name && (e2 += ` Received an instance of ${t2.constructor.name}`), e2; + } + let N = (e2, ...t2) => I("Key must be ", e2, ...t2); + function M(e2, t2, ...r2) { + return I(`Key for the ${e2} algorithm must be `, t2, ...r2); + } + let $ = (e2) => !!R(e2) || e2?.[Symbol.toStringTag] === "KeyObject", L = ["CryptoKey"]; + function j(e2) { + if (!("object" == typeof e2 && null !== e2) || "[object Object]" !== Object.prototype.toString.call(e2)) + return false; + if (null === Object.getPrototypeOf(e2)) + return true; + let t2 = e2; + for (; null !== Object.getPrototypeOf(t2); ) + t2 = Object.getPrototypeOf(t2); + return Object.getPrototypeOf(e2) === t2; + } + function D(e2) { + return j(e2) && "string" == typeof e2.kty; + } + let F = async (e2) => { + if (!e2.alg) + throw TypeError('"alg" argument is required when "jwk.alg" is not present'); + let { algorithm: t2, keyUsages: r2 } = function(e3) { + let t3, r3; + switch (e3.kty) { + case "RSA": + switch (e3.alg) { + case "PS256": + case "PS384": + case "PS512": + t3 = { name: "RSA-PSS", hash: `SHA-${e3.alg.slice(-3)}` }, r3 = e3.d ? ["sign"] : ["verify"]; + break; + case "RS256": + case "RS384": + case "RS512": + t3 = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e3.alg.slice(-3)}` }, r3 = e3.d ? ["sign"] : ["verify"]; + break; + case "RSA-OAEP": + case "RSA-OAEP-256": + case "RSA-OAEP-384": + case "RSA-OAEP-512": + t3 = { name: "RSA-OAEP", hash: `SHA-${parseInt(e3.alg.slice(-3), 10) || 1}` }, r3 = e3.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"]; + break; + default: + throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); + } + break; + case "EC": + switch (e3.alg) { + case "ES256": + t3 = { name: "ECDSA", namedCurve: "P-256" }, r3 = e3.d ? ["sign"] : ["verify"]; + break; + case "ES384": + t3 = { name: "ECDSA", namedCurve: "P-384" }, r3 = e3.d ? ["sign"] : ["verify"]; + break; + case "ES512": + t3 = { name: "ECDSA", namedCurve: "P-521" }, r3 = e3.d ? ["sign"] : ["verify"]; + break; + case "ECDH-ES": + case "ECDH-ES+A128KW": + case "ECDH-ES+A192KW": + case "ECDH-ES+A256KW": + t3 = { name: "ECDH", namedCurve: e3.crv }, r3 = e3.d ? ["deriveBits"] : []; + break; + default: + throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); + } + break; + case "OKP": + switch (e3.alg) { + case "EdDSA": + t3 = { name: e3.crv }, r3 = e3.d ? ["sign"] : ["verify"]; + break; + case "ECDH-ES": + case "ECDH-ES+A128KW": + case "ECDH-ES+A192KW": + case "ECDH-ES+A256KW": + t3 = { name: e3.crv }, r3 = e3.d ? ["deriveBits"] : []; + break; + default: + throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); + } + break; + default: + throw new m('Invalid or unsupported JWK "kty" (Key Type) Parameter value'); + } + return { algorithm: t3, keyUsages: r3 }; + }(e2), n2 = [t2, e2.ext ?? false, e2.key_ops ?? r2], i2 = { ...e2 }; + return delete i2.alg, delete i2.use, C.subtle.importKey("jwk", i2, ...n2); + }, B = (e2) => u(e2), U = (e2) => e2?.[Symbol.toStringTag] === "KeyObject", q = async (e2, t2, r2, n2, i2 = false) => { + let s2 = e2.get(t2); + if (s2?.[n2]) + return s2[n2]; + let a2 = await F({ ...r2, alg: n2 }); + return i2 && Object.freeze(t2), s2 ? s2[n2] = a2 : e2.set(t2, { [n2]: a2 }), a2; + }, z = { normalizePublicKey: (e2, t2) => { + if (U(e2)) { + let r2 = e2.export({ format: "jwk" }); + return (delete r2.d, delete r2.dp, delete r2.dq, delete r2.p, delete r2.q, delete r2.qi, r2.k) ? B(r2.k) : (i || (i = /* @__PURE__ */ new WeakMap()), q(i, e2, r2, t2)); + } + return D(e2) ? e2.k ? u(e2.k) : (i || (i = /* @__PURE__ */ new WeakMap()), q(i, e2, e2, t2, true)) : e2; + }, normalizePrivateKey: (e2, t2) => { + if (U(e2)) { + let r2 = e2.export({ format: "jwk" }); + return r2.k ? B(r2.k) : (n || (n = /* @__PURE__ */ new WeakMap()), q(n, e2, r2, t2)); + } + return D(e2) ? e2.k ? u(e2.k) : (n || (n = /* @__PURE__ */ new WeakMap()), q(n, e2, e2, t2, true)) : e2; + } }; + async function H(e2, t2, r2) { + if ("sign" === r2 && (t2 = await z.normalizePrivateKey(t2, e2)), "verify" === r2 && (t2 = await z.normalizePublicKey(t2, e2)), R(t2)) + return !function(e3, t3, ...r3) { + switch (t3) { + case "HS256": + case "HS384": + case "HS512": { + if (!A(e3.algorithm, "HMAC")) + throw T("HMAC"); + let r4 = parseInt(t3.slice(2), 10); + if (O(e3.algorithm.hash) !== r4) + throw T(`SHA-${r4}`, "algorithm.hash"); + break; + } + case "RS256": + case "RS384": + case "RS512": { + if (!A(e3.algorithm, "RSASSA-PKCS1-v1_5")) + throw T("RSASSA-PKCS1-v1_5"); + let r4 = parseInt(t3.slice(2), 10); + if (O(e3.algorithm.hash) !== r4) + throw T(`SHA-${r4}`, "algorithm.hash"); + break; + } + case "PS256": + case "PS384": + case "PS512": { + if (!A(e3.algorithm, "RSA-PSS")) + throw T("RSA-PSS"); + let r4 = parseInt(t3.slice(2), 10); + if (O(e3.algorithm.hash) !== r4) + throw T(`SHA-${r4}`, "algorithm.hash"); + break; + } + case "EdDSA": + if ("Ed25519" !== e3.algorithm.name && "Ed448" !== e3.algorithm.name) + throw T("Ed25519 or Ed448"); + break; + case "ES256": + case "ES384": + case "ES512": { + if (!A(e3.algorithm, "ECDSA")) + throw T("ECDSA"); + let r4 = function(e4) { + switch (e4) { + case "ES256": + return "P-256"; + case "ES384": + return "P-384"; + case "ES512": + return "P-521"; + default: + throw Error("unreachable"); + } + }(t3); + if (e3.algorithm.namedCurve !== r4) + throw T(r4, "algorithm.namedCurve"); + break; + } + default: + throw TypeError("CryptoKey does not support this operation"); + } + (function(e4, t4) { + if (t4.length && !t4.some((t5) => e4.usages.includes(t5))) { + let e5 = "CryptoKey does not support this operation, its usages must include "; + if (t4.length > 2) { + let r4 = t4.pop(); + e5 += `one of ${t4.join(", ")}, or ${r4}.`; + } else + 2 === t4.length ? e5 += `one of ${t4[0]} or ${t4[1]}.` : e5 += `${t4[0]}.`; + throw TypeError(e5); + } + })(e3, r3); + }(t2, e2, r2), t2; + if (t2 instanceof Uint8Array) { + if (!e2.startsWith("HS")) + throw TypeError(N(t2, ...L)); + return C.subtle.importKey("raw", t2, { hash: `SHA-${e2.slice(-3)}`, name: "HMAC" }, false, [r2]); + } + throw TypeError(N(t2, ...L, "Uint8Array", "JSON Web Key")); + } + let W = async (e2, t2, r2) => { + let n2 = await H(e2, t2, "sign"); + return P(e2, n2), new Uint8Array(await C.subtle.sign(function(e3, t3) { + let r3 = `SHA-${e3.slice(-3)}`; + switch (e3) { + case "HS256": + case "HS384": + case "HS512": + return { hash: r3, name: "HMAC" }; + case "PS256": + case "PS384": + case "PS512": + return { hash: r3, name: "RSA-PSS", saltLength: e3.slice(-3) >> 3 }; + case "RS256": + case "RS384": + case "RS512": + return { hash: r3, name: "RSASSA-PKCS1-v1_5" }; + case "ES256": + case "ES384": + case "ES512": + return { hash: r3, name: "ECDSA", namedCurve: t3.namedCurve }; + case "EdDSA": + return { name: t3.name }; + default: + throw new m(`alg ${e3} is not supported either by JOSE or your javascript runtime`); + } + }(e2, n2.algorithm), n2, r2)); + }, Q = (...e2) => { + let t2; + let r2 = e2.filter(Boolean); + if (0 === r2.length || 1 === r2.length) + return true; + for (let e3 of r2) { + let r3 = Object.keys(e3); + if (!t2 || 0 === t2.size) { + t2 = new Set(r3); + continue; + } + for (let e4 of r3) { + if (t2.has(e4)) + return false; + t2.add(e4); + } + } + return true; + }, V = (e2) => e2?.[Symbol.toStringTag], G = (e2, t2, r2) => { + if (void 0 !== t2.use && "sig" !== t2.use) + throw TypeError("Invalid key for this operation, when present its use must be sig"); + if (void 0 !== t2.key_ops && t2.key_ops.includes?.(r2) !== true) + throw TypeError(`Invalid key for this operation, when present its key_ops must include ${r2}`); + if (void 0 !== t2.alg && t2.alg !== e2) + throw TypeError(`Invalid key for this operation, when present its alg must be ${e2}`); + return true; + }, Z = (e2, t2, r2, n2) => { + if (!(t2 instanceof Uint8Array)) { + if (n2 && D(t2)) { + if (function(e3) { + return D(e3) && "oct" === e3.kty && "string" == typeof e3.k; + }(t2) && G(e2, t2, r2)) + return; + throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present'); + } + if (!$(t2)) + throw TypeError(M(e2, t2, ...L, "Uint8Array", n2 ? "JSON Web Key" : null)); + if ("secret" !== t2.type) + throw TypeError(`${V(t2)} instances for symmetric algorithms must be of type "secret"`); + } + }, K = (e2, t2, r2, n2) => { + if (n2 && D(t2)) + switch (r2) { + case "sign": + if (function(e3) { + return "oct" !== e3.kty && "string" == typeof e3.d; + }(t2) && G(e2, t2, r2)) + return; + throw TypeError("JSON Web Key for this operation be a private JWK"); + case "verify": + if (function(e3) { + return "oct" !== e3.kty && void 0 === e3.d; + }(t2) && G(e2, t2, r2)) + return; + throw TypeError("JSON Web Key for this operation be a public JWK"); + } + if (!$(t2)) + throw TypeError(M(e2, t2, ...L, n2 ? "JSON Web Key" : null)); + if ("secret" === t2.type) + throw TypeError(`${V(t2)} instances for asymmetric algorithms must not be of type "secret"`); + if ("sign" === r2 && "public" === t2.type) + throw TypeError(`${V(t2)} instances for asymmetric algorithm signing must be of type "private"`); + if ("decrypt" === r2 && "public" === t2.type) + throw TypeError(`${V(t2)} instances for asymmetric algorithm decryption must be of type "private"`); + if (t2.algorithm && "verify" === r2 && "private" === t2.type) + throw TypeError(`${V(t2)} instances for asymmetric algorithm verifying must be of type "public"`); + if (t2.algorithm && "encrypt" === r2 && "private" === t2.type) + throw TypeError(`${V(t2)} instances for asymmetric algorithm encryption must be of type "public"`); + }; + function J(e2, t2, r2, n2) { + t2.startsWith("HS") || "dir" === t2 || t2.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t2) ? Z(t2, r2, n2, e2) : K(t2, r2, n2, e2); + } + J.bind(void 0, false); + let Y = J.bind(void 0, true), X = function(e2, t2, r2, n2, i2) { + let s2; + if (void 0 !== i2.crit && n2?.crit === void 0) + throw new e2('"crit" (Critical) Header Parameter MUST be integrity protected'); + if (!n2 || void 0 === n2.crit) + return /* @__PURE__ */ new Set(); + if (!Array.isArray(n2.crit) || 0 === n2.crit.length || n2.crit.some((e3) => "string" != typeof e3 || 0 === e3.length)) + throw new e2('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present'); + for (let a2 of (s2 = void 0 !== r2 ? new Map([...Object.entries(r2), ...t2.entries()]) : t2, n2.crit)) { + if (!s2.has(a2)) + throw new m(`Extension Header Parameter "${a2}" is not recognized`); + if (void 0 === i2[a2]) + throw new e2(`Extension Header Parameter "${a2}" is missing`); + if (s2.get(a2) && void 0 === n2[a2]) + throw new e2(`Extension Header Parameter "${a2}" MUST be integrity protected`); + } + return new Set(n2.crit); + }; + class ee { + constructor(e2) { + if (!(e2 instanceof Uint8Array)) + throw TypeError("payload must be an instance of Uint8Array"); + this._payload = e2; + } + setProtectedHeader(e2) { + if (this._protectedHeader) + throw TypeError("setProtectedHeader can only be called once"); + return this._protectedHeader = e2, this; + } + setUnprotectedHeader(e2) { + if (this._unprotectedHeader) + throw TypeError("setUnprotectedHeader can only be called once"); + return this._unprotectedHeader = e2, this; + } + async sign(e2, t2) { + let r2; + if (!this._protectedHeader && !this._unprotectedHeader) + throw new v("either setProtectedHeader or setUnprotectedHeader must be called before #sign()"); + if (!Q(this._protectedHeader, this._unprotectedHeader)) + throw new v("JWS Protected and JWS Unprotected Header Parameter names must be disjoint"); + let n2 = { ...this._protectedHeader, ...this._unprotectedHeader }, i2 = X(v, /* @__PURE__ */ new Map([["b64", true]]), t2?.crit, this._protectedHeader, n2), o2 = true; + if (i2.has("b64") && "boolean" != typeof (o2 = this._protectedHeader.b64)) + throw new v('The "b64" (base64url-encode payload) Header Parameter must be a boolean'); + let { alg: c2 } = n2; + if ("string" != typeof c2 || !c2) + throw new v('JWS "alg" (Algorithm) Header Parameter missing or invalid'); + Y(c2, e2, "sign"); + let u2 = this._payload; + o2 && (u2 = s.encode(l(u2))); + let d2 = function(...e3) { + let t3 = new Uint8Array(e3.reduce((e4, { length: t4 }) => e4 + t4, 0)), r3 = 0; + for (let n3 of e3) + t3.set(n3, r3), r3 += n3.length; + return t3; + }(r2 = this._protectedHeader ? s.encode(l(JSON.stringify(this._protectedHeader))) : s.encode(""), s.encode("."), u2), h2 = { signature: l(await W(c2, e2, d2)), payload: "" }; + return o2 && (h2.payload = a.decode(u2)), this._unprotectedHeader && (h2.header = this._unprotectedHeader), this._protectedHeader && (h2.protected = a.decode(r2)), h2; + } + } + class et { + constructor(e2) { + this._flattened = new ee(e2); + } + setProtectedHeader(e2) { + return this._flattened.setProtectedHeader(e2), this; + } + async sign(e2, t2) { + let r2 = await this._flattened.sign(e2, t2); + if (void 0 === r2.payload) + throw TypeError("use the flattened module for creating JWS with b64: false"); + return `${r2.protected}.${r2.payload}.${r2.signature}`; + } + } + let er = (e2) => Math.floor(e2.getTime() / 1e3), en = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, ei = (e2) => { + let t2; + let r2 = en.exec(e2); + if (!r2 || r2[4] && r2[1]) + throw TypeError("Invalid time period format"); + let n2 = parseFloat(r2[2]); + switch (r2[3].toLowerCase()) { + case "sec": + case "secs": + case "second": + case "seconds": + case "s": + t2 = Math.round(n2); + break; + case "minute": + case "minutes": + case "min": + case "mins": + case "m": + t2 = Math.round(60 * n2); + break; + case "hour": + case "hours": + case "hr": + case "hrs": + case "h": + t2 = Math.round(3600 * n2); + break; + case "day": + case "days": + case "d": + t2 = Math.round(86400 * n2); + break; + case "week": + case "weeks": + case "w": + t2 = Math.round(604800 * n2); + break; + default: + t2 = Math.round(31557600 * n2); + } + return "-" === r2[1] || "ago" === r2[4] ? -t2 : t2; + }; + function es(e2, t2) { + if (!Number.isFinite(t2)) + throw TypeError(`Invalid ${e2} input`); + return t2; + } + class ea { + constructor(e2 = {}) { + if (!j(e2)) + throw TypeError("JWT Claims Set MUST be an object"); + this._payload = e2; + } + setIssuer(e2) { + return this._payload = { ...this._payload, iss: e2 }, this; + } + setSubject(e2) { + return this._payload = { ...this._payload, sub: e2 }, this; + } + setAudience(e2) { + return this._payload = { ...this._payload, aud: e2 }, this; + } + setJti(e2) { + return this._payload = { ...this._payload, jti: e2 }, this; + } + setNotBefore(e2) { + return "number" == typeof e2 ? this._payload = { ...this._payload, nbf: es("setNotBefore", e2) } : e2 instanceof Date ? this._payload = { ...this._payload, nbf: es("setNotBefore", er(e2)) } : this._payload = { ...this._payload, nbf: er(/* @__PURE__ */ new Date()) + ei(e2) }, this; + } + setExpirationTime(e2) { + return "number" == typeof e2 ? this._payload = { ...this._payload, exp: es("setExpirationTime", e2) } : e2 instanceof Date ? this._payload = { ...this._payload, exp: es("setExpirationTime", er(e2)) } : this._payload = { ...this._payload, exp: er(/* @__PURE__ */ new Date()) + ei(e2) }, this; + } + setIssuedAt(e2) { + return void 0 === e2 ? this._payload = { ...this._payload, iat: er(/* @__PURE__ */ new Date()) } : e2 instanceof Date ? this._payload = { ...this._payload, iat: es("setIssuedAt", er(e2)) } : "string" == typeof e2 ? this._payload = { ...this._payload, iat: es("setIssuedAt", er(/* @__PURE__ */ new Date()) + ei(e2)) } : this._payload = { ...this._payload, iat: es("setIssuedAt", e2) }, this; + } + } + class eo extends ea { + setProtectedHeader(e2) { + return this._protectedHeader = e2, this; + } + async sign(e2, t2) { + let r2 = new et(s.encode(JSON.stringify(this._payload))); + if (r2.setProtectedHeader(this._protectedHeader), Array.isArray(this._protectedHeader?.crit) && this._protectedHeader.crit.includes("b64") && false === this._protectedHeader.b64) + throw new b("JWTs MUST NOT use unencoded payload"); + return r2.sign(e2, t2); + } + } + }; + __namedExportsObject5["__chunk_6161"] = (e, t, r) => { + "use strict"; + r.d(t, { d: () => n }); + let n = Symbol.for("drizzle:ViewBaseConfig"); + }; + __namedExportsObject5["__chunk_77915"] = (e, t, r) => { + "use strict"; + r.d(t, { An: () => m, M4: () => c, M6: () => d, SS: () => f, ZS: () => function e2(t2, r2) { + return Object.entries(t2).reduce((t3, [a2, l2]) => { + if ("string" != typeof a2) + return t3; + let c2 = r2 ? [...r2, a2] : [a2]; + return (0, i.is)(l2, n.s) || (0, i.is)(l2, s.$s) || (0, i.is)(l2, s.$s.Aliased) ? t3.push({ path: c2, field: l2 }) : (0, i.is)(l2, o.iA) ? t3.push(...e2(l2[o.iA.Symbol.Columns], c2)) : t3.push(...e2(l2, c2)), t3; + }, []); + }, dP: () => p, ef: () => h, ux: () => u, wM: () => g }); + var n = r(97014), i = r(35971), s = r(62640), a = r(75360), o = r(84335), l = r(6161); + function c(e2, t2, r2) { + let a2 = {}, l2 = e2.reduce((e3, { path: l3, field: c2 }, u2) => { + let d2; + d2 = (0, i.is)(c2, n.s) ? c2 : (0, i.is)(c2, s.$s) ? c2.decoder : c2.sql.decoder; + let h2 = e3; + for (let [e4, s2] of l3.entries()) + if (e4 < l3.length - 1) + s2 in h2 || (h2[s2] = {}), h2 = h2[s2]; + else { + let e5 = t2[u2], f2 = h2[s2] = null === e5 ? null : d2.mapFromDriverValue(e5); + if (r2 && (0, i.is)(c2, n.s) && 2 === l3.length) { + let e6 = l3[0]; + e6 in a2 ? "string" == typeof a2[e6] && a2[e6] !== (0, o.SP)(c2.table) && (a2[e6] = false) : a2[e6] = null === f2 && (0, o.SP)(c2.table); + } + } + return e3; + }, {}); + if (r2 && Object.keys(a2).length > 0) + for (let [e3, t3] of Object.entries(a2)) + "string" != typeof t3 || r2[t3] || (l2[e3] = null); + return l2; + } + function u(e2, t2) { + let r2 = Object.keys(e2), n2 = Object.keys(t2); + if (r2.length !== n2.length) + return false; + for (let [e3, t3] of r2.entries()) + if (t3 !== n2[e3]) + return false; + return true; + } + function d(e2, t2) { + let r2 = Object.entries(t2).filter(([, e3]) => void 0 !== e3).map(([t3, r3]) => (0, i.is)(r3, s.$s) ? [t3, r3] : [t3, new s.dO(r3, e2[o.iA.Symbol.Columns][t3])]); + if (0 === r2.length) + throw Error("No values to set"); + return Object.fromEntries(r2); + } + function h(e2, t2) { + for (let r2 of t2) + for (let t3 of Object.getOwnPropertyNames(r2.prototype)) + "constructor" !== t3 && Object.defineProperty(e2.prototype, t3, Object.getOwnPropertyDescriptor(r2.prototype, t3) || /* @__PURE__ */ Object.create(null)); + } + function f(e2) { + return e2[o.iA.Symbol.Columns]; + } + function p(e2) { + return (0, i.is)(e2, a.k) ? e2._.alias : (0, i.is)(e2, s.G7) ? e2[l.d].name : (0, i.is)(e2, s.$s) ? void 0 : e2[o.iA.Symbol.IsAlias] ? e2[o.iA.Symbol.Name] : e2[o.iA.Symbol.BaseName]; + } + function m(e2, t2) { + return { name: "string" == typeof e2 && e2.length > 0 ? e2 : "", config: "object" == typeof e2 ? e2 : t2 }; + } + function g(e2) { + if ("object" != typeof e2 || null === e2 || "Object" !== e2.constructor.name) + return false; + if ("logger" in e2) { + let t2 = typeof e2.logger; + return "boolean" === t2 || "object" === t2 && "function" == typeof e2.logger.logQuery || "undefined" === t2; + } + if ("schema" in e2) { + let t2 = typeof e2.logger; + return "object" === t2 || "undefined" === t2; + } + if ("casing" in e2) { + let t2 = typeof e2.logger; + return "string" === t2 || "undefined" === t2; + } + if ("mode" in e2) + return "default" === e2.mode && "planetscale" === e2.mode && void 0 === e2.mode; + if ("connection" in e2) { + let t2 = typeof e2.connection; + return "string" === t2 || "object" === t2 || "undefined" === t2; + } + if ("client" in e2) { + let t2 = typeof e2.client; + return "object" === t2 || "undefined" === t2; + } + return 0 === Object.keys(e2).length; + } + }; + __namedExportsObject5["__chunk_42712"] = (e, t, r) => { + "use strict"; + let n, i; + r.d(t, { Z: () => a }); + var s = r(93239); + let a = { startActiveSpan: (e2, t2) => n ? (i || (i = n.trace.getTracer("drizzle-orm", "0.35.3")), (0, s.t)((r2, n2) => n2.startActiveSpan(e2, (e3) => { + try { + return t2(e3); + } catch (t3) { + throw e3.setStatus({ code: r2.SpanStatusCode.ERROR, message: t3 instanceof Error ? t3.message : "Unknown error" }), t3; + } finally { + e3.end(); + } + }), n, i)) : t2() }; + }; + __namedExportsObject5["__chunk_93239"] = (e, t, r) => { + "use strict"; + function n(e2, ...t2) { + return e2(...t2); + } + r.d(t, { t: () => n }); + }; + __namedExportsObject5["__chunk_41144"] = (e, t, r) => { + "use strict"; + r.d(t, { m: () => n }); + let n = Symbol.for("drizzle:Name"); + }; + __namedExportsObject5["__chunk_84335"] = (e, t, r) => { + "use strict"; + r.d(t, { Q0: () => m, SP: () => p, iA: () => f }); + var n = r(35971), i = r(41144); + let s = Symbol.for("drizzle:Schema"), a = Symbol.for("drizzle:Columns"), o = Symbol.for("drizzle:ExtraConfigColumns"), l = Symbol.for("drizzle:OriginalName"), c = Symbol.for("drizzle:BaseName"), u = Symbol.for("drizzle:IsAlias"), d = Symbol.for("drizzle:ExtraConfigBuilder"), h = Symbol.for("drizzle:IsDrizzleTable"); + class f { + static [n.Q] = "Table"; + static Symbol = { Name: i.m, Schema: s, OriginalName: l, Columns: a, ExtraConfigColumns: o, BaseName: c, IsAlias: u, ExtraConfigBuilder: d }; + [i.m]; + [l]; + [s]; + [a]; + [o]; + [c]; + [u] = false; + [h] = true; + [d] = void 0; + constructor(e2, t2, r2) { + this[i.m] = this[l] = e2, this[s] = t2, this[c] = r2; + } + } + function p(e2) { + return e2[i.m]; + } + function m(e2) { + return `${e2[s] ?? "public"}.${e2[i.m]}`; + } + }; + __namedExportsObject5["__chunk_75360"] = (e, t, r) => { + "use strict"; + r.d(t, { S: () => s, k: () => i }); + var n = r(35971); + class i { + static [n.Q] = "Subquery"; + constructor(e2, t2, r2, n2 = false) { + this._ = { brand: "Subquery", sql: e2, selectedFields: t2, alias: r2, isWith: n2 }; + } + } + class s extends i { + static [n.Q] = "WithSubquery"; + } + }; + __namedExportsObject5["__chunk_62640"] = (e, t, r) => { + "use strict"; + r.d(t, { dO: () => x, Vm: () => _, $s: () => g, Zm: () => m, G7: () => k, Pr: () => E, _B: () => v, zl: () => p, i6: () => S }); + var n = r(35971), i = r(50189); + let s = Symbol.for("drizzle:isPgEnum"); + class a extends i.b1 { + static [n.Q] = "PgEnumColumnBuilder"; + constructor(e2, t2) { + super(e2, "string", "PgEnumColumn"), this.config.enum = t2; + } + build(e2) { + return new o(e2, this.config); + } + } + class o extends i.df { + static [n.Q] = "PgEnumColumn"; + enum = this.config.enum; + enumValues = this.config.enum.enumValues; + constructor(e2, t2) { + super(e2, t2), this.enum = t2.enum; + } + getSQLType() { + return this.enum.enumName; + } + } + var l = r(75360), c = r(42712), u = r(6161), d = r(97014), h = r(84335); + class f { + static [n.Q] = null; + } + function p(e2) { + return null != e2 && "function" == typeof e2.getSQL; + } + class m { + static [n.Q] = "StringChunk"; + value; + constructor(e2) { + this.value = Array.isArray(e2) ? e2 : [e2]; + } + getSQL() { + return new g([this]); + } + } + class g { + constructor(e2) { + this.queryChunks = e2; + } + static [n.Q] = "SQL"; + decoder = b; + shouldInlineParams = false; + append(e2) { + return this.queryChunks.push(...e2.queryChunks), this; + } + toQuery(e2) { + return c.Z.startActiveSpan("drizzle.buildSQL", (t2) => { + let r2 = this.buildQueryFromSourceParams(this.queryChunks, e2); + return t2?.setAttributes({ "drizzle.query.text": r2.sql, "drizzle.query.params": JSON.stringify(r2.params) }), r2; + }); + } + buildQueryFromSourceParams(e2, t2) { + let r2 = Object.assign({}, t2, { inlineParams: t2.inlineParams || this.shouldInlineParams, paramStartIndex: t2.paramStartIndex || { value: 0 } }), { casing: i2, escapeName: a2, escapeParam: o2, prepareTyping: c2, inlineParams: f2, paramStartIndex: v2 } = r2; + return function(e3) { + let t3 = { sql: "", params: [] }; + for (let r3 of e3) + t3.sql += r3.sql, t3.params.push(...r3.params), r3.typings?.length && (t3.typings || (t3.typings = []), t3.typings.push(...r3.typings)); + return t3; + }(e2.map((e3) => { + if ((0, n.is)(e3, m)) + return { sql: e3.value.join(""), params: [] }; + if ((0, n.is)(e3, y)) + return { sql: a2(e3.value), params: [] }; + if (void 0 === e3) + return { sql: "", params: [] }; + if (Array.isArray(e3)) { + let t3 = [new m("(")]; + for (let [r3, n2] of e3.entries()) + t3.push(n2), r3 < e3.length - 1 && t3.push(new m(", ")); + return t3.push(new m(")")), this.buildQueryFromSourceParams(t3, r2); + } + if ((0, n.is)(e3, g)) + return this.buildQueryFromSourceParams(e3.queryChunks, { ...r2, inlineParams: f2 || e3.shouldInlineParams }); + if ((0, n.is)(e3, h.iA)) { + let t3 = e3[h.iA.Symbol.Schema], r3 = e3[h.iA.Symbol.Name]; + return { sql: void 0 === t3 ? a2(r3) : a2(t3) + "." + a2(r3), params: [] }; + } + if ((0, n.is)(e3, d.s)) { + let r3 = i2.getColumnCasing(e3); + return "indexes" === t2.invokeSource ? { sql: a2(r3), params: [] } : { sql: a2(e3.table[h.iA.Symbol.Name]) + "." + a2(r3), params: [] }; + } + if ((0, n.is)(e3, k)) { + let t3 = e3[u.d].schema, r3 = e3[u.d].name; + return { sql: void 0 === t3 ? a2(r3) : a2(t3) + "." + a2(r3), params: [] }; + } + if ((0, n.is)(e3, x)) { + if ((0, n.is)(e3.value, _)) + return { sql: o2(v2.value++, e3), params: [e3], typings: ["none"] }; + let t3 = null === e3.value ? null : e3.encoder.mapToDriverValue(e3.value); + if ((0, n.is)(t3, g)) + return this.buildQueryFromSourceParams([t3], r2); + if (f2) + return { sql: this.mapInlineParam(t3, r2), params: [] }; + let i3 = ["none"]; + return c2 && (i3 = [c2(e3.encoder)]), { sql: o2(v2.value++, t3), params: [t3], typings: i3 }; + } + return (0, n.is)(e3, _) ? { sql: o2(v2.value++, e3), params: [e3], typings: ["none"] } : (0, n.is)(e3, g.Aliased) && void 0 !== e3.fieldAlias ? { sql: a2(e3.fieldAlias), params: [] } : (0, n.is)(e3, l.k) ? e3._.isWith ? { sql: a2(e3._.alias), params: [] } : this.buildQueryFromSourceParams([new m("("), e3._.sql, new m(") "), new y(e3._.alias)], r2) : e3 && "function" == typeof e3 && s in e3 && true === e3[s] ? e3.schema ? { sql: a2(e3.schema) + "." + a2(e3.enumName), params: [] } : { sql: a2(e3.enumName), params: [] } : p(e3) ? e3.shouldOmitSQLParens?.() ? this.buildQueryFromSourceParams([e3.getSQL()], r2) : this.buildQueryFromSourceParams([new m("("), e3.getSQL(), new m(")")], r2) : f2 ? { sql: this.mapInlineParam(e3, r2), params: [] } : { sql: o2(v2.value++, e3), params: [e3], typings: ["none"] }; + })); + } + mapInlineParam(e2, { escapeString: t2 }) { + if (null === e2) + return "null"; + if ("number" == typeof e2 || "boolean" == typeof e2) + return e2.toString(); + if ("string" == typeof e2) + return t2(e2); + if ("object" == typeof e2) { + let r2 = e2.toString(); + return "[object Object]" === r2 ? t2(JSON.stringify(e2)) : t2(r2); + } + throw Error("Unexpected param value: " + e2); + } + getSQL() { + return this; + } + as(e2) { + return void 0 === e2 ? this : new g.Aliased(this, e2); + } + mapWith(e2) { + return this.decoder = "function" == typeof e2 ? { mapFromDriverValue: e2 } : e2, this; + } + inlineParams() { + return this.shouldInlineParams = true, this; + } + if(e2) { + return e2 ? this : void 0; + } + } + class y { + constructor(e2) { + this.value = e2; + } + static [n.Q] = "Name"; + brand; + getSQL() { + return new g([this]); + } + } + function v(e2) { + return "object" == typeof e2 && null !== e2 && "mapToDriverValue" in e2 && "function" == typeof e2.mapToDriverValue; + } + let b = { mapFromDriverValue: (e2) => e2 }, w = { mapToDriverValue: (e2) => e2 }; + ({ ...b, ...w }); + class x { + constructor(e2, t2 = w) { + this.value = e2, this.encoder = t2; + } + static [n.Q] = "Param"; + brand; + getSQL() { + return new g([this]); + } + } + function S(e2, ...t2) { + let r2 = []; + for (let [n2, i2] of ((t2.length > 0 || e2.length > 0 && "" !== e2[0]) && r2.push(new m(e2[0])), t2.entries())) + r2.push(i2, new m(e2[n2 + 1])); + return new g(r2); + } + ((e2) => { + e2.empty = function() { + return new g([]); + }, e2.fromList = function(e3) { + return new g(e3); + }, e2.raw = function(e3) { + return new g([new m(e3)]); + }, e2.join = function(e3, t2) { + let r2 = []; + for (let [n2, i2] of e3.entries()) + n2 > 0 && void 0 !== t2 && r2.push(t2), r2.push(i2); + return new g(r2); + }, e2.identifier = function(e3) { + return new y(e3); + }, e2.placeholder = function(e3) { + return new _(e3); + }, e2.param = function(e3, t2) { + return new x(e3, t2); + }; + })(S || (S = {})), ((e2) => { + class t2 { + constructor(e3, t3) { + this.sql = e3, this.fieldAlias = t3; + } + static [n.Q] = "SQL.Aliased"; + isSelectionField = false; + getSQL() { + return this.sql; + } + clone() { + return new t2(this.sql, this.fieldAlias); + } + } + e2.Aliased = t2; + })(g || (g = {})); + class _ { + constructor(e2) { + this.name = e2; + } + static [n.Q] = "Placeholder"; + getSQL() { + return new g([this]); + } + } + function E(e2, t2) { + return e2.map((e3) => { + if ((0, n.is)(e3, _)) { + if (!(e3.name in t2)) + throw Error(`No value for placeholder "${e3.name}" was provided`); + return t2[e3.name]; + } + if ((0, n.is)(e3, x) && (0, n.is)(e3.value, _)) { + if (!(e3.value.name in t2)) + throw Error(`No value for placeholder "${e3.value.name}" was provided`); + return e3.encoder.mapToDriverValue(t2[e3.value.name]); + } + return e3; + }); + } + class k { + static [n.Q] = "View"; + [u.d]; + constructor({ name: e2, schema: t2, selectedFields: r2, query: n2 }) { + this[u.d] = { name: e2, originalName: e2, schema: t2, selectedFields: r2, query: n2, isExisting: !n2, isAlias: false }; + } + getSQL() { + return new g([this]); + } + } + d.s.prototype.getSQL = function() { + return new g([this]); + }, h.iA.prototype.getSQL = function() { + return new g([this]); + }, l.k.prototype.getSQL = function() { + return new g([this]); + }; + }; + __namedExportsObject5["__chunk_33920"] = (e, t, r) => { + "use strict"; + r.d(t, { Ft: () => b, G: () => g, Gg: () => x, K0: () => w, Nl: () => v, OL: () => E, Qg: () => C, UN: () => S, d3: () => y, eg: () => p, eq: () => l, ff: () => h, gt: () => f, lt: () => m, mM: () => P, ne: () => c, o$: () => R, or: () => d, vL: () => k, vX: () => _, xD: () => u }); + var n = r(97014), i = r(35971), s = r(84335), a = r(62640); + function o(e2, t2) { + return !(0, a._B)(t2) || (0, a.zl)(e2) || (0, i.is)(e2, a.dO) || (0, i.is)(e2, a.Vm) || (0, i.is)(e2, n.s) || (0, i.is)(e2, s.iA) || (0, i.is)(e2, a.G7) ? e2 : new a.dO(e2, t2); + } + let l = (e2, t2) => (0, a.i6)`${e2} = ${o(t2, e2)}`, c = (e2, t2) => (0, a.i6)`${e2} <> ${o(t2, e2)}`; + function u(...e2) { + let t2 = e2.filter((e3) => void 0 !== e3); + return 0 === t2.length ? void 0 : new a.$s(1 === t2.length ? t2 : [new a.Zm("("), a.i6.join(t2, new a.Zm(" and ")), new a.Zm(")")]); + } + function d(...e2) { + let t2 = e2.filter((e3) => void 0 !== e3); + return 0 === t2.length ? void 0 : new a.$s(1 === t2.length ? t2 : [new a.Zm("("), a.i6.join(t2, new a.Zm(" or ")), new a.Zm(")")]); + } + function h(e2) { + return (0, a.i6)`not ${e2}`; + } + let f = (e2, t2) => (0, a.i6)`${e2} > ${o(t2, e2)}`, p = (e2, t2) => (0, a.i6)`${e2} >= ${o(t2, e2)}`, m = (e2, t2) => (0, a.i6)`${e2} < ${o(t2, e2)}`, g = (e2, t2) => (0, a.i6)`${e2} <= ${o(t2, e2)}`; + function y(e2, t2) { + return Array.isArray(t2) ? 0 === t2.length ? (0, a.i6)`false` : (0, a.i6)`${e2} in ${t2.map((t3) => o(t3, e2))}` : (0, a.i6)`${e2} in ${o(t2, e2)}`; + } + function v(e2, t2) { + return Array.isArray(t2) ? 0 === t2.length ? (0, a.i6)`true` : (0, a.i6)`${e2} not in ${t2.map((t3) => o(t3, e2))}` : (0, a.i6)`${e2} not in ${o(t2, e2)}`; + } + function b(e2) { + return (0, a.i6)`${e2} is null`; + } + function w(e2) { + return (0, a.i6)`${e2} is not null`; + } + function x(e2) { + return (0, a.i6)`exists ${e2}`; + } + function S(e2) { + return (0, a.i6)`not exists ${e2}`; + } + function _(e2, t2, r2) { + return (0, a.i6)`${e2} between ${o(t2, e2)} and ${o(r2, e2)}`; + } + function E(e2, t2, r2) { + return (0, a.i6)`${e2} not between ${o(t2, e2)} and ${o(r2, e2)}`; + } + function k(e2, t2) { + return (0, a.i6)`${e2} like ${t2}`; + } + function C(e2, t2) { + return (0, a.i6)`${e2} not like ${t2}`; + } + function R(e2, t2) { + return (0, a.i6)`${e2} ilike ${t2}`; + } + function P(e2, t2) { + return (0, a.i6)`${e2} not ilike ${t2}`; + } + }; + __namedExportsObject5["__chunk_75389"] = (e, t, r) => { + "use strict"; + r.d(t, { sj: () => g, fh: () => m, _J: () => S, pb: () => b, vU: () => y, pl: () => v, WX: () => function e2(t2, r2, n2, a2, o2 = (e3) => e3) { + let l2 = {}; + for (let [c2, d2] of a2.entries()) + if (d2.isJson) { + let i2 = r2.relations[d2.tsKey], a3 = n2[c2], u2 = "string" == typeof a3 ? JSON.parse(a3) : a3; + l2[d2.tsKey] = (0, s.is)(i2, m) ? u2 && e2(t2, t2[d2.relationTableTsKey], u2, d2.selection, o2) : u2.map((r3) => e2(t2, t2[d2.relationTableTsKey], r3, d2.selection, o2)); + } else { + let e3; + let t3 = o2(n2[c2]), r3 = d2.field; + e3 = (0, s.is)(r3, i.s) ? r3 : (0, s.is)(r3, u.$s) ? r3.decoder : r3.sql.decoder, l2[d2.tsKey] = null === t3 ? null : e3.mapFromDriverValue(t3); + } + return l2; + }, wG: () => x, lE: () => w }); + var n = r(84335), i = r(97014), s = r(35971), a = r(11445); + class o { + static [s.Q] = "PgPrimaryKeyBuilder"; + columns; + name; + constructor(e2, t2) { + this.columns = e2, this.name = t2; + } + build(e2) { + return new l(e2, this.columns, this.name); + } + } + class l { + constructor(e2, t2, r2) { + this.table = e2, this.columns = t2, this.name = r2; + } + static [s.Q] = "PgPrimaryKey"; + columns; + name; + getName() { + return this.name ?? `${this.table[a.YA.Symbol.Name]}_${this.columns.map((e2) => e2.name).join("_")}_pk`; + } + } + var c = r(33920), u = r(62640); + function d(e2) { + return (0, u.i6)`${e2} asc`; + } + function h(e2) { + return (0, u.i6)`${e2} desc`; + } + class f { + constructor(e2, t2, r2) { + this.sourceTable = e2, this.referencedTable = t2, this.relationName = r2, this.referencedTableName = t2[n.iA.Symbol.Name]; + } + static [s.Q] = "Relation"; + referencedTableName; + fieldName; + } + class p { + constructor(e2, t2) { + this.table = e2, this.config = t2; + } + static [s.Q] = "Relations"; + } + class m extends f { + constructor(e2, t2, r2, n2) { + super(e2, t2, r2?.relationName), this.config = r2, this.isNullable = n2; + } + static [s.Q] = "One"; + withFieldName(e2) { + let t2 = new m(this.sourceTable, this.referencedTable, this.config, this.isNullable); + return t2.fieldName = e2, t2; + } + } + class g extends f { + constructor(e2, t2, r2) { + super(e2, t2, r2?.relationName), this.config = r2; + } + static [s.Q] = "Many"; + withFieldName(e2) { + let t2 = new g(this.sourceTable, this.referencedTable, this.config); + return t2.fieldName = e2, t2; + } + } + function y() { + return { and: c.xD, between: c.vX, eq: c.eq, exists: c.Gg, gt: c.gt, gte: c.eg, ilike: c.o$, inArray: c.d3, isNull: c.Ft, isNotNull: c.K0, like: c.vL, lt: c.lt, lte: c.G, ne: c.ne, not: c.ff, notBetween: c.OL, notExists: c.UN, notLike: c.Qg, notIlike: c.mM, notInArray: c.Nl, or: c.or, sql: u.i6 }; + } + function v() { + return { sql: u.i6, asc: d, desc: h }; + } + function b(e2, t2) { + 1 === Object.keys(e2).length && "default" in e2 && !(0, s.is)(e2.default, n.iA) && (e2 = e2.default); + let r2 = {}, i2 = {}, a2 = {}; + for (let [l2, c2] of Object.entries(e2)) + if ((0, s.is)(c2, n.iA)) { + let e3 = (0, n.Q0)(c2), t3 = i2[e3]; + for (let i3 of (r2[e3] = l2, a2[l2] = { tsName: l2, dbName: c2[n.iA.Symbol.Name], schema: c2[n.iA.Symbol.Schema], columns: c2[n.iA.Symbol.Columns], relations: t3?.relations ?? {}, primaryKey: t3?.primaryKey ?? [] }, Object.values(c2[n.iA.Symbol.Columns]))) + i3.primary && a2[l2].primaryKey.push(i3); + let u2 = c2[n.iA.Symbol.ExtraConfigBuilder]?.(c2[n.iA.Symbol.ExtraConfigColumns]); + if (u2) + for (let e4 of Object.values(u2)) + (0, s.is)(e4, o) && a2[l2].primaryKey.push(...e4.columns); + } else if ((0, s.is)(c2, p)) { + let e3; + let s2 = (0, n.Q0)(c2.table), o2 = r2[s2]; + for (let [r3, n2] of Object.entries(c2.config(t2(c2.table)))) + if (o2) { + let t3 = a2[o2]; + t3.relations[r3] = n2, e3 && t3.primaryKey.push(...e3); + } else + s2 in i2 || (i2[s2] = { relations: {}, primaryKey: e3 }), i2[s2].relations[r3] = n2; + } + return { tables: a2, tableNamesMap: r2 }; + } + function w(e2, t2) { + return new p(e2, (e3) => Object.fromEntries(Object.entries(t2(e3)).map(([e4, t3]) => [e4, t3.withFieldName(e4)]))); + } + function x(e2, t2, r2) { + if ((0, s.is)(r2, m) && r2.config) + return { fields: r2.config.fields, references: r2.config.references }; + let i2 = t2[(0, n.Q0)(r2.referencedTable)]; + if (!i2) + throw Error(`Table "${r2.referencedTable[n.iA.Symbol.Name]}" not found in schema`); + let a2 = e2[i2]; + if (!a2) + throw Error(`Table "${i2}" not found in schema`); + let o2 = r2.sourceTable, l2 = t2[(0, n.Q0)(o2)]; + if (!l2) + throw Error(`Table "${o2[n.iA.Symbol.Name]}" not found in schema`); + let c2 = []; + for (let e3 of Object.values(a2.relations)) + (r2.relationName && r2 !== e3 && e3.relationName === r2.relationName || !r2.relationName && e3.referencedTable === r2.sourceTable) && c2.push(e3); + if (c2.length > 1) + throw r2.relationName ? Error(`There are multiple relations with name "${r2.relationName}" in table "${i2}"`) : Error(`There are multiple relations between "${i2}" and "${r2.sourceTable[n.iA.Symbol.Name]}". Please specify relation name`); + if (c2[0] && (0, s.is)(c2[0], m) && c2[0].config) + return { fields: c2[0].config.references, references: c2[0].config.fields }; + throw Error(`There is not enough information to infer relation "${l2}.${r2.fieldName}"`); + } + function S(e2) { + return { one: function(t2, r2) { + return new m(e2, t2, r2, r2?.fields.reduce((e3, t3) => e3 && t3.notNull, true) ?? false); + }, many: function(t2, r2) { + return new g(e2, t2, r2); + } }; + } + }; + __namedExportsObject5["__chunk_11445"] = (e, t, r) => { + "use strict"; + r.d(t, { YA: () => eU, af: () => eq }); + var n = r(35971), i = r(84335), s = r(77915), a = r(50189), o = r(72986); + class l extends o.O { + static [n.Q] = "PgBigInt53Builder"; + constructor(e2) { + super(e2, "number", "PgBigInt53"); + } + build(e2) { + return new c(e2, this.config); + } + } + class c extends a.df { + static [n.Q] = "PgBigInt53"; + getSQLType() { + return "bigint"; + } + mapFromDriverValue(e2) { + return "number" == typeof e2 ? e2 : Number(e2); + } + } + class u extends o.O { + static [n.Q] = "PgBigInt64Builder"; + constructor(e2) { + super(e2, "bigint", "PgBigInt64"); + } + build(e2) { + return new d(e2, this.config); + } + } + class d extends a.df { + static [n.Q] = "PgBigInt64"; + getSQLType() { + return "bigint"; + } + mapFromDriverValue(e2) { + return BigInt(e2); + } + } + function h(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return "number" === n2.mode ? new l(r2) : new u(r2); + } + class f extends a.b1 { + static [n.Q] = "PgBigSerial53Builder"; + constructor(e2) { + super(e2, "number", "PgBigSerial53"), this.config.hasDefault = true, this.config.notNull = true; + } + build(e2) { + return new p(e2, this.config); + } + } + class p extends a.df { + static [n.Q] = "PgBigSerial53"; + getSQLType() { + return "bigserial"; + } + mapFromDriverValue(e2) { + return "number" == typeof e2 ? e2 : Number(e2); + } + } + class m extends a.b1 { + static [n.Q] = "PgBigSerial64Builder"; + constructor(e2) { + super(e2, "bigint", "PgBigSerial64"), this.config.hasDefault = true; + } + build(e2) { + return new g(e2, this.config); + } + } + class g extends a.df { + static [n.Q] = "PgBigSerial64"; + getSQLType() { + return "bigserial"; + } + mapFromDriverValue(e2) { + return BigInt(e2); + } + } + function y(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return "number" === n2.mode ? new f(r2) : new m(r2); + } + class v extends a.b1 { + static [n.Q] = "PgBooleanBuilder"; + constructor(e2) { + super(e2, "boolean", "PgBoolean"); + } + build(e2) { + return new b(e2, this.config); + } + } + class b extends a.df { + static [n.Q] = "PgBoolean"; + getSQLType() { + return "boolean"; + } + } + function w(e2) { + return new v(e2 ?? ""); + } + class x extends a.b1 { + static [n.Q] = "PgCharBuilder"; + constructor(e2, t2) { + super(e2, "string", "PgChar"), this.config.length = t2.length, this.config.enumValues = t2.enum; + } + build(e2) { + return new S(e2, this.config); + } + } + class S extends a.df { + static [n.Q] = "PgChar"; + length = this.config.length; + enumValues = this.config.enumValues; + getSQLType() { + return void 0 === this.length ? "char" : `char(${this.length})`; + } + } + function _(e2, t2 = {}) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return new x(r2, n2); + } + class E extends a.b1 { + static [n.Q] = "PgCidrBuilder"; + constructor(e2) { + super(e2, "string", "PgCidr"); + } + build(e2) { + return new k(e2, this.config); + } + } + class k extends a.df { + static [n.Q] = "PgCidr"; + getSQLType() { + return "cidr"; + } + } + function C(e2) { + return new E(e2 ?? ""); + } + class R extends a.b1 { + static [n.Q] = "PgCustomColumnBuilder"; + constructor(e2, t2, r2) { + super(e2, "custom", "PgCustomColumn"), this.config.fieldConfig = t2, this.config.customTypeParams = r2; + } + build(e2) { + return new P(e2, this.config); + } + } + class P extends a.df { + static [n.Q] = "PgCustomColumn"; + sqlName; + mapTo; + mapFrom; + constructor(e2, t2) { + super(e2, t2), this.sqlName = t2.customTypeParams.dataType(t2.fieldConfig), this.mapTo = t2.customTypeParams.toDriver, this.mapFrom = t2.customTypeParams.fromDriver; + } + getSQLType() { + return this.sqlName; + } + mapFromDriverValue(e2) { + return "function" == typeof this.mapFrom ? this.mapFrom(e2) : e2; + } + mapToDriverValue(e2) { + return "function" == typeof this.mapTo ? this.mapTo(e2) : e2; + } + } + function T(e2) { + return (t2, r2) => { + let { name: n2, config: i2 } = (0, s.An)(t2, r2); + return new R(n2, i2, e2); + }; + } + var A = r(93594); + class O extends a.b1 { + static [n.Q] = "PgDoublePrecisionBuilder"; + constructor(e2) { + super(e2, "number", "PgDoublePrecision"); + } + build(e2) { + return new I(e2, this.config); + } + } + class I extends a.df { + static [n.Q] = "PgDoublePrecision"; + getSQLType() { + return "double precision"; + } + mapFromDriverValue(e2) { + return "string" == typeof e2 ? Number.parseFloat(e2) : e2; + } + } + function N(e2) { + return new O(e2 ?? ""); + } + class M extends a.b1 { + static [n.Q] = "PgInetBuilder"; + constructor(e2) { + super(e2, "string", "PgInet"); + } + build(e2) { + return new $(e2, this.config); + } + } + class $ extends a.df { + static [n.Q] = "PgInet"; + getSQLType() { + return "inet"; + } + } + function L(e2) { + return new M(e2 ?? ""); + } + var j = r(37957); + class D extends a.b1 { + static [n.Q] = "PgIntervalBuilder"; + constructor(e2, t2) { + super(e2, "string", "PgInterval"), this.config.intervalConfig = t2; + } + build(e2) { + return new F(e2, this.config); + } + } + class F extends a.df { + static [n.Q] = "PgInterval"; + fields = this.config.intervalConfig.fields; + precision = this.config.intervalConfig.precision; + getSQLType() { + let e2 = this.fields ? ` ${this.fields}` : "", t2 = this.precision ? `(${this.precision})` : ""; + return `interval${e2}${t2}`; + } + } + function B(e2, t2 = {}) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return new D(r2, n2); + } + var U = r(12837), q = r(32750); + class z extends a.b1 { + static [n.Q] = "PgLineBuilder"; + constructor(e2) { + super(e2, "array", "PgLine"); + } + build(e2) { + return new H(e2, this.config); + } + } + class H extends a.df { + static [n.Q] = "PgLine"; + getSQLType() { + return "line"; + } + mapFromDriverValue(e2) { + let [t2, r2, n2] = e2.slice(1, -1).split(","); + return [Number.parseFloat(t2), Number.parseFloat(r2), Number.parseFloat(n2)]; + } + mapToDriverValue(e2) { + return `{${e2[0]},${e2[1]},${e2[2]}}`; + } + } + class W extends a.b1 { + static [n.Q] = "PgLineABCBuilder"; + constructor(e2) { + super(e2, "json", "PgLineABC"); + } + build(e2) { + return new Q(e2, this.config); + } + } + class Q extends a.df { + static [n.Q] = "PgLineABC"; + getSQLType() { + return "line"; + } + mapFromDriverValue(e2) { + let [t2, r2, n2] = e2.slice(1, -1).split(","); + return { a: Number.parseFloat(t2), b: Number.parseFloat(r2), c: Number.parseFloat(n2) }; + } + mapToDriverValue(e2) { + return `{${e2.a},${e2.b},${e2.c}}`; + } + } + function V(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return n2?.mode && "tuple" !== n2.mode ? new W(r2) : new z(r2); + } + class G extends a.b1 { + static [n.Q] = "PgMacaddrBuilder"; + constructor(e2) { + super(e2, "string", "PgMacaddr"); + } + build(e2) { + return new Z(e2, this.config); + } + } + class Z extends a.df { + static [n.Q] = "PgMacaddr"; + getSQLType() { + return "macaddr"; + } + } + function K(e2) { + return new G(e2 ?? ""); + } + class J extends a.b1 { + static [n.Q] = "PgMacaddr8Builder"; + constructor(e2) { + super(e2, "string", "PgMacaddr8"); + } + build(e2) { + return new Y(e2, this.config); + } + } + class Y extends a.df { + static [n.Q] = "PgMacaddr8"; + getSQLType() { + return "macaddr8"; + } + } + function X(e2) { + return new J(e2 ?? ""); + } + var ee = r(82806); + class et extends a.b1 { + static [n.Q] = "PgPointTupleBuilder"; + constructor(e2) { + super(e2, "array", "PgPointTuple"); + } + build(e2) { + return new er(e2, this.config); + } + } + class er extends a.df { + static [n.Q] = "PgPointTuple"; + getSQLType() { + return "point"; + } + mapFromDriverValue(e2) { + if ("string" == typeof e2) { + let [t2, r2] = e2.slice(1, -1).split(","); + return [Number.parseFloat(t2), Number.parseFloat(r2)]; + } + return [e2.x, e2.y]; + } + mapToDriverValue(e2) { + return `(${e2[0]},${e2[1]})`; + } + } + class en extends a.b1 { + static [n.Q] = "PgPointObjectBuilder"; + constructor(e2) { + super(e2, "json", "PgPointObject"); + } + build(e2) { + return new ei(e2, this.config); + } + } + class ei extends a.df { + static [n.Q] = "PgPointObject"; + getSQLType() { + return "point"; + } + mapFromDriverValue(e2) { + if ("string" == typeof e2) { + let [t2, r2] = e2.slice(1, -1).split(","); + return { x: Number.parseFloat(t2), y: Number.parseFloat(r2) }; + } + return e2; + } + mapToDriverValue(e2) { + return `(${e2.x},${e2.y})`; + } + } + function es(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return n2?.mode && "tuple" !== n2.mode ? new en(r2) : new et(r2); + } + function ea(e2, t2) { + let r2 = new DataView(new ArrayBuffer(8)); + for (let n2 = 0; n2 < 8; n2++) + r2.setUint8(n2, e2[t2 + n2]); + return r2.getFloat64(0, true); + } + function eo(e2) { + let t2 = function(e3) { + let t3 = []; + for (let r3 = 0; r3 < e3.length; r3 += 2) + t3.push(Number.parseInt(e3.slice(r3, r3 + 2), 16)); + return new Uint8Array(t3); + }(e2), r2 = 0, n2 = t2[0]; + r2 += 1; + let i2 = new DataView(t2.buffer), s2 = i2.getUint32(r2, 1 === n2); + if (r2 += 4, 536870912 & s2 && (i2.getUint32(r2, 1 === n2), r2 += 4), (65535 & s2) == 1) { + let e3 = ea(t2, r2), n3 = ea(t2, r2 += 8); + return r2 += 8, [e3, n3]; + } + throw Error("Unsupported geometry type"); + } + class el extends a.b1 { + static [n.Q] = "PgGeometryBuilder"; + constructor(e2) { + super(e2, "array", "PgGeometry"); + } + build(e2) { + return new ec(e2, this.config); + } + } + class ec extends a.df { + static [n.Q] = "PgGeometry"; + getSQLType() { + return "geometry(point)"; + } + mapFromDriverValue(e2) { + return eo(e2); + } + mapToDriverValue(e2) { + return `point(${e2[0]} ${e2[1]})`; + } + } + class eu extends a.b1 { + static [n.Q] = "PgGeometryObjectBuilder"; + constructor(e2) { + super(e2, "json", "PgGeometryObject"); + } + build(e2) { + return new ed(e2, this.config); + } + } + class ed extends a.df { + static [n.Q] = "PgGeometryObject"; + getSQLType() { + return "geometry(point)"; + } + mapFromDriverValue(e2) { + let t2 = eo(e2); + return { x: t2[0], y: t2[1] }; + } + mapToDriverValue(e2) { + return `point(${e2.x} ${e2.y})`; + } + } + function eh(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return n2?.mode && "tuple" !== n2.mode ? new eu(r2) : new el(r2); + } + class ef extends a.b1 { + static [n.Q] = "PgRealBuilder"; + constructor(e2, t2) { + super(e2, "number", "PgReal"), this.config.length = t2; + } + build(e2) { + return new ep(e2, this.config); + } + } + class ep extends a.df { + static [n.Q] = "PgReal"; + constructor(e2, t2) { + super(e2, t2); + } + getSQLType() { + return "real"; + } + mapFromDriverValue = (e2) => "string" == typeof e2 ? Number.parseFloat(e2) : e2; + } + function em(e2) { + return new ef(e2 ?? ""); + } + var eg = r(9070); + class ey extends o.O { + static [n.Q] = "PgSmallIntBuilder"; + constructor(e2) { + super(e2, "number", "PgSmallInt"); + } + build(e2) { + return new ev(e2, this.config); + } + } + class ev extends a.df { + static [n.Q] = "PgSmallInt"; + getSQLType() { + return "smallint"; + } + mapFromDriverValue = (e2) => "string" == typeof e2 ? Number(e2) : e2; + } + function eb(e2) { + return new ey(e2 ?? ""); + } + class ew extends a.b1 { + static [n.Q] = "PgSmallSerialBuilder"; + constructor(e2) { + super(e2, "number", "PgSmallSerial"), this.config.hasDefault = true, this.config.notNull = true; + } + build(e2) { + return new ex(e2, this.config); + } + } + class ex extends a.df { + static [n.Q] = "PgSmallSerial"; + getSQLType() { + return "smallserial"; + } + } + function eS(e2) { + return new ew(e2 ?? ""); + } + var e_ = r(33617), eE = r(86902), ek = r(27442), eC = r(75713), eR = r(99076); + class eP extends a.b1 { + static [n.Q] = "PgBinaryVectorBuilder"; + constructor(e2, t2) { + super(e2, "string", "PgBinaryVector"), this.config.dimensions = t2.dimensions; + } + build(e2) { + return new eT(e2, this.config); + } + } + class eT extends a.df { + static [n.Q] = "PgBinaryVector"; + dimensions = this.config.dimensions; + getSQLType() { + return `bit(${this.dimensions})`; + } + } + function eA(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return new eP(r2, n2); + } + class eO extends a.b1 { + static [n.Q] = "PgHalfVectorBuilder"; + constructor(e2, t2) { + super(e2, "array", "PgHalfVector"), this.config.dimensions = t2.dimensions; + } + build(e2) { + return new eI(e2, this.config); + } + } + class eI extends a.df { + static [n.Q] = "PgHalfVector"; + dimensions = this.config.dimensions; + getSQLType() { + return `halfvec(${this.dimensions})`; + } + mapToDriverValue(e2) { + return JSON.stringify(e2); + } + mapFromDriverValue(e2) { + return e2.slice(1, -1).split(",").map((e3) => Number.parseFloat(e3)); + } + } + function eN(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return new eO(r2, n2); + } + class eM extends a.b1 { + static [n.Q] = "PgSparseVectorBuilder"; + constructor(e2, t2) { + super(e2, "string", "PgSparseVector"), this.config.dimensions = t2.dimensions; + } + build(e2) { + return new e$(e2, this.config); + } + } + class e$ extends a.df { + static [n.Q] = "PgSparseVector"; + dimensions = this.config.dimensions; + getSQLType() { + return `sparsevec(${this.dimensions})`; + } + } + function eL(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return new eM(r2, n2); + } + class ej extends a.b1 { + static [n.Q] = "PgVectorBuilder"; + constructor(e2, t2) { + super(e2, "array", "PgVector"), this.config.dimensions = t2.dimensions; + } + build(e2) { + return new eD(e2, this.config); + } + } + class eD extends a.df { + static [n.Q] = "PgVector"; + dimensions = this.config.dimensions; + getSQLType() { + return `vector(${this.dimensions})`; + } + mapToDriverValue(e2) { + return JSON.stringify(e2); + } + mapFromDriverValue(e2) { + return e2.slice(1, -1).split(",").map((e3) => Number.parseFloat(e3)); + } + } + function eF(e2, t2) { + let { name: r2, config: n2 } = (0, s.An)(e2, t2); + return new ej(r2, n2); + } + let eB = Symbol.for("drizzle:PgInlineForeignKeys"); + class eU extends i.iA { + static [n.Q] = "PgTable"; + static Symbol = Object.assign({}, i.iA.Symbol, { InlineForeignKeys: eB }); + [eB] = []; + [i.iA.Symbol.ExtraConfigBuilder] = void 0; + } + let eq = (e2, t2, r2) => function(e3, t3, r3, n2, s2 = e3) { + let a2 = new eU(e3, n2, s2), o2 = "function" == typeof t3 ? t3({ bigint: h, bigserial: y, boolean: w, char: _, cidr: C, customType: T, date: A.hT, doublePrecision: N, inet: L, integer: j._L, interval: B, json: U.AV, jsonb: q.JB, line: V, macaddr: K, macaddr8: X, numeric: ee.uR, point: es, geometry: eh, real: em, serial: eg.eP, smallint: eb, smallserial: eS, text: e_.fL, time: eE.XV, timestamp: ek.AB, uuid: eC.Vj, varchar: eR.L7, bit: eA, halfvec: eN, sparsevec: eL, vector: eF }) : t3, l2 = Object.fromEntries(Object.entries(o2).map(([e4, t4]) => { + t4.setName(e4); + let r4 = t4.build(a2); + return a2[eB].push(...t4.buildForeignKeys(r4, a2)), [e4, r4]; + })), c2 = Object.fromEntries(Object.entries(o2).map(([e4, t4]) => (t4.setName(e4), [e4, t4.buildExtraConfigColumn(a2)]))), u2 = Object.assign(a2, l2); + return u2[i.iA.Symbol.Columns] = l2, u2[i.iA.Symbol.ExtraConfigColumns] = c2, r3 && (u2[eU.Symbol.ExtraConfigBuilder] = r3), u2; + }(e2, t2, r2, void 0); + }; + __namedExportsObject5["__chunk_70129"] = (e, t, r) => { + "use strict"; + r.d(t, { Kz: () => c }); + var n = r(62640), i = r(35971), s = r(50189); + class a { + constructor(e2, t2) { + this.unique = e2, this.name = t2; + } + static [i.Q] = "PgIndexBuilderOn"; + on(...e2) { + return new o(e2.map((e3) => { + if ((0, i.is)(e3, n.$s)) + return e3; + let t2 = new s.pK(e3.name, !!e3.keyAsName, e3.columnType, e3.indexConfig); + return e3.indexConfig = JSON.parse(JSON.stringify(e3.defaultConfig)), t2; + }), this.unique, false, this.name); + } + onOnly(...e2) { + return new o(e2.map((e3) => { + if ((0, i.is)(e3, n.$s)) + return e3; + let t2 = new s.pK(e3.name, !!e3.keyAsName, e3.columnType, e3.indexConfig); + return e3.indexConfig = e3.defaultConfig, t2; + }), this.unique, true, this.name); + } + using(e2, ...t2) { + return new o(t2.map((e3) => { + if ((0, i.is)(e3, n.$s)) + return e3; + let t3 = new s.pK(e3.name, !!e3.keyAsName, e3.columnType, e3.indexConfig); + return e3.indexConfig = JSON.parse(JSON.stringify(e3.defaultConfig)), t3; + }), this.unique, true, this.name, e2); + } + } + class o { + static [i.Q] = "PgIndexBuilder"; + config; + constructor(e2, t2, r2, n2, i2 = "btree") { + this.config = { name: n2, columns: e2, unique: t2, only: r2, method: i2 }; + } + concurrently() { + return this.config.concurrently = true, this; + } + with(e2) { + return this.config.with = e2, this; + } + where(e2) { + return this.config.where = e2, this; + } + build(e2) { + return new l(this.config, e2); + } + } + class l { + static [i.Q] = "PgIndex"; + config; + constructor(e2, t2) { + this.config = { ...e2, table: t2 }; + } + } + function c(e2) { + return new a(false, e2); + } + }; + __namedExportsObject5["__chunk_99076"] = (e, t, r) => { + "use strict"; + r.d(t, { L7: () => l }); + var n = r(35971), i = r(77915), s = r(50189); + class a extends s.b1 { + static [n.Q] = "PgVarcharBuilder"; + constructor(e2, t2) { + super(e2, "string", "PgVarchar"), this.config.length = t2.length, this.config.enumValues = t2.enum; + } + build(e2) { + return new o(e2, this.config); + } + } + class o extends s.df { + static [n.Q] = "PgVarchar"; + length = this.config.length; + enumValues = this.config.enumValues; + getSQLType() { + return void 0 === this.length ? "varchar" : `varchar(${this.length})`; + } + } + function l(e2, t2 = {}) { + let { name: r2, config: n2 } = (0, i.An)(e2, t2); + return new a(r2, n2); + } + }; + __namedExportsObject5["__chunk_75713"] = (e, t, r) => { + "use strict"; + r.d(t, { RX: () => o, Vj: () => l }); + var n = r(35971), i = r(62640), s = r(50189); + class a extends s.b1 { + static [n.Q] = "PgUUIDBuilder"; + constructor(e2) { + super(e2, "string", "PgUUID"); + } + defaultRandom() { + return this.default((0, i.i6)`gen_random_uuid()`); + } + build(e2) { + return new o(e2, this.config); + } + } + class o extends s.df { + static [n.Q] = "PgUUID"; + getSQLType() { + return "uuid"; + } + } + function l(e2) { + return new a(e2 ?? ""); + } + }; + __namedExportsObject5["__chunk_27442"] = (e, t, r) => { + "use strict"; + r.d(t, { AB: () => d, bf: () => u, sC: () => l }); + var n = r(35971), i = r(77915), s = r(50189), a = r(5346); + class o extends a.M { + static [n.Q] = "PgTimestampBuilder"; + constructor(e2, t2, r2) { + super(e2, "date", "PgTimestamp"), this.config.withTimezone = t2, this.config.precision = r2; + } + build(e2) { + return new l(e2, this.config); + } + } + class l extends s.df { + static [n.Q] = "PgTimestamp"; + withTimezone; + precision; + constructor(e2, t2) { + super(e2, t2), this.withTimezone = t2.withTimezone, this.precision = t2.precision; + } + getSQLType() { + let e2 = void 0 === this.precision ? "" : ` (${this.precision})`; + return `timestamp${e2}${this.withTimezone ? " with time zone" : ""}`; + } + mapFromDriverValue = (e2) => new Date(this.withTimezone ? e2 : e2 + "+0000"); + mapToDriverValue = (e2) => e2.toISOString(); + } + class c extends a.M { + static [n.Q] = "PgTimestampStringBuilder"; + constructor(e2, t2, r2) { + super(e2, "string", "PgTimestampString"), this.config.withTimezone = t2, this.config.precision = r2; + } + build(e2) { + return new u(e2, this.config); + } + } + class u extends s.df { + static [n.Q] = "PgTimestampString"; + withTimezone; + precision; + constructor(e2, t2) { + super(e2, t2), this.withTimezone = t2.withTimezone, this.precision = t2.precision; + } + getSQLType() { + let e2 = void 0 === this.precision ? "" : `(${this.precision})`; + return `timestamp${e2}${this.withTimezone ? " with time zone" : ""}`; + } + } + function d(e2, t2 = {}) { + let { name: r2, config: n2 } = (0, i.An)(e2, t2); + return n2?.mode === "string" ? new c(r2, n2.withTimezone ?? false, n2.precision) : new o(r2, n2?.withTimezone ?? false, n2?.precision); + } + }; + __namedExportsObject5["__chunk_86902"] = (e, t, r) => { + "use strict"; + r.d(t, { XV: () => c, vu: () => l }); + var n = r(35971), i = r(77915), s = r(50189), a = r(5346); + class o extends a.M { + constructor(e2, t2, r2) { + super(e2, "string", "PgTime"), this.withTimezone = t2, this.precision = r2, this.config.withTimezone = t2, this.config.precision = r2; + } + static [n.Q] = "PgTimeBuilder"; + build(e2) { + return new l(e2, this.config); + } + } + class l extends s.df { + static [n.Q] = "PgTime"; + withTimezone; + precision; + constructor(e2, t2) { + super(e2, t2), this.withTimezone = t2.withTimezone, this.precision = t2.precision; + } + getSQLType() { + let e2 = void 0 === this.precision ? "" : `(${this.precision})`; + return `time${e2}${this.withTimezone ? " with time zone" : ""}`; + } + } + function c(e2, t2 = {}) { + let { name: r2, config: n2 } = (0, i.An)(e2, t2); + return new o(r2, n2.withTimezone ?? false, n2.precision); + } + }; + __namedExportsObject5["__chunk_33617"] = (e, t, r) => { + "use strict"; + r.d(t, { fL: () => l }); + var n = r(35971), i = r(77915), s = r(50189); + class a extends s.b1 { + static [n.Q] = "PgTextBuilder"; + constructor(e2, t2) { + super(e2, "string", "PgText"), this.config.enumValues = t2.enum; + } + build(e2) { + return new o(e2, this.config); + } + } + class o extends s.df { + static [n.Q] = "PgText"; + enumValues = this.config.enumValues; + getSQLType() { + return "text"; + } + } + function l(e2, t2 = {}) { + let { name: r2, config: n2 } = (0, i.An)(e2, t2); + return new a(r2, n2); + } + }; + __namedExportsObject5["__chunk_9070"] = (e, t, r) => { + "use strict"; + r.d(t, { eP: () => o }); + var n = r(35971), i = r(50189); + class s extends i.b1 { + static [n.Q] = "PgSerialBuilder"; + constructor(e2) { + super(e2, "number", "PgSerial"), this.config.hasDefault = true, this.config.notNull = true; + } + build(e2) { + return new a(e2, this.config); + } + } + class a extends i.df { + static [n.Q] = "PgSerial"; + getSQLType() { + return "serial"; + } + } + function o(e2) { + return new s(e2 ?? ""); + } + }; + __namedExportsObject5["__chunk_82806"] = (e, t, r) => { + "use strict"; + r.d(t, { OJ: () => o, uR: () => l }); + var n = r(35971), i = r(77915), s = r(50189); + class a extends s.b1 { + static [n.Q] = "PgNumericBuilder"; + constructor(e2, t2, r2) { + super(e2, "string", "PgNumeric"), this.config.precision = t2, this.config.scale = r2; + } + build(e2) { + return new o(e2, this.config); + } + } + class o extends s.df { + static [n.Q] = "PgNumeric"; + precision; + scale; + constructor(e2, t2) { + super(e2, t2), this.precision = t2.precision, this.scale = t2.scale; + } + getSQLType() { + return void 0 !== this.precision && void 0 !== this.scale ? `numeric(${this.precision}, ${this.scale})` : void 0 === this.precision ? "numeric" : `numeric(${this.precision})`; + } + } + function l(e2, t2) { + let { name: r2, config: n2 } = (0, i.An)(e2, t2); + return new a(r2, n2?.precision, n2?.scale); + } + }; + __namedExportsObject5["__chunk_32750"] = (e, t, r) => { + "use strict"; + r.d(t, { B2: () => a, JB: () => o }); + var n = r(35971), i = r(50189); + class s extends i.b1 { + static [n.Q] = "PgJsonbBuilder"; + constructor(e2) { + super(e2, "json", "PgJsonb"); + } + build(e2) { + return new a(e2, this.config); + } + } + class a extends i.df { + static [n.Q] = "PgJsonb"; + constructor(e2, t2) { + super(e2, t2); + } + getSQLType() { + return "jsonb"; + } + mapToDriverValue(e2) { + return JSON.stringify(e2); + } + mapFromDriverValue(e2) { + if ("string" == typeof e2) + try { + return JSON.parse(e2); + } catch { + } + return e2; + } + } + function o(e2) { + return new s(e2 ?? ""); + } + }; + __namedExportsObject5["__chunk_12837"] = (e, t, r) => { + "use strict"; + r.d(t, { AV: () => o, y2: () => a }); + var n = r(35971), i = r(50189); + class s extends i.b1 { + static [n.Q] = "PgJsonBuilder"; + constructor(e2) { + super(e2, "json", "PgJson"); + } + build(e2) { + return new a(e2, this.config); + } + } + class a extends i.df { + static [n.Q] = "PgJson"; + constructor(e2, t2) { + super(e2, t2); + } + getSQLType() { + return "json"; + } + mapToDriverValue(e2) { + return JSON.stringify(e2); + } + mapFromDriverValue(e2) { + if ("string" == typeof e2) + try { + return JSON.parse(e2); + } catch { + } + return e2; + } + } + function o(e2) { + return new s(e2 ?? ""); + } + }; + __namedExportsObject5["__chunk_37957"] = (e, t, r) => { + "use strict"; + r.d(t, { _L: () => l }); + var n = r(35971), i = r(50189), s = r(72986); + class a extends s.O { + static [n.Q] = "PgIntegerBuilder"; + constructor(e2) { + super(e2, "number", "PgInteger"); + } + build(e2) { + return new o(e2, this.config); + } + } + class o extends i.df { + static [n.Q] = "PgInteger"; + getSQLType() { + return "integer"; + } + mapFromDriverValue(e2) { + return "string" == typeof e2 ? Number.parseInt(e2) : e2; + } + } + function l(e2) { + return new a(e2 ?? ""); + } + }; + __namedExportsObject5["__chunk_72986"] = (e, t, r) => { + "use strict"; + r.d(t, { O: () => s }); + var n = r(35971), i = r(50189); + class s extends i.b1 { + static [n.Q] = "PgIntColumnBaseBuilder"; + generatedAlwaysAsIdentity(e2) { + if (e2) { + let { name: t2, ...r2 } = e2; + this.config.generatedIdentity = { type: "always", sequenceName: t2, sequenceOptions: r2 }; + } else + this.config.generatedIdentity = { type: "always" }; + return this.config.hasDefault = true, this.config.notNull = true, this; + } + generatedByDefaultAsIdentity(e2) { + if (e2) { + let { name: t2, ...r2 } = e2; + this.config.generatedIdentity = { type: "byDefault", sequenceName: t2, sequenceOptions: r2 }; + } else + this.config.generatedIdentity = { type: "byDefault" }; + return this.config.hasDefault = true, this.config.notNull = true, this; + } + } + }; + __namedExportsObject5["__chunk_93594"] = (e, t, r) => { + "use strict"; + r.d(t, { Ec: () => u, ch: () => l, hT: () => d }); + var n = r(35971), i = r(77915), s = r(50189), a = r(5346); + class o extends a.M { + static [n.Q] = "PgDateBuilder"; + constructor(e2) { + super(e2, "date", "PgDate"); + } + build(e2) { + return new l(e2, this.config); + } + } + class l extends s.df { + static [n.Q] = "PgDate"; + getSQLType() { + return "date"; + } + mapFromDriverValue(e2) { + return new Date(e2); + } + mapToDriverValue(e2) { + return e2.toISOString(); + } + } + class c extends a.M { + static [n.Q] = "PgDateStringBuilder"; + constructor(e2) { + super(e2, "string", "PgDateString"); + } + build(e2) { + return new u(e2, this.config); + } + } + class u extends s.df { + static [n.Q] = "PgDateString"; + getSQLType() { + return "date"; + } + } + function d(e2, t2) { + let { name: r2, config: n2 } = (0, i.An)(e2, t2); + return n2?.mode === "date" ? new o(r2) : new c(r2); + } + }; + __namedExportsObject5["__chunk_5346"] = (e, t, r) => { + "use strict"; + r.d(t, { M: () => a }); + var n = r(35971), i = r(62640), s = r(50189); + class a extends s.b1 { + static [n.Q] = "PgDateColumnBaseBuilder"; + defaultNow() { + return this.default((0, i.i6)`now()`); + } + } + }; + __namedExportsObject5["__chunk_50189"] = (e, t, r) => { + "use strict"; + r.d(t, { pK: () => v, df: () => g, b1: () => m }); + var n = r(35971); + class i { + static [n.Q] = "ColumnBuilder"; + config; + constructor(e2, t2, r2) { + this.config = { name: e2, keyAsName: "" === e2, notNull: false, default: void 0, hasDefault: false, primaryKey: false, isUnique: false, uniqueName: void 0, uniqueType: void 0, dataType: t2, columnType: r2, generated: void 0 }; + } + $type() { + return this; + } + notNull() { + return this.config.notNull = true, this; + } + default(e2) { + return this.config.default = e2, this.config.hasDefault = true, this; + } + $defaultFn(e2) { + return this.config.defaultFn = e2, this.config.hasDefault = true, this; + } + $default = this.$defaultFn; + $onUpdateFn(e2) { + return this.config.onUpdateFn = e2, this.config.hasDefault = true, this; + } + $onUpdate = this.$onUpdateFn; + primaryKey() { + return this.config.primaryKey = true, this.config.notNull = true, this; + } + setName(e2) { + "" === this.config.name && (this.config.name = e2); + } + } + var s = r(97014), a = r(41144); + class o { + static [n.Q] = "PgForeignKeyBuilder"; + reference; + _onUpdate = "no action"; + _onDelete = "no action"; + constructor(e2, t2) { + this.reference = () => { + let { name: t3, columns: r2, foreignColumns: n2 } = e2(); + return { name: t3, columns: r2, foreignTable: n2[0].table, foreignColumns: n2 }; + }, t2 && (this._onUpdate = t2.onUpdate, this._onDelete = t2.onDelete); + } + onUpdate(e2) { + return this._onUpdate = void 0 === e2 ? "no action" : e2, this; + } + onDelete(e2) { + return this._onDelete = void 0 === e2 ? "no action" : e2, this; + } + build(e2) { + return new l(e2, this); + } + } + class l { + constructor(e2, t2) { + this.table = e2, this.reference = t2.reference, this.onUpdate = t2._onUpdate, this.onDelete = t2._onDelete; + } + static [n.Q] = "PgForeignKey"; + reference; + onUpdate; + onDelete; + getName() { + let { name: e2, columns: t2, foreignColumns: r2 } = this.reference(), n2 = t2.map((e3) => e3.name), i2 = r2.map((e3) => e3.name), s2 = [this.table[a.m], ...n2, r2[0].table[a.m], ...i2]; + return e2 ?? `${s2.join("_")}_fk`; + } + } + var c = r(93239); + function u(e2, t2) { + return `${e2[a.m]}_${t2.join("_")}_unique`; + } + class d { + constructor(e2, t2) { + this.name = t2, this.columns = e2; + } + static [n.Q] = null; + columns; + nullsNotDistinctConfig = false; + nullsNotDistinct() { + return this.nullsNotDistinctConfig = true, this; + } + build(e2) { + return new f(e2, this.columns, this.nullsNotDistinctConfig, this.name); + } + } + class h { + static [n.Q] = null; + name; + constructor(e2) { + this.name = e2; + } + on(...e2) { + return new d(e2, this.name); + } + } + class f { + constructor(e2, t2, r2, n2) { + this.table = e2, this.columns = t2, this.name = n2 ?? u(this.table, this.columns.map((e3) => e3.name)), this.nullsNotDistinct = r2; + } + static [n.Q] = null; + columns; + name; + nullsNotDistinct = false; + getName() { + return this.name; + } + } + function p(e2, t2, r2) { + for (let n2 = t2; n2 < e2.length; n2++) { + let i2 = e2[n2]; + if ("\\" === i2) { + n2++; + continue; + } + if ('"' === i2) + return [e2.slice(t2, n2).replace(/\\/g, ""), n2 + 1]; + if (!r2 && ("," === i2 || "}" === i2)) + return [e2.slice(t2, n2).replace(/\\/g, ""), n2]; + } + return [e2.slice(t2).replace(/\\/g, ""), e2.length]; + } + class m extends i { + foreignKeyConfigs = []; + static [n.Q] = "PgColumnBuilder"; + array(e2) { + return new b(this.config.name, this, e2); + } + references(e2, t2 = {}) { + return this.foreignKeyConfigs.push({ ref: e2, actions: t2 }), this; + } + unique(e2, t2) { + return this.config.isUnique = true, this.config.uniqueName = e2, this.config.uniqueType = t2?.nulls, this; + } + generatedAlwaysAs(e2) { + return this.config.generated = { as: e2, type: "always", mode: "stored" }, this; + } + buildForeignKeys(e2, t2) { + return this.foreignKeyConfigs.map(({ ref: r2, actions: n2 }) => (0, c.t)((r3, n3) => { + let i2 = new o(() => ({ columns: [e2], foreignColumns: [r3()] })); + return n3.onUpdate && i2.onUpdate(n3.onUpdate), n3.onDelete && i2.onDelete(n3.onDelete), i2.build(t2); + }, r2, n2)); + } + buildExtraConfigColumn(e2) { + return new y(e2, this.config); + } + } + class g extends s.s { + constructor(e2, t2) { + t2.uniqueName || (t2.uniqueName = u(e2, [t2.name])), super(e2, t2), this.table = e2; + } + static [n.Q] = "PgColumn"; + } + class y extends g { + static [n.Q] = "ExtraConfigColumn"; + getSQLType() { + return this.getSQLType(); + } + indexConfig = { order: this.config.order ?? "asc", nulls: this.config.nulls ?? "last", opClass: this.config.opClass }; + defaultConfig = { order: "asc", nulls: "last", opClass: void 0 }; + asc() { + return this.indexConfig.order = "asc", this; + } + desc() { + return this.indexConfig.order = "desc", this; + } + nullsFirst() { + return this.indexConfig.nulls = "first", this; + } + nullsLast() { + return this.indexConfig.nulls = "last", this; + } + op(e2) { + return this.indexConfig.opClass = e2, this; + } + } + class v { + static [n.Q] = "IndexedColumn"; + constructor(e2, t2, r2, n2) { + this.name = e2, this.keyAsName = t2, this.type = r2, this.indexConfig = n2; + } + name; + keyAsName; + type; + indexConfig; + } + class b extends m { + static [n.Q] = "PgArrayBuilder"; + constructor(e2, t2, r2) { + super(e2, "array", "PgArray"), this.config.baseBuilder = t2, this.config.size = r2; + } + build(e2) { + let t2 = this.config.baseBuilder.build(e2); + return new w(e2, this.config, t2); + } + } + class w extends g { + constructor(e2, t2, r2, n2) { + super(e2, t2), this.baseColumn = r2, this.range = n2, this.size = t2.size; + } + size; + static [n.Q] = "PgArray"; + getSQLType() { + return `${this.baseColumn.getSQLType()}[${"number" == typeof this.size ? this.size : ""}]`; + } + mapFromDriverValue(e2) { + return "string" == typeof e2 && (e2 = function(e3) { + let [t2] = function e4(t3, r2 = 0) { + let n2 = [], i2 = r2, s2 = false; + for (; i2 < t3.length; ) { + let a2 = t3[i2]; + if ("," === a2) { + (s2 || i2 === r2) && n2.push(""), s2 = true, i2++; + continue; + } + if (s2 = false, "\\" === a2) { + i2 += 2; + continue; + } + if ('"' === a2) { + let [e5, r3] = p(t3, i2 + 1, true); + n2.push(e5), i2 = r3; + continue; + } + if ("}" === a2) + return [n2, i2 + 1]; + if ("{" === a2) { + let [r3, s3] = e4(t3, i2 + 1); + n2.push(r3), i2 = s3; + continue; + } + let [o2, l2] = p(t3, i2, false); + n2.push(o2), i2 = l2; + } + return [n2, i2]; + }(e3, 1); + return t2; + }(e2)), e2.map((e3) => this.baseColumn.mapFromDriverValue(e3)); + } + mapToDriverValue(e2, t2 = false) { + let r2 = e2.map((e3) => null === e3 ? null : (0, n.is)(this.baseColumn, w) ? this.baseColumn.mapToDriverValue(e3, true) : this.baseColumn.mapToDriverValue(e3)); + return t2 ? r2 : function e3(t3) { + return `{${t3.map((t4) => Array.isArray(t4) ? e3(t4) : "string" == typeof t4 ? `"${t4.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : `${t4}`).join(",")}}`; + }(r2); + } + } + }; + __namedExportsObject5["__chunk_14199"] = (e, t, r) => { + "use strict"; + r.d(t, { tS: () => eE }); + var n = r(59454), i = r(35971); + class s { + static [i.Q] = "ConsoleLogWriter"; + write(e2) { + console.log(e2); + } + } + class a { + static [i.Q] = "DefaultLogger"; + writer; + constructor(e2) { + this.writer = e2?.writer ?? new s(); + } + logQuery(e2, t2) { + let r2 = t2.map((e3) => { + try { + return JSON.stringify(e3); + } catch { + return String(e3); + } + }), n2 = r2.length ? ` -- params: [${r2.join(", ")}]` : ""; + this.writer.write(`Query: ${e2}${n2}`); + } + } + class o { + static [i.Q] = "NoopLogger"; + logQuery() { + } + } + var l = r(97014), c = r(62640), u = r(84335), d = r(6161); + class h { + constructor(e2) { + this.table = e2; + } + static [i.Q] = "ColumnAliasProxyHandler"; + get(e2, t2) { + return "table" === t2 ? this.table : e2[t2]; + } + } + class f { + constructor(e2, t2) { + this.alias = e2, this.replaceOriginalName = t2; + } + static [i.Q] = "TableAliasProxyHandler"; + get(e2, t2) { + if (t2 === u.iA.Symbol.IsAlias) + return true; + if (t2 === u.iA.Symbol.Name || this.replaceOriginalName && t2 === u.iA.Symbol.OriginalName) + return this.alias; + if (t2 === d.d) + return { ...e2[d.d], name: this.alias, isAlias: true }; + if (t2 === u.iA.Symbol.Columns) { + let t3 = e2[u.iA.Symbol.Columns]; + if (!t3) + return t3; + let r3 = {}; + return Object.keys(t3).map((n2) => { + r3[n2] = new Proxy(t3[n2], new h(new Proxy(e2, this))); + }), r3; + } + let r2 = e2[t2]; + return (0, i.is)(r2, l.s) ? new Proxy(r2, new h(new Proxy(e2, this))) : r2; + } + } + class p { + constructor(e2) { + this.alias = e2; + } + static [i.Q] = null; + get(e2, t2) { + return "sourceTable" === t2 ? m(e2.sourceTable, this.alias) : e2[t2]; + } + } + function m(e2, t2) { + return new Proxy(e2, new f(t2, false)); + } + function g(e2, t2) { + return new Proxy(e2, new h(new Proxy(e2.table, new f(t2, false)))); + } + function y(e2, t2) { + return new c.$s.Aliased(v(e2.sql, t2), e2.fieldAlias); + } + function v(e2, t2) { + return c.i6.join(e2.queryChunks.map((e3) => (0, i.is)(e3, l.s) ? g(e3, t2) : (0, i.is)(e3, c.$s) ? v(e3, t2) : (0, i.is)(e3, c.$s.Aliased) ? y(e3, t2) : e3)); + } + function b(e2) { + return (e2.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).map((e3) => e3.toLowerCase()).join("_"); + } + function w(e2) { + return (e2.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).reduce((e3, t2, r2) => e3 + (0 === r2 ? t2.toLowerCase() : `${t2[0].toUpperCase()}${t2.slice(1)}`), ""); + } + function x(e2) { + return e2; + } + class S { + static [i.Q] = "CasingCache"; + cache = {}; + cachedTables = {}; + convert; + constructor(e2) { + this.convert = "snake_case" === e2 ? b : "camelCase" === e2 ? w : x; + } + getColumnCasing(e2) { + if (!e2.keyAsName) + return e2.name; + let t2 = e2.table[u.iA.Symbol.Schema] ?? "public", r2 = e2.table[u.iA.Symbol.OriginalName], n2 = `${t2}.${r2}.${e2.name}`; + return this.cache[n2] || this.cacheTable(e2.table), this.cache[n2]; + } + cacheTable(e2) { + let t2 = e2[u.iA.Symbol.Schema] ?? "public", r2 = e2[u.iA.Symbol.OriginalName], n2 = `${t2}.${r2}`; + if (!this.cachedTables[n2]) { + for (let t3 of Object.values(e2[u.iA.Symbol.Columns])) { + let e3 = `${n2}.${t3.name}`; + this.cache[e3] = this.convert(t3.name); + } + this.cachedTables[n2] = true; + } + } + clearCache() { + this.cache = {}, this.cachedTables = {}; + } + } + class _ extends Error { + static [i.Q] = "DrizzleError"; + constructor({ message: e2, cause: t2 }) { + super(e2), this.name = "DrizzleError", this.cause = t2; + } + } + class E extends _ { + static [i.Q] = "TransactionRollbackError"; + constructor() { + super({ message: "Rollback" }); + } + } + var k = r(50189), C = r(32750), R = r(12837), P = r(82806), T = r(86902), A = r(27442), O = r(93594), I = r(75713), N = r(11445), M = r(75389), $ = r(33920), L = r(75360), j = r(77915); + class D extends c.G7 { + static [i.Q] = "PgViewBase"; + } + class F { + static [i.Q] = "PgDialect"; + casing; + constructor(e2) { + this.casing = new S(e2?.casing); + } + async migrate(e2, t2, r2) { + let n2 = "string" == typeof r2 ? "__drizzle_migrations" : r2.migrationsTable ?? "__drizzle_migrations", i2 = "string" == typeof r2 ? "drizzle" : r2.migrationsSchema ?? "drizzle", s2 = (0, c.i6)` + CREATE TABLE IF NOT EXISTS ${c.i6.identifier(i2)}.${c.i6.identifier(n2)} ( + id SERIAL PRIMARY KEY, + hash text NOT NULL, + created_at bigint + ) + `; + await t2.execute((0, c.i6)`CREATE SCHEMA IF NOT EXISTS ${c.i6.identifier(i2)}`), await t2.execute(s2); + let a2 = (await t2.all((0, c.i6)`select id, hash, created_at from ${c.i6.identifier(i2)}.${c.i6.identifier(n2)} order by created_at desc limit 1`))[0]; + await t2.transaction(async (t3) => { + for await (let r3 of e2) + if (!a2 || Number(a2.created_at) < r3.folderMillis) { + for (let e3 of r3.sql) + await t3.execute(c.i6.raw(e3)); + await t3.execute((0, c.i6)`insert into ${c.i6.identifier(i2)}.${c.i6.identifier(n2)} ("hash", "created_at") values(${r3.hash}, ${r3.folderMillis})`); + } + }); + } + escapeName(e2) { + return `"${e2}"`; + } + escapeParam(e2) { + return `$${e2 + 1}`; + } + escapeString(e2) { + return `'${e2.replace(/'/g, "''")}'`; + } + buildWithCTE(e2) { + if (!e2?.length) + return; + let t2 = [(0, c.i6)`with `]; + for (let [r2, n2] of e2.entries()) + t2.push((0, c.i6)`${c.i6.identifier(n2._.alias)} as (${n2._.sql})`), r2 < e2.length - 1 && t2.push((0, c.i6)`, `); + return t2.push((0, c.i6)` `), c.i6.join(t2); + } + buildDeleteQuery({ table: e2, where: t2, returning: r2, withList: n2 }) { + let i2 = this.buildWithCTE(n2), s2 = r2 ? (0, c.i6)` returning ${this.buildSelection(r2, { isSingleTable: true })}` : void 0, a2 = t2 ? (0, c.i6)` where ${t2}` : void 0; + return (0, c.i6)`${i2}delete from ${e2}${a2}${s2}`; + } + buildUpdateSet(e2, t2) { + let r2 = e2[u.iA.Symbol.Columns], n2 = Object.keys(r2).filter((e3) => void 0 !== t2[e3] || r2[e3]?.onUpdateFn !== void 0), i2 = n2.length; + return c.i6.join(n2.flatMap((e3, n3) => { + let s2 = r2[e3], a2 = t2[e3] ?? c.i6.param(s2.onUpdateFn(), s2), o2 = (0, c.i6)`${c.i6.identifier(this.casing.getColumnCasing(s2))} = ${a2}`; + return n3 < i2 - 1 ? [o2, c.i6.raw(", ")] : [o2]; + })); + } + buildUpdateQuery({ table: e2, set: t2, where: r2, returning: n2, withList: i2 }) { + let s2 = this.buildWithCTE(i2), a2 = this.buildUpdateSet(e2, t2), o2 = n2 ? (0, c.i6)` returning ${this.buildSelection(n2, { isSingleTable: true })}` : void 0, l2 = r2 ? (0, c.i6)` where ${r2}` : void 0; + return (0, c.i6)`${s2}update ${e2} set ${a2}${l2}${o2}`; + } + buildSelection(e2, { isSingleTable: t2 = false } = {}) { + let r2 = e2.length, n2 = e2.flatMap(({ field: e3 }, n3) => { + let s2 = []; + if ((0, i.is)(e3, c.$s.Aliased) && e3.isSelectionField) + s2.push(c.i6.identifier(e3.fieldAlias)); + else if ((0, i.is)(e3, c.$s.Aliased) || (0, i.is)(e3, c.$s)) { + let r3 = (0, i.is)(e3, c.$s.Aliased) ? e3.sql : e3; + t2 ? s2.push(new c.$s(r3.queryChunks.map((e4) => (0, i.is)(e4, k.df) ? c.i6.identifier(this.casing.getColumnCasing(e4)) : e4))) : s2.push(r3), (0, i.is)(e3, c.$s.Aliased) && s2.push((0, c.i6)` as ${c.i6.identifier(e3.fieldAlias)}`); + } else + (0, i.is)(e3, l.s) && (t2 ? s2.push(c.i6.identifier(this.casing.getColumnCasing(e3))) : s2.push(e3)); + return n3 < r2 - 1 && s2.push((0, c.i6)`, `), s2; + }); + return c.i6.join(n2); + } + buildSelectQuery({ withList: e2, fields: t2, fieldsFlat: r2, where: n2, having: s2, table: a2, joins: o2, orderBy: h2, groupBy: f2, limit: p2, offset: m2, lockingClause: g2, distinct: y2, setOperators: v2 }) { + let b2, w2, x2; + let S2 = r2 ?? (0, j.ZS)(t2); + for (let e3 of S2) { + let t3; + if ((0, i.is)(e3.field, l.s) && (0, u.SP)(e3.field.table) !== ((0, i.is)(a2, L.k) ? a2._.alias : (0, i.is)(a2, D) ? a2[d.d].name : (0, i.is)(a2, c.$s) ? void 0 : (0, u.SP)(a2)) && (t3 = e3.field.table, !o2?.some(({ alias: e4 }) => e4 === (t3[u.iA.Symbol.IsAlias] ? u.SP(t3) : t3[u.iA.Symbol.BaseName])))) { + let t4 = (0, u.SP)(e3.field.table); + throw Error(`Your "${e3.path.join("->")}" field references a column "${t4}"."${e3.field.name}", but the table "${t4}" is not part of the query! Did you forget to join it?`); + } + } + let _2 = !o2 || 0 === o2.length, E2 = this.buildWithCTE(e2); + y2 && (b2 = true === y2 ? (0, c.i6)` distinct` : (0, c.i6)` distinct on (${c.i6.join(y2.on, (0, c.i6)`, `)})`); + let k2 = this.buildSelection(S2, { isSingleTable: _2 }), C2 = (() => { + if ((0, i.is)(a2, u.iA) && a2[u.iA.Symbol.OriginalName] !== a2[u.iA.Symbol.Name]) { + let e3 = (0, c.i6)`${c.i6.identifier(a2[u.iA.Symbol.OriginalName])}`; + return a2[u.iA.Symbol.Schema] && (e3 = (0, c.i6)`${c.i6.identifier(a2[u.iA.Symbol.Schema])}.${e3}`), (0, c.i6)`${e3} ${c.i6.identifier(a2[u.iA.Symbol.Name])}`; + } + return a2; + })(), R2 = []; + if (o2) + for (let [e3, t3] of o2.entries()) { + 0 === e3 && R2.push((0, c.i6)` `); + let r3 = t3.table, n3 = t3.lateral ? (0, c.i6)` lateral` : void 0; + if ((0, i.is)(r3, N.YA)) { + let e4 = r3[N.YA.Symbol.Name], i2 = r3[N.YA.Symbol.Schema], s3 = r3[N.YA.Symbol.OriginalName], a3 = e4 === s3 ? void 0 : t3.alias; + R2.push((0, c.i6)`${c.i6.raw(t3.joinType)} join${n3} ${i2 ? (0, c.i6)`${c.i6.identifier(i2)}.` : void 0}${c.i6.identifier(s3)}${a3 && (0, c.i6)` ${c.i6.identifier(a3)}`} on ${t3.on}`); + } else if ((0, i.is)(r3, c.G7)) { + let e4 = r3[d.d].name, i2 = r3[d.d].schema, s3 = r3[d.d].originalName, a3 = e4 === s3 ? void 0 : t3.alias; + R2.push((0, c.i6)`${c.i6.raw(t3.joinType)} join${n3} ${i2 ? (0, c.i6)`${c.i6.identifier(i2)}.` : void 0}${c.i6.identifier(s3)}${a3 && (0, c.i6)` ${c.i6.identifier(a3)}`} on ${t3.on}`); + } else + R2.push((0, c.i6)`${c.i6.raw(t3.joinType)} join${n3} ${r3} on ${t3.on}`); + e3 < o2.length - 1 && R2.push((0, c.i6)` `); + } + let P2 = c.i6.join(R2), T2 = n2 ? (0, c.i6)` where ${n2}` : void 0, A2 = s2 ? (0, c.i6)` having ${s2}` : void 0; + h2 && h2.length > 0 && (w2 = (0, c.i6)` order by ${c.i6.join(h2, (0, c.i6)`, `)}`), f2 && f2.length > 0 && (x2 = (0, c.i6)` group by ${c.i6.join(f2, (0, c.i6)`, `)}`); + let O2 = "object" == typeof p2 || "number" == typeof p2 && p2 >= 0 ? (0, c.i6)` limit ${p2}` : void 0, I2 = m2 ? (0, c.i6)` offset ${m2}` : void 0, M2 = c.i6.empty(); + if (g2) { + let e3 = (0, c.i6)` for ${c.i6.raw(g2.strength)}`; + g2.config.of && e3.append((0, c.i6)` of ${c.i6.join(Array.isArray(g2.config.of) ? g2.config.of : [g2.config.of], (0, c.i6)`, `)}`), g2.config.noWait ? e3.append((0, c.i6)` no wait`) : g2.config.skipLocked && e3.append((0, c.i6)` skip locked`), M2.append(e3); + } + let $2 = (0, c.i6)`${E2}select${b2} ${k2} from ${C2}${P2}${T2}${x2}${A2}${w2}${O2}${I2}${M2}`; + return v2.length > 0 ? this.buildSetOperations($2, v2) : $2; + } + buildSetOperations(e2, t2) { + let [r2, ...n2] = t2; + if (!r2) + throw Error("Cannot pass undefined values to any set operator"); + return 0 === n2.length ? this.buildSetOperationQuery({ leftSelect: e2, setOperator: r2 }) : this.buildSetOperations(this.buildSetOperationQuery({ leftSelect: e2, setOperator: r2 }), n2); + } + buildSetOperationQuery({ leftSelect: e2, setOperator: { type: t2, isAll: r2, rightSelect: n2, limit: s2, orderBy: a2, offset: o2 } }) { + let l2; + let u2 = (0, c.i6)`(${e2.getSQL()}) `, d2 = (0, c.i6)`(${n2.getSQL()})`; + if (a2 && a2.length > 0) { + let e3 = []; + for (let t3 of a2) + if ((0, i.is)(t3, k.df)) + e3.push(c.i6.identifier(t3.name)); + else if ((0, i.is)(t3, c.$s)) { + for (let e4 = 0; e4 < t3.queryChunks.length; e4++) { + let r3 = t3.queryChunks[e4]; + (0, i.is)(r3, k.df) && (t3.queryChunks[e4] = c.i6.identifier(r3.name)); + } + e3.push((0, c.i6)`${t3}`); + } else + e3.push((0, c.i6)`${t3}`); + l2 = (0, c.i6)` order by ${c.i6.join(e3, (0, c.i6)`, `)} `; + } + let h2 = "object" == typeof s2 || "number" == typeof s2 && s2 >= 0 ? (0, c.i6)` limit ${s2}` : void 0, f2 = c.i6.raw(`${t2} ${r2 ? "all " : ""}`), p2 = o2 ? (0, c.i6)` offset ${o2}` : void 0; + return (0, c.i6)`${u2}${f2}${d2}${l2}${h2}${p2}`; + } + buildInsertQuery({ table: e2, values: t2, onConflict: r2, returning: n2, withList: s2 }) { + let a2 = [], o2 = Object.entries(e2[u.iA.Symbol.Columns]).filter(([e3, t3]) => !t3.shouldDisableInsert()), l2 = o2.map(([, e3]) => c.i6.identifier(this.casing.getColumnCasing(e3))); + for (let [e3, r3] of t2.entries()) { + let n3 = []; + for (let [e4, t3] of o2) { + let s3 = r3[e4]; + if (void 0 === s3 || (0, i.is)(s3, c.dO) && void 0 === s3.value) { + if (void 0 !== t3.defaultFn) { + let e5 = t3.defaultFn(), r4 = (0, i.is)(e5, c.$s) ? e5 : c.i6.param(e5, t3); + n3.push(r4); + } else if (t3.default || void 0 === t3.onUpdateFn) + n3.push((0, c.i6)`default`); + else { + let e5 = t3.onUpdateFn(), r4 = (0, i.is)(e5, c.$s) ? e5 : c.i6.param(e5, t3); + n3.push(r4); + } + } else + n3.push(s3); + } + a2.push(n3), e3 < t2.length - 1 && a2.push((0, c.i6)`, `); + } + let d2 = this.buildWithCTE(s2), h2 = c.i6.join(a2), f2 = n2 ? (0, c.i6)` returning ${this.buildSelection(n2, { isSingleTable: true })}` : void 0, p2 = r2 ? (0, c.i6)` on conflict ${r2}` : void 0; + return (0, c.i6)`${d2}insert into ${e2} ${l2} values ${h2}${p2}${f2}`; + } + buildRefreshMaterializedViewQuery({ view: e2, concurrently: t2, withNoData: r2 }) { + let n2 = t2 ? (0, c.i6)` concurrently` : void 0, i2 = r2 ? (0, c.i6)` with no data` : void 0; + return (0, c.i6)`refresh materialized view${n2} ${e2}${i2}`; + } + prepareTyping(e2) { + return (0, i.is)(e2, C.B2) || (0, i.is)(e2, R.y2) ? "json" : (0, i.is)(e2, P.OJ) ? "decimal" : (0, i.is)(e2, T.vu) ? "time" : (0, i.is)(e2, A.sC) || (0, i.is)(e2, A.bf) ? "timestamp" : (0, i.is)(e2, O.ch) || (0, i.is)(e2, O.Ec) ? "date" : (0, i.is)(e2, I.RX) ? "uuid" : "none"; + } + sqlToQuery(e2, t2) { + return e2.toQuery({ casing: this.casing, escapeName: this.escapeName, escapeParam: this.escapeParam, escapeString: this.escapeString, prepareTyping: this.prepareTyping, invokeSource: t2 }); + } + buildRelationalQueryWithoutPK({ fullSchema: e2, schema: t2, tableNamesMap: r2, table: n2, tableConfig: s2, queryConfig: a2, tableAlias: o2, nestedQueryRelation: d2, joinOn: h2 }) { + let f2, p2 = [], b2, w2, x2 = [], S2, E2 = []; + if (true === a2) + p2 = Object.entries(s2.columns).map(([e3, t3]) => ({ dbKey: t3.name, tsKey: e3, field: g(t3, o2), relationTableTsKey: void 0, isJson: false, selection: [] })); + else { + let n3 = Object.fromEntries(Object.entries(s2.columns).map(([e3, t3]) => [e3, g(t3, o2)])); + if (a2.where) { + let e3 = "function" == typeof a2.where ? a2.where(n3, (0, M.vU)()) : a2.where; + S2 = e3 && v(e3, o2); + } + let d3 = [], h3 = []; + if (a2.columns) { + let e3 = false; + for (let [t3, r3] of Object.entries(a2.columns)) + void 0 !== r3 && t3 in s2.columns && (e3 || true !== r3 || (e3 = true), h3.push(t3)); + h3.length > 0 && (h3 = e3 ? h3.filter((e4) => a2.columns?.[e4] === true) : Object.keys(s2.columns).filter((e4) => !h3.includes(e4))); + } else + h3 = Object.keys(s2.columns); + for (let e3 of h3) { + let t3 = s2.columns[e3]; + d3.push({ tsKey: e3, value: t3 }); + } + let f3 = []; + if (a2.with && (f3 = Object.entries(a2.with).filter((e3) => !!e3[1]).map(([e3, t3]) => ({ tsKey: e3, queryConfig: t3, relation: s2.relations[e3] }))), a2.extras) + for (let [e3, t3] of Object.entries("function" == typeof a2.extras ? a2.extras(n3, { sql: c.i6 }) : a2.extras)) + d3.push({ tsKey: e3, value: y(t3, o2) }); + for (let { tsKey: e3, value: t3 } of d3) + p2.push({ dbKey: (0, i.is)(t3, c.$s.Aliased) ? t3.fieldAlias : s2.columns[e3].name, tsKey: e3, field: (0, i.is)(t3, l.s) ? g(t3, o2) : t3, relationTableTsKey: void 0, isJson: false, selection: [] }); + let m2 = "function" == typeof a2.orderBy ? a2.orderBy(n3, (0, M.pl)()) : a2.orderBy ?? []; + for (let { tsKey: n4, queryConfig: s3, relation: d4 } of (Array.isArray(m2) || (m2 = [m2]), x2 = m2.map((e3) => (0, i.is)(e3, l.s) ? g(e3, o2) : v(e3, o2)), b2 = a2.limit, w2 = a2.offset, f3)) { + let a3 = (0, M.wG)(t2, r2, d4), l2 = r2[(0, u.Q0)(d4.referencedTable)], h4 = `${o2}_${n4}`, f4 = (0, $.xD)(...a3.fields.map((e3, t3) => (0, $.eq)(g(a3.references[t3], h4), g(e3, o2)))), m3 = this.buildRelationalQueryWithoutPK({ fullSchema: e2, schema: t2, tableNamesMap: r2, table: e2[l2], tableConfig: t2[l2], queryConfig: (0, i.is)(d4, M.fh) ? true === s3 ? { limit: 1 } : { ...s3, limit: 1 } : s3, tableAlias: h4, joinOn: f4, nestedQueryRelation: d4 }), y2 = (0, c.i6)`${c.i6.identifier(h4)}.${c.i6.identifier("data")}`.as(n4); + E2.push({ on: (0, c.i6)`true`, table: new L.k(m3.sql, {}, h4), alias: h4, joinType: "left", lateral: true }), p2.push({ dbKey: n4, tsKey: n4, field: y2, relationTableTsKey: l2, isJson: true, selection: m3.selection }); + } + } + if (0 === p2.length) + throw new _({ message: `No fields selected for table "${s2.tsName}" ("${o2}")` }); + if (S2 = (0, $.xD)(h2, S2), d2) { + let e3 = (0, c.i6)`json_build_array(${c.i6.join(p2.map(({ field: e4, tsKey: t4, isJson: r3 }) => r3 ? (0, c.i6)`${c.i6.identifier(`${o2}_${t4}`)}.${c.i6.identifier("data")}` : (0, i.is)(e4, c.$s.Aliased) ? e4.sql : e4), (0, c.i6)`, `)})`; + (0, i.is)(d2, M.sj) && (e3 = (0, c.i6)`coalesce(json_agg(${e3}${x2.length > 0 ? (0, c.i6)` order by ${c.i6.join(x2, (0, c.i6)`, `)}` : void 0}), '[]'::json)`); + let t3 = [{ dbKey: "data", tsKey: "data", field: e3.as("data"), isJson: true, relationTableTsKey: s2.tsName, selection: p2 }]; + void 0 !== b2 || void 0 !== w2 || x2.length > 0 ? (f2 = this.buildSelectQuery({ table: m(n2, o2), fields: {}, fieldsFlat: [{ path: [], field: c.i6.raw("*") }], where: S2, limit: b2, offset: w2, orderBy: x2, setOperators: [] }), S2 = void 0, b2 = void 0, w2 = void 0, x2 = []) : f2 = m(n2, o2), f2 = this.buildSelectQuery({ table: (0, i.is)(f2, N.YA) ? f2 : new L.k(f2, {}, o2), fields: {}, fieldsFlat: t3.map(({ field: e4 }) => ({ path: [], field: (0, i.is)(e4, l.s) ? g(e4, o2) : e4 })), joins: E2, where: S2, limit: b2, offset: w2, orderBy: x2, setOperators: [] }); + } else + f2 = this.buildSelectQuery({ table: m(n2, o2), fields: {}, fieldsFlat: p2.map(({ field: e3 }) => ({ path: [], field: (0, i.is)(e3, l.s) ? g(e3, o2) : e3 })), joins: E2, where: S2, limit: b2, offset: w2, orderBy: x2, setOperators: [] }); + return { tableTsKey: s2.tsName, sql: f2, selection: p2 }; + } + } + class B { + static [i.Q] = "SelectionProxyHandler"; + config; + constructor(e2) { + this.config = { ...e2 }; + } + get(e2, t2) { + if ("_" === t2) + return { ...e2._, selectedFields: new Proxy(e2._.selectedFields, this) }; + if (t2 === d.d) + return { ...e2[d.d], selectedFields: new Proxy(e2[d.d].selectedFields, this) }; + if ("symbol" == typeof t2) + return e2[t2]; + let r2 = ((0, i.is)(e2, L.k) ? e2._.selectedFields : (0, i.is)(e2, c.G7) ? e2[d.d].selectedFields : e2)[t2]; + if ((0, i.is)(r2, c.$s.Aliased)) { + if ("sql" === this.config.sqlAliasedBehavior && !r2.isSelectionField) + return r2.sql; + let e3 = r2.clone(); + return e3.isSelectionField = true, e3; + } + if ((0, i.is)(r2, c.$s)) { + if ("sql" === this.config.sqlBehavior) + return r2; + throw Error(`You tried to reference "${t2}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`); + } + return (0, i.is)(r2, l.s) ? this.config.alias ? new Proxy(r2, new h(new Proxy(r2.table, new f(this.config.alias, this.config.replaceOriginalName ?? false)))) : r2 : "object" != typeof r2 || null === r2 ? r2 : new Proxy(r2, new B(this.config)); + } + } + class U { + static [i.Q] = "TypedQueryBuilder"; + getSelectedFields() { + return this._.selectedFields; + } + } + class q { + static [i.Q] = "QueryPromise"; + [Symbol.toStringTag] = "QueryPromise"; + catch(e2) { + return this.then(void 0, e2); + } + finally(e2) { + return this.then((t2) => (e2?.(), t2), (t2) => { + throw e2?.(), t2; + }); + } + then(e2, t2) { + return this.execute().then(e2, t2); + } + } + var z = r(42712); + class H { + static [i.Q] = "PgSelectBuilder"; + fields; + session; + dialect; + withList = []; + distinct; + constructor(e2) { + this.fields = e2.fields, this.session = e2.session, this.dialect = e2.dialect, e2.withList && (this.withList = e2.withList), this.distinct = e2.distinct; + } + from(e2) { + let t2; + let r2 = !!this.fields; + return t2 = this.fields ? this.fields : (0, i.is)(e2, L.k) ? Object.fromEntries(Object.keys(e2._.selectedFields).map((t3) => [t3, e2[t3]])) : (0, i.is)(e2, D) ? e2[d.d].selectedFields : (0, i.is)(e2, c.$s) ? {} : (0, j.SS)(e2), new Q({ table: e2, fields: t2, isPartialSelect: r2, session: this.session, dialect: this.dialect, withList: this.withList, distinct: this.distinct }); + } + } + class W extends U { + static [i.Q] = "PgSelectQueryBuilder"; + _; + config; + joinsNotNullableMap; + tableName; + isPartialSelect; + session; + dialect; + constructor({ table: e2, fields: t2, isPartialSelect: r2, session: n2, dialect: i2, withList: s2, distinct: a2 }) { + super(), this.config = { withList: s2, table: e2, fields: { ...t2 }, distinct: a2, setOperators: [] }, this.isPartialSelect = r2, this.session = n2, this.dialect = i2, this._ = { selectedFields: t2 }, this.tableName = (0, j.dP)(e2), this.joinsNotNullableMap = "string" == typeof this.tableName ? { [this.tableName]: true } : {}; + } + createJoin(e2) { + return (t2, r2) => { + let n2 = this.tableName, s2 = (0, j.dP)(t2); + if ("string" == typeof s2 && this.config.joins?.some((e3) => e3.alias === s2)) + throw Error(`Alias "${s2}" is already used in this query`); + if (!this.isPartialSelect && (1 === Object.keys(this.joinsNotNullableMap).length && "string" == typeof n2 && (this.config.fields = { [n2]: this.config.fields }), "string" == typeof s2 && !(0, i.is)(t2, c.$s))) { + let e3 = (0, i.is)(t2, L.k) ? t2._.selectedFields : (0, i.is)(t2, c.G7) ? t2[d.d].selectedFields : t2[u.iA.Symbol.Columns]; + this.config.fields[s2] = e3; + } + if ("function" == typeof r2 && (r2 = r2(new Proxy(this.config.fields, new B({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })))), this.config.joins || (this.config.joins = []), this.config.joins.push({ on: r2, table: t2, joinType: e2, alias: s2 }), "string" == typeof s2) + switch (e2) { + case "left": + this.joinsNotNullableMap[s2] = false; + break; + case "right": + this.joinsNotNullableMap = Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e3]) => [e3, false])), this.joinsNotNullableMap[s2] = true; + break; + case "inner": + this.joinsNotNullableMap[s2] = true; + break; + case "full": + this.joinsNotNullableMap = Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e3]) => [e3, false])), this.joinsNotNullableMap[s2] = false; + } + return this; + }; + } + leftJoin = this.createJoin("left"); + rightJoin = this.createJoin("right"); + innerJoin = this.createJoin("inner"); + fullJoin = this.createJoin("full"); + createSetOperator(e2, t2) { + return (r2) => { + let n2 = "function" == typeof r2 ? r2(G()) : r2; + if (!(0, j.ux)(this.getSelectedFields(), n2.getSelectedFields())) + throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order"); + return this.config.setOperators.push({ type: e2, isAll: t2, rightSelect: n2 }), this; + }; + } + union = this.createSetOperator("union", false); + unionAll = this.createSetOperator("union", true); + intersect = this.createSetOperator("intersect", false); + intersectAll = this.createSetOperator("intersect", true); + except = this.createSetOperator("except", false); + exceptAll = this.createSetOperator("except", true); + addSetOperators(e2) { + return this.config.setOperators.push(...e2), this; + } + where(e2) { + return "function" == typeof e2 && (e2 = e2(new Proxy(this.config.fields, new B({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })))), this.config.where = e2, this; + } + having(e2) { + return "function" == typeof e2 && (e2 = e2(new Proxy(this.config.fields, new B({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })))), this.config.having = e2, this; + } + groupBy(...e2) { + if ("function" == typeof e2[0]) { + let t2 = e2[0](new Proxy(this.config.fields, new B({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }))); + this.config.groupBy = Array.isArray(t2) ? t2 : [t2]; + } else + this.config.groupBy = e2; + return this; + } + orderBy(...e2) { + if ("function" == typeof e2[0]) { + let t2 = e2[0](new Proxy(this.config.fields, new B({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }))), r2 = Array.isArray(t2) ? t2 : [t2]; + this.config.setOperators.length > 0 ? this.config.setOperators.at(-1).orderBy = r2 : this.config.orderBy = r2; + } else + this.config.setOperators.length > 0 ? this.config.setOperators.at(-1).orderBy = e2 : this.config.orderBy = e2; + return this; + } + limit(e2) { + return this.config.setOperators.length > 0 ? this.config.setOperators.at(-1).limit = e2 : this.config.limit = e2, this; + } + offset(e2) { + return this.config.setOperators.length > 0 ? this.config.setOperators.at(-1).offset = e2 : this.config.offset = e2, this; + } + for(e2, t2 = {}) { + return this.config.lockingClause = { strength: e2, config: t2 }, this; + } + getSQL() { + return this.dialect.buildSelectQuery(this.config); + } + toSQL() { + let { typings: e2, ...t2 } = this.dialect.sqlToQuery(this.getSQL()); + return t2; + } + as(e2) { + return new Proxy(new L.k(this.getSQL(), this.config.fields, e2), new B({ alias: e2, sqlAliasedBehavior: "alias", sqlBehavior: "error" })); + } + getSelectedFields() { + return new Proxy(this.config.fields, new B({ alias: this.tableName, sqlAliasedBehavior: "alias", sqlBehavior: "error" })); + } + $dynamic() { + return this; + } + } + class Q extends W { + static [i.Q] = "PgSelect"; + _prepare(e2) { + let { session: t2, config: r2, dialect: n2, joinsNotNullableMap: i2 } = this; + if (!t2) + throw Error("Cannot execute a query on a query builder. Please use a database instance instead."); + return z.Z.startActiveSpan("drizzle.prepareQuery", () => { + let s2 = (0, j.ZS)(r2.fields), a2 = t2.prepareQuery(n2.sqlToQuery(this.getSQL()), s2, e2, true); + return a2.joinsNotNullableMap = i2, a2; + }); + } + prepare(e2) { + return this._prepare(e2); + } + execute = (e2) => z.Z.startActiveSpan("drizzle.operation", () => this._prepare().execute(e2)); + } + function V(e2, t2) { + return (r2, n2, ...i2) => { + let s2 = [n2, ...i2].map((r3) => ({ type: e2, isAll: t2, rightSelect: r3 })); + for (let e3 of s2) + if (!(0, j.ux)(r2.getSelectedFields(), e3.rightSelect.getSelectedFields())) + throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order"); + return r2.addSetOperators(s2); + }; + } + (0, j.ef)(Q, [q]); + let G = () => ({ union: Z, unionAll: K, intersect: J, intersectAll: Y, except: X, exceptAll: ee }), Z = V("union", false), K = V("union", true), J = V("intersect", false), Y = V("intersect", true), X = V("except", false), ee = V("except", true); + class et { + static [i.Q] = "PgQueryBuilder"; + dialect; + dialectConfig; + constructor(e2) { + this.dialect = (0, i.is)(e2, F) ? e2 : void 0, this.dialectConfig = (0, i.is)(e2, F) ? void 0 : e2; + } + $with(e2) { + let t2 = this; + return { as: (r2) => ("function" == typeof r2 && (r2 = r2(t2)), new Proxy(new L.S(r2.getSQL(), r2.getSelectedFields(), e2, true), new B({ alias: e2, sqlAliasedBehavior: "alias", sqlBehavior: "error" }))) }; + } + with(...e2) { + let t2 = this; + return { select: function(r2) { + return new H({ fields: r2 ?? void 0, session: void 0, dialect: t2.getDialect(), withList: e2 }); + }, selectDistinct: function(e3) { + return new H({ fields: e3 ?? void 0, session: void 0, dialect: t2.getDialect(), distinct: true }); + }, selectDistinctOn: function(e3, r2) { + return new H({ fields: r2 ?? void 0, session: void 0, dialect: t2.getDialect(), distinct: { on: e3 } }); + } }; + } + select(e2) { + return new H({ fields: e2 ?? void 0, session: void 0, dialect: this.getDialect() }); + } + selectDistinct(e2) { + return new H({ fields: e2 ?? void 0, session: void 0, dialect: this.getDialect(), distinct: true }); + } + selectDistinctOn(e2, t2) { + return new H({ fields: t2 ?? void 0, session: void 0, dialect: this.getDialect(), distinct: { on: e2 } }); + } + getDialect() { + return this.dialect || (this.dialect = new F(this.dialectConfig)), this.dialect; + } + } + class er { + constructor(e2, t2, r2, n2) { + this.table = e2, this.session = t2, this.dialect = r2, this.withList = n2; + } + static [i.Q] = "PgUpdateBuilder"; + set(e2) { + return new en(this.table, (0, j.M6)(this.table, e2), this.session, this.dialect, this.withList); + } + } + class en extends q { + constructor(e2, t2, r2, n2, i2) { + super(), this.session = r2, this.dialect = n2, this.config = { set: t2, table: e2, withList: i2 }; + } + static [i.Q] = "PgUpdate"; + config; + where(e2) { + return this.config.where = e2, this; + } + returning(e2 = this.config.table[u.iA.Symbol.Columns]) { + return this.config.returning = (0, j.ZS)(e2), this; + } + getSQL() { + return this.dialect.buildUpdateQuery(this.config); + } + toSQL() { + let { typings: e2, ...t2 } = this.dialect.sqlToQuery(this.getSQL()); + return t2; + } + _prepare(e2) { + return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), this.config.returning, e2, true); + } + prepare(e2) { + return this._prepare(e2); + } + execute = (e2) => this._prepare().execute(e2); + $dynamic() { + return this; + } + } + class ei { + constructor(e2, t2, r2, n2) { + this.table = e2, this.session = t2, this.dialect = r2, this.withList = n2; + } + static [i.Q] = "PgInsertBuilder"; + values(e2) { + if (0 === (e2 = Array.isArray(e2) ? e2 : [e2]).length) + throw Error("values() must be called with at least one value"); + let t2 = e2.map((e3) => { + let t3 = {}, r2 = this.table[u.iA.Symbol.Columns]; + for (let n2 of Object.keys(e3)) { + let s2 = e3[n2]; + t3[n2] = (0, i.is)(s2, c.$s) ? s2 : new c.dO(s2, r2[n2]); + } + return t3; + }); + return new es(this.table, t2, this.session, this.dialect, this.withList); + } + } + class es extends q { + constructor(e2, t2, r2, n2, i2) { + super(), this.session = r2, this.dialect = n2, this.config = { table: e2, values: t2, withList: i2 }; + } + static [i.Q] = "PgInsert"; + config; + returning(e2 = this.config.table[u.iA.Symbol.Columns]) { + return this.config.returning = (0, j.ZS)(e2), this; + } + onConflictDoNothing(e2 = {}) { + if (void 0 === e2.target) + this.config.onConflict = (0, c.i6)`do nothing`; + else { + let t2 = ""; + t2 = Array.isArray(e2.target) ? e2.target.map((e3) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(e3))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(e2.target)); + let r2 = e2.where ? (0, c.i6)` where ${e2.where}` : void 0; + this.config.onConflict = (0, c.i6)`(${c.i6.raw(t2)})${r2} do nothing`; + } + return this; + } + onConflictDoUpdate(e2) { + if (e2.where && (e2.targetWhere || e2.setWhere)) + throw Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.'); + let t2 = e2.where ? (0, c.i6)` where ${e2.where}` : void 0, r2 = e2.targetWhere ? (0, c.i6)` where ${e2.targetWhere}` : void 0, n2 = e2.setWhere ? (0, c.i6)` where ${e2.setWhere}` : void 0, i2 = this.dialect.buildUpdateSet(this.config.table, (0, j.M6)(this.config.table, e2.set)), s2 = ""; + return s2 = Array.isArray(e2.target) ? e2.target.map((e3) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(e3))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(e2.target)), this.config.onConflict = (0, c.i6)`(${c.i6.raw(s2)})${r2} do update set ${i2}${t2}${n2}`, this; + } + getSQL() { + return this.dialect.buildInsertQuery(this.config); + } + toSQL() { + let { typings: e2, ...t2 } = this.dialect.sqlToQuery(this.getSQL()); + return t2; + } + _prepare(e2) { + return z.Z.startActiveSpan("drizzle.prepareQuery", () => this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), this.config.returning, e2, true)); + } + prepare(e2) { + return this._prepare(e2); + } + execute = (e2) => z.Z.startActiveSpan("drizzle.operation", () => this._prepare().execute(e2)); + $dynamic() { + return this; + } + } + class ea extends q { + constructor(e2, t2, r2, n2) { + super(), this.session = t2, this.dialect = r2, this.config = { table: e2, withList: n2 }; + } + static [i.Q] = "PgDelete"; + config; + where(e2) { + return this.config.where = e2, this; + } + returning(e2 = this.config.table[u.iA.Symbol.Columns]) { + return this.config.returning = (0, j.ZS)(e2), this; + } + getSQL() { + return this.dialect.buildDeleteQuery(this.config); + } + toSQL() { + let { typings: e2, ...t2 } = this.dialect.sqlToQuery(this.getSQL()); + return t2; + } + _prepare(e2) { + return z.Z.startActiveSpan("drizzle.prepareQuery", () => this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), this.config.returning, e2, true)); + } + prepare(e2) { + return this._prepare(e2); + } + execute = (e2) => z.Z.startActiveSpan("drizzle.operation", () => this._prepare().execute(e2)); + $dynamic() { + return this; + } + } + class eo extends c.$s { + constructor(e2) { + super(eo.buildEmbeddedCount(e2.source, e2.filters).queryChunks), this.params = e2, this.mapWith(Number), this.session = e2.session, this.sql = eo.buildCount(e2.source, e2.filters); + } + sql; + static [i.Q] = "PgCountBuilder"; + [Symbol.toStringTag] = "PgCountBuilder"; + session; + static buildEmbeddedCount(e2, t2) { + return (0, c.i6)`(select count(*) from ${e2}${c.i6.raw(" where ").if(t2)}${t2})`; + } + static buildCount(e2, t2) { + return (0, c.i6)`select count(*) as count from ${e2}${c.i6.raw(" where ").if(t2)}${t2};`; + } + then(e2, t2) { + return Promise.resolve(this.session.count(this.sql)).then(e2, t2); + } + catch(e2) { + return this.then(void 0, e2); + } + finally(e2) { + return this.then((t2) => (e2?.(), t2), (t2) => { + throw e2?.(), t2; + }); + } + } + class el { + constructor(e2, t2, r2, n2, i2, s2, a2) { + this.fullSchema = e2, this.schema = t2, this.tableNamesMap = r2, this.table = n2, this.tableConfig = i2, this.dialect = s2, this.session = a2; + } + static [i.Q] = "PgRelationalQueryBuilder"; + findMany(e2) { + return new ec(this.fullSchema, this.schema, this.tableNamesMap, this.table, this.tableConfig, this.dialect, this.session, e2 || {}, "many"); + } + findFirst(e2) { + return new ec(this.fullSchema, this.schema, this.tableNamesMap, this.table, this.tableConfig, this.dialect, this.session, e2 ? { ...e2, limit: 1 } : { limit: 1 }, "first"); + } + } + class ec extends q { + constructor(e2, t2, r2, n2, i2, s2, a2, o2, l2) { + super(), this.fullSchema = e2, this.schema = t2, this.tableNamesMap = r2, this.table = n2, this.tableConfig = i2, this.dialect = s2, this.session = a2, this.config = o2, this.mode = l2; + } + static [i.Q] = "PgRelationalQuery"; + _prepare(e2) { + return z.Z.startActiveSpan("drizzle.prepareQuery", () => { + let { query: t2, builtQuery: r2 } = this._toSQL(); + return this.session.prepareQuery(r2, void 0, e2, true, (e3, r3) => { + let n2 = e3.map((e4) => (0, M.WX)(this.schema, this.tableConfig, e4, t2.selection, r3)); + return "first" === this.mode ? n2[0] : n2; + }); + }); + } + prepare(e2) { + return this._prepare(e2); + } + _getQuery() { + return this.dialect.buildRelationalQueryWithoutPK({ fullSchema: this.fullSchema, schema: this.schema, tableNamesMap: this.tableNamesMap, table: this.table, tableConfig: this.tableConfig, queryConfig: this.config, tableAlias: this.tableConfig.tsName }); + } + getSQL() { + return this._getQuery().sql; + } + _toSQL() { + let e2 = this._getQuery(), t2 = this.dialect.sqlToQuery(e2.sql); + return { query: e2, builtQuery: t2 }; + } + toSQL() { + return this._toSQL().builtQuery; + } + execute() { + return z.Z.startActiveSpan("drizzle.operation", () => this._prepare().execute()); + } + } + class eu extends q { + constructor(e2, t2, r2, n2) { + super(), this.execute = e2, this.sql = t2, this.query = r2, this.mapBatchResult = n2; + } + static [i.Q] = "PgRaw"; + getSQL() { + return this.sql; + } + getQuery() { + return this.query; + } + mapResult(e2, t2) { + return t2 ? this.mapBatchResult(e2) : e2; + } + _prepare() { + return this; + } + isResponseInArrayMode() { + return false; + } + } + class ed extends q { + constructor(e2, t2, r2) { + super(), this.session = t2, this.dialect = r2, this.config = { view: e2 }; + } + static [i.Q] = "PgRefreshMaterializedView"; + config; + concurrently() { + if (void 0 !== this.config.withNoData) + throw Error("Cannot use concurrently and withNoData together"); + return this.config.concurrently = true, this; + } + withNoData() { + if (void 0 !== this.config.concurrently) + throw Error("Cannot use concurrently and withNoData together"); + return this.config.withNoData = true, this; + } + getSQL() { + return this.dialect.buildRefreshMaterializedViewQuery(this.config); + } + toSQL() { + let { typings: e2, ...t2 } = this.dialect.sqlToQuery(this.getSQL()); + return t2; + } + _prepare(e2) { + return z.Z.startActiveSpan("drizzle.prepareQuery", () => this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), void 0, e2, true)); + } + prepare(e2) { + return this._prepare(e2); + } + execute = (e2) => z.Z.startActiveSpan("drizzle.operation", () => this._prepare().execute(e2)); + } + class eh { + constructor(e2, t2, r2) { + if (this.dialect = e2, this.session = t2, this._ = r2 ? { schema: r2.schema, fullSchema: r2.fullSchema, tableNamesMap: r2.tableNamesMap, session: t2 } : { schema: void 0, fullSchema: {}, tableNamesMap: {}, session: t2 }, this.query = {}, this._.schema) + for (let [n2, i2] of Object.entries(this._.schema)) + this.query[n2] = new el(r2.fullSchema, this._.schema, this._.tableNamesMap, r2.fullSchema[n2], i2, e2, t2); + } + static [i.Q] = "PgDatabase"; + query; + $with(e2) { + let t2 = this; + return { as: (r2) => ("function" == typeof r2 && (r2 = r2(new et(t2.dialect))), new Proxy(new L.S(r2.getSQL(), r2.getSelectedFields(), e2, true), new B({ alias: e2, sqlAliasedBehavior: "alias", sqlBehavior: "error" }))) }; + } + $count(e2, t2) { + return new eo({ source: e2, filters: t2, session: this.session }); + } + with(...e2) { + let t2 = this; + return { select: function(r2) { + return new H({ fields: r2 ?? void 0, session: t2.session, dialect: t2.dialect, withList: e2 }); + }, selectDistinct: function(r2) { + return new H({ fields: r2 ?? void 0, session: t2.session, dialect: t2.dialect, withList: e2, distinct: true }); + }, selectDistinctOn: function(r2, n2) { + return new H({ fields: n2 ?? void 0, session: t2.session, dialect: t2.dialect, withList: e2, distinct: { on: r2 } }); + }, update: function(r2) { + return new er(r2, t2.session, t2.dialect, e2); + }, insert: function(r2) { + return new ei(r2, t2.session, t2.dialect, e2); + }, delete: function(r2) { + return new ea(r2, t2.session, t2.dialect, e2); + } }; + } + select(e2) { + return new H({ fields: e2 ?? void 0, session: this.session, dialect: this.dialect }); + } + selectDistinct(e2) { + return new H({ fields: e2 ?? void 0, session: this.session, dialect: this.dialect, distinct: true }); + } + selectDistinctOn(e2, t2) { + return new H({ fields: t2 ?? void 0, session: this.session, dialect: this.dialect, distinct: { on: e2 } }); + } + update(e2) { + return new er(e2, this.session, this.dialect); + } + insert(e2) { + return new ei(e2, this.session, this.dialect); + } + delete(e2) { + return new ea(e2, this.session, this.dialect); + } + refreshMaterializedView(e2) { + return new ed(e2, this.session, this.dialect); + } + execute(e2) { + let t2 = "string" == typeof e2 ? c.i6.raw(e2) : e2.getSQL(), r2 = this.dialect.sqlToQuery(t2), n2 = this.session.prepareQuery(r2, void 0, void 0, false); + return new eu(() => n2.execute(), t2, r2, (e3) => n2.mapResult(e3, true)); + } + transaction(e2, t2) { + return this.session.transaction(e2, t2); + } + } + class ef { + constructor(e2) { + this.query = e2; + } + getQuery() { + return this.query; + } + mapResult(e2, t2) { + return e2; + } + static [i.Q] = "PgPreparedQuery"; + joinsNotNullableMap; + } + class ep { + constructor(e2) { + this.dialect = e2; + } + static [i.Q] = "PgSession"; + execute(e2) { + return z.Z.startActiveSpan("drizzle.operation", () => z.Z.startActiveSpan("drizzle.prepareQuery", () => this.prepareQuery(this.dialect.sqlToQuery(e2), void 0, void 0, false)).execute()); + } + all(e2) { + return this.prepareQuery(this.dialect.sqlToQuery(e2), void 0, void 0, false).all(); + } + async count(e2) { + return Number((await this.execute(e2))[0].count); + } + } + class em extends eh { + constructor(e2, t2, r2, n2 = 0) { + super(e2, t2, r2), this.schema = r2, this.nestedIndex = n2; + } + static [i.Q] = "PgTransaction"; + rollback() { + throw new E(); + } + getTransactionConfigSQL(e2) { + let t2 = []; + return e2.isolationLevel && t2.push(`isolation level ${e2.isolationLevel}`), e2.accessMode && t2.push(e2.accessMode), "boolean" == typeof e2.deferrable && t2.push(e2.deferrable ? "deferrable" : "not deferrable"), c.i6.raw(t2.join(" ")); + } + setTransaction(e2) { + return this.session.execute((0, c.i6)`set transaction ${this.getTransactionConfigSQL(e2)}`); + } + } + let eg = { arrayMode: false, fullResults: true }, ey = { arrayMode: true, fullResults: true }; + class ev extends ef { + constructor(e2, t2, r2, n2, i2, s2) { + super(t2), this.client = e2, this.logger = r2, this.fields = n2, this._isResponseInArrayMode = i2, this.customResultMapper = s2; + } + static [i.Q] = "NeonHttpPreparedQuery"; + async execute(e2 = {}) { + let t2 = (0, c.Pr)(this.query.params, e2); + this.logger.logQuery(this.query.sql, t2); + let { fields: r2, client: n2, query: i2, customResultMapper: s2 } = this; + if (!r2 && !s2) + return n2(i2.sql, t2, eg); + let a2 = await n2(i2.sql, t2, ey); + return this.mapResult(a2); + } + mapResult(e2) { + if (!this.fields && !this.customResultMapper) + return e2; + let t2 = e2.rows; + return this.customResultMapper ? this.customResultMapper(t2) : t2.map((e3) => (0, j.M4)(this.fields, e3, this.joinsNotNullableMap)); + } + all(e2 = {}) { + let t2 = (0, c.Pr)(this.query.params, e2); + return this.logger.logQuery(this.query.sql, t2), this.client(this.query.sql, t2, eg).then((e3) => e3.rows); + } + values(e2 = {}) { + let t2 = (0, c.Pr)(this.query.params, e2); + return this.logger.logQuery(this.query.sql, t2), this.client(this.query.sql, t2, { arrayMode: true, fullResults: true }).then((e3) => e3.rows); + } + isResponseInArrayMode() { + return this._isResponseInArrayMode; + } + } + class eb extends ep { + constructor(e2, t2, r2, n2 = {}) { + super(t2), this.client = e2, this.schema = r2, this.options = n2, this.logger = n2.logger ?? new o(); + } + static [i.Q] = "NeonHttpSession"; + logger; + prepareQuery(e2, t2, r2, n2, i2) { + return new ev(this.client, e2, this.logger, t2, n2, i2); + } + async batch(e2) { + let t2 = [], r2 = []; + for (let n2 of e2) { + let e3 = n2._prepare(), i2 = e3.getQuery(); + t2.push(e3), r2.push(this.client(i2.sql, i2.params, { fullResults: true, arrayMode: e3.isResponseInArrayMode() })); + } + return (await this.client.transaction(r2, ey)).map((e3, r3) => t2[r3].mapResult(e3, true)); + } + async query(e2, t2) { + return this.logger.logQuery(e2, t2), await this.client(e2, t2, { arrayMode: true, fullResults: true }); + } + async queryObjects(e2, t2) { + return this.client(e2, t2, { arrayMode: false, fullResults: true }); + } + async count(e2) { + return Number((await this.execute(e2)).rows[0].count); + } + async transaction(e2, t2 = {}) { + throw Error("No transactions support in neon-http driver"); + } + } + class ew extends null { + static [i.Q] = null; + async transaction(e2) { + throw Error("No transactions support in neon-http driver"); + } + } + class ex { + constructor(e2, t2, r2 = {}) { + this.client = e2, this.dialect = t2, this.options = r2, this.initMappers(); + } + static [i.Q] = "NeonDriver"; + createSession(e2) { + return new eb(this.client, this.dialect, e2, { logger: this.options.logger }); + } + initMappers() { + n.V5.setTypeParser(n.V5.builtins.TIMESTAMPTZ, (e2) => e2), n.V5.setTypeParser(n.V5.builtins.TIMESTAMP, (e2) => e2), n.V5.setTypeParser(n.V5.builtins.DATE, (e2) => e2), n.V5.setTypeParser(n.V5.builtins.INTERVAL, (e2) => e2); + } + } + class eS extends eh { + static [i.Q] = "NeonHttpDatabase"; + async batch(e2) { + return this.session.batch(e2); + } + } + function e_(e2, t2 = {}) { + let r2, n2; + let i2 = new F({ casing: t2.casing }); + if (true === t2.logger ? r2 = new a() : false !== t2.logger && (r2 = t2.logger), t2.schema) { + let e3 = (0, M.pb)(t2.schema, M._J); + n2 = { fullSchema: t2.schema, schema: e3.tables, tableNamesMap: e3.tableNamesMap }; + } + let s2 = new ex(e2, i2, { logger: r2 }).createSession(n2), o2 = new eS(i2, s2, n2); + return o2.$client = e2, o2; + } + function eE(...e2) { + if ("string" == typeof e2[0]) + return e_((0, n.qn)(e2[0]), e2[1]); + if ((0, j.wM)(e2[0])) { + let { connection: t2, client: r2, ...i2 } = e2[0]; + if (r2) + return e_(r2, i2); + if ("object" == typeof t2) { + let { connectionString: e3, ...r3 } = t2; + return e_((0, n.qn)(e3, r3), i2); + } + return e_((0, n.qn)(t2), i2); + } + return e_(e2[0], e2[1]); + } + (eE || (eE = {})).mock = function(e2) { + return e_({}, e2); + }; + }; + __namedExportsObject5["__chunk_35971"] = (e, t, r) => { + "use strict"; + r.d(t, { Q: () => n, is: () => i }); + let n = Symbol.for("drizzle:entityKind"); + function i(e2, t2) { + if (!e2 || "object" != typeof e2) + return false; + if (e2 instanceof t2) + return true; + if (!Object.prototype.hasOwnProperty.call(t2, n)) + throw Error(`Class "${t2.name ?? ""}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`); + let r2 = Object.getPrototypeOf(e2).constructor; + if (r2) + for (; r2; ) { + if (n in r2 && r2[n] === t2[n]) + return true; + r2 = Object.getPrototypeOf(r2); + } + return false; + } + Symbol.for("drizzle:hasOwnEntityKind"); + }; + __namedExportsObject5["__chunk_97014"] = (e, t, r) => { + "use strict"; + r.d(t, { s: () => i }); + var n = r(35971); + class i { + constructor(e2, t2) { + this.table = e2, this.config = t2, this.name = t2.name, this.keyAsName = t2.keyAsName, this.notNull = t2.notNull, this.default = t2.default, this.defaultFn = t2.defaultFn, this.onUpdateFn = t2.onUpdateFn, this.hasDefault = t2.hasDefault, this.primary = t2.primaryKey, this.isUnique = t2.isUnique, this.uniqueName = t2.uniqueName, this.uniqueType = t2.uniqueType, this.dataType = t2.dataType, this.columnType = t2.columnType, this.generated = t2.generated, this.generatedIdentity = t2.generatedIdentity; + } + static [n.Q] = "Column"; + name; + keyAsName; + primary; + notNull; + default; + defaultFn; + onUpdateFn; + hasDefault; + isUnique; + uniqueName; + uniqueType; + dataType; + columnType; + enumValues = void 0; + generated = void 0; + generatedIdentity = void 0; + config; + mapFromDriverValue(e2) { + return e2; + } + mapToDriverValue(e2) { + return e2; + } + shouldDisableInsert() { + return void 0 !== this.config.generated && "byDefault" !== this.config.generated.type; + } + } + }; + __namedExportsObject5["__chunk_94051"] = (e, t, r) => { + "use strict"; + r.d(t, { c: () => i }); + let n = (0, r(63861).D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/@vercel+analytics@1.3.2_vexc2uksyhqelk5ylgnwfopx4a/node_modules/@vercel/analytics/dist/react/index.mjs`), i = n.Analytics; + n.track; + }; + __namedExportsObject5["__chunk_64760"] = (e, t, r) => { + "use strict"; + r.d(t, { s: () => rl }); + var n = r(7717), i = r(28526), s = Object.defineProperty; + ((e10, t10) => { + for (var r2 in t10) + s(e10, r2, { get: t10[r2], enumerable: true }); + })({}, { UpstashError: () => a, UrlError: () => o }); + var a = class extends Error { + constructor(e10) { + super(e10), this.name = "UpstashError"; + } + }, o = class extends Error { + constructor(e10) { + super(`Upstash Redis client was passed an invalid URL. You should pass a URL starting with https. Received: "${e10}". `), this.name = "UrlError"; + } + }, l = class { + baseUrl; + headers; + options; + readYourWrites; + upstashSyncToken = ""; + hasCredentials; + retry; + constructor(e10) { + if (this.options = { backend: e10.options?.backend, agent: e10.agent, responseEncoding: e10.responseEncoding ?? "base64", cache: e10.cache, signal: e10.signal, keepAlive: e10.keepAlive ?? true }, this.upstashSyncToken = "", this.readYourWrites = e10.readYourWrites ?? true, this.baseUrl = (e10.baseUrl || "").replace(/\/$/, ""), this.baseUrl && !/^https?:\/\/[^\s#$./?].\S*$/.test(this.baseUrl)) + throw new o(this.baseUrl); + this.headers = { "Content-Type": "application/json", ...e10.headers }, this.hasCredentials = !!(this.baseUrl && this.headers.authorization.split(" ")[1]), "base64" === this.options.responseEncoding && (this.headers["Upstash-Encoding"] = "base64"), this.retry = "boolean" != typeof e10.retry || e10.retry ? { attempts: e10.retry?.retries ?? 5, backoff: e10.retry?.backoff ?? ((e11) => 50 * Math.exp(e11)) } : { attempts: 1, backoff: () => 0 }; + } + mergeTelemetry(e10) { + this.headers = d(this.headers, "Upstash-Telemetry-Runtime", e10.runtime), this.headers = d(this.headers, "Upstash-Telemetry-Platform", e10.platform), this.headers = d(this.headers, "Upstash-Telemetry-Sdk", e10.sdk); + } + async request(e10) { + let t10 = { cache: this.options.cache, method: "POST", headers: this.headers, body: JSON.stringify(e10.body), keepalive: this.options.keepAlive, agent: this.options.agent, signal: this.options.signal, backend: this.options.backend }; + if (this.hasCredentials || console.warn("[Upstash Redis] Redis client was initialized without url or token. Failed to execute command."), this.readYourWrites) { + let e11 = this.upstashSyncToken; + this.headers["upstash-sync-token"] = e11; + } + let r2 = null, n2 = null; + for (let i3 = 0; i3 <= this.retry.attempts; i3++) + try { + r2 = await fetch([this.baseUrl, ...e10.path ?? []].join("/"), t10); + break; + } catch (e11) { + if (this.options.signal?.aborted) { + r2 = new Response(new Blob([JSON.stringify({ result: this.options.signal.reason ?? "Aborted" })]), { status: 200, statusText: this.options.signal.reason ?? "Aborted" }); + break; + } + n2 = e11, await new Promise((e12) => setTimeout(e12, this.retry.backoff(i3))); + } + if (!r2) + throw n2 ?? Error("Exhausted all retries"); + let i2 = await r2.json(); + if (!r2.ok) + throw new a(`${i2.error}, command was: ${JSON.stringify(e10.body)}`); + if (this.readYourWrites || this.readYourWrites) { + let e11 = r2.headers; + this.upstashSyncToken = e11.get("upstash-sync-token") ?? ""; + } + return "base64" === this.options.responseEncoding ? Array.isArray(i2) ? i2.map(({ result: e11, error: t11 }) => ({ result: u(e11), error: t11 })) : { result: u(i2.result), error: i2.error } : i2; + } + }; + function c(e10) { + let t10 = ""; + try { + let r2 = atob(e10), n2 = r2.length, i2 = new Uint8Array(n2); + for (let e11 = 0; e11 < n2; e11++) + i2[e11] = r2.charCodeAt(e11); + t10 = new TextDecoder().decode(i2); + } catch { + t10 = e10; + } + return t10; + } + function u(e10) { + let t10; + switch (typeof e10) { + case "undefined": + return e10; + case "number": + t10 = e10; + break; + case "object": + t10 = Array.isArray(e10) ? e10.map((e11) => "string" == typeof e11 ? c(e11) : Array.isArray(e11) ? e11.map((e12) => u(e12)) : e11) : null; + break; + case "string": + t10 = "OK" === e10 ? "OK" : c(e10); + } + return t10; + } + function d(e10, t10, r2) { + return r2 && (e10[t10] = e10[t10] ? [e10[t10], r2].join(",") : r2), e10; + } + function h(e10) { + try { + return function e11(t10) { + let r2 = Array.isArray(t10) ? t10.map((t11) => { + try { + return e11(t11); + } catch { + return t11; + } + }) : JSON.parse(t10); + return "number" == typeof r2 && r2.toString() !== t10 ? t10 : r2; + }(e10); + } catch { + return e10; + } + } + function f(e10) { + return [e10[0], ...h(e10.slice(1))]; + } + var p = (e10) => { + switch (typeof e10) { + case "string": + case "number": + case "boolean": + return e10; + default: + return JSON.stringify(e10); + } + }, m = class { + command; + serialize; + deserialize; + constructor(e10, t10) { + if (this.serialize = p, this.deserialize = t10?.automaticDeserialization === void 0 || t10.automaticDeserialization ? t10?.deserialize ?? h : (e11) => e11, this.command = e10.map((e11) => this.serialize(e11)), t10?.latencyLogging) { + let e11 = this.exec.bind(this); + this.exec = async (t11) => { + let r2 = performance.now(), n2 = await e11(t11), i2 = (performance.now() - r2).toFixed(2); + return console.log(`Latency for \x1B[38;2;19;185;39m${this.command[0].toString().toUpperCase()}\x1B[0m: \x1B[38;2;0;255;255m${i2} ms\x1B[0m`), n2; + }; + } + } + async exec(e10) { + let { result: t10, error: r2 } = await e10.request({ body: this.command, upstashSyncToken: e10.upstashSyncToken }); + if (r2) + throw new a(r2); + if (void 0 === t10) + throw TypeError("Request did not return a result"); + return this.deserialize(t10); + } + }, g = class extends m { + constructor(e10, t10) { + let r2 = ["hrandfield", e10[0]]; + "number" == typeof e10[1] && r2.push(e10[1]), e10[2] && r2.push("WITHVALUES"), super(r2, { deserialize: e10[2] ? (e11) => function(e12) { + if (0 === e12.length) + return null; + let t11 = {}; + for (; e12.length >= 2; ) { + let r3 = e12.shift(), n2 = e12.shift(); + try { + t11[r3] = JSON.parse(n2); + } catch { + t11[r3] = n2; + } + } + return t11; + }(e11) : t10?.deserialize, ...t10 }); + } + }, y = class extends m { + constructor(e10, t10) { + super(["append", ...e10], t10); + } + }, v = class extends m { + constructor([e10, t10, r2], n2) { + let i2 = ["bitcount", e10]; + "number" == typeof t10 && i2.push(t10), "number" == typeof r2 && i2.push(r2), super(i2, n2); + } + }, b = class { + constructor(e10, t10, r2, n2 = (e11) => e11.exec(this.client)) { + this.client = t10, this.opts = r2, this.execOperation = n2, this.command = ["bitfield", ...e10]; + } + command; + chain(...e10) { + return this.command.push(...e10), this; + } + get(...e10) { + return this.chain("get", ...e10); + } + set(...e10) { + return this.chain("set", ...e10); + } + incrby(...e10) { + return this.chain("incrby", ...e10); + } + overflow(e10) { + return this.chain("overflow", e10); + } + exec() { + let e10 = new m(this.command, this.opts); + return this.execOperation(e10); + } + }, w = class extends m { + constructor(e10, t10) { + super(["bitop", ...e10], t10); + } + }, x = class extends m { + constructor(e10, t10) { + super(["bitpos", ...e10], t10); + } + }, S = class extends m { + constructor([e10, t10, r2], n2) { + super(["COPY", e10, t10, ...r2?.replace ? ["REPLACE"] : []], { ...n2, deserialize: (e11) => e11 > 0 ? "COPIED" : "NOT_COPIED" }); + } + }, _ = class extends m { + constructor(e10) { + super(["dbsize"], e10); + } + }, E = class extends m { + constructor(e10, t10) { + super(["decr", ...e10], t10); + } + }, k = class extends m { + constructor(e10, t10) { + super(["decrby", ...e10], t10); + } + }, C = class extends m { + constructor(e10, t10) { + super(["del", ...e10], t10); + } + }, R = class extends m { + constructor(e10, t10) { + super(["echo", ...e10], t10); + } + }, P = class extends m { + constructor([e10, t10, r2], n2) { + super(["eval", e10, t10.length, ...t10, ...r2 ?? []], n2); + } + }, T = class extends m { + constructor([e10, t10, r2], n2) { + super(["evalsha", e10, t10.length, ...t10, ...r2 ?? []], n2); + } + }, A = class extends m { + constructor(e10, t10) { + super(["exists", ...e10], t10); + } + }, O = class extends m { + constructor(e10, t10) { + super(["expire", ...e10.filter(Boolean)], t10); + } + }, I = class extends m { + constructor(e10, t10) { + super(["expireat", ...e10], t10); + } + }, N = class extends m { + constructor(e10, t10) { + let r2 = ["flushall"]; + e10 && e10.length > 0 && e10[0].async && r2.push("async"), super(r2, t10); + } + }, M = class extends m { + constructor([e10], t10) { + let r2 = ["flushdb"]; + e10?.async && r2.push("async"), super(r2, t10); + } + }, $ = class extends m { + constructor([e10, t10, ...r2], n2) { + let i2 = ["geoadd", e10]; + "nx" in t10 && t10.nx ? i2.push("nx") : "xx" in t10 && t10.xx && i2.push("xx"), "ch" in t10 && t10.ch && i2.push("ch"), "latitude" in t10 && t10.latitude && i2.push(t10.longitude, t10.latitude, t10.member), i2.push(...r2.flatMap(({ latitude: e11, longitude: t11, member: r3 }) => [t11, e11, r3])), super(i2, n2); + } + }, L = class extends m { + constructor([e10, t10, r2, n2 = "M"], i2) { + super(["GEODIST", e10, t10, r2, n2], i2); + } + }, j = class extends m { + constructor(e10, t10) { + let [r2] = e10; + super(["GEOHASH", r2, ...Array.isArray(e10[1]) ? e10[1] : e10.slice(1)], t10); + } + }, D = class extends m { + constructor(e10, t10) { + let [r2] = e10; + super(["GEOPOS", r2, ...Array.isArray(e10[1]) ? e10[1] : e10.slice(1)], { deserialize: (e11) => function(e12) { + let t11 = []; + for (let r3 of e12) + r3?.[0] && r3?.[1] && t11.push({ lng: Number.parseFloat(r3[0]), lat: Number.parseFloat(r3[1]) }); + return t11; + }(e11), ...t10 }); + } + }, F = class extends m { + constructor([e10, t10, r2, n2, i2], s2) { + let a2 = ["GEOSEARCH", e10]; + ("FROMMEMBER" === t10.type || "frommember" === t10.type) && a2.push(t10.type, t10.member), ("FROMLONLAT" === t10.type || "fromlonlat" === t10.type) && a2.push(t10.type, t10.coordinate.lon, t10.coordinate.lat), ("BYRADIUS" === r2.type || "byradius" === r2.type) && a2.push(r2.type, r2.radius, r2.radiusType), ("BYBOX" === r2.type || "bybox" === r2.type) && a2.push(r2.type, r2.rect.width, r2.rect.height, r2.rectType), a2.push(n2), i2?.count && a2.push("COUNT", i2.count.limit, ...i2.count.any ? ["ANY"] : []), super([...a2, ...i2?.withCoord ? ["WITHCOORD"] : [], ...i2?.withDist ? ["WITHDIST"] : [], ...i2?.withHash ? ["WITHHASH"] : []], { deserialize: (e11) => i2?.withCoord || i2?.withDist || i2?.withHash ? e11.map((e12) => { + let t11 = 1, r3 = {}; + try { + r3.member = JSON.parse(e12[0]); + } catch { + r3.member = e12[0]; + } + return i2.withDist && (r3.dist = Number.parseFloat(e12[t11++])), i2.withHash && (r3.hash = e12[t11++].toString()), i2.withCoord && (r3.coord = { long: Number.parseFloat(e12[t11][0]), lat: Number.parseFloat(e12[t11][1]) }), r3; + }) : e11.map((e12) => { + try { + return { member: JSON.parse(e12) }; + } catch { + return { member: e12 }; + } + }), ...s2 }); + } + }, B = class extends m { + constructor([e10, t10, r2, n2, i2, s2], a2) { + let o2 = ["GEOSEARCHSTORE", e10, t10]; + ("FROMMEMBER" === r2.type || "frommember" === r2.type) && o2.push(r2.type, r2.member), ("FROMLONLAT" === r2.type || "fromlonlat" === r2.type) && o2.push(r2.type, r2.coordinate.lon, r2.coordinate.lat), ("BYRADIUS" === n2.type || "byradius" === n2.type) && o2.push(n2.type, n2.radius, n2.radiusType), ("BYBOX" === n2.type || "bybox" === n2.type) && o2.push(n2.type, n2.rect.width, n2.rect.height, n2.rectType), o2.push(i2), s2?.count && o2.push("COUNT", s2.count.limit, ...s2.count.any ? ["ANY"] : []), super([...o2, ...s2?.storeDist ? ["STOREDIST"] : []], a2); + } + }, U = class extends m { + constructor(e10, t10) { + super(["get", ...e10], t10); + } + }, q = class extends m { + constructor(e10, t10) { + super(["getbit", ...e10], t10); + } + }, z = class extends m { + constructor(e10, t10) { + super(["getdel", ...e10], t10); + } + }, H = class extends m { + constructor(e10, t10) { + super(["getrange", ...e10], t10); + } + }, W = class extends m { + constructor(e10, t10) { + super(["getset", ...e10], t10); + } + }, Q = class extends m { + constructor(e10, t10) { + super(["hdel", ...e10], t10); + } + }, V = class extends m { + constructor(e10, t10) { + super(["hexists", ...e10], t10); + } + }, G = class extends m { + constructor(e10, t10) { + super(["hget", ...e10], t10); + } + }, Z = class extends m { + constructor(e10, t10) { + super(["hgetall", ...e10], { deserialize: (e11) => function(e12) { + if (0 === e12.length) + return null; + let t11 = {}; + for (; e12.length >= 2; ) { + let r2 = e12.shift(), n2 = e12.shift(); + try { + let e13 = !Number.isNaN(Number(n2)) && !Number.isSafeInteger(Number(n2)); + t11[r2] = e13 ? n2 : JSON.parse(n2); + } catch { + t11[r2] = n2; + } + } + return t11; + }(e11), ...t10 }); + } + }, K = class extends m { + constructor(e10, t10) { + super(["hincrby", ...e10], t10); + } + }, J = class extends m { + constructor(e10, t10) { + super(["hincrbyfloat", ...e10], t10); + } + }, Y = class extends m { + constructor([e10], t10) { + super(["hkeys", e10], t10); + } + }, X = class extends m { + constructor(e10, t10) { + super(["hlen", ...e10], t10); + } + }, ee = class extends m { + constructor([e10, ...t10], r2) { + super(["hmget", e10, ...t10], { deserialize: (e11) => function(e12, t11) { + if (t11.every((e13) => null === e13)) + return null; + let r3 = {}; + for (let [n2, i2] of e12.entries()) + try { + r3[i2] = JSON.parse(t11[n2]); + } catch { + r3[i2] = t11[n2]; + } + return r3; + }(t10, e11), ...r2 }); + } + }, et = class extends m { + constructor([e10, t10], r2) { + super(["hmset", e10, ...Object.entries(t10).flatMap(([e11, t11]) => [e11, t11])], r2); + } + }, er = class extends m { + constructor([e10, t10, r2], n2) { + let i2 = ["hscan", e10, t10]; + r2?.match && i2.push("match", r2.match), "number" == typeof r2?.count && i2.push("count", r2.count), super(i2, { deserialize: f, ...n2 }); + } + }, en = class extends m { + constructor([e10, t10], r2) { + super(["hset", e10, ...Object.entries(t10).flatMap(([e11, t11]) => [e11, t11])], r2); + } + }, ei = class extends m { + constructor(e10, t10) { + super(["hsetnx", ...e10], t10); + } + }, es = class extends m { + constructor(e10, t10) { + super(["hstrlen", ...e10], t10); + } + }, ea = class extends m { + constructor(e10, t10) { + super(["hvals", ...e10], t10); + } + }, eo = class extends m { + constructor(e10, t10) { + super(["incr", ...e10], t10); + } + }, el = class extends m { + constructor(e10, t10) { + super(["incrby", ...e10], t10); + } + }, ec = class extends m { + constructor(e10, t10) { + super(["incrbyfloat", ...e10], t10); + } + }, eu = class extends m { + constructor(e10, t10) { + super(["JSON.ARRAPPEND", ...e10], t10); + } + }, ed = class extends m { + constructor(e10, t10) { + super(["JSON.ARRINDEX", ...e10], t10); + } + }, eh = class extends m { + constructor(e10, t10) { + super(["JSON.ARRINSERT", ...e10], t10); + } + }, ef = class extends m { + constructor(e10, t10) { + super(["JSON.ARRLEN", e10[0], e10[1] ?? "$"], t10); + } + }, ep = class extends m { + constructor(e10, t10) { + super(["JSON.ARRPOP", ...e10], t10); + } + }, em = class extends m { + constructor(e10, t10) { + super(["JSON.ARRTRIM", e10[0], e10[1] ?? "$", e10[2] ?? 0, e10[3] ?? 0], t10); + } + }, eg = class extends m { + constructor(e10, t10) { + super(["JSON.CLEAR", ...e10], t10); + } + }, ey = class extends m { + constructor(e10, t10) { + super(["JSON.DEL", ...e10], t10); + } + }, ev = class extends m { + constructor(e10, t10) { + super(["JSON.FORGET", ...e10], t10); + } + }, eb = class extends m { + constructor(e10, t10) { + let r2 = ["JSON.GET"]; + "string" == typeof e10[1] ? r2.push(...e10) : (r2.push(e10[0]), e10[1] && (e10[1].indent && r2.push("INDENT", e10[1].indent), e10[1].newline && r2.push("NEWLINE", e10[1].newline), e10[1].space && r2.push("SPACE", e10[1].space)), r2.push(...e10.slice(2))), super(r2, t10); + } + }, ew = class extends m { + constructor(e10, t10) { + super(["JSON.MGET", ...e10[0], e10[1]], t10); + } + }, ex = class extends m { + constructor(e10, t10) { + let r2 = ["JSON.MSET"]; + for (let t11 of e10) + r2.push(t11.key, t11.path, t11.value); + super(r2, t10); + } + }, eS = class extends m { + constructor(e10, t10) { + super(["JSON.NUMINCRBY", ...e10], t10); + } + }, e_ = class extends m { + constructor(e10, t10) { + super(["JSON.NUMMULTBY", ...e10], t10); + } + }, eE = class extends m { + constructor(e10, t10) { + super(["JSON.OBJKEYS", ...e10], t10); + } + }, ek = class extends m { + constructor(e10, t10) { + super(["JSON.OBJLEN", ...e10], t10); + } + }, eC = class extends m { + constructor(e10, t10) { + super(["JSON.RESP", ...e10], t10); + } + }, eR = class extends m { + constructor(e10, t10) { + let r2 = ["JSON.SET", e10[0], e10[1], e10[2]]; + e10[3] && (e10[3].nx ? r2.push("NX") : e10[3].xx && r2.push("XX")), super(r2, t10); + } + }, eP = class extends m { + constructor(e10, t10) { + super(["JSON.STRAPPEND", ...e10], t10); + } + }, eT = class extends m { + constructor(e10, t10) { + super(["JSON.STRLEN", ...e10], t10); + } + }, eA = class extends m { + constructor(e10, t10) { + super(["JSON.TOGGLE", ...e10], t10); + } + }, eO = class extends m { + constructor(e10, t10) { + super(["JSON.TYPE", ...e10], t10); + } + }, eI = class extends m { + constructor(e10, t10) { + super(["keys", ...e10], t10); + } + }, eN = class extends m { + constructor(e10, t10) { + super(["lindex", ...e10], t10); + } + }, eM = class extends m { + constructor(e10, t10) { + super(["linsert", ...e10], t10); + } + }, e$ = class extends m { + constructor(e10, t10) { + super(["llen", ...e10], t10); + } + }, eL = class extends m { + constructor(e10, t10) { + super(["lmove", ...e10], t10); + } + }, ej = class extends m { + constructor(e10, t10) { + let [r2, n2, i2, s2] = e10; + super(["LMPOP", r2, ...n2, i2, ...s2 ? ["COUNT", s2] : []], t10); + } + }, eD = class extends m { + constructor(e10, t10) { + super(["lpop", ...e10], t10); + } + }, eF = class extends m { + constructor(e10, t10) { + let r2 = ["lpos", e10[0], e10[1]]; + "number" == typeof e10[2]?.rank && r2.push("rank", e10[2].rank), "number" == typeof e10[2]?.count && r2.push("count", e10[2].count), "number" == typeof e10[2]?.maxLen && r2.push("maxLen", e10[2].maxLen), super(r2, t10); + } + }, eB = class extends m { + constructor(e10, t10) { + super(["lpush", ...e10], t10); + } + }, eU = class extends m { + constructor(e10, t10) { + super(["lpushx", ...e10], t10); + } + }, eq = class extends m { + constructor(e10, t10) { + super(["lrange", ...e10], t10); + } + }, ez = class extends m { + constructor(e10, t10) { + super(["lrem", ...e10], t10); + } + }, eH = class extends m { + constructor(e10, t10) { + super(["lset", ...e10], t10); + } + }, eW = class extends m { + constructor(e10, t10) { + super(["ltrim", ...e10], t10); + } + }, eQ = class extends m { + constructor(e10, t10) { + super(["mget", ...Array.isArray(e10[0]) ? e10[0] : e10], t10); + } + }, eV = class extends m { + constructor([e10], t10) { + super(["mset", ...Object.entries(e10).flatMap(([e11, t11]) => [e11, t11])], t10); + } + }, eG = class extends m { + constructor([e10], t10) { + super(["msetnx", ...Object.entries(e10).flat()], t10); + } + }, eZ = class extends m { + constructor(e10, t10) { + super(["persist", ...e10], t10); + } + }, eK = class extends m { + constructor(e10, t10) { + super(["pexpire", ...e10], t10); + } + }, eJ = class extends m { + constructor(e10, t10) { + super(["pexpireat", ...e10], t10); + } + }, eY = class extends m { + constructor(e10, t10) { + super(["pfadd", ...e10], t10); + } + }, eX = class extends m { + constructor(e10, t10) { + super(["pfcount", ...e10], t10); + } + }, e0 = class extends m { + constructor(e10, t10) { + super(["pfmerge", ...e10], t10); + } + }, e1 = class extends m { + constructor(e10, t10) { + let r2 = ["ping"]; + e10?.[0] !== void 0 && r2.push(e10[0]), super(r2, t10); + } + }, e2 = class extends m { + constructor(e10, t10) { + super(["psetex", ...e10], t10); + } + }, e6 = class extends m { + constructor(e10, t10) { + super(["pttl", ...e10], t10); + } + }, e5 = class extends m { + constructor(e10, t10) { + super(["publish", ...e10], t10); + } + }, e4 = class extends m { + constructor(e10) { + super(["randomkey"], e10); + } + }, e3 = class extends m { + constructor(e10, t10) { + super(["rename", ...e10], t10); + } + }, e8 = class extends m { + constructor(e10, t10) { + super(["renamenx", ...e10], t10); + } + }, e9 = class extends m { + constructor(e10, t10) { + super(["rpop", ...e10], t10); + } + }, e7 = class extends m { + constructor(e10, t10) { + super(["rpush", ...e10], t10); + } + }, te = class extends m { + constructor(e10, t10) { + super(["rpushx", ...e10], t10); + } + }, tt = class extends m { + constructor(e10, t10) { + super(["sadd", ...e10], t10); + } + }, tr = class extends m { + constructor([e10, t10], r2) { + let n2 = ["scan", e10]; + t10?.match && n2.push("match", t10.match), "number" == typeof t10?.count && n2.push("count", t10.count), t10?.type && t10.type.length > 0 && n2.push("type", t10.type), super(n2, { deserialize: f, ...r2 }); + } + }, tn = class extends m { + constructor(e10, t10) { + super(["scard", ...e10], t10); + } + }, ti = class extends m { + constructor(e10, t10) { + super(["script", "exists", ...e10], { deserialize: (e11) => e11, ...t10 }); + } + }, ts = class extends m { + constructor([e10], t10) { + let r2 = ["script", "flush"]; + e10?.sync ? r2.push("sync") : e10?.async && r2.push("async"), super(r2, t10); + } + }, ta = class extends m { + constructor(e10, t10) { + super(["script", "load", ...e10], t10); + } + }, to = class extends m { + constructor(e10, t10) { + super(["sdiff", ...e10], t10); + } + }, tl = class extends m { + constructor(e10, t10) { + super(["sdiffstore", ...e10], t10); + } + }, tc = class extends m { + constructor([e10, t10, r2], n2) { + let i2 = ["set", e10, t10]; + r2 && ("nx" in r2 && r2.nx ? i2.push("nx") : "xx" in r2 && r2.xx && i2.push("xx"), "get" in r2 && r2.get && i2.push("get"), "ex" in r2 && "number" == typeof r2.ex ? i2.push("ex", r2.ex) : "px" in r2 && "number" == typeof r2.px ? i2.push("px", r2.px) : "exat" in r2 && "number" == typeof r2.exat ? i2.push("exat", r2.exat) : "pxat" in r2 && "number" == typeof r2.pxat ? i2.push("pxat", r2.pxat) : "keepTtl" in r2 && r2.keepTtl && i2.push("keepTtl")), super(i2, n2); + } + }, tu = class extends m { + constructor(e10, t10) { + super(["setbit", ...e10], t10); + } + }, td = class extends m { + constructor(e10, t10) { + super(["setex", ...e10], t10); + } + }, th = class extends m { + constructor(e10, t10) { + super(["setnx", ...e10], t10); + } + }, tf = class extends m { + constructor(e10, t10) { + super(["setrange", ...e10], t10); + } + }, tp = class extends m { + constructor(e10, t10) { + super(["sinter", ...e10], t10); + } + }, tm = class extends m { + constructor(e10, t10) { + super(["sinterstore", ...e10], t10); + } + }, tg = class extends m { + constructor(e10, t10) { + super(["sismember", ...e10], t10); + } + }, ty = class extends m { + constructor(e10, t10) { + super(["smembers", ...e10], t10); + } + }, tv = class extends m { + constructor(e10, t10) { + super(["smismember", e10[0], ...e10[1]], t10); + } + }, tb = class extends m { + constructor(e10, t10) { + super(["smove", ...e10], t10); + } + }, tw = class extends m { + constructor([e10, t10], r2) { + let n2 = ["spop", e10]; + "number" == typeof t10 && n2.push(t10), super(n2, r2); + } + }, tx = class extends m { + constructor([e10, t10], r2) { + let n2 = ["srandmember", e10]; + "number" == typeof t10 && n2.push(t10), super(n2, r2); + } + }, tS = class extends m { + constructor(e10, t10) { + super(["srem", ...e10], t10); + } + }, t_ = class extends m { + constructor([e10, t10, r2], n2) { + let i2 = ["sscan", e10, t10]; + r2?.match && i2.push("match", r2.match), "number" == typeof r2?.count && i2.push("count", r2.count), super(i2, { deserialize: f, ...n2 }); + } + }, tE = class extends m { + constructor(e10, t10) { + super(["strlen", ...e10], t10); + } + }, tk = class extends m { + constructor(e10, t10) { + super(["sunion", ...e10], t10); + } + }, tC = class extends m { + constructor(e10, t10) { + super(["sunionstore", ...e10], t10); + } + }, tR = class extends m { + constructor(e10) { + super(["time"], e10); + } + }, tP = class extends m { + constructor(e10, t10) { + super(["touch", ...e10], t10); + } + }, tT = class extends m { + constructor(e10, t10) { + super(["ttl", ...e10], t10); + } + }, tA = class extends m { + constructor(e10, t10) { + super(["type", ...e10], t10); + } + }, tO = class extends m { + constructor(e10, t10) { + super(["unlink", ...e10], t10); + } + }, tI = class extends m { + constructor([e10, t10, r2], n2) { + super(["XACK", e10, t10, ...Array.isArray(r2) ? [...r2] : [r2]], n2); + } + }, tN = class extends m { + constructor([e10, t10, r2, n2], i2) { + let s2 = ["XADD", e10]; + for (let [e11, i3] of (n2 && (n2.nomkStream && s2.push("NOMKSTREAM"), n2.trim && (s2.push(n2.trim.type, n2.trim.comparison, n2.trim.threshold), void 0 !== n2.trim.limit && s2.push("LIMIT", n2.trim.limit))), s2.push(t10), Object.entries(r2))) + s2.push(e11, i3); + super(s2, i2); + } + }, tM = class extends m { + constructor([e10, t10, r2, n2, i2, s2], a2) { + let o2 = []; + s2?.count && o2.push("COUNT", s2.count), s2?.justId && o2.push("JUSTID"), super(["XAUTOCLAIM", e10, t10, r2, n2, i2, ...o2], a2); + } + }, t$ = class extends m { + constructor([e10, t10, r2, n2, i2, s2], a2) { + let o2 = Array.isArray(i2) ? [...i2] : [i2], l2 = []; + s2?.idleMS && l2.push("IDLE", s2.idleMS), s2?.idleMS && l2.push("TIME", s2.timeMS), s2?.retryCount && l2.push("RETRYCOUNT", s2.retryCount), s2?.force && l2.push("FORCE"), s2?.justId && l2.push("JUSTID"), s2?.lastId && l2.push("LASTID", s2.lastId), super(["XCLAIM", e10, t10, r2, n2, ...o2, ...l2], a2); + } + }, tL = class extends m { + constructor([e10, t10], r2) { + super(["XDEL", e10, ...Array.isArray(t10) ? [...t10] : [t10]], r2); + } + }, tj = class extends m { + constructor([e10, t10], r2) { + let n2 = ["XGROUP"]; + switch (t10.type) { + case "CREATE": + n2.push("CREATE", e10, t10.group, t10.id), t10.options && (t10.options.MKSTREAM && n2.push("MKSTREAM"), void 0 !== t10.options.ENTRIESREAD && n2.push("ENTRIESREAD", t10.options.ENTRIESREAD.toString())); + break; + case "CREATECONSUMER": + n2.push("CREATECONSUMER", e10, t10.group, t10.consumer); + break; + case "DELCONSUMER": + n2.push("DELCONSUMER", e10, t10.group, t10.consumer); + break; + case "DESTROY": + n2.push("DESTROY", e10, t10.group); + break; + case "SETID": + n2.push("SETID", e10, t10.group, t10.id), t10.options?.ENTRIESREAD !== void 0 && n2.push("ENTRIESREAD", t10.options.ENTRIESREAD.toString()); + break; + default: + throw Error("Invalid XGROUP"); + } + super(n2, r2); + } + }, tD = class extends m { + constructor([e10, t10], r2) { + let n2 = []; + "CONSUMERS" === t10.type ? n2.push("CONSUMERS", e10, t10.group) : n2.push("GROUPS", e10), super(["XINFO", ...n2], r2); + } + }, tF = class extends m { + constructor(e10, t10) { + super(["XLEN", ...e10], t10); + } + }, tB = class extends m { + constructor([e10, t10, r2, n2, i2, s2], a2) { + super(["XPENDING", e10, t10, ...s2?.idleTime ? ["IDLE", s2.idleTime] : [], r2, n2, i2, ...s2?.consumer === void 0 ? [] : Array.isArray(s2.consumer) ? [...s2.consumer] : [s2.consumer]], a2); + } + }, tU = class extends m { + constructor([e10, t10, r2, n2], i2) { + let s2 = ["XRANGE", e10, t10, r2]; + "number" == typeof n2 && s2.push("COUNT", n2), super(s2, { deserialize: (e11) => function(e12) { + let t11 = {}; + for (let r3 of e12) + for (; r3.length >= 2; ) { + let e13 = r3.shift(), n3 = r3.shift(); + for ((e13 in t11) || (t11[e13] = {}); n3.length >= 2; ) { + let r4 = n3.shift(), i3 = n3.shift(); + try { + t11[e13][r4] = JSON.parse(i3); + } catch { + t11[e13][r4] = i3; + } + } + } + return t11; + }(e11), ...i2 }); + } + }, tq = class extends m { + constructor([e10, t10, r2], n2) { + if (Array.isArray(e10) && Array.isArray(t10) && e10.length !== t10.length) + throw Error("ERR Unbalanced XREAD list of streams: for each stream key an ID or '$' must be specified"); + let i2 = []; + "number" == typeof r2?.count && i2.push("COUNT", r2.count), "number" == typeof r2?.blockMS && i2.push("BLOCK", r2.blockMS), i2.push("STREAMS", ...Array.isArray(e10) ? [...e10] : [e10], ...Array.isArray(t10) ? [...t10] : [t10]), super(["XREAD", ...i2], n2); + } + }, tz = class extends m { + constructor([e10, t10, r2, n2, i2], s2) { + if (Array.isArray(r2) && Array.isArray(n2) && r2.length !== n2.length) + throw Error("ERR Unbalanced XREADGROUP list of streams: for each stream key an ID or '$' must be specified"); + let a2 = []; + "number" == typeof i2?.count && a2.push("COUNT", i2.count), "number" == typeof i2?.blockMS && a2.push("BLOCK", i2.blockMS), "boolean" == typeof i2?.NOACK && i2.NOACK && a2.push("NOACK"), a2.push("STREAMS", ...Array.isArray(r2) ? [...r2] : [r2], ...Array.isArray(n2) ? [...n2] : [n2]), super(["XREADGROUP", "GROUP", e10, t10, ...a2], s2); + } + }, tH = class extends m { + constructor([e10, t10, r2, n2], i2) { + let s2 = ["XREVRANGE", e10, t10, r2]; + "number" == typeof n2 && s2.push("COUNT", n2), super(s2, { deserialize: (e11) => function(e12) { + let t11 = {}; + for (let r3 of e12) + for (; r3.length >= 2; ) { + let e13 = r3.shift(), n3 = r3.shift(); + for ((e13 in t11) || (t11[e13] = {}); n3.length >= 2; ) { + let r4 = n3.shift(), i3 = n3.shift(); + try { + t11[e13][r4] = JSON.parse(i3); + } catch { + t11[e13][r4] = i3; + } + } + } + return t11; + }(e11), ...i2 }); + } + }, tW = class extends m { + constructor([e10, t10], r2) { + let { limit: n2, strategy: i2, threshold: s2, exactness: a2 = "~" } = t10; + super(["XTRIM", e10, i2, a2, s2, ...n2 ? ["LIMIT", n2] : []], r2); + } + }, tQ = class extends m { + constructor([e10, t10, ...r2], n2) { + let i2 = ["zadd", e10]; + "nx" in t10 && t10.nx ? i2.push("nx") : "xx" in t10 && t10.xx && i2.push("xx"), "ch" in t10 && t10.ch && i2.push("ch"), "incr" in t10 && t10.incr && i2.push("incr"), "lt" in t10 && t10.lt ? i2.push("lt") : "gt" in t10 && t10.gt && i2.push("gt"), "score" in t10 && "member" in t10 && i2.push(t10.score, t10.member), i2.push(...r2.flatMap(({ score: e11, member: t11 }) => [e11, t11])), super(i2, n2); + } + }, tV = class extends m { + constructor(e10, t10) { + super(["zcard", ...e10], t10); + } + }, tG = class extends m { + constructor(e10, t10) { + super(["zcount", ...e10], t10); + } + }, tZ = class extends m { + constructor(e10, t10) { + super(["zincrby", ...e10], t10); + } + }, tK = class extends m { + constructor([e10, t10, r2, n2], i2) { + let s2 = ["zinterstore", e10, t10]; + Array.isArray(r2) ? s2.push(...r2) : s2.push(r2), n2 && ("weights" in n2 && n2.weights ? s2.push("weights", ...n2.weights) : "weight" in n2 && "number" == typeof n2.weight && s2.push("weights", n2.weight), "aggregate" in n2 && s2.push("aggregate", n2.aggregate)), super(s2, i2); + } + }, tJ = class extends m { + constructor(e10, t10) { + super(["zlexcount", ...e10], t10); + } + }, tY = class extends m { + constructor([e10, t10], r2) { + let n2 = ["zpopmax", e10]; + "number" == typeof t10 && n2.push(t10), super(n2, r2); + } + }, tX = class extends m { + constructor([e10, t10], r2) { + let n2 = ["zpopmin", e10]; + "number" == typeof t10 && n2.push(t10), super(n2, r2); + } + }, t0 = class extends m { + constructor([e10, t10, r2, n2], i2) { + let s2 = ["zrange", e10, t10, r2]; + n2?.byScore && s2.push("byscore"), n2?.byLex && s2.push("bylex"), n2?.rev && s2.push("rev"), n2?.count !== void 0 && void 0 !== n2.offset && s2.push("limit", n2.offset, n2.count), n2?.withScores && s2.push("withscores"), super(s2, i2); + } + }, t1 = class extends m { + constructor(e10, t10) { + super(["zrank", ...e10], t10); + } + }, t2 = class extends m { + constructor(e10, t10) { + super(["zrem", ...e10], t10); + } + }, t6 = class extends m { + constructor(e10, t10) { + super(["zremrangebylex", ...e10], t10); + } + }, t5 = class extends m { + constructor(e10, t10) { + super(["zremrangebyrank", ...e10], t10); + } + }, t4 = class extends m { + constructor(e10, t10) { + super(["zremrangebyscore", ...e10], t10); + } + }, t3 = class extends m { + constructor(e10, t10) { + super(["zrevrank", ...e10], t10); + } + }, t8 = class extends m { + constructor([e10, t10, r2], n2) { + let i2 = ["zscan", e10, t10]; + r2?.match && i2.push("match", r2.match), "number" == typeof r2?.count && i2.push("count", r2.count), super(i2, { deserialize: f, ...n2 }); + } + }, t9 = class extends m { + constructor(e10, t10) { + super(["zscore", ...e10], t10); + } + }, t7 = class extends m { + constructor([e10, t10, r2], n2) { + let i2 = ["zunion", e10]; + Array.isArray(t10) ? i2.push(...t10) : i2.push(t10), r2 && ("weights" in r2 && r2.weights ? i2.push("weights", ...r2.weights) : "weight" in r2 && "number" == typeof r2.weight && i2.push("weights", r2.weight), "aggregate" in r2 && i2.push("aggregate", r2.aggregate), r2.withScores && i2.push("withscores")), super(i2, n2); + } + }, re = class extends m { + constructor([e10, t10, r2, n2], i2) { + let s2 = ["zunionstore", e10, t10]; + Array.isArray(r2) ? s2.push(...r2) : s2.push(r2), n2 && ("weights" in n2 && n2.weights ? s2.push("weights", ...n2.weights) : "weight" in n2 && "number" == typeof n2.weight && s2.push("weights", n2.weight), "aggregate" in n2 && s2.push("aggregate", n2.aggregate)), super(s2, i2); + } + }, rt = class extends m { + constructor(e10, t10) { + super(["zdiffstore", ...e10], t10); + } + }, rr = class extends m { + constructor(e10, t10) { + let [r2, n2] = e10; + super(["zmscore", r2, ...n2], t10); + } + }, rn = class { + client; + commands; + commandOptions; + multiExec; + constructor(e10) { + if (this.client = e10.client, this.commands = [], this.commandOptions = e10.commandOptions, this.multiExec = e10.multiExec ?? false, this.commandOptions?.latencyLogging) { + let e11 = this.exec.bind(this); + this.exec = async (t10) => { + let r2 = performance.now(), n2 = await (t10 ? e11(t10) : e11()), i2 = (performance.now() - r2).toFixed(2); + return console.log(`Latency for \x1B[38;2;19;185;39m${this.multiExec ? ["MULTI-EXEC"] : ["PIPELINE"].toString().toUpperCase()}\x1B[0m: \x1B[38;2;0;255;255m${i2} ms\x1B[0m`), n2; + }; + } + } + exec = async (e10) => { + if (0 === this.commands.length) + throw Error("Pipeline is empty"); + let t10 = this.multiExec ? ["multi-exec"] : ["pipeline"], r2 = await this.client.request({ path: t10, body: Object.values(this.commands).map((e11) => e11.command) }); + return e10?.keepErrors ? r2.map(({ error: e11, result: t11 }, r3) => ({ error: e11, result: this.commands[r3].deserialize(t11) })) : r2.map(({ error: e11, result: t11 }, r3) => { + if (e11) + throw new a(`Command ${r3 + 1} [ ${this.commands[r3].command[0]} ] failed: ${e11}`); + return this.commands[r3].deserialize(t11); + }); + }; + length() { + return this.commands.length; + } + chain(e10) { + return this.commands.push(e10), this; + } + append = (...e10) => this.chain(new y(e10, this.commandOptions)); + bitcount = (...e10) => this.chain(new v(e10, this.commandOptions)); + bitfield = (...e10) => new b(e10, this.client, this.commandOptions, this.chain.bind(this)); + bitop = (e10, t10, r2, ...n2) => this.chain(new w([e10, t10, r2, ...n2], this.commandOptions)); + bitpos = (...e10) => this.chain(new x(e10, this.commandOptions)); + copy = (...e10) => this.chain(new S(e10, this.commandOptions)); + zdiffstore = (...e10) => this.chain(new rt(e10, this.commandOptions)); + dbsize = () => this.chain(new _(this.commandOptions)); + decr = (...e10) => this.chain(new E(e10, this.commandOptions)); + decrby = (...e10) => this.chain(new k(e10, this.commandOptions)); + del = (...e10) => this.chain(new C(e10, this.commandOptions)); + echo = (...e10) => this.chain(new R(e10, this.commandOptions)); + eval = (...e10) => this.chain(new P(e10, this.commandOptions)); + evalsha = (...e10) => this.chain(new T(e10, this.commandOptions)); + exists = (...e10) => this.chain(new A(e10, this.commandOptions)); + expire = (...e10) => this.chain(new O(e10, this.commandOptions)); + expireat = (...e10) => this.chain(new I(e10, this.commandOptions)); + flushall = (e10) => this.chain(new N(e10, this.commandOptions)); + flushdb = (...e10) => this.chain(new M(e10, this.commandOptions)); + geoadd = (...e10) => this.chain(new $(e10, this.commandOptions)); + geodist = (...e10) => this.chain(new L(e10, this.commandOptions)); + geopos = (...e10) => this.chain(new D(e10, this.commandOptions)); + geohash = (...e10) => this.chain(new j(e10, this.commandOptions)); + geosearch = (...e10) => this.chain(new F(e10, this.commandOptions)); + geosearchstore = (...e10) => this.chain(new B(e10, this.commandOptions)); + get = (...e10) => this.chain(new U(e10, this.commandOptions)); + getbit = (...e10) => this.chain(new q(e10, this.commandOptions)); + getdel = (...e10) => this.chain(new z(e10, this.commandOptions)); + getrange = (...e10) => this.chain(new H(e10, this.commandOptions)); + getset = (e10, t10) => this.chain(new W([e10, t10], this.commandOptions)); + hdel = (...e10) => this.chain(new Q(e10, this.commandOptions)); + hexists = (...e10) => this.chain(new V(e10, this.commandOptions)); + hget = (...e10) => this.chain(new G(e10, this.commandOptions)); + hgetall = (...e10) => this.chain(new Z(e10, this.commandOptions)); + hincrby = (...e10) => this.chain(new K(e10, this.commandOptions)); + hincrbyfloat = (...e10) => this.chain(new J(e10, this.commandOptions)); + hkeys = (...e10) => this.chain(new Y(e10, this.commandOptions)); + hlen = (...e10) => this.chain(new X(e10, this.commandOptions)); + hmget = (...e10) => this.chain(new ee(e10, this.commandOptions)); + hmset = (e10, t10) => this.chain(new et([e10, t10], this.commandOptions)); + hrandfield = (e10, t10, r2) => this.chain(new g([e10, t10, r2], this.commandOptions)); + hscan = (...e10) => this.chain(new er(e10, this.commandOptions)); + hset = (e10, t10) => this.chain(new en([e10, t10], this.commandOptions)); + hsetnx = (e10, t10, r2) => this.chain(new ei([e10, t10, r2], this.commandOptions)); + hstrlen = (...e10) => this.chain(new es(e10, this.commandOptions)); + hvals = (...e10) => this.chain(new ea(e10, this.commandOptions)); + incr = (...e10) => this.chain(new eo(e10, this.commandOptions)); + incrby = (...e10) => this.chain(new el(e10, this.commandOptions)); + incrbyfloat = (...e10) => this.chain(new ec(e10, this.commandOptions)); + keys = (...e10) => this.chain(new eI(e10, this.commandOptions)); + lindex = (...e10) => this.chain(new eN(e10, this.commandOptions)); + linsert = (e10, t10, r2, n2) => this.chain(new eM([e10, t10, r2, n2], this.commandOptions)); + llen = (...e10) => this.chain(new e$(e10, this.commandOptions)); + lmove = (...e10) => this.chain(new eL(e10, this.commandOptions)); + lpop = (...e10) => this.chain(new eD(e10, this.commandOptions)); + lmpop = (...e10) => this.chain(new ej(e10, this.commandOptions)); + lpos = (...e10) => this.chain(new eF(e10, this.commandOptions)); + lpush = (e10, ...t10) => this.chain(new eB([e10, ...t10], this.commandOptions)); + lpushx = (e10, ...t10) => this.chain(new eU([e10, ...t10], this.commandOptions)); + lrange = (...e10) => this.chain(new eq(e10, this.commandOptions)); + lrem = (e10, t10, r2) => this.chain(new ez([e10, t10, r2], this.commandOptions)); + lset = (e10, t10, r2) => this.chain(new eH([e10, t10, r2], this.commandOptions)); + ltrim = (...e10) => this.chain(new eW(e10, this.commandOptions)); + mget = (...e10) => this.chain(new eQ(e10, this.commandOptions)); + mset = (e10) => this.chain(new eV([e10], this.commandOptions)); + msetnx = (e10) => this.chain(new eG([e10], this.commandOptions)); + persist = (...e10) => this.chain(new eZ(e10, this.commandOptions)); + pexpire = (...e10) => this.chain(new eK(e10, this.commandOptions)); + pexpireat = (...e10) => this.chain(new eJ(e10, this.commandOptions)); + pfadd = (...e10) => this.chain(new eY(e10, this.commandOptions)); + pfcount = (...e10) => this.chain(new eX(e10, this.commandOptions)); + pfmerge = (...e10) => this.chain(new e0(e10, this.commandOptions)); + ping = (e10) => this.chain(new e1(e10, this.commandOptions)); + psetex = (e10, t10, r2) => this.chain(new e2([e10, t10, r2], this.commandOptions)); + pttl = (...e10) => this.chain(new e6(e10, this.commandOptions)); + publish = (...e10) => this.chain(new e5(e10, this.commandOptions)); + randomkey = () => this.chain(new e4(this.commandOptions)); + rename = (...e10) => this.chain(new e3(e10, this.commandOptions)); + renamenx = (...e10) => this.chain(new e8(e10, this.commandOptions)); + rpop = (...e10) => this.chain(new e9(e10, this.commandOptions)); + rpush = (e10, ...t10) => this.chain(new e7([e10, ...t10], this.commandOptions)); + rpushx = (e10, ...t10) => this.chain(new te([e10, ...t10], this.commandOptions)); + sadd = (e10, t10, ...r2) => this.chain(new tt([e10, t10, ...r2], this.commandOptions)); + scan = (...e10) => this.chain(new tr(e10, this.commandOptions)); + scard = (...e10) => this.chain(new tn(e10, this.commandOptions)); + scriptExists = (...e10) => this.chain(new ti(e10, this.commandOptions)); + scriptFlush = (...e10) => this.chain(new ts(e10, this.commandOptions)); + scriptLoad = (...e10) => this.chain(new ta(e10, this.commandOptions)); + sdiff = (...e10) => this.chain(new to(e10, this.commandOptions)); + sdiffstore = (...e10) => this.chain(new tl(e10, this.commandOptions)); + set = (e10, t10, r2) => this.chain(new tc([e10, t10, r2], this.commandOptions)); + setbit = (...e10) => this.chain(new tu(e10, this.commandOptions)); + setex = (e10, t10, r2) => this.chain(new td([e10, t10, r2], this.commandOptions)); + setnx = (e10, t10) => this.chain(new th([e10, t10], this.commandOptions)); + setrange = (...e10) => this.chain(new tf(e10, this.commandOptions)); + sinter = (...e10) => this.chain(new tp(e10, this.commandOptions)); + sinterstore = (...e10) => this.chain(new tm(e10, this.commandOptions)); + sismember = (e10, t10) => this.chain(new tg([e10, t10], this.commandOptions)); + smembers = (...e10) => this.chain(new ty(e10, this.commandOptions)); + smismember = (e10, t10) => this.chain(new tv([e10, t10], this.commandOptions)); + smove = (e10, t10, r2) => this.chain(new tb([e10, t10, r2], this.commandOptions)); + spop = (...e10) => this.chain(new tw(e10, this.commandOptions)); + srandmember = (...e10) => this.chain(new tx(e10, this.commandOptions)); + srem = (e10, ...t10) => this.chain(new tS([e10, ...t10], this.commandOptions)); + sscan = (...e10) => this.chain(new t_(e10, this.commandOptions)); + strlen = (...e10) => this.chain(new tE(e10, this.commandOptions)); + sunion = (...e10) => this.chain(new tk(e10, this.commandOptions)); + sunionstore = (...e10) => this.chain(new tC(e10, this.commandOptions)); + time = () => this.chain(new tR(this.commandOptions)); + touch = (...e10) => this.chain(new tP(e10, this.commandOptions)); + ttl = (...e10) => this.chain(new tT(e10, this.commandOptions)); + type = (...e10) => this.chain(new tA(e10, this.commandOptions)); + unlink = (...e10) => this.chain(new tO(e10, this.commandOptions)); + zadd = (...e10) => (e10[1], this.chain(new tQ([e10[0], e10[1], ...e10.slice(2)], this.commandOptions))); + xadd = (...e10) => this.chain(new tN(e10, this.commandOptions)); + xack = (...e10) => this.chain(new tI(e10, this.commandOptions)); + xdel = (...e10) => this.chain(new tL(e10, this.commandOptions)); + xgroup = (...e10) => this.chain(new tj(e10, this.commandOptions)); + xread = (...e10) => this.chain(new tq(e10, this.commandOptions)); + xreadgroup = (...e10) => this.chain(new tz(e10, this.commandOptions)); + xinfo = (...e10) => this.chain(new tD(e10, this.commandOptions)); + xlen = (...e10) => this.chain(new tF(e10, this.commandOptions)); + xpending = (...e10) => this.chain(new tB(e10, this.commandOptions)); + xclaim = (...e10) => this.chain(new t$(e10, this.commandOptions)); + xautoclaim = (...e10) => this.chain(new tM(e10, this.commandOptions)); + xtrim = (...e10) => this.chain(new tW(e10, this.commandOptions)); + xrange = (...e10) => this.chain(new tU(e10, this.commandOptions)); + xrevrange = (...e10) => this.chain(new tH(e10, this.commandOptions)); + zcard = (...e10) => this.chain(new tV(e10, this.commandOptions)); + zcount = (...e10) => this.chain(new tG(e10, this.commandOptions)); + zincrby = (e10, t10, r2) => this.chain(new tZ([e10, t10, r2], this.commandOptions)); + zinterstore = (...e10) => this.chain(new tK(e10, this.commandOptions)); + zlexcount = (...e10) => this.chain(new tJ(e10, this.commandOptions)); + zmscore = (...e10) => this.chain(new rr(e10, this.commandOptions)); + zpopmax = (...e10) => this.chain(new tY(e10, this.commandOptions)); + zpopmin = (...e10) => this.chain(new tX(e10, this.commandOptions)); + zrange = (...e10) => this.chain(new t0(e10, this.commandOptions)); + zrank = (e10, t10) => this.chain(new t1([e10, t10], this.commandOptions)); + zrem = (e10, ...t10) => this.chain(new t2([e10, ...t10], this.commandOptions)); + zremrangebylex = (...e10) => this.chain(new t6(e10, this.commandOptions)); + zremrangebyrank = (...e10) => this.chain(new t5(e10, this.commandOptions)); + zremrangebyscore = (...e10) => this.chain(new t4(e10, this.commandOptions)); + zrevrank = (e10, t10) => this.chain(new t3([e10, t10], this.commandOptions)); + zscan = (...e10) => this.chain(new t8(e10, this.commandOptions)); + zscore = (e10, t10) => this.chain(new t9([e10, t10], this.commandOptions)); + zunionstore = (...e10) => this.chain(new re(e10, this.commandOptions)); + zunion = (...e10) => this.chain(new t7(e10, this.commandOptions)); + get json() { + return { arrappend: (...e10) => this.chain(new eu(e10, this.commandOptions)), arrindex: (...e10) => this.chain(new ed(e10, this.commandOptions)), arrinsert: (...e10) => this.chain(new eh(e10, this.commandOptions)), arrlen: (...e10) => this.chain(new ef(e10, this.commandOptions)), arrpop: (...e10) => this.chain(new ep(e10, this.commandOptions)), arrtrim: (...e10) => this.chain(new em(e10, this.commandOptions)), clear: (...e10) => this.chain(new eg(e10, this.commandOptions)), del: (...e10) => this.chain(new ey(e10, this.commandOptions)), forget: (...e10) => this.chain(new ev(e10, this.commandOptions)), get: (...e10) => this.chain(new eb(e10, this.commandOptions)), mget: (...e10) => this.chain(new ew(e10, this.commandOptions)), mset: (...e10) => this.chain(new ex(e10, this.commandOptions)), numincrby: (...e10) => this.chain(new eS(e10, this.commandOptions)), nummultby: (...e10) => this.chain(new e_(e10, this.commandOptions)), objkeys: (...e10) => this.chain(new eE(e10, this.commandOptions)), objlen: (...e10) => this.chain(new ek(e10, this.commandOptions)), resp: (...e10) => this.chain(new eC(e10, this.commandOptions)), set: (...e10) => this.chain(new eR(e10, this.commandOptions)), strappend: (...e10) => this.chain(new eP(e10, this.commandOptions)), strlen: (...e10) => this.chain(new eT(e10, this.commandOptions)), toggle: (...e10) => this.chain(new eA(e10, this.commandOptions)), type: (...e10) => this.chain(new eO(e10, this.commandOptions)) }; + } + }, ri = class { + pipelinePromises = /* @__PURE__ */ new WeakMap(); + activePipeline = null; + indexInCurrentPipeline = 0; + redis; + pipeline; + pipelineCounter = 0; + constructor(e10) { + this.redis = e10, this.pipeline = e10.pipeline(); + } + async withAutoPipeline(e10) { + let t10 = this.activePipeline ?? this.redis.pipeline(); + this.activePipeline || (this.activePipeline = t10, this.indexInCurrentPipeline = 0); + let r2 = this.indexInCurrentPipeline++; + e10(t10); + let n2 = this.deferExecution().then(() => { + if (!this.pipelinePromises.has(t10)) { + let e11 = t10.exec({ keepErrors: true }); + this.pipelineCounter += 1, this.pipelinePromises.set(t10, e11), this.activePipeline = null; + } + return this.pipelinePromises.get(t10); + }), i2 = (await n2)[r2]; + if (i2.error) + throw new a(`Command failed: ${i2.error}`); + return i2.result; + } + async deferExecution() { + await Promise.resolve(), await Promise.resolve(); + } + }, rs = class { + script; + sha1; + redis; + constructor(e10, t10) { + this.redis = e10, this.sha1 = this.digest(t10), this.script = t10; + } + async eval(e10, t10) { + return await this.redis.eval(this.script, e10, t10); + } + async evalsha(e10, t10) { + return await this.redis.evalsha(this.sha1, e10, t10); + } + async exec(e10, t10) { + return await this.redis.evalsha(this.sha1, e10, t10).catch(async (r2) => { + if (r2 instanceof Error && r2.message.toLowerCase().includes("noscript")) + return await this.redis.eval(this.script, e10, t10); + throw r2; + }); + } + digest(e10) { + return n.stringify(i(e10)); + } + }, ra = class { + client; + opts; + enableTelemetry; + enableAutoPipelining; + constructor(e10, t10) { + this.client = e10, this.opts = t10, this.enableTelemetry = t10?.enableTelemetry ?? true, t10?.readYourWrites === false && (this.client.readYourWrites = false), this.enableAutoPipelining = t10?.enableAutoPipelining ?? true; + } + get readYourWritesSyncToken() { + return this.client.upstashSyncToken; + } + set readYourWritesSyncToken(e10) { + this.client.upstashSyncToken = e10; + } + get json() { + return { arrappend: (...e10) => new eu(e10, this.opts).exec(this.client), arrindex: (...e10) => new ed(e10, this.opts).exec(this.client), arrinsert: (...e10) => new eh(e10, this.opts).exec(this.client), arrlen: (...e10) => new ef(e10, this.opts).exec(this.client), arrpop: (...e10) => new ep(e10, this.opts).exec(this.client), arrtrim: (...e10) => new em(e10, this.opts).exec(this.client), clear: (...e10) => new eg(e10, this.opts).exec(this.client), del: (...e10) => new ey(e10, this.opts).exec(this.client), forget: (...e10) => new ev(e10, this.opts).exec(this.client), get: (...e10) => new eb(e10, this.opts).exec(this.client), mget: (...e10) => new ew(e10, this.opts).exec(this.client), mset: (...e10) => new ex(e10, this.opts).exec(this.client), numincrby: (...e10) => new eS(e10, this.opts).exec(this.client), nummultby: (...e10) => new e_(e10, this.opts).exec(this.client), objkeys: (...e10) => new eE(e10, this.opts).exec(this.client), objlen: (...e10) => new ek(e10, this.opts).exec(this.client), resp: (...e10) => new eC(e10, this.opts).exec(this.client), set: (...e10) => new eR(e10, this.opts).exec(this.client), strappend: (...e10) => new eP(e10, this.opts).exec(this.client), strlen: (...e10) => new eT(e10, this.opts).exec(this.client), toggle: (...e10) => new eA(e10, this.opts).exec(this.client), type: (...e10) => new eO(e10, this.opts).exec(this.client) }; + } + use = (e10) => { + let t10 = this.client.request.bind(this.client); + this.client.request = (r2) => e10(r2, t10); + }; + addTelemetry = (e10) => { + if (this.enableTelemetry) + try { + this.client.mergeTelemetry(e10); + } catch { + } + }; + createScript(e10) { + return new rs(this, e10); + } + pipeline = () => new rn({ client: this.client, commandOptions: this.opts, multiExec: false }); + autoPipeline = () => function e10(t10, r2) { + return t10.autoPipelineExecutor || (t10.autoPipelineExecutor = new ri(t10)), new Proxy(t10, { get: (t11, n2) => "pipelineCounter" === n2 ? t11.autoPipelineExecutor.pipelineCounter : "json" === n2 ? e10(t11, true) : n2 in t11 && !(n2 in t11.autoPipelineExecutor.pipeline) ? t11[n2] : (r2 ? "function" == typeof t11.autoPipelineExecutor.pipeline.json[n2] : "function" == typeof t11.autoPipelineExecutor.pipeline[n2]) ? (...e11) => t11.autoPipelineExecutor.withAutoPipeline((t12) => { + r2 ? t12.json[n2](...e11) : t12[n2](...e11); + }) : t11.autoPipelineExecutor.pipeline[n2] }); + }(this); + multi = () => new rn({ client: this.client, commandOptions: this.opts, multiExec: true }); + bitfield = (...e10) => new b(e10, this.client, this.opts); + append = (...e10) => new y(e10, this.opts).exec(this.client); + bitcount = (...e10) => new v(e10, this.opts).exec(this.client); + bitop = (e10, t10, r2, ...n2) => new w([e10, t10, r2, ...n2], this.opts).exec(this.client); + bitpos = (...e10) => new x(e10, this.opts).exec(this.client); + copy = (...e10) => new S(e10, this.opts).exec(this.client); + dbsize = () => new _(this.opts).exec(this.client); + decr = (...e10) => new E(e10, this.opts).exec(this.client); + decrby = (...e10) => new k(e10, this.opts).exec(this.client); + del = (...e10) => new C(e10, this.opts).exec(this.client); + echo = (...e10) => new R(e10, this.opts).exec(this.client); + eval = (...e10) => new P(e10, this.opts).exec(this.client); + evalsha = (...e10) => new T(e10, this.opts).exec(this.client); + exists = (...e10) => new A(e10, this.opts).exec(this.client); + expire = (...e10) => new O(e10, this.opts).exec(this.client); + expireat = (...e10) => new I(e10, this.opts).exec(this.client); + flushall = (e10) => new N(e10, this.opts).exec(this.client); + flushdb = (...e10) => new M(e10, this.opts).exec(this.client); + geoadd = (...e10) => new $(e10, this.opts).exec(this.client); + geopos = (...e10) => new D(e10, this.opts).exec(this.client); + geodist = (...e10) => new L(e10, this.opts).exec(this.client); + geohash = (...e10) => new j(e10, this.opts).exec(this.client); + geosearch = (...e10) => new F(e10, this.opts).exec(this.client); + geosearchstore = (...e10) => new B(e10, this.opts).exec(this.client); + get = (...e10) => new U(e10, this.opts).exec(this.client); + getbit = (...e10) => new q(e10, this.opts).exec(this.client); + getdel = (...e10) => new z(e10, this.opts).exec(this.client); + getrange = (...e10) => new H(e10, this.opts).exec(this.client); + getset = (e10, t10) => new W([e10, t10], this.opts).exec(this.client); + hdel = (...e10) => new Q(e10, this.opts).exec(this.client); + hexists = (...e10) => new V(e10, this.opts).exec(this.client); + hget = (...e10) => new G(e10, this.opts).exec(this.client); + hgetall = (...e10) => new Z(e10, this.opts).exec(this.client); + hincrby = (...e10) => new K(e10, this.opts).exec(this.client); + hincrbyfloat = (...e10) => new J(e10, this.opts).exec(this.client); + hkeys = (...e10) => new Y(e10, this.opts).exec(this.client); + hlen = (...e10) => new X(e10, this.opts).exec(this.client); + hmget = (...e10) => new ee(e10, this.opts).exec(this.client); + hmset = (e10, t10) => new et([e10, t10], this.opts).exec(this.client); + hrandfield = (e10, t10, r2) => new g([e10, t10, r2], this.opts).exec(this.client); + hscan = (...e10) => new er(e10, this.opts).exec(this.client); + hset = (e10, t10) => new en([e10, t10], this.opts).exec(this.client); + hsetnx = (e10, t10, r2) => new ei([e10, t10, r2], this.opts).exec(this.client); + hstrlen = (...e10) => new es(e10, this.opts).exec(this.client); + hvals = (...e10) => new ea(e10, this.opts).exec(this.client); + incr = (...e10) => new eo(e10, this.opts).exec(this.client); + incrby = (...e10) => new el(e10, this.opts).exec(this.client); + incrbyfloat = (...e10) => new ec(e10, this.opts).exec(this.client); + keys = (...e10) => new eI(e10, this.opts).exec(this.client); + lindex = (...e10) => new eN(e10, this.opts).exec(this.client); + linsert = (e10, t10, r2, n2) => new eM([e10, t10, r2, n2], this.opts).exec(this.client); + llen = (...e10) => new e$(e10, this.opts).exec(this.client); + lmove = (...e10) => new eL(e10, this.opts).exec(this.client); + lpop = (...e10) => new eD(e10, this.opts).exec(this.client); + lmpop = (...e10) => new ej(e10, this.opts).exec(this.client); + lpos = (...e10) => new eF(e10, this.opts).exec(this.client); + lpush = (e10, ...t10) => new eB([e10, ...t10], this.opts).exec(this.client); + lpushx = (e10, ...t10) => new eU([e10, ...t10], this.opts).exec(this.client); + lrange = (...e10) => new eq(e10, this.opts).exec(this.client); + lrem = (e10, t10, r2) => new ez([e10, t10, r2], this.opts).exec(this.client); + lset = (e10, t10, r2) => new eH([e10, t10, r2], this.opts).exec(this.client); + ltrim = (...e10) => new eW(e10, this.opts).exec(this.client); + mget = (...e10) => new eQ(e10, this.opts).exec(this.client); + mset = (e10) => new eV([e10], this.opts).exec(this.client); + msetnx = (e10) => new eG([e10], this.opts).exec(this.client); + persist = (...e10) => new eZ(e10, this.opts).exec(this.client); + pexpire = (...e10) => new eK(e10, this.opts).exec(this.client); + pexpireat = (...e10) => new eJ(e10, this.opts).exec(this.client); + pfadd = (...e10) => new eY(e10, this.opts).exec(this.client); + pfcount = (...e10) => new eX(e10, this.opts).exec(this.client); + pfmerge = (...e10) => new e0(e10, this.opts).exec(this.client); + ping = (e10) => new e1(e10, this.opts).exec(this.client); + psetex = (e10, t10, r2) => new e2([e10, t10, r2], this.opts).exec(this.client); + pttl = (...e10) => new e6(e10, this.opts).exec(this.client); + publish = (...e10) => new e5(e10, this.opts).exec(this.client); + randomkey = () => new e4().exec(this.client); + rename = (...e10) => new e3(e10, this.opts).exec(this.client); + renamenx = (...e10) => new e8(e10, this.opts).exec(this.client); + rpop = (...e10) => new e9(e10, this.opts).exec(this.client); + rpush = (e10, ...t10) => new e7([e10, ...t10], this.opts).exec(this.client); + rpushx = (e10, ...t10) => new te([e10, ...t10], this.opts).exec(this.client); + sadd = (e10, t10, ...r2) => new tt([e10, t10, ...r2], this.opts).exec(this.client); + scan = (...e10) => new tr(e10, this.opts).exec(this.client); + scard = (...e10) => new tn(e10, this.opts).exec(this.client); + scriptExists = (...e10) => new ti(e10, this.opts).exec(this.client); + scriptFlush = (...e10) => new ts(e10, this.opts).exec(this.client); + scriptLoad = (...e10) => new ta(e10, this.opts).exec(this.client); + sdiff = (...e10) => new to(e10, this.opts).exec(this.client); + sdiffstore = (...e10) => new tl(e10, this.opts).exec(this.client); + set = (e10, t10, r2) => new tc([e10, t10, r2], this.opts).exec(this.client); + setbit = (...e10) => new tu(e10, this.opts).exec(this.client); + setex = (e10, t10, r2) => new td([e10, t10, r2], this.opts).exec(this.client); + setnx = (e10, t10) => new th([e10, t10], this.opts).exec(this.client); + setrange = (...e10) => new tf(e10, this.opts).exec(this.client); + sinter = (...e10) => new tp(e10, this.opts).exec(this.client); + sinterstore = (...e10) => new tm(e10, this.opts).exec(this.client); + sismember = (e10, t10) => new tg([e10, t10], this.opts).exec(this.client); + smismember = (e10, t10) => new tv([e10, t10], this.opts).exec(this.client); + smembers = (...e10) => new ty(e10, this.opts).exec(this.client); + smove = (e10, t10, r2) => new tb([e10, t10, r2], this.opts).exec(this.client); + spop = (...e10) => new tw(e10, this.opts).exec(this.client); + srandmember = (...e10) => new tx(e10, this.opts).exec(this.client); + srem = (e10, ...t10) => new tS([e10, ...t10], this.opts).exec(this.client); + sscan = (...e10) => new t_(e10, this.opts).exec(this.client); + strlen = (...e10) => new tE(e10, this.opts).exec(this.client); + sunion = (...e10) => new tk(e10, this.opts).exec(this.client); + sunionstore = (...e10) => new tC(e10, this.opts).exec(this.client); + time = () => new tR().exec(this.client); + touch = (...e10) => new tP(e10, this.opts).exec(this.client); + ttl = (...e10) => new tT(e10, this.opts).exec(this.client); + type = (...e10) => new tA(e10, this.opts).exec(this.client); + unlink = (...e10) => new tO(e10, this.opts).exec(this.client); + xadd = (...e10) => new tN(e10, this.opts).exec(this.client); + xack = (...e10) => new tI(e10, this.opts).exec(this.client); + xdel = (...e10) => new tL(e10, this.opts).exec(this.client); + xgroup = (...e10) => new tj(e10, this.opts).exec(this.client); + xread = (...e10) => new tq(e10, this.opts).exec(this.client); + xreadgroup = (...e10) => new tz(e10, this.opts).exec(this.client); + xinfo = (...e10) => new tD(e10, this.opts).exec(this.client); + xlen = (...e10) => new tF(e10, this.opts).exec(this.client); + xpending = (...e10) => new tB(e10, this.opts).exec(this.client); + xclaim = (...e10) => new t$(e10, this.opts).exec(this.client); + xautoclaim = (...e10) => new tM(e10, this.opts).exec(this.client); + xtrim = (...e10) => new tW(e10, this.opts).exec(this.client); + xrange = (...e10) => new tU(e10, this.opts).exec(this.client); + xrevrange = (...e10) => new tH(e10, this.opts).exec(this.client); + zadd = (...e10) => (e10[1], new tQ([e10[0], e10[1], ...e10.slice(2)], this.opts).exec(this.client)); + zcard = (...e10) => new tV(e10, this.opts).exec(this.client); + zcount = (...e10) => new tG(e10, this.opts).exec(this.client); + zdiffstore = (...e10) => new rt(e10, this.opts).exec(this.client); + zincrby = (e10, t10, r2) => new tZ([e10, t10, r2], this.opts).exec(this.client); + zinterstore = (...e10) => new tK(e10, this.opts).exec(this.client); + zlexcount = (...e10) => new tJ(e10, this.opts).exec(this.client); + zmscore = (...e10) => new rr(e10, this.opts).exec(this.client); + zpopmax = (...e10) => new tY(e10, this.opts).exec(this.client); + zpopmin = (...e10) => new tX(e10, this.opts).exec(this.client); + zrange = (...e10) => new t0(e10, this.opts).exec(this.client); + zrank = (e10, t10) => new t1([e10, t10], this.opts).exec(this.client); + zrem = (e10, ...t10) => new t2([e10, ...t10], this.opts).exec(this.client); + zremrangebylex = (...e10) => new t6(e10, this.opts).exec(this.client); + zremrangebyrank = (...e10) => new t5(e10, this.opts).exec(this.client); + zremrangebyscore = (...e10) => new t4(e10, this.opts).exec(this.client); + zrevrank = (e10, t10) => new t3([e10, t10], this.opts).exec(this.client); + zscan = (...e10) => new t8(e10, this.opts).exec(this.client); + zscore = (e10, t10) => new t9([e10, t10], this.opts).exec(this.client); + zunion = (...e10) => new t7(e10, this.opts).exec(this.client); + zunionstore = (...e10) => new re(e10, this.opts).exec(this.client); + }, ro = r(26195).Buffer; + "undefined" == typeof atob && (global.atob = (e10) => ro.from(e10, "base64").toString("utf8")); + var rl = class e10 extends ra { + constructor(e11) { + if ("request" in e11) { + super(e11); + return; + } + if (e11.url ? (e11.url.startsWith(" ") || e11.url.endsWith(" ") || /\r|\n/.test(e11.url)) && console.warn("[Upstash Redis] The redis url contains whitespace or newline, which can cause errors!") : console.warn("[Upstash Redis] The 'url' property is missing or undefined in your Redis config."), e11.token ? (e11.token.startsWith(" ") || e11.token.endsWith(" ") || /\r|\n/.test(e11.token)) && console.warn("[Upstash Redis] The redis token contains whitespace or newline, which can cause errors!") : console.warn("[Upstash Redis] The 'token' property is missing or undefined in your Redis config."), super(new l({ baseUrl: e11.url, retry: e11.retry, headers: { authorization: `Bearer ${e11.token}` }, agent: e11.agent, responseEncoding: e11.responseEncoding, cache: e11.cache ?? "no-store", signal: e11.signal, keepAlive: e11.keepAlive, readYourWrites: e11.readYourWrites }), { automaticDeserialization: e11.automaticDeserialization, enableTelemetry: !process.env.UPSTASH_DISABLE_TELEMETRY, latencyLogging: e11.latencyLogging, enableAutoPipelining: e11.enableAutoPipelining }), this.addTelemetry({ runtime: "edge-light", platform: "0" ? "vercel" : process.env.AWS_REGION ? "aws" : "unknown", sdk: "@upstash/redis@v1.34.3" }), this.enableAutoPipelining) + return this.autoPipeline(); + } + static fromEnv(t10) { + if (void 0 === process.env) + throw TypeError('[Upstash Redis] Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead'); + let r2 = process.env.UPSTASH_REDIS_REST_URL || process.env.KV_REST_API_URL; + r2 || console.warn("[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_URL`"); + let n2 = process.env.UPSTASH_REDIS_REST_TOKEN || process.env.KV_REST_API_TOKEN; + return n2 || console.warn("[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`"), new e10({ ...t10, url: r2, token: n2 }); + } + }; + }; + __namedExportsObject5["__chunk_59454"] = (e, t, r) => { + "use strict"; + r.d(t, { V5: () => ts, qn: () => e8 }); + var n, i, s, a, o, l = Object.create, c = Object.defineProperty, u = Object.getOwnPropertyDescriptor, d = Object.getOwnPropertyNames, h = Object.getPrototypeOf, f = Object.prototype.hasOwnProperty, p = (e10, t2, r2) => t2 in e10 ? c(e10, t2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e10[t2] = r2, m = (e10, t2) => c(e10, "name", { value: t2, configurable: true }), g = (e10, t2) => () => (e10 && (t2 = e10(e10 = 0)), t2), y = (e10, t2) => () => (t2 || e10((t2 = { exports: {} }).exports, t2), t2.exports), v = (e10, t2) => { + for (var r2 in t2) + c(e10, r2, { get: t2[r2], enumerable: true }); + }, b = (e10, t2, r2, n2) => { + if (t2 && "object" == typeof t2 || "function" == typeof t2) + for (let i2 of d(t2)) + f.call(e10, i2) || i2 === r2 || c(e10, i2, { get: () => t2[i2], enumerable: !(n2 = u(t2, i2)) || n2.enumerable }); + return e10; + }, w = (e10, t2, r2) => (r2 = null != e10 ? l(h(e10)) : {}, b(!t2 && e10 && e10.__esModule ? r2 : c(r2, "default", { value: e10, enumerable: true }), e10)), x = (e10) => b(c({}, "__esModule", { value: true }), e10), S = (e10, t2, r2) => p(e10, "symbol" != typeof t2 ? t2 + "" : t2, r2), _ = y((e10) => { + C(), e10.byteLength = l2, e10.toByteArray = u2, e10.fromByteArray = f2; + var t2, r2, n2 = [], i2 = [], s2 = "u" > typeof Uint8Array ? Uint8Array : Array, a2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (t2 = 0, r2 = a2.length; t2 < r2; ++t2) + n2[t2] = a2[t2], i2[a2.charCodeAt(t2)] = t2; + function o2(e11) { + var t3 = e11.length; + if (t3 % 4 > 0) + throw Error("Invalid string. Length must be a multiple of 4"); + var r3 = e11.indexOf("="); + -1 === r3 && (r3 = t3); + var n3 = r3 === t3 ? 0 : 4 - r3 % 4; + return [r3, n3]; + } + function l2(e11) { + var t3 = o2(e11), r3 = t3[0], n3 = t3[1]; + return (r3 + n3) * 3 / 4 - n3; + } + function c2(e11, t3, r3) { + return (t3 + r3) * 3 / 4 - r3; + } + function u2(e11) { + var t3, r3, n3 = o2(e11), a3 = n3[0], l3 = n3[1], u3 = new s2(c2(e11, a3, l3)), d3 = 0, h3 = l3 > 0 ? a3 - 4 : a3; + for (r3 = 0; r3 < h3; r3 += 4) + t3 = i2[e11.charCodeAt(r3)] << 18 | i2[e11.charCodeAt(r3 + 1)] << 12 | i2[e11.charCodeAt(r3 + 2)] << 6 | i2[e11.charCodeAt(r3 + 3)], u3[d3++] = t3 >> 16 & 255, u3[d3++] = t3 >> 8 & 255, u3[d3++] = 255 & t3; + return 2 === l3 && (t3 = i2[e11.charCodeAt(r3)] << 2 | i2[e11.charCodeAt(r3 + 1)] >> 4, u3[d3++] = 255 & t3), 1 === l3 && (t3 = i2[e11.charCodeAt(r3)] << 10 | i2[e11.charCodeAt(r3 + 1)] << 4 | i2[e11.charCodeAt(r3 + 2)] >> 2, u3[d3++] = t3 >> 8 & 255, u3[d3++] = 255 & t3), u3; + } + function d2(e11) { + return n2[e11 >> 18 & 63] + n2[e11 >> 12 & 63] + n2[e11 >> 6 & 63] + n2[63 & e11]; + } + function h2(e11, t3, r3) { + for (var n3 = [], i3 = t3; i3 < r3; i3 += 3) + n3.push(d2((e11[i3] << 16 & 16711680) + (e11[i3 + 1] << 8 & 65280) + (255 & e11[i3 + 2]))); + return n3.join(""); + } + function f2(e11) { + for (var t3, r3 = e11.length, i3 = r3 % 3, s3 = [], a3 = 0, o3 = r3 - i3; a3 < o3; a3 += 16383) + s3.push(h2(e11, a3, a3 + 16383 > o3 ? o3 : a3 + 16383)); + return 1 === i3 ? s3.push(n2[(t3 = e11[r3 - 1]) >> 2] + n2[t3 << 4 & 63] + "==") : 2 === i3 && s3.push(n2[(t3 = (e11[r3 - 2] << 8) + e11[r3 - 1]) >> 10] + n2[t3 >> 4 & 63] + n2[t3 << 2 & 63] + "="), s3.join(""); + } + i2[45] = 62, i2[95] = 63, m(o2, "getLens"), m(l2, "byteLength"), m(c2, "_byteLength"), m(u2, "toByteArray"), m(d2, "tripletToBase64"), m(h2, "encodeChunk"), m(f2, "fromByteArray"); + }), E = y((e10) => { + C(), e10.read = function(e11, t2, r2, n2, i2) { + var s2, a2, o2 = 8 * i2 - n2 - 1, l2 = (1 << o2) - 1, c2 = l2 >> 1, u2 = -7, d2 = r2 ? i2 - 1 : 0, h2 = r2 ? -1 : 1, f2 = e11[t2 + d2]; + for (d2 += h2, s2 = f2 & (1 << -u2) - 1, f2 >>= -u2, u2 += o2; u2 > 0; s2 = 256 * s2 + e11[t2 + d2], d2 += h2, u2 -= 8) + ; + for (a2 = s2 & (1 << -u2) - 1, s2 >>= -u2, u2 += n2; u2 > 0; a2 = 256 * a2 + e11[t2 + d2], d2 += h2, u2 -= 8) + ; + if (0 === s2) + s2 = 1 - c2; + else { + if (s2 === l2) + return a2 ? NaN : 1 / 0 * (f2 ? -1 : 1); + a2 += Math.pow(2, n2), s2 -= c2; + } + return (f2 ? -1 : 1) * a2 * Math.pow(2, s2 - n2); + }, e10.write = function(e11, t2, r2, n2, i2, s2) { + var a2, o2, l2, c2 = 8 * s2 - i2 - 1, u2 = (1 << c2) - 1, d2 = u2 >> 1, h2 = 23 === i2 ? 5960464477539062e-23 : 0, f2 = n2 ? 0 : s2 - 1, p2 = n2 ? 1 : -1, m2 = t2 < 0 || 0 === t2 && 1 / t2 < 0 ? 1 : 0; + for (isNaN(t2 = Math.abs(t2)) || t2 === 1 / 0 ? (o2 = isNaN(t2) ? 1 : 0, a2 = u2) : (a2 = Math.floor(Math.log(t2) / Math.LN2), t2 * (l2 = Math.pow(2, -a2)) < 1 && (a2--, l2 *= 2), a2 + d2 >= 1 ? t2 += h2 / l2 : t2 += h2 * Math.pow(2, 1 - d2), t2 * l2 >= 2 && (a2++, l2 /= 2), a2 + d2 >= u2 ? (o2 = 0, a2 = u2) : a2 + d2 >= 1 ? (o2 = (t2 * l2 - 1) * Math.pow(2, i2), a2 += d2) : (o2 = t2 * Math.pow(2, d2 - 1) * Math.pow(2, i2), a2 = 0)); i2 >= 8; e11[r2 + f2] = 255 & o2, f2 += p2, o2 /= 256, i2 -= 8) + ; + for (a2 = a2 << i2 | o2, c2 += i2; c2 > 0; e11[r2 + f2] = 255 & a2, f2 += p2, a2 /= 256, c2 -= 8) + ; + e11[r2 + f2 - p2] |= 128 * m2; + }; + }), k = y((e10) => { + C(); + var t2 = _(), r2 = E(), n2 = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null; + function i2() { + try { + let e11 = new Uint8Array(1), t3 = { foo: m(function() { + return 42; + }, "foo") }; + return Object.setPrototypeOf(t3, Uint8Array.prototype), Object.setPrototypeOf(e11, t3), 42 === e11.foo(); + } catch { + return false; + } + } + function s2(e11) { + if (e11 > 2147483647) + throw RangeError('The value "' + e11 + '" is invalid for option "size"'); + let t3 = new Uint8Array(e11); + return Object.setPrototypeOf(t3, a2.prototype), t3; + } + function a2(e11, t3, r3) { + if ("number" == typeof e11) { + if ("string" == typeof t3) + throw TypeError('The "string" argument must be of type string. Received type number'); + return u2(e11); + } + return o2(e11, t3, r3); + } + function o2(e11, t3, r3) { + if ("string" == typeof e11) + return d2(e11, t3); + if (ArrayBuffer.isView(e11)) + return f2(e11); + if (null == e11) + throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e11); + if (ea2(e11, ArrayBuffer) || e11 && ea2(e11.buffer, ArrayBuffer) || "u" > typeof SharedArrayBuffer && (ea2(e11, SharedArrayBuffer) || e11 && ea2(e11.buffer, SharedArrayBuffer))) + return p2(e11, t3, r3); + if ("number" == typeof e11) + throw TypeError('The "value" argument must not be of type number. Received type number'); + let n3 = e11.valueOf && e11.valueOf(); + if (null != n3 && n3 !== e11) + return a2.from(n3, t3, r3); + let i3 = g2(e11); + if (i3) + return i3; + if ("u" > typeof Symbol && null != Symbol.toPrimitive && "function" == typeof e11[Symbol.toPrimitive]) + return a2.from(e11[Symbol.toPrimitive]("string"), t3, r3); + throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e11); + } + function l2(e11) { + if ("number" != typeof e11) + throw TypeError('"size" argument must be of type number'); + if (e11 < 0) + throw RangeError('The value "' + e11 + '" is invalid for option "size"'); + } + function c2(e11, t3, r3) { + return l2(e11), e11 <= 0 ? s2(e11) : void 0 !== t3 ? "string" == typeof r3 ? s2(e11).fill(t3, r3) : s2(e11).fill(t3) : s2(e11); + } + function u2(e11) { + return l2(e11), s2(e11 < 0 ? 0 : 0 | y2(e11)); + } + function d2(e11, t3) { + if (("string" != typeof t3 || "" === t3) && (t3 = "utf8"), !a2.isEncoding(t3)) + throw TypeError("Unknown encoding: " + t3); + let r3 = 0 | b2(e11, t3), n3 = s2(r3), i3 = n3.write(e11, t3); + return i3 !== r3 && (n3 = n3.slice(0, i3)), n3; + } + function h2(e11) { + let t3 = e11.length < 0 ? 0 : 0 | y2(e11.length), r3 = s2(t3); + for (let n3 = 0; n3 < t3; n3 += 1) + r3[n3] = 255 & e11[n3]; + return r3; + } + function f2(e11) { + if (ea2(e11, Uint8Array)) { + let t3 = new Uint8Array(e11); + return p2(t3.buffer, t3.byteOffset, t3.byteLength); + } + return h2(e11); + } + function p2(e11, t3, r3) { + let n3; + if (t3 < 0 || e11.byteLength < t3) + throw RangeError('"offset" is outside of buffer bounds'); + if (e11.byteLength < t3 + (r3 || 0)) + throw RangeError('"length" is outside of buffer bounds'); + return Object.setPrototypeOf(n3 = void 0 === t3 && void 0 === r3 ? new Uint8Array(e11) : void 0 === r3 ? new Uint8Array(e11, t3) : new Uint8Array(e11, t3, r3), a2.prototype), n3; + } + function g2(e11) { + if (a2.isBuffer(e11)) { + let t3 = 0 | y2(e11.length), r3 = s2(t3); + return 0 === r3.length || e11.copy(r3, 0, 0, t3), r3; + } + return void 0 !== e11.length ? "number" != typeof e11.length || eo2(e11.length) ? s2(0) : h2(e11) : "Buffer" === e11.type && Array.isArray(e11.data) ? h2(e11.data) : void 0; + } + function y2(e11) { + if (e11 >= 2147483647) + throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes"); + return 0 | e11; + } + function v2(e11) { + return +e11 != e11 && (e11 = 0), a2.alloc(+e11); + } + function b2(e11, t3) { + if (a2.isBuffer(e11)) + return e11.length; + if (ArrayBuffer.isView(e11) || ea2(e11, ArrayBuffer)) + return e11.byteLength; + if ("string" != typeof e11) + throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e11); + let r3 = e11.length, n3 = arguments.length > 2 && true === arguments[2]; + if (!n3 && 0 === r3) + return 0; + let i3 = false; + for (; ; ) + switch (t3) { + case "ascii": + case "latin1": + case "binary": + return r3; + case "utf8": + case "utf-8": + return et2(e11).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return 2 * r3; + case "hex": + return r3 >>> 1; + case "base64": + return ei2(e11).length; + default: + if (i3) + return n3 ? -1 : et2(e11).length; + t3 = ("" + t3).toLowerCase(), i3 = true; + } + } + function w2(e11, t3, r3) { + let n3 = false; + if ((void 0 === t3 || t3 < 0) && (t3 = 0), t3 > this.length || ((void 0 === r3 || r3 > this.length) && (r3 = this.length), r3 <= 0) || (r3 >>>= 0) <= (t3 >>>= 0)) + return ""; + for (e11 || (e11 = "utf8"); ; ) + switch (e11) { + case "hex": + return j2(this, t3, r3); + case "utf8": + case "utf-8": + return N2(this, t3, r3); + case "ascii": + return $2(this, t3, r3); + case "latin1": + case "binary": + return L2(this, t3, r3); + case "base64": + return I2(this, t3, r3); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return D2(this, t3, r3); + default: + if (n3) + throw TypeError("Unknown encoding: " + e11); + e11 = (e11 + "").toLowerCase(), n3 = true; + } + } + function x2(e11, t3, r3) { + let n3 = e11[t3]; + e11[t3] = e11[r3], e11[r3] = n3; + } + function S2(e11, t3, r3, n3, i3) { + if (0 === e11.length) + return -1; + if ("string" == typeof r3 ? (n3 = r3, r3 = 0) : r3 > 2147483647 ? r3 = 2147483647 : r3 < -2147483648 && (r3 = -2147483648), eo2(r3 = +r3) && (r3 = i3 ? 0 : e11.length - 1), r3 < 0 && (r3 = e11.length + r3), r3 >= e11.length) { + if (i3) + return -1; + r3 = e11.length - 1; + } else if (r3 < 0) { + if (!i3) + return -1; + r3 = 0; + } + if ("string" == typeof t3 && (t3 = a2.from(t3, n3)), a2.isBuffer(t3)) + return 0 === t3.length ? -1 : k2(e11, t3, r3, n3, i3); + if ("number" == typeof t3) + return t3 &= 255, "function" == typeof Uint8Array.prototype.indexOf ? i3 ? Uint8Array.prototype.indexOf.call(e11, t3, r3) : Uint8Array.prototype.lastIndexOf.call(e11, t3, r3) : k2(e11, [t3], r3, n3, i3); + throw TypeError("val must be string, number or Buffer"); + } + function k2(e11, t3, r3, n3, i3) { + let s3, a3 = 1, o3 = e11.length, l3 = t3.length; + if (void 0 !== n3 && ("ucs2" === (n3 = String(n3).toLowerCase()) || "ucs-2" === n3 || "utf16le" === n3 || "utf-16le" === n3)) { + if (e11.length < 2 || t3.length < 2) + return -1; + a3 = 2, o3 /= 2, l3 /= 2, r3 /= 2; + } + function c3(e12, t4) { + return 1 === a3 ? e12[t4] : e12.readUInt16BE(t4 * a3); + } + if (m(c3, "read"), i3) { + let n4 = -1; + for (s3 = r3; s3 < o3; s3++) + if (c3(e11, s3) === c3(t3, -1 === n4 ? 0 : s3 - n4)) { + if (-1 === n4 && (n4 = s3), s3 - n4 + 1 === l3) + return n4 * a3; + } else + -1 !== n4 && (s3 -= s3 - n4), n4 = -1; + } else + for (r3 + l3 > o3 && (r3 = o3 - l3), s3 = r3; s3 >= 0; s3--) { + let r4 = true; + for (let n4 = 0; n4 < l3; n4++) + if (c3(e11, s3 + n4) !== c3(t3, n4)) { + r4 = false; + break; + } + if (r4) + return s3; + } + return -1; + } + function R2(e11, t3, r3, n3) { + let i3; + r3 = Number(r3) || 0; + let s3 = e11.length - r3; + n3 ? (n3 = Number(n3)) > s3 && (n3 = s3) : n3 = s3; + let a3 = t3.length; + for (n3 > a3 / 2 && (n3 = a3 / 2), i3 = 0; i3 < n3; ++i3) { + let n4 = parseInt(t3.substr(2 * i3, 2), 16); + if (eo2(n4)) + break; + e11[r3 + i3] = n4; + } + return i3; + } + function P2(e11, t3, r3, n3) { + return es2(et2(t3, e11.length - r3), e11, r3, n3); + } + function T2(e11, t3, r3, n3) { + return es2(er2(t3), e11, r3, n3); + } + function A2(e11, t3, r3, n3) { + return es2(ei2(t3), e11, r3, n3); + } + function O2(e11, t3, r3, n3) { + return es2(en2(t3, e11.length - r3), e11, r3, n3); + } + function I2(e11, r3, n3) { + return 0 === r3 && n3 === e11.length ? t2.fromByteArray(e11) : t2.fromByteArray(e11.slice(r3, n3)); + } + function N2(e11, t3, r3) { + r3 = Math.min(e11.length, r3); + let n3 = [], i3 = t3; + for (; i3 < r3; ) { + let t4 = e11[i3], s3 = null, a3 = t4 > 239 ? 4 : t4 > 223 ? 3 : t4 > 191 ? 2 : 1; + if (i3 + a3 <= r3) { + let r4, n4, o3, l3; + switch (a3) { + case 1: + t4 < 128 && (s3 = t4); + break; + case 2: + (192 & (r4 = e11[i3 + 1])) == 128 && (l3 = (31 & t4) << 6 | 63 & r4) > 127 && (s3 = l3); + break; + case 3: + r4 = e11[i3 + 1], n4 = e11[i3 + 2], (192 & r4) == 128 && (192 & n4) == 128 && (l3 = (15 & t4) << 12 | (63 & r4) << 6 | 63 & n4) > 2047 && (l3 < 55296 || l3 > 57343) && (s3 = l3); + break; + case 4: + r4 = e11[i3 + 1], n4 = e11[i3 + 2], o3 = e11[i3 + 3], (192 & r4) == 128 && (192 & n4) == 128 && (192 & o3) == 128 && (l3 = (15 & t4) << 18 | (63 & r4) << 12 | (63 & n4) << 6 | 63 & o3) > 65535 && l3 < 1114112 && (s3 = l3); + } + } + null === s3 ? (s3 = 65533, a3 = 1) : s3 > 65535 && (s3 -= 65536, n3.push(s3 >>> 10 & 1023 | 55296), s3 = 56320 | 1023 & s3), n3.push(s3), i3 += a3; + } + return M2(n3); + } + function M2(e11) { + let t3 = e11.length; + if (t3 <= 4096) + return String.fromCharCode.apply(String, e11); + let r3 = "", n3 = 0; + for (; n3 < t3; ) + r3 += String.fromCharCode.apply(String, e11.slice(n3, n3 += 4096)); + return r3; + } + function $2(e11, t3, r3) { + let n3 = ""; + r3 = Math.min(e11.length, r3); + for (let i3 = t3; i3 < r3; ++i3) + n3 += String.fromCharCode(127 & e11[i3]); + return n3; + } + function L2(e11, t3, r3) { + let n3 = ""; + r3 = Math.min(e11.length, r3); + for (let i3 = t3; i3 < r3; ++i3) + n3 += String.fromCharCode(e11[i3]); + return n3; + } + function j2(e11, t3, r3) { + let n3 = e11.length; + (!t3 || t3 < 0) && (t3 = 0), (!r3 || r3 < 0 || r3 > n3) && (r3 = n3); + let i3 = ""; + for (let n4 = t3; n4 < r3; ++n4) + i3 += el2[e11[n4]]; + return i3; + } + function D2(e11, t3, r3) { + let n3 = e11.slice(t3, r3), i3 = ""; + for (let e12 = 0; e12 < n3.length - 1; e12 += 2) + i3 += String.fromCharCode(n3[e12] + 256 * n3[e12 + 1]); + return i3; + } + function F2(e11, t3, r3) { + if (e11 % 1 != 0 || e11 < 0) + throw RangeError("offset is not uint"); + if (e11 + t3 > r3) + throw RangeError("Trying to access beyond buffer length"); + } + function B2(e11, t3, r3, n3, i3, s3) { + if (!a2.isBuffer(e11)) + throw TypeError('"buffer" argument must be a Buffer instance'); + if (t3 > i3 || t3 < s3) + throw RangeError('"value" argument is out of bounds'); + if (r3 + n3 > e11.length) + throw RangeError("Index out of range"); + } + function U2(e11, t3, r3, n3, i3) { + K2(t3, n3, i3, e11, r3, 7); + let s3 = Number(t3 & BigInt(4294967295)); + e11[r3++] = s3, s3 >>= 8, e11[r3++] = s3, s3 >>= 8, e11[r3++] = s3, s3 >>= 8, e11[r3++] = s3; + let a3 = Number(t3 >> BigInt(32) & BigInt(4294967295)); + return e11[r3++] = a3, a3 >>= 8, e11[r3++] = a3, a3 >>= 8, e11[r3++] = a3, a3 >>= 8, e11[r3++] = a3, r3; + } + function q2(e11, t3, r3, n3, i3) { + K2(t3, n3, i3, e11, r3, 7); + let s3 = Number(t3 & BigInt(4294967295)); + e11[r3 + 7] = s3, s3 >>= 8, e11[r3 + 6] = s3, s3 >>= 8, e11[r3 + 5] = s3, s3 >>= 8, e11[r3 + 4] = s3; + let a3 = Number(t3 >> BigInt(32) & BigInt(4294967295)); + return e11[r3 + 3] = a3, a3 >>= 8, e11[r3 + 2] = a3, a3 >>= 8, e11[r3 + 1] = a3, a3 >>= 8, e11[r3] = a3, r3 + 8; + } + function z2(e11, t3, r3, n3, i3, s3) { + if (r3 + n3 > e11.length || r3 < 0) + throw RangeError("Index out of range"); + } + function H2(e11, t3, n3, i3, s3) { + return t3 = +t3, n3 >>>= 0, s3 || z2(e11, t3, n3, 4, 34028234663852886e22, -34028234663852886e22), r2.write(e11, t3, n3, i3, 23, 4), n3 + 4; + } + function W2(e11, t3, n3, i3, s3) { + return t3 = +t3, n3 >>>= 0, s3 || z2(e11, t3, n3, 8, 17976931348623157e292, -17976931348623157e292), r2.write(e11, t3, n3, i3, 52, 8), n3 + 8; + } + e10.Buffer = a2, e10.SlowBuffer = v2, e10.INSPECT_MAX_BYTES = 50, e10.kMaxLength = 2147483647, a2.TYPED_ARRAY_SUPPORT = i2(), !a2.TYPED_ARRAY_SUPPORT && "u" > typeof console && "function" == typeof console.error && console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), m(i2, "typedArraySupport"), Object.defineProperty(a2.prototype, "parent", { enumerable: true, get: m(function() { + if (a2.isBuffer(this)) + return this.buffer; + }, "get") }), Object.defineProperty(a2.prototype, "offset", { enumerable: true, get: m(function() { + if (a2.isBuffer(this)) + return this.byteOffset; + }, "get") }), m(s2, "createBuffer"), m(a2, "Buffer"), a2.poolSize = 8192, m(o2, "from"), a2.from = function(e11, t3, r3) { + return o2(e11, t3, r3); + }, Object.setPrototypeOf(a2.prototype, Uint8Array.prototype), Object.setPrototypeOf(a2, Uint8Array), m(l2, "assertSize"), m(c2, "alloc"), a2.alloc = function(e11, t3, r3) { + return c2(e11, t3, r3); + }, m(u2, "allocUnsafe"), a2.allocUnsafe = function(e11) { + return u2(e11); + }, a2.allocUnsafeSlow = function(e11) { + return u2(e11); + }, m(d2, "fromString"), m(h2, "fromArrayLike"), m(f2, "fromArrayView"), m(p2, "fromArrayBuffer"), m(g2, "fromObject"), m(y2, "checked"), m(v2, "SlowBuffer"), a2.isBuffer = m(function(e11) { + return null != e11 && true === e11._isBuffer && e11 !== a2.prototype; + }, "isBuffer"), a2.compare = m(function(e11, t3) { + if (ea2(e11, Uint8Array) && (e11 = a2.from(e11, e11.offset, e11.byteLength)), ea2(t3, Uint8Array) && (t3 = a2.from(t3, t3.offset, t3.byteLength)), !a2.isBuffer(e11) || !a2.isBuffer(t3)) + throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + if (e11 === t3) + return 0; + let r3 = e11.length, n3 = t3.length; + for (let i3 = 0, s3 = Math.min(r3, n3); i3 < s3; ++i3) + if (e11[i3] !== t3[i3]) { + r3 = e11[i3], n3 = t3[i3]; + break; + } + return r3 < n3 ? -1 : n3 < r3 ? 1 : 0; + }, "compare"), a2.isEncoding = m(function(e11) { + switch (String(e11).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }, "isEncoding"), a2.concat = m(function(e11, t3) { + let r3; + if (!Array.isArray(e11)) + throw TypeError('"list" argument must be an Array of Buffers'); + if (0 === e11.length) + return a2.alloc(0); + if (void 0 === t3) + for (t3 = 0, r3 = 0; r3 < e11.length; ++r3) + t3 += e11[r3].length; + let n3 = a2.allocUnsafe(t3), i3 = 0; + for (r3 = 0; r3 < e11.length; ++r3) { + let t4 = e11[r3]; + if (ea2(t4, Uint8Array)) + i3 + t4.length > n3.length ? (a2.isBuffer(t4) || (t4 = a2.from(t4)), t4.copy(n3, i3)) : Uint8Array.prototype.set.call(n3, t4, i3); + else if (a2.isBuffer(t4)) + t4.copy(n3, i3); + else + throw TypeError('"list" argument must be an Array of Buffers'); + i3 += t4.length; + } + return n3; + }, "concat"), m(b2, "byteLength"), a2.byteLength = b2, m(w2, "slowToString"), a2.prototype._isBuffer = true, m(x2, "swap"), a2.prototype.swap16 = m(function() { + let e11 = this.length; + if (e11 % 2 != 0) + throw RangeError("Buffer size must be a multiple of 16-bits"); + for (let t3 = 0; t3 < e11; t3 += 2) + x2(this, t3, t3 + 1); + return this; + }, "swap16"), a2.prototype.swap32 = m(function() { + let e11 = this.length; + if (e11 % 4 != 0) + throw RangeError("Buffer size must be a multiple of 32-bits"); + for (let t3 = 0; t3 < e11; t3 += 4) + x2(this, t3, t3 + 3), x2(this, t3 + 1, t3 + 2); + return this; + }, "swap32"), a2.prototype.swap64 = m(function() { + let e11 = this.length; + if (e11 % 8 != 0) + throw RangeError("Buffer size must be a multiple of 64-bits"); + for (let t3 = 0; t3 < e11; t3 += 8) + x2(this, t3, t3 + 7), x2(this, t3 + 1, t3 + 6), x2(this, t3 + 2, t3 + 5), x2(this, t3 + 3, t3 + 4); + return this; + }, "swap64"), a2.prototype.toString = m(function() { + let e11 = this.length; + return 0 === e11 ? "" : 0 == arguments.length ? N2(this, 0, e11) : w2.apply(this, arguments); + }, "toString"), a2.prototype.toLocaleString = a2.prototype.toString, a2.prototype.equals = m(function(e11) { + if (!a2.isBuffer(e11)) + throw TypeError("Argument must be a Buffer"); + return this === e11 || 0 === a2.compare(this, e11); + }, "equals"), a2.prototype.inspect = m(function() { + let t3 = "", r3 = e10.INSPECT_MAX_BYTES; + return t3 = this.toString("hex", 0, r3).replace(/(.{2})/g, "$1 ").trim(), this.length > r3 && (t3 += " ... "), ""; + }, "inspect"), n2 && (a2.prototype[n2] = a2.prototype.inspect), a2.prototype.compare = m(function(e11, t3, r3, n3, i3) { + if (ea2(e11, Uint8Array) && (e11 = a2.from(e11, e11.offset, e11.byteLength)), !a2.isBuffer(e11)) + throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e11); + if (void 0 === t3 && (t3 = 0), void 0 === r3 && (r3 = e11 ? e11.length : 0), void 0 === n3 && (n3 = 0), void 0 === i3 && (i3 = this.length), t3 < 0 || r3 > e11.length || n3 < 0 || i3 > this.length) + throw RangeError("out of range index"); + if (n3 >= i3 && t3 >= r3) + return 0; + if (n3 >= i3) + return -1; + if (t3 >= r3) + return 1; + if (t3 >>>= 0, r3 >>>= 0, n3 >>>= 0, i3 >>>= 0, this === e11) + return 0; + let s3 = i3 - n3, o3 = r3 - t3, l3 = Math.min(s3, o3), c3 = this.slice(n3, i3), u3 = e11.slice(t3, r3); + for (let e12 = 0; e12 < l3; ++e12) + if (c3[e12] !== u3[e12]) { + s3 = c3[e12], o3 = u3[e12]; + break; + } + return s3 < o3 ? -1 : o3 < s3 ? 1 : 0; + }, "compare"), m(S2, "bidirectionalIndexOf"), m(k2, "arrayIndexOf"), a2.prototype.includes = m(function(e11, t3, r3) { + return -1 !== this.indexOf(e11, t3, r3); + }, "includes"), a2.prototype.indexOf = m(function(e11, t3, r3) { + return S2(this, e11, t3, r3, true); + }, "indexOf"), a2.prototype.lastIndexOf = m(function(e11, t3, r3) { + return S2(this, e11, t3, r3, false); + }, "lastIndexOf"), m(R2, "hexWrite"), m(P2, "utf8Write"), m(T2, "asciiWrite"), m(A2, "base64Write"), m(O2, "ucs2Write"), a2.prototype.write = m(function(e11, t3, r3, n3) { + if (void 0 === t3) + n3 = "utf8", r3 = this.length, t3 = 0; + else if (void 0 === r3 && "string" == typeof t3) + n3 = t3, r3 = this.length, t3 = 0; + else if (isFinite(t3)) + t3 >>>= 0, isFinite(r3) ? (r3 >>>= 0, void 0 === n3 && (n3 = "utf8")) : (n3 = r3, r3 = void 0); + else + throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + let i3 = this.length - t3; + if ((void 0 === r3 || r3 > i3) && (r3 = i3), e11.length > 0 && (r3 < 0 || t3 < 0) || t3 > this.length) + throw RangeError("Attempt to write outside buffer bounds"); + n3 || (n3 = "utf8"); + let s3 = false; + for (; ; ) + switch (n3) { + case "hex": + return R2(this, e11, t3, r3); + case "utf8": + case "utf-8": + return P2(this, e11, t3, r3); + case "ascii": + case "latin1": + case "binary": + return T2(this, e11, t3, r3); + case "base64": + return A2(this, e11, t3, r3); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return O2(this, e11, t3, r3); + default: + if (s3) + throw TypeError("Unknown encoding: " + n3); + n3 = ("" + n3).toLowerCase(), s3 = true; + } + }, "write"), a2.prototype.toJSON = m(function() { + return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; + }, "toJSON"), m(I2, "base64Slice"), m(N2, "utf8Slice"), m(M2, "decodeCodePointsArray"), m($2, "asciiSlice"), m(L2, "latin1Slice"), m(j2, "hexSlice"), m(D2, "utf16leSlice"), a2.prototype.slice = m(function(e11, t3) { + let r3 = this.length; + e11 = ~~e11, t3 = void 0 === t3 ? r3 : ~~t3, e11 < 0 ? (e11 += r3) < 0 && (e11 = 0) : e11 > r3 && (e11 = r3), t3 < 0 ? (t3 += r3) < 0 && (t3 = 0) : t3 > r3 && (t3 = r3), t3 < e11 && (t3 = e11); + let n3 = this.subarray(e11, t3); + return Object.setPrototypeOf(n3, a2.prototype), n3; + }, "slice"), m(F2, "checkOffset"), a2.prototype.readUintLE = a2.prototype.readUIntLE = m(function(e11, t3, r3) { + e11 >>>= 0, t3 >>>= 0, r3 || F2(e11, t3, this.length); + let n3 = this[e11], i3 = 1, s3 = 0; + for (; ++s3 < t3 && (i3 *= 256); ) + n3 += this[e11 + s3] * i3; + return n3; + }, "readUIntLE"), a2.prototype.readUintBE = a2.prototype.readUIntBE = m(function(e11, t3, r3) { + e11 >>>= 0, t3 >>>= 0, r3 || F2(e11, t3, this.length); + let n3 = this[e11 + --t3], i3 = 1; + for (; t3 > 0 && (i3 *= 256); ) + n3 += this[e11 + --t3] * i3; + return n3; + }, "readUIntBE"), a2.prototype.readUint8 = a2.prototype.readUInt8 = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 1, this.length), this[e11]; + }, "readUInt8"), a2.prototype.readUint16LE = a2.prototype.readUInt16LE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 2, this.length), this[e11] | this[e11 + 1] << 8; + }, "readUInt16LE"), a2.prototype.readUint16BE = a2.prototype.readUInt16BE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 2, this.length), this[e11] << 8 | this[e11 + 1]; + }, "readUInt16BE"), a2.prototype.readUint32LE = a2.prototype.readUInt32LE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 4, this.length), (this[e11] | this[e11 + 1] << 8 | this[e11 + 2] << 16) + 16777216 * this[e11 + 3]; + }, "readUInt32LE"), a2.prototype.readUint32BE = a2.prototype.readUInt32BE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 4, this.length), 16777216 * this[e11] + (this[e11 + 1] << 16 | this[e11 + 2] << 8 | this[e11 + 3]); + }, "readUInt32BE"), a2.prototype.readBigUInt64LE = ec2(m(function(e11) { + J2(e11 >>>= 0, "offset"); + let t3 = this[e11], r3 = this[e11 + 7]; + (void 0 === t3 || void 0 === r3) && Y2(e11, this.length - 8); + let n3 = t3 + 256 * this[++e11] + 65536 * this[++e11] + 16777216 * this[++e11], i3 = this[++e11] + 256 * this[++e11] + 65536 * this[++e11] + 16777216 * r3; + return BigInt(n3) + (BigInt(i3) << BigInt(32)); + }, "readBigUInt64LE")), a2.prototype.readBigUInt64BE = ec2(m(function(e11) { + J2(e11 >>>= 0, "offset"); + let t3 = this[e11], r3 = this[e11 + 7]; + (void 0 === t3 || void 0 === r3) && Y2(e11, this.length - 8); + let n3 = 16777216 * t3 + 65536 * this[++e11] + 256 * this[++e11] + this[++e11], i3 = 16777216 * this[++e11] + 65536 * this[++e11] + 256 * this[++e11] + r3; + return (BigInt(n3) << BigInt(32)) + BigInt(i3); + }, "readBigUInt64BE")), a2.prototype.readIntLE = m(function(e11, t3, r3) { + e11 >>>= 0, t3 >>>= 0, r3 || F2(e11, t3, this.length); + let n3 = this[e11], i3 = 1, s3 = 0; + for (; ++s3 < t3 && (i3 *= 256); ) + n3 += this[e11 + s3] * i3; + return n3 >= (i3 *= 128) && (n3 -= Math.pow(2, 8 * t3)), n3; + }, "readIntLE"), a2.prototype.readIntBE = m(function(e11, t3, r3) { + e11 >>>= 0, t3 >>>= 0, r3 || F2(e11, t3, this.length); + let n3 = t3, i3 = 1, s3 = this[e11 + --n3]; + for (; n3 > 0 && (i3 *= 256); ) + s3 += this[e11 + --n3] * i3; + return s3 >= (i3 *= 128) && (s3 -= Math.pow(2, 8 * t3)), s3; + }, "readIntBE"), a2.prototype.readInt8 = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 1, this.length), 128 & this[e11] ? -((255 - this[e11] + 1) * 1) : this[e11]; + }, "readInt8"), a2.prototype.readInt16LE = m(function(e11, t3) { + e11 >>>= 0, t3 || F2(e11, 2, this.length); + let r3 = this[e11] | this[e11 + 1] << 8; + return 32768 & r3 ? 4294901760 | r3 : r3; + }, "readInt16LE"), a2.prototype.readInt16BE = m(function(e11, t3) { + e11 >>>= 0, t3 || F2(e11, 2, this.length); + let r3 = this[e11 + 1] | this[e11] << 8; + return 32768 & r3 ? 4294901760 | r3 : r3; + }, "readInt16BE"), a2.prototype.readInt32LE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 4, this.length), this[e11] | this[e11 + 1] << 8 | this[e11 + 2] << 16 | this[e11 + 3] << 24; + }, "readInt32LE"), a2.prototype.readInt32BE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 4, this.length), this[e11] << 24 | this[e11 + 1] << 16 | this[e11 + 2] << 8 | this[e11 + 3]; + }, "readInt32BE"), a2.prototype.readBigInt64LE = ec2(m(function(e11) { + J2(e11 >>>= 0, "offset"); + let t3 = this[e11], r3 = this[e11 + 7]; + return (void 0 === t3 || void 0 === r3) && Y2(e11, this.length - 8), (BigInt(this[e11 + 4] + 256 * this[e11 + 5] + 65536 * this[e11 + 6] + (r3 << 24)) << BigInt(32)) + BigInt(t3 + 256 * this[++e11] + 65536 * this[++e11] + 16777216 * this[++e11]); + }, "readBigInt64LE")), a2.prototype.readBigInt64BE = ec2(m(function(e11) { + J2(e11 >>>= 0, "offset"); + let t3 = this[e11], r3 = this[e11 + 7]; + return (void 0 === t3 || void 0 === r3) && Y2(e11, this.length - 8), (BigInt((t3 << 24) + 65536 * this[++e11] + 256 * this[++e11] + this[++e11]) << BigInt(32)) + BigInt(16777216 * this[++e11] + 65536 * this[++e11] + 256 * this[++e11] + r3); + }, "readBigInt64BE")), a2.prototype.readFloatLE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 4, this.length), r2.read(this, e11, true, 23, 4); + }, "readFloatLE"), a2.prototype.readFloatBE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 4, this.length), r2.read(this, e11, false, 23, 4); + }, "readFloatBE"), a2.prototype.readDoubleLE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 8, this.length), r2.read(this, e11, true, 52, 8); + }, "readDoubleLE"), a2.prototype.readDoubleBE = m(function(e11, t3) { + return e11 >>>= 0, t3 || F2(e11, 8, this.length), r2.read(this, e11, false, 52, 8); + }, "readDoubleBE"), m(B2, "checkInt"), a2.prototype.writeUintLE = a2.prototype.writeUIntLE = m(function(e11, t3, r3, n3) { + if (e11 = +e11, t3 >>>= 0, r3 >>>= 0, !n3) { + let n4 = Math.pow(2, 8 * r3) - 1; + B2(this, e11, t3, r3, n4, 0); + } + let i3 = 1, s3 = 0; + for (this[t3] = 255 & e11; ++s3 < r3 && (i3 *= 256); ) + this[t3 + s3] = e11 / i3 & 255; + return t3 + r3; + }, "writeUIntLE"), a2.prototype.writeUintBE = a2.prototype.writeUIntBE = m(function(e11, t3, r3, n3) { + if (e11 = +e11, t3 >>>= 0, r3 >>>= 0, !n3) { + let n4 = Math.pow(2, 8 * r3) - 1; + B2(this, e11, t3, r3, n4, 0); + } + let i3 = r3 - 1, s3 = 1; + for (this[t3 + i3] = 255 & e11; --i3 >= 0 && (s3 *= 256); ) + this[t3 + i3] = e11 / s3 & 255; + return t3 + r3; + }, "writeUIntBE"), a2.prototype.writeUint8 = a2.prototype.writeUInt8 = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 1, 255, 0), this[t3] = 255 & e11, t3 + 1; + }, "writeUInt8"), a2.prototype.writeUint16LE = a2.prototype.writeUInt16LE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 2, 65535, 0), this[t3] = 255 & e11, this[t3 + 1] = e11 >>> 8, t3 + 2; + }, "writeUInt16LE"), a2.prototype.writeUint16BE = a2.prototype.writeUInt16BE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 2, 65535, 0), this[t3] = e11 >>> 8, this[t3 + 1] = 255 & e11, t3 + 2; + }, "writeUInt16BE"), a2.prototype.writeUint32LE = a2.prototype.writeUInt32LE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 4, 4294967295, 0), this[t3 + 3] = e11 >>> 24, this[t3 + 2] = e11 >>> 16, this[t3 + 1] = e11 >>> 8, this[t3] = 255 & e11, t3 + 4; + }, "writeUInt32LE"), a2.prototype.writeUint32BE = a2.prototype.writeUInt32BE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 4, 4294967295, 0), this[t3] = e11 >>> 24, this[t3 + 1] = e11 >>> 16, this[t3 + 2] = e11 >>> 8, this[t3 + 3] = 255 & e11, t3 + 4; + }, "writeUInt32BE"), m(U2, "wrtBigUInt64LE"), m(q2, "wrtBigUInt64BE"), a2.prototype.writeBigUInt64LE = ec2(m(function(e11, t3 = 0) { + return U2(this, e11, t3, BigInt(0), BigInt("0xffffffffffffffff")); + }, "writeBigUInt64LE")), a2.prototype.writeBigUInt64BE = ec2(m(function(e11, t3 = 0) { + return q2(this, e11, t3, BigInt(0), BigInt("0xffffffffffffffff")); + }, "writeBigUInt64BE")), a2.prototype.writeIntLE = m(function(e11, t3, r3, n3) { + if (e11 = +e11, t3 >>>= 0, !n3) { + let n4 = Math.pow(2, 8 * r3 - 1); + B2(this, e11, t3, r3, n4 - 1, -n4); + } + let i3 = 0, s3 = 1, a3 = 0; + for (this[t3] = 255 & e11; ++i3 < r3 && (s3 *= 256); ) + e11 < 0 && 0 === a3 && 0 !== this[t3 + i3 - 1] && (a3 = 1), this[t3 + i3] = (e11 / s3 >> 0) - a3 & 255; + return t3 + r3; + }, "writeIntLE"), a2.prototype.writeIntBE = m(function(e11, t3, r3, n3) { + if (e11 = +e11, t3 >>>= 0, !n3) { + let n4 = Math.pow(2, 8 * r3 - 1); + B2(this, e11, t3, r3, n4 - 1, -n4); + } + let i3 = r3 - 1, s3 = 1, a3 = 0; + for (this[t3 + i3] = 255 & e11; --i3 >= 0 && (s3 *= 256); ) + e11 < 0 && 0 === a3 && 0 !== this[t3 + i3 + 1] && (a3 = 1), this[t3 + i3] = (e11 / s3 >> 0) - a3 & 255; + return t3 + r3; + }, "writeIntBE"), a2.prototype.writeInt8 = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 1, 127, -128), e11 < 0 && (e11 = 255 + e11 + 1), this[t3] = 255 & e11, t3 + 1; + }, "writeInt8"), a2.prototype.writeInt16LE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 2, 32767, -32768), this[t3] = 255 & e11, this[t3 + 1] = e11 >>> 8, t3 + 2; + }, "writeInt16LE"), a2.prototype.writeInt16BE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 2, 32767, -32768), this[t3] = e11 >>> 8, this[t3 + 1] = 255 & e11, t3 + 2; + }, "writeInt16BE"), a2.prototype.writeInt32LE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 4, 2147483647, -2147483648), this[t3] = 255 & e11, this[t3 + 1] = e11 >>> 8, this[t3 + 2] = e11 >>> 16, this[t3 + 3] = e11 >>> 24, t3 + 4; + }, "writeInt32LE"), a2.prototype.writeInt32BE = m(function(e11, t3, r3) { + return e11 = +e11, t3 >>>= 0, r3 || B2(this, e11, t3, 4, 2147483647, -2147483648), e11 < 0 && (e11 = 4294967295 + e11 + 1), this[t3] = e11 >>> 24, this[t3 + 1] = e11 >>> 16, this[t3 + 2] = e11 >>> 8, this[t3 + 3] = 255 & e11, t3 + 4; + }, "writeInt32BE"), a2.prototype.writeBigInt64LE = ec2(m(function(e11, t3 = 0) { + return U2(this, e11, t3, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }, "writeBigInt64LE")), a2.prototype.writeBigInt64BE = ec2(m(function(e11, t3 = 0) { + return q2(this, e11, t3, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }, "writeBigInt64BE")), m(z2, "checkIEEE754"), m(H2, "writeFloat"), a2.prototype.writeFloatLE = m(function(e11, t3, r3) { + return H2(this, e11, t3, true, r3); + }, "writeFloatLE"), a2.prototype.writeFloatBE = m(function(e11, t3, r3) { + return H2(this, e11, t3, false, r3); + }, "writeFloatBE"), m(W2, "writeDouble"), a2.prototype.writeDoubleLE = m(function(e11, t3, r3) { + return W2(this, e11, t3, true, r3); + }, "writeDoubleLE"), a2.prototype.writeDoubleBE = m(function(e11, t3, r3) { + return W2(this, e11, t3, false, r3); + }, "writeDoubleBE"), a2.prototype.copy = m(function(e11, t3, r3, n3) { + if (!a2.isBuffer(e11)) + throw TypeError("argument should be a Buffer"); + if (r3 || (r3 = 0), n3 || 0 === n3 || (n3 = this.length), t3 >= e11.length && (t3 = e11.length), t3 || (t3 = 0), n3 > 0 && n3 < r3 && (n3 = r3), n3 === r3 || 0 === e11.length || 0 === this.length) + return 0; + if (t3 < 0) + throw RangeError("targetStart out of bounds"); + if (r3 < 0 || r3 >= this.length) + throw RangeError("Index out of range"); + if (n3 < 0) + throw RangeError("sourceEnd out of bounds"); + n3 > this.length && (n3 = this.length), e11.length - t3 < n3 - r3 && (n3 = e11.length - t3 + r3); + let i3 = n3 - r3; + return this === e11 && "function" == typeof Uint8Array.prototype.copyWithin ? this.copyWithin(t3, r3, n3) : Uint8Array.prototype.set.call(e11, this.subarray(r3, n3), t3), i3; + }, "copy"), a2.prototype.fill = m(function(e11, t3, r3, n3) { + let i3; + if ("string" == typeof e11) { + if ("string" == typeof t3 ? (n3 = t3, t3 = 0, r3 = this.length) : "string" == typeof r3 && (n3 = r3, r3 = this.length), void 0 !== n3 && "string" != typeof n3) + throw TypeError("encoding must be a string"); + if ("string" == typeof n3 && !a2.isEncoding(n3)) + throw TypeError("Unknown encoding: " + n3); + if (1 === e11.length) { + let t4 = e11.charCodeAt(0); + ("utf8" === n3 && t4 < 128 || "latin1" === n3) && (e11 = t4); + } + } else + "number" == typeof e11 ? e11 &= 255 : "boolean" == typeof e11 && (e11 = Number(e11)); + if (t3 < 0 || this.length < t3 || this.length < r3) + throw RangeError("Out of range index"); + if (r3 <= t3) + return this; + if (t3 >>>= 0, r3 = void 0 === r3 ? this.length : r3 >>> 0, e11 || (e11 = 0), "number" == typeof e11) + for (i3 = t3; i3 < r3; ++i3) + this[i3] = e11; + else { + let s3 = a2.isBuffer(e11) ? e11 : a2.from(e11, n3), o3 = s3.length; + if (0 === o3) + throw TypeError('The value "' + e11 + '" is invalid for argument "value"'); + for (i3 = 0; i3 < r3 - t3; ++i3) + this[i3 + t3] = s3[i3 % o3]; + } + return this; + }, "fill"); + var Q2 = {}; + function V2(e11, t3, r3) { + var n3; + Q2[e11] = (m(n3 = class extends r3 { + constructor() { + super(), Object.defineProperty(this, "message", { value: t3.apply(this, arguments), writable: true, configurable: true }), this.name = `${this.name} [${e11}]`, this.stack, delete this.name; + } + get code() { + return e11; + } + set code(e12) { + Object.defineProperty(this, "code", { configurable: true, enumerable: true, value: e12, writable: true }); + } + toString() { + return `${this.name} [${e11}]: ${this.message}`; + } + }, "NodeError"), n3); + } + function G2(e11) { + let t3 = "", r3 = e11.length, n3 = "-" === e11[0] ? 1 : 0; + for (; r3 >= n3 + 4; r3 -= 3) + t3 = `_${e11.slice(r3 - 3, r3)}${t3}`; + return `${e11.slice(0, r3)}${t3}`; + } + function Z2(e11, t3, r3) { + J2(t3, "offset"), (void 0 === e11[t3] || void 0 === e11[t3 + r3]) && Y2(t3, e11.length - (r3 + 1)); + } + function K2(e11, t3, r3, n3, i3, s3) { + if (e11 > r3 || e11 < t3) { + let n4 = "bigint" == typeof t3 ? "n" : "", i4; + throw i4 = s3 > 3 ? 0 === t3 || t3 === BigInt(0) ? `>= 0${n4} and < 2${n4} ** ${(s3 + 1) * 8}${n4}` : `>= -(2${n4} ** ${(s3 + 1) * 8 - 1}${n4}) and < 2 ** ${(s3 + 1) * 8 - 1}${n4}` : `>= ${t3}${n4} and <= ${r3}${n4}`, new Q2.ERR_OUT_OF_RANGE("value", i4, e11); + } + Z2(n3, i3, s3); + } + function J2(e11, t3) { + if ("number" != typeof e11) + throw new Q2.ERR_INVALID_ARG_TYPE(t3, "number", e11); + } + function Y2(e11, t3, r3) { + throw Math.floor(e11) !== e11 ? (J2(e11, r3), new Q2.ERR_OUT_OF_RANGE(r3 || "offset", "an integer", e11)) : t3 < 0 ? new Q2.ERR_BUFFER_OUT_OF_BOUNDS() : new Q2.ERR_OUT_OF_RANGE(r3 || "offset", `>= ${r3 ? 1 : 0} and <= ${t3}`, e11); + } + m(V2, "E"), V2("ERR_BUFFER_OUT_OF_BOUNDS", function(e11) { + return e11 ? `${e11} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds"; + }, RangeError), V2("ERR_INVALID_ARG_TYPE", function(e11, t3) { + return `The "${e11}" argument must be of type number. Received type ${typeof t3}`; + }, TypeError), V2("ERR_OUT_OF_RANGE", function(e11, t3, r3) { + let n3 = `The value of "${e11}" is out of range.`, i3 = r3; + return Number.isInteger(r3) && Math.abs(r3) > 4294967296 ? i3 = G2(String(r3)) : "bigint" == typeof r3 && (i3 = String(r3), (r3 > BigInt(2) ** BigInt(32) || r3 < -(BigInt(2) ** BigInt(32))) && (i3 = G2(i3)), i3 += "n"), n3 += ` It must be ${t3}. Received ${i3}`; + }, RangeError), m(G2, "addNumericalSeparator"), m(Z2, "checkBounds"), m(K2, "checkIntBI"), m(J2, "validateNumber"), m(Y2, "boundsError"); + var X2 = /[^+/0-9A-Za-z-_]/g; + function ee2(e11) { + if ((e11 = (e11 = e11.split("=")[0]).trim().replace(X2, "")).length < 2) + return ""; + for (; e11.length % 4 != 0; ) + e11 += "="; + return e11; + } + function et2(e11, t3) { + t3 = t3 || 1 / 0; + let r3, n3 = e11.length, i3 = null, s3 = []; + for (let a3 = 0; a3 < n3; ++a3) { + if ((r3 = e11.charCodeAt(a3)) > 55295 && r3 < 57344) { + if (!i3) { + if (r3 > 56319 || a3 + 1 === n3) { + (t3 -= 3) > -1 && s3.push(239, 191, 189); + continue; + } + i3 = r3; + continue; + } + if (r3 < 56320) { + (t3 -= 3) > -1 && s3.push(239, 191, 189), i3 = r3; + continue; + } + r3 = (i3 - 55296 << 10 | r3 - 56320) + 65536; + } else + i3 && (t3 -= 3) > -1 && s3.push(239, 191, 189); + if (i3 = null, r3 < 128) { + if ((t3 -= 1) < 0) + break; + s3.push(r3); + } else if (r3 < 2048) { + if ((t3 -= 2) < 0) + break; + s3.push(r3 >> 6 | 192, 63 & r3 | 128); + } else if (r3 < 65536) { + if ((t3 -= 3) < 0) + break; + s3.push(r3 >> 12 | 224, r3 >> 6 & 63 | 128, 63 & r3 | 128); + } else if (r3 < 1114112) { + if ((t3 -= 4) < 0) + break; + s3.push(r3 >> 18 | 240, r3 >> 12 & 63 | 128, r3 >> 6 & 63 | 128, 63 & r3 | 128); + } else + throw Error("Invalid code point"); + } + return s3; + } + function er2(e11) { + let t3 = []; + for (let r3 = 0; r3 < e11.length; ++r3) + t3.push(255 & e11.charCodeAt(r3)); + return t3; + } + function en2(e11, t3) { + let r3, n3, i3 = []; + for (let s3 = 0; s3 < e11.length && !((t3 -= 2) < 0); ++s3) + n3 = (r3 = e11.charCodeAt(s3)) >> 8, i3.push(r3 % 256), i3.push(n3); + return i3; + } + function ei2(e11) { + return t2.toByteArray(ee2(e11)); + } + function es2(e11, t3, r3, n3) { + let i3; + for (i3 = 0; i3 < n3 && !(i3 + r3 >= t3.length || i3 >= e11.length); ++i3) + t3[i3 + r3] = e11[i3]; + return i3; + } + function ea2(e11, t3) { + return e11 instanceof t3 || null != e11 && null != e11.constructor && null != e11.constructor.name && e11.constructor.name === t3.name; + } + function eo2(e11) { + return e11 != e11; + } + m(ee2, "base64clean"), m(et2, "utf8ToBytes"), m(er2, "asciiToBytes"), m(en2, "utf16leToBytes"), m(ei2, "base64ToBytes"), m(es2, "blitBuffer"), m(ea2, "isInstance"), m(eo2, "numberIsNaN"); + var el2 = function() { + let e11 = "0123456789abcdef", t3 = Array(256); + for (let r3 = 0; r3 < 16; ++r3) { + let n3 = 16 * r3; + for (let i3 = 0; i3 < 16; ++i3) + t3[n3 + i3] = e11[r3] + e11[i3]; + } + return t3; + }(); + function ec2(e11) { + return typeof BigInt > "u" ? eu2 : e11; + } + function eu2() { + throw Error("BigInt not supported"); + } + m(ec2, "defineBigIntMethod"), m(eu2, "BufferBigIntNotDefined"); + }), C = g(() => { + n = globalThis2, i = globalThis2.setImmediate ?? ((e10) => setTimeout(e10, 0)), globalThis2.clearImmediate ?? ((e10) => clearTimeout(e10)), (s = globalThis2.crypto ?? {}).subtle ?? (s.subtle = {}), a = "function" == typeof globalThis2.Buffer && "function" == typeof globalThis2.Buffer.allocUnsafe ? globalThis2.Buffer : k().Buffer, (o = globalThis2.process ?? {}).env ?? (o.env = {}); + try { + o.nextTick(() => { + }); + } catch { + let e10 = Promise.resolve(); + o.nextTick = e10.then.bind(e10); + } + }), R = y((e10, t2) => { + C(); + var r2, n2 = "object" == typeof Reflect ? Reflect : null, i2 = n2 && "function" == typeof n2.apply ? n2.apply : m(function(e11, t3, r3) { + return Function.prototype.apply.call(e11, t3, r3); + }, "ReflectApply"); + function s2(e11) { + console && console.warn && console.warn(e11); + } + r2 = n2 && "function" == typeof n2.ownKeys ? n2.ownKeys : Object.getOwnPropertySymbols ? m(function(e11) { + return Object.getOwnPropertyNames(e11).concat(Object.getOwnPropertySymbols(e11)); + }, "ReflectOwnKeys") : m(function(e11) { + return Object.getOwnPropertyNames(e11); + }, "ReflectOwnKeys"), m(s2, "ProcessEmitWarning"); + var a2 = Number.isNaN || m(function(e11) { + return e11 != e11; + }, "NumberIsNaN"); + function o2() { + o2.init.call(this); + } + m(o2, "EventEmitter"), t2.exports = o2, t2.exports.once = w2, o2.EventEmitter = o2, o2.prototype._events = void 0, o2.prototype._eventsCount = 0, o2.prototype._maxListeners = void 0; + var l2 = 10; + function c2(e11) { + if ("function" != typeof e11) + throw TypeError('The "listener" argument must be of type Function. Received type ' + typeof e11); + } + function u2(e11) { + return void 0 === e11._maxListeners ? o2.defaultMaxListeners : e11._maxListeners; + } + function d2(e11, t3, r3, n3) { + var i3, a3, o3; + if (c2(r3), void 0 === (a3 = e11._events) ? (a3 = e11._events = /* @__PURE__ */ Object.create(null), e11._eventsCount = 0) : (void 0 !== a3.newListener && (e11.emit("newListener", t3, r3.listener ? r3.listener : r3), a3 = e11._events), o3 = a3[t3]), void 0 === o3) + o3 = a3[t3] = r3, ++e11._eventsCount; + else if ("function" == typeof o3 ? o3 = a3[t3] = n3 ? [r3, o3] : [o3, r3] : n3 ? o3.unshift(r3) : o3.push(r3), (i3 = u2(e11)) > 0 && o3.length > i3 && !o3.warned) { + o3.warned = true; + var l3 = Error("Possible EventEmitter memory leak detected. " + o3.length + " " + String(t3) + " listeners added. Use emitter.setMaxListeners() to increase limit"); + l3.name = "MaxListenersExceededWarning", l3.emitter = e11, l3.type = t3, l3.count = o3.length, s2(l3); + } + return e11; + } + function h2() { + if (!this.fired) + return this.target.removeListener(this.type, this.wrapFn), this.fired = true, 0 == arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); + } + function f2(e11, t3, r3) { + var n3 = { fired: false, wrapFn: void 0, target: e11, type: t3, listener: r3 }, i3 = h2.bind(n3); + return i3.listener = r3, n3.wrapFn = i3, i3; + } + function p2(e11, t3, r3) { + var n3 = e11._events; + if (void 0 === n3) + return []; + var i3 = n3[t3]; + return void 0 === i3 ? [] : "function" == typeof i3 ? r3 ? [i3.listener || i3] : [i3] : r3 ? b2(i3) : y2(i3, i3.length); + } + function g2(e11) { + var t3 = this._events; + if (void 0 !== t3) { + var r3 = t3[e11]; + if ("function" == typeof r3) + return 1; + if (void 0 !== r3) + return r3.length; + } + return 0; + } + function y2(e11, t3) { + for (var r3 = Array(t3), n3 = 0; n3 < t3; ++n3) + r3[n3] = e11[n3]; + return r3; + } + function v2(e11, t3) { + for (; t3 + 1 < e11.length; t3++) + e11[t3] = e11[t3 + 1]; + e11.pop(); + } + function b2(e11) { + for (var t3 = Array(e11.length), r3 = 0; r3 < t3.length; ++r3) + t3[r3] = e11[r3].listener || e11[r3]; + return t3; + } + function w2(e11, t3) { + return new Promise(function(r3, n3) { + function i3(r4) { + e11.removeListener(t3, s3), n3(r4); + } + function s3() { + "function" == typeof e11.removeListener && e11.removeListener("error", i3), r3([].slice.call(arguments)); + } + m(i3, "errorListener"), m(s3, "resolver"), S2(e11, t3, s3, { once: true }), "error" !== t3 && x2(e11, i3, { once: true }); + }); + } + function x2(e11, t3, r3) { + "function" == typeof e11.on && S2(e11, "error", t3, r3); + } + function S2(e11, t3, r3, n3) { + if ("function" == typeof e11.on) + n3.once ? e11.once(t3, r3) : e11.on(t3, r3); + else if ("function" == typeof e11.addEventListener) + e11.addEventListener(t3, m(function i3(s3) { + n3.once && e11.removeEventListener(t3, i3), r3(s3); + }, "wrapListener")); + else + throw TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof e11); + } + m(c2, "checkListener"), Object.defineProperty(o2, "defaultMaxListeners", { enumerable: true, get: m(function() { + return l2; + }, "get"), set: m(function(e11) { + if ("number" != typeof e11 || e11 < 0 || a2(e11)) + throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e11 + "."); + l2 = e11; + }, "set") }), o2.init = function() { + (void 0 === this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; + }, o2.prototype.setMaxListeners = m(function(e11) { + if ("number" != typeof e11 || e11 < 0 || a2(e11)) + throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e11 + "."); + return this._maxListeners = e11, this; + }, "setMaxListeners"), m(u2, "_getMaxListeners"), o2.prototype.getMaxListeners = m(function() { + return u2(this); + }, "getMaxListeners"), o2.prototype.emit = m(function(e11) { + for (var t3 = [], r3 = 1; r3 < arguments.length; r3++) + t3.push(arguments[r3]); + var n3 = "error" === e11, s3 = this._events; + if (void 0 !== s3) + n3 = n3 && void 0 === s3.error; + else if (!n3) + return false; + if (n3) { + if (t3.length > 0 && (a3 = t3[0]), a3 instanceof Error) + throw a3; + var a3, o3 = Error("Unhandled error." + (a3 ? " (" + a3.message + ")" : "")); + throw o3.context = a3, o3; + } + var l3 = s3[e11]; + if (void 0 === l3) + return false; + if ("function" == typeof l3) + i2(l3, this, t3); + else + for (var c3 = l3.length, u3 = y2(l3, c3), r3 = 0; r3 < c3; ++r3) + i2(u3[r3], this, t3); + return true; + }, "emit"), m(d2, "_addListener"), o2.prototype.addListener = m(function(e11, t3) { + return d2(this, e11, t3, false); + }, "addListener"), o2.prototype.on = o2.prototype.addListener, o2.prototype.prependListener = m(function(e11, t3) { + return d2(this, e11, t3, true); + }, "prependListener"), m(h2, "onceWrapper"), m(f2, "_onceWrap"), o2.prototype.once = m(function(e11, t3) { + return c2(t3), this.on(e11, f2(this, e11, t3)), this; + }, "once"), o2.prototype.prependOnceListener = m(function(e11, t3) { + return c2(t3), this.prependListener(e11, f2(this, e11, t3)), this; + }, "prependOnceListener"), o2.prototype.removeListener = m(function(e11, t3) { + var r3, n3, i3, s3, a3; + if (c2(t3), void 0 === (n3 = this._events) || void 0 === (r3 = n3[e11])) + return this; + if (r3 === t3 || r3.listener === t3) + 0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : (delete n3[e11], n3.removeListener && this.emit("removeListener", e11, r3.listener || t3)); + else if ("function" != typeof r3) { + for (i3 = -1, s3 = r3.length - 1; s3 >= 0; s3--) + if (r3[s3] === t3 || r3[s3].listener === t3) { + a3 = r3[s3].listener, i3 = s3; + break; + } + if (i3 < 0) + return this; + 0 === i3 ? r3.shift() : v2(r3, i3), 1 === r3.length && (n3[e11] = r3[0]), void 0 !== n3.removeListener && this.emit("removeListener", e11, a3 || t3); + } + return this; + }, "removeListener"), o2.prototype.off = o2.prototype.removeListener, o2.prototype.removeAllListeners = m(function(e11) { + var t3, r3, n3; + if (void 0 === (r3 = this._events)) + return this; + if (void 0 === r3.removeListener) + return 0 == arguments.length ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : void 0 !== r3[e11] && (0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : delete r3[e11]), this; + if (0 == arguments.length) { + var i3, s3 = Object.keys(r3); + for (n3 = 0; n3 < s3.length; ++n3) + "removeListener" !== (i3 = s3[n3]) && this.removeAllListeners(i3); + return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this; + } + if ("function" == typeof (t3 = r3[e11])) + this.removeListener(e11, t3); + else if (void 0 !== t3) + for (n3 = t3.length - 1; n3 >= 0; n3--) + this.removeListener(e11, t3[n3]); + return this; + }, "removeAllListeners"), m(p2, "_listeners"), o2.prototype.listeners = m(function(e11) { + return p2(this, e11, true); + }, "listeners"), o2.prototype.rawListeners = m(function(e11) { + return p2(this, e11, false); + }, "rawListeners"), o2.listenerCount = function(e11, t3) { + return "function" == typeof e11.listenerCount ? e11.listenerCount(t3) : g2.call(e11, t3); + }, o2.prototype.listenerCount = g2, m(g2, "listenerCount"), o2.prototype.eventNames = m(function() { + return this._eventsCount > 0 ? r2(this._events) : []; + }, "eventNames"), m(y2, "arrayClone"), m(v2, "spliceOne"), m(b2, "unwrapListeners"), m(w2, "once"), m(x2, "addErrorHandlerIfEventEmitter"), m(S2, "eventTargetAgnosticAddListener"); + }), P = {}; + v(P, { default: () => T }); + var T, A = g(() => { + C(), T = {}; + }); + function O(e10) { + let t2 = 1779033703, r2 = 3144134277, n2 = 1013904242, i2 = 2773480762, s2 = 1359893119, a2 = 2600822924, o2 = 528734635, l2 = 1541459225, c2 = 0, u2 = 0, d2 = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298], h2 = m((e11, t3) => e11 >>> t3 | e11 << 32 - t3, "rrot"), f2 = new Uint32Array(64), p2 = new Uint8Array(64), g2 = m(() => { + for (let e12 = 0, t3 = 0; e12 < 16; e12++, t3 += 4) + f2[e12] = p2[t3] << 24 | p2[t3 + 1] << 16 | p2[t3 + 2] << 8 | p2[t3 + 3]; + for (let e12 = 16; e12 < 64; e12++) { + let t3 = h2(f2[e12 - 15], 7) ^ h2(f2[e12 - 15], 18) ^ f2[e12 - 15] >>> 3, r3 = h2(f2[e12 - 2], 17) ^ h2(f2[e12 - 2], 19) ^ f2[e12 - 2] >>> 10; + f2[e12] = f2[e12 - 16] + t3 + f2[e12 - 7] + r3 | 0; + } + let e11 = t2, c3 = r2, m2 = n2, g3 = i2, y3 = s2, v3 = a2, b2 = o2, w2 = l2; + for (let t3 = 0; t3 < 64; t3++) { + let r3 = w2 + (h2(y3, 6) ^ h2(y3, 11) ^ h2(y3, 25)) + (y3 & v3 ^ ~y3 & b2) + d2[t3] + f2[t3] | 0, n3 = (h2(e11, 2) ^ h2(e11, 13) ^ h2(e11, 22)) + (e11 & c3 ^ e11 & m2 ^ c3 & m2) | 0; + w2 = b2, b2 = v3, v3 = y3, y3 = g3 + r3 | 0, g3 = m2, m2 = c3, c3 = e11, e11 = r3 + n3 | 0; + } + t2 = t2 + e11 | 0, r2 = r2 + c3 | 0, n2 = n2 + m2 | 0, i2 = i2 + g3 | 0, s2 = s2 + y3 | 0, a2 = a2 + v3 | 0, o2 = o2 + b2 | 0, l2 = l2 + w2 | 0, u2 = 0; + }, "process"), y2 = m((e11) => { + "string" == typeof e11 && (e11 = new TextEncoder().encode(e11)); + for (let t3 = 0; t3 < e11.length; t3++) + p2[u2++] = e11[t3], 64 === u2 && g2(); + c2 += e11.length; + }, "add"), v2 = m(() => { + if (p2[u2++] = 128, 64 == u2 && g2(), u2 + 8 > 64) { + for (; u2 < 64; ) + p2[u2++] = 0; + g2(); + } + for (; u2 < 58; ) + p2[u2++] = 0; + let e11 = 8 * c2; + p2[u2++] = e11 / 1099511627776 & 255, p2[u2++] = e11 / 4294967296 & 255, p2[u2++] = e11 >>> 24, p2[u2++] = e11 >>> 16 & 255, p2[u2++] = e11 >>> 8 & 255, p2[u2++] = 255 & e11, g2(); + let d3 = new Uint8Array(32); + return d3[0] = t2 >>> 24, d3[1] = t2 >>> 16 & 255, d3[2] = t2 >>> 8 & 255, d3[3] = 255 & t2, d3[4] = r2 >>> 24, d3[5] = r2 >>> 16 & 255, d3[6] = r2 >>> 8 & 255, d3[7] = 255 & r2, d3[8] = n2 >>> 24, d3[9] = n2 >>> 16 & 255, d3[10] = n2 >>> 8 & 255, d3[11] = 255 & n2, d3[12] = i2 >>> 24, d3[13] = i2 >>> 16 & 255, d3[14] = i2 >>> 8 & 255, d3[15] = 255 & i2, d3[16] = s2 >>> 24, d3[17] = s2 >>> 16 & 255, d3[18] = s2 >>> 8 & 255, d3[19] = 255 & s2, d3[20] = a2 >>> 24, d3[21] = a2 >>> 16 & 255, d3[22] = a2 >>> 8 & 255, d3[23] = 255 & a2, d3[24] = o2 >>> 24, d3[25] = o2 >>> 16 & 255, d3[26] = o2 >>> 8 & 255, d3[27] = 255 & o2, d3[28] = l2 >>> 24, d3[29] = l2 >>> 16 & 255, d3[30] = l2 >>> 8 & 255, d3[31] = 255 & l2, d3; + }, "digest"); + return void 0 === e10 ? { add: y2, digest: v2 } : (y2(e10), v2()); + } + var I, N, M = g(() => { + C(), m(O, "sha256"); + }), $ = g(() => { + C(), m(I = class e10 { + constructor() { + S(this, "_dataLength", 0), S(this, "_bufferLength", 0), S(this, "_state", new Int32Array(4)), S(this, "_buffer", new ArrayBuffer(68)), S(this, "_buffer8"), S(this, "_buffer32"), this._buffer8 = new Uint8Array(this._buffer, 0, 68), this._buffer32 = new Uint32Array(this._buffer, 0, 17), this.start(); + } + static hashByteArray(e11, t2 = false) { + return this.onePassHasher.start().appendByteArray(e11).end(t2); + } + static hashStr(e11, t2 = false) { + return this.onePassHasher.start().appendStr(e11).end(t2); + } + static hashAsciiStr(e11, t2 = false) { + return this.onePassHasher.start().appendAsciiStr(e11).end(t2); + } + static _hex(t2) { + let r2 = e10.hexChars, n2 = e10.hexOut, i2, s2, a2, o2; + for (o2 = 0; o2 < 4; o2 += 1) + for (s2 = 8 * o2, i2 = t2[o2], a2 = 0; a2 < 8; a2 += 2) + n2[s2 + 1 + a2] = r2.charAt(15 & i2), i2 >>>= 4, n2[s2 + 0 + a2] = r2.charAt(15 & i2), i2 >>>= 4; + return n2.join(""); + } + static _md5cycle(e11, t2) { + let r2 = e11[0], n2 = e11[1], i2 = e11[2], s2 = e11[3]; + r2 += (n2 & i2 | ~n2 & s2) + t2[0] - 680876936 | 0, s2 += ((r2 = (r2 << 7 | r2 >>> 25) + n2 | 0) & n2 | ~r2 & i2) + t2[1] - 389564586 | 0, i2 += ((s2 = (s2 << 12 | s2 >>> 20) + r2 | 0) & r2 | ~s2 & n2) + t2[2] + 606105819 | 0, n2 += ((i2 = (i2 << 17 | i2 >>> 15) + s2 | 0) & s2 | ~i2 & r2) + t2[3] - 1044525330 | 0, r2 += ((n2 = (n2 << 22 | n2 >>> 10) + i2 | 0) & i2 | ~n2 & s2) + t2[4] - 176418897 | 0, s2 += ((r2 = (r2 << 7 | r2 >>> 25) + n2 | 0) & n2 | ~r2 & i2) + t2[5] + 1200080426 | 0, i2 += ((s2 = (s2 << 12 | s2 >>> 20) + r2 | 0) & r2 | ~s2 & n2) + t2[6] - 1473231341 | 0, n2 += ((i2 = (i2 << 17 | i2 >>> 15) + s2 | 0) & s2 | ~i2 & r2) + t2[7] - 45705983 | 0, r2 += ((n2 = (n2 << 22 | n2 >>> 10) + i2 | 0) & i2 | ~n2 & s2) + t2[8] + 1770035416 | 0, s2 += ((r2 = (r2 << 7 | r2 >>> 25) + n2 | 0) & n2 | ~r2 & i2) + t2[9] - 1958414417 | 0, i2 += ((s2 = (s2 << 12 | s2 >>> 20) + r2 | 0) & r2 | ~s2 & n2) + t2[10] - 42063 | 0, n2 += ((i2 = (i2 << 17 | i2 >>> 15) + s2 | 0) & s2 | ~i2 & r2) + t2[11] - 1990404162 | 0, r2 += ((n2 = (n2 << 22 | n2 >>> 10) + i2 | 0) & i2 | ~n2 & s2) + t2[12] + 1804603682 | 0, s2 += ((r2 = (r2 << 7 | r2 >>> 25) + n2 | 0) & n2 | ~r2 & i2) + t2[13] - 40341101 | 0, i2 += ((s2 = (s2 << 12 | s2 >>> 20) + r2 | 0) & r2 | ~s2 & n2) + t2[14] - 1502002290 | 0, n2 += ((i2 = (i2 << 17 | i2 >>> 15) + s2 | 0) & s2 | ~i2 & r2) + t2[15] + 1236535329 | 0, r2 += ((n2 = (n2 << 22 | n2 >>> 10) + i2 | 0) & s2 | i2 & ~s2) + t2[1] - 165796510 | 0, s2 += ((r2 = (r2 << 5 | r2 >>> 27) + n2 | 0) & i2 | n2 & ~i2) + t2[6] - 1069501632 | 0, i2 += ((s2 = (s2 << 9 | s2 >>> 23) + r2 | 0) & n2 | r2 & ~n2) + t2[11] + 643717713 | 0, n2 += ((i2 = (i2 << 14 | i2 >>> 18) + s2 | 0) & r2 | s2 & ~r2) + t2[0] - 373897302 | 0, r2 += ((n2 = (n2 << 20 | n2 >>> 12) + i2 | 0) & s2 | i2 & ~s2) + t2[5] - 701558691 | 0, s2 += ((r2 = (r2 << 5 | r2 >>> 27) + n2 | 0) & i2 | n2 & ~i2) + t2[10] + 38016083 | 0, i2 += ((s2 = (s2 << 9 | s2 >>> 23) + r2 | 0) & n2 | r2 & ~n2) + t2[15] - 660478335 | 0, n2 += ((i2 = (i2 << 14 | i2 >>> 18) + s2 | 0) & r2 | s2 & ~r2) + t2[4] - 405537848 | 0, r2 += ((n2 = (n2 << 20 | n2 >>> 12) + i2 | 0) & s2 | i2 & ~s2) + t2[9] + 568446438 | 0, s2 += ((r2 = (r2 << 5 | r2 >>> 27) + n2 | 0) & i2 | n2 & ~i2) + t2[14] - 1019803690 | 0, i2 += ((s2 = (s2 << 9 | s2 >>> 23) + r2 | 0) & n2 | r2 & ~n2) + t2[3] - 187363961 | 0, n2 += ((i2 = (i2 << 14 | i2 >>> 18) + s2 | 0) & r2 | s2 & ~r2) + t2[8] + 1163531501 | 0, r2 += ((n2 = (n2 << 20 | n2 >>> 12) + i2 | 0) & s2 | i2 & ~s2) + t2[13] - 1444681467 | 0, s2 += ((r2 = (r2 << 5 | r2 >>> 27) + n2 | 0) & i2 | n2 & ~i2) + t2[2] - 51403784 | 0, i2 += ((s2 = (s2 << 9 | s2 >>> 23) + r2 | 0) & n2 | r2 & ~n2) + t2[7] + 1735328473 | 0, n2 += ((i2 = (i2 << 14 | i2 >>> 18) + s2 | 0) & r2 | s2 & ~r2) + t2[12] - 1926607734 | 0, r2 += ((n2 = (n2 << 20 | n2 >>> 12) + i2 | 0) ^ i2 ^ s2) + t2[5] - 378558 | 0, s2 += ((r2 = (r2 << 4 | r2 >>> 28) + n2 | 0) ^ n2 ^ i2) + t2[8] - 2022574463 | 0, i2 += ((s2 = (s2 << 11 | s2 >>> 21) + r2 | 0) ^ r2 ^ n2) + t2[11] + 1839030562 | 0, n2 += ((i2 = (i2 << 16 | i2 >>> 16) + s2 | 0) ^ s2 ^ r2) + t2[14] - 35309556 | 0, r2 += ((n2 = (n2 << 23 | n2 >>> 9) + i2 | 0) ^ i2 ^ s2) + t2[1] - 1530992060 | 0, s2 += ((r2 = (r2 << 4 | r2 >>> 28) + n2 | 0) ^ n2 ^ i2) + t2[4] + 1272893353 | 0, i2 += ((s2 = (s2 << 11 | s2 >>> 21) + r2 | 0) ^ r2 ^ n2) + t2[7] - 155497632 | 0, n2 += ((i2 = (i2 << 16 | i2 >>> 16) + s2 | 0) ^ s2 ^ r2) + t2[10] - 1094730640 | 0, r2 += ((n2 = (n2 << 23 | n2 >>> 9) + i2 | 0) ^ i2 ^ s2) + t2[13] + 681279174 | 0, s2 += ((r2 = (r2 << 4 | r2 >>> 28) + n2 | 0) ^ n2 ^ i2) + t2[0] - 358537222 | 0, i2 += ((s2 = (s2 << 11 | s2 >>> 21) + r2 | 0) ^ r2 ^ n2) + t2[3] - 722521979 | 0, n2 += ((i2 = (i2 << 16 | i2 >>> 16) + s2 | 0) ^ s2 ^ r2) + t2[6] + 76029189 | 0, r2 += ((n2 = (n2 << 23 | n2 >>> 9) + i2 | 0) ^ i2 ^ s2) + t2[9] - 640364487 | 0, s2 += ((r2 = (r2 << 4 | r2 >>> 28) + n2 | 0) ^ n2 ^ i2) + t2[12] - 421815835 | 0, i2 += ((s2 = (s2 << 11 | s2 >>> 21) + r2 | 0) ^ r2 ^ n2) + t2[15] + 530742520 | 0, n2 += ((i2 = (i2 << 16 | i2 >>> 16) + s2 | 0) ^ s2 ^ r2) + t2[2] - 995338651 | 0, n2 = (n2 << 23 | n2 >>> 9) + i2 | 0, r2 += (i2 ^ (n2 | ~s2)) + t2[0] - 198630844 | 0, r2 = (r2 << 6 | r2 >>> 26) + n2 | 0, s2 += (n2 ^ (r2 | ~i2)) + t2[7] + 1126891415 | 0, s2 = (s2 << 10 | s2 >>> 22) + r2 | 0, i2 += (r2 ^ (s2 | ~n2)) + t2[14] - 1416354905 | 0, i2 = (i2 << 15 | i2 >>> 17) + s2 | 0, n2 += (s2 ^ (i2 | ~r2)) + t2[5] - 57434055 | 0, n2 = (n2 << 21 | n2 >>> 11) + i2 | 0, r2 += (i2 ^ (n2 | ~s2)) + t2[12] + 1700485571 | 0, r2 = (r2 << 6 | r2 >>> 26) + n2 | 0, s2 += (n2 ^ (r2 | ~i2)) + t2[3] - 1894986606 | 0, s2 = (s2 << 10 | s2 >>> 22) + r2 | 0, i2 += (r2 ^ (s2 | ~n2)) + t2[10] - 1051523 | 0, i2 = (i2 << 15 | i2 >>> 17) + s2 | 0, n2 += (s2 ^ (i2 | ~r2)) + t2[1] - 2054922799 | 0, n2 = (n2 << 21 | n2 >>> 11) + i2 | 0, r2 += (i2 ^ (n2 | ~s2)) + t2[8] + 1873313359 | 0, r2 = (r2 << 6 | r2 >>> 26) + n2 | 0, s2 += (n2 ^ (r2 | ~i2)) + t2[15] - 30611744 | 0, s2 = (s2 << 10 | s2 >>> 22) + r2 | 0, i2 += (r2 ^ (s2 | ~n2)) + t2[6] - 1560198380 | 0, i2 = (i2 << 15 | i2 >>> 17) + s2 | 0, n2 += (s2 ^ (i2 | ~r2)) + t2[13] + 1309151649 | 0, n2 = (n2 << 21 | n2 >>> 11) + i2 | 0, r2 += (i2 ^ (n2 | ~s2)) + t2[4] - 145523070 | 0, r2 = (r2 << 6 | r2 >>> 26) + n2 | 0, s2 += (n2 ^ (r2 | ~i2)) + t2[11] - 1120210379 | 0, s2 = (s2 << 10 | s2 >>> 22) + r2 | 0, i2 += (r2 ^ (s2 | ~n2)) + t2[2] + 718787259 | 0, i2 = (i2 << 15 | i2 >>> 17) + s2 | 0, n2 += (s2 ^ (i2 | ~r2)) + t2[9] - 343485551 | 0, n2 = (n2 << 21 | n2 >>> 11) + i2 | 0, e11[0] = r2 + e11[0] | 0, e11[1] = n2 + e11[1] | 0, e11[2] = i2 + e11[2] | 0, e11[3] = s2 + e11[3] | 0; + } + start() { + return this._dataLength = 0, this._bufferLength = 0, this._state.set(e10.stateIdentity), this; + } + appendStr(t2) { + let r2 = this._buffer8, n2 = this._buffer32, i2 = this._bufferLength, s2, a2; + for (a2 = 0; a2 < t2.length; a2 += 1) { + if ((s2 = t2.charCodeAt(a2)) < 128) + r2[i2++] = s2; + else if (s2 < 2048) + r2[i2++] = (s2 >>> 6) + 192, r2[i2++] = 63 & s2 | 128; + else if (s2 < 55296 || s2 > 56319) + r2[i2++] = (s2 >>> 12) + 224, r2[i2++] = s2 >>> 6 & 63 | 128, r2[i2++] = 63 & s2 | 128; + else { + if ((s2 = (s2 - 55296) * 1024 + (t2.charCodeAt(++a2) - 56320) + 65536) > 1114111) + throw Error("Unicode standard supports code points up to U+10FFFF"); + r2[i2++] = (s2 >>> 18) + 240, r2[i2++] = s2 >>> 12 & 63 | 128, r2[i2++] = s2 >>> 6 & 63 | 128, r2[i2++] = 63 & s2 | 128; + } + i2 >= 64 && (this._dataLength += 64, e10._md5cycle(this._state, n2), i2 -= 64, n2[0] = n2[16]); + } + return this._bufferLength = i2, this; + } + appendAsciiStr(t2) { + let r2 = this._buffer8, n2 = this._buffer32, i2 = this._bufferLength, s2, a2 = 0; + for (; ; ) { + for (s2 = Math.min(t2.length - a2, 64 - i2); s2--; ) + r2[i2++] = t2.charCodeAt(a2++); + if (i2 < 64) + break; + this._dataLength += 64, e10._md5cycle(this._state, n2), i2 = 0; + } + return this._bufferLength = i2, this; + } + appendByteArray(t2) { + let r2 = this._buffer8, n2 = this._buffer32, i2 = this._bufferLength, s2, a2 = 0; + for (; ; ) { + for (s2 = Math.min(t2.length - a2, 64 - i2); s2--; ) + r2[i2++] = t2[a2++]; + if (i2 < 64) + break; + this._dataLength += 64, e10._md5cycle(this._state, n2), i2 = 0; + } + return this._bufferLength = i2, this; + } + getState() { + let e11 = this._state; + return { buffer: String.fromCharCode.apply(null, Array.from(this._buffer8)), buflen: this._bufferLength, length: this._dataLength, state: [e11[0], e11[1], e11[2], e11[3]] }; + } + setState(e11) { + let t2 = e11.buffer, r2 = e11.state, n2 = this._state, i2; + for (this._dataLength = e11.length, this._bufferLength = e11.buflen, n2[0] = r2[0], n2[1] = r2[1], n2[2] = r2[2], n2[3] = r2[3], i2 = 0; i2 < t2.length; i2 += 1) + this._buffer8[i2] = t2.charCodeAt(i2); + } + end(t2 = false) { + let r2 = this._bufferLength, n2 = this._buffer8, i2 = this._buffer32, s2 = (r2 >> 2) + 1; + this._dataLength += r2; + let a2 = 8 * this._dataLength; + if (n2[r2] = 128, n2[r2 + 1] = n2[r2 + 2] = n2[r2 + 3] = 0, i2.set(e10.buffer32Identity.subarray(s2), s2), r2 > 55 && (e10._md5cycle(this._state, i2), i2.set(e10.buffer32Identity)), a2 <= 4294967295) + i2[14] = a2; + else { + let e11 = a2.toString(16).match(/(.*?)(.{0,8})$/); + if (null === e11) + return; + let t3 = parseInt(e11[2], 16), r3 = parseInt(e11[1], 16) || 0; + i2[14] = t3, i2[15] = r3; + } + return e10._md5cycle(this._state, i2), t2 ? this._state : e10._hex(this._state); + } + }, "Md5"), S(I, "stateIdentity", new Int32Array([1732584193, -271733879, -1732584194, 271733878])), S(I, "buffer32Identity", new Int32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])), S(I, "hexChars", "0123456789abcdef"), S(I, "hexOut", []), S(I, "onePassHasher", new I()), N = I; + }), L = {}; + function j(e10) { + return s.getRandomValues(a.alloc(e10)); + } + function D(e10) { + if ("sha256" === e10) + return { update: m(function(e11) { + return { digest: m(function() { + return a.from(O(e11)); + }, "digest") }; + }, "update") }; + if ("md5" === e10) + return { update: m(function(e11) { + return { digest: m(function() { + return "string" == typeof e11 ? N.hashStr(e11) : N.hashByteArray(e11); + }, "digest") }; + }, "update") }; + throw Error(`Hash type '${e10}' not supported`); + } + function F(e10, t2) { + if ("sha256" !== e10) + throw Error(`Only sha256 is supported (requested: '${e10}')`); + return { update: m(function(e11) { + return { digest: m(function() { + "string" == typeof t2 && (t2 = new TextEncoder().encode(t2)), "string" == typeof e11 && (e11 = new TextEncoder().encode(e11)); + let r2 = t2.length; + if (r2 > 64) + t2 = O(t2); + else if (r2 < 64) { + let e12 = new Uint8Array(64); + e12.set(t2), t2 = e12; + } + let n2 = new Uint8Array(64), i2 = new Uint8Array(64); + for (let e12 = 0; e12 < 64; e12++) + n2[e12] = 54 ^ t2[e12], i2[e12] = 92 ^ t2[e12]; + let s2 = new Uint8Array(e11.length + 64); + s2.set(n2, 0), s2.set(e11, 64); + let o2 = new Uint8Array(96); + return o2.set(i2, 0), o2.set(O(s2), 64), a.from(O(o2)); + }, "digest") }; + }, "update") }; + } + v(L, { createHash: () => D, createHmac: () => F, randomBytes: () => j }); + var B = g(() => { + C(), M(), $(), m(j, "randomBytes"), m(D, "createHash"), m(F, "createHmac"); + }), U = y((e10) => { + C(), e10.parse = function(e11, t3) { + return new r2(e11, t3).parse(); + }; + var t2 = class e11 { + constructor(e12, t3) { + this.source = e12, this.transform = t3 || n2, this.position = 0, this.entries = [], this.recorded = [], this.dimension = 0; + } + isEof() { + return this.position >= this.source.length; + } + nextCharacter() { + var e12 = this.source[this.position++]; + return "\\" === e12 ? { value: this.source[this.position++], escaped: true } : { value: e12, escaped: false }; + } + record(e12) { + this.recorded.push(e12); + } + newEntry(e12) { + var t3; + (this.recorded.length > 0 || e12) && ("NULL" !== (t3 = this.recorded.join("")) || e12 || (t3 = null), null !== t3 && (t3 = this.transform(t3)), this.entries.push(t3), this.recorded = []); + } + consumeDimensions() { + if ("[" === this.source[0]) + for (; !this.isEof() && "=" !== this.nextCharacter().value; ) + ; + } + parse(t3) { + var r3, n3, i2; + for (this.consumeDimensions(); !this.isEof(); ) + if ("{" !== (r3 = this.nextCharacter()).value || i2) { + if ("}" !== r3.value || i2) + '"' !== r3.value || r3.escaped ? "," !== r3.value || i2 ? this.record(r3.value) : this.newEntry() : (i2 && this.newEntry(true), i2 = !i2); + else if (this.dimension--, !this.dimension && (this.newEntry(), t3)) + return this.entries; + } else + this.dimension++, this.dimension > 1 && (n3 = new e11(this.source.substr(this.position - 1), this.transform), this.entries.push(n3.parse(true)), this.position += n3.position - 2); + if (0 !== this.dimension) + throw Error("array dimension not balanced"); + return this.entries; + } + }; + m(t2, "ArrayParser"); + var r2 = t2; + function n2(e11) { + return e11; + } + m(n2, "identity"); + }), q = y((e10, t2) => { + C(); + var r2 = U(); + t2.exports = { create: m(function(e11, t3) { + return { parse: m(function() { + return r2.parse(e11, t3); + }, "parse") }; + }, "create") }; + }), z = y((e10, t2) => { + C(); + var r2 = /(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, n2 = /^(\d{1,})-(\d{2})-(\d{2})( BC)?$/, i2 = /([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/, s2 = /^-?infinity$/; + function a2(e11) { + var t3 = n2.exec(e11); + if (t3) { + var r3 = parseInt(t3[1], 10); + t3[4] && (r3 = l2(r3)); + var i3 = new Date(r3, parseInt(t3[2], 10) - 1, t3[3]); + return c2(r3) && i3.setFullYear(r3), i3; + } + } + function o2(e11) { + if (e11.endsWith("+00")) + return 0; + var t3 = i2.exec(e11.split(" ")[1]); + if (t3) { + var r3 = t3[1]; + return "Z" === r3 ? 0 : (3600 * parseInt(t3[2], 10) + 60 * parseInt(t3[3] || 0, 10) + parseInt(t3[4] || 0, 10)) * ("-" === r3 ? -1 : 1) * 1e3; + } + } + function l2(e11) { + return -(e11 - 1); + } + function c2(e11) { + return e11 >= 0 && e11 < 100; + } + t2.exports = m(function(e11) { + if (s2.test(e11)) + return Number(e11.replace("i", "I")); + var t3 = r2.exec(e11); + if (!t3) + return a2(e11) || null; + var n3 = !!t3[8], i3 = parseInt(t3[1], 10); + n3 && (i3 = l2(i3)); + var u2 = parseInt(t3[2], 10) - 1, d2 = t3[3], h2 = parseInt(t3[4], 10), f2 = parseInt(t3[5], 10), p2 = parseInt(t3[6], 10), m2 = t3[7]; + m2 = m2 ? 1e3 * parseFloat(m2) : 0; + var g2, y2 = o2(e11); + return null != y2 ? (g2 = new Date(Date.UTC(i3, u2, d2, h2, f2, p2, m2)), c2(i3) && g2.setUTCFullYear(i3), 0 !== y2 && g2.setTime(g2.getTime() - y2)) : (g2 = new Date(i3, u2, d2, h2, f2, p2, m2), c2(i3) && g2.setFullYear(i3)), g2; + }, "parseDate"), m(a2, "getDate"), m(o2, "timeZoneOffset"), m(l2, "bcYearToNegativeYear"), m(c2, "is0To99"); + }), H = y((e10, t2) => { + C(), t2.exports = n2; + var r2 = Object.prototype.hasOwnProperty; + function n2(e11) { + for (var t3 = 1; t3 < arguments.length; t3++) { + var n3 = arguments[t3]; + for (var i2 in n3) + r2.call(n3, i2) && (e11[i2] = n3[i2]); + } + return e11; + } + m(n2, "extend"); + }), W = y((e10, t2) => { + C(); + var r2 = H(); + function n2(e11) { + if (!(this instanceof n2)) + return new n2(e11); + r2(this, f2(e11)); + } + t2.exports = n2, m(n2, "PostgresInterval"); + var i2 = ["seconds", "minutes", "hours", "days", "months", "years"]; + n2.prototype.toPostgres = function() { + var e11 = i2.filter(this.hasOwnProperty, this); + return this.milliseconds && 0 > e11.indexOf("seconds") && e11.push("seconds"), 0 === e11.length ? "0" : e11.map(function(e12) { + var t3 = this[e12] || 0; + return "seconds" === e12 && this.milliseconds && (t3 = (t3 + this.milliseconds / 1e3).toFixed(6).replace(/\.?0+$/, "")), t3 + " " + e12; + }, this).join(" "); + }; + var s2 = { years: "Y", months: "M", days: "D", hours: "H", minutes: "M", seconds: "S" }, a2 = ["years", "months", "days"], o2 = ["hours", "minutes", "seconds"]; + n2.prototype.toISOString = n2.prototype.toISO = function() { + return "P" + a2.map(e11, this).join("") + "T" + o2.map(e11, this).join(""); + function e11(e12) { + var t3 = this[e12] || 0; + return "seconds" === e12 && this.milliseconds && (t3 = (t3 + this.milliseconds / 1e3).toFixed(6).replace(/0+$/, "")), t3 + s2[e12]; + } + }; + var l2 = "([+-]?\\d+)", c2 = new RegExp([l2 + "\\s+years?", l2 + "\\s+mons?", l2 + "\\s+days?", "([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?"].map(function(e11) { + return "(" + e11 + ")?"; + }).join("\\s*")), u2 = { years: 2, months: 4, days: 6, hours: 9, minutes: 10, seconds: 11, milliseconds: 12 }, d2 = ["hours", "minutes", "seconds", "milliseconds"]; + function h2(e11) { + return parseInt(e11 + "000000".slice(e11.length), 10) / 1e3; + } + function f2(e11) { + if (!e11) + return {}; + var t3 = c2.exec(e11), r3 = "-" === t3[8]; + return Object.keys(u2).reduce(function(e12, n3) { + var i3 = t3[u2[n3]]; + return i3 && (i3 = "milliseconds" === n3 ? h2(i3) : parseInt(i3, 10)) && (r3 && ~d2.indexOf(n3) && (i3 *= -1), e12[n3] = i3), e12; + }, {}); + } + m(h2, "parseMilliseconds"), m(f2, "parse"); + }), Q = y((e10, t2) => { + C(), t2.exports = m(function(e11) { + if (/^\\x/.test(e11)) + return new a(e11.substr(2), "hex"); + for (var t3 = "", r2 = 0; r2 < e11.length; ) + if ("\\" !== e11[r2]) + t3 += e11[r2], ++r2; + else if (/[0-7]{3}/.test(e11.substr(r2 + 1, 3))) + t3 += String.fromCharCode(parseInt(e11.substr(r2 + 1, 3), 8)), r2 += 4; + else { + for (var n2 = 1; r2 + n2 < e11.length && "\\" === e11[r2 + n2]; ) + n2++; + for (var i2 = 0; i2 < Math.floor(n2 / 2); ++i2) + t3 += "\\"; + r2 += 2 * Math.floor(n2 / 2); + } + return new a(t3, "binary"); + }, "parseBytea"); + }), V = y((e10, t2) => { + C(); + var r2 = U(), n2 = q(), i2 = z(), s2 = W(), a2 = Q(); + function o2(e11) { + return m(function(t3) { + return null === t3 ? t3 : e11(t3); + }, "nullAllowed"); + } + function l2(e11) { + return null === e11 ? e11 : "TRUE" === e11 || "t" === e11 || "true" === e11 || "y" === e11 || "yes" === e11 || "on" === e11 || "1" === e11; + } + function c2(e11) { + return e11 ? r2.parse(e11, l2) : null; + } + function u2(e11) { + return parseInt(e11, 10); + } + function d2(e11) { + return e11 ? r2.parse(e11, o2(u2)) : null; + } + function h2(e11) { + return e11 ? r2.parse(e11, o2(function(e12) { + return x2(e12).trim(); + })) : null; + } + m(o2, "allowNull"), m(l2, "parseBool"), m(c2, "parseBoolArray"), m(u2, "parseBaseTenInt"), m(d2, "parseIntegerArray"), m(h2, "parseBigIntegerArray"); + var f2 = m(function(e11) { + return e11 ? n2.create(e11, function(e12) { + return null !== e12 && (e12 = _2(e12)), e12; + }).parse() : null; + }, "parsePointArray"), p2 = m(function(e11) { + return e11 ? n2.create(e11, function(e12) { + return null !== e12 && (e12 = parseFloat(e12)), e12; + }).parse() : null; + }, "parseFloatArray"), g2 = m(function(e11) { + return e11 ? n2.create(e11).parse() : null; + }, "parseStringArray"), y2 = m(function(e11) { + return e11 ? n2.create(e11, function(e12) { + return null !== e12 && (e12 = i2(e12)), e12; + }).parse() : null; + }, "parseDateArray"), v2 = m(function(e11) { + return e11 ? n2.create(e11, function(e12) { + return null !== e12 && (e12 = s2(e12)), e12; + }).parse() : null; + }, "parseIntervalArray"), b2 = m(function(e11) { + return e11 ? r2.parse(e11, o2(a2)) : null; + }, "parseByteAArray"), w2 = m(function(e11) { + return parseInt(e11, 10); + }, "parseInteger"), x2 = m(function(e11) { + var t3 = String(e11); + return /^\d+$/.test(t3) ? t3 : e11; + }, "parseBigInteger"), S2 = m(function(e11) { + return e11 ? r2.parse(e11, o2(JSON.parse)) : null; + }, "parseJsonArray"), _2 = m(function(e11) { + return "(" !== e11[0] ? null : { x: parseFloat((e11 = e11.substring(1, e11.length - 1).split(","))[0]), y: parseFloat(e11[1]) }; + }, "parsePoint"), E2 = m(function(e11) { + if ("<" !== e11[0] && "(" !== e11[1]) + return null; + for (var t3 = "(", r3 = "", n3 = false, i3 = 2; i3 < e11.length - 1; i3++) { + if (n3 || (t3 += e11[i3]), ")" === e11[i3]) { + n3 = true; + continue; + } + n3 && "," !== e11[i3] && (r3 += e11[i3]); + } + var s3 = _2(t3); + return s3.radius = parseFloat(r3), s3; + }, "parseCircle"), k2 = m(function(e11) { + e11(20, x2), e11(21, w2), e11(23, w2), e11(26, w2), e11(700, parseFloat), e11(701, parseFloat), e11(16, l2), e11(1082, i2), e11(1114, i2), e11(1184, i2), e11(600, _2), e11(651, g2), e11(718, E2), e11(1e3, c2), e11(1001, b2), e11(1005, d2), e11(1007, d2), e11(1028, d2), e11(1016, h2), e11(1017, f2), e11(1021, p2), e11(1022, p2), e11(1231, p2), e11(1014, g2), e11(1015, g2), e11(1008, g2), e11(1009, g2), e11(1040, g2), e11(1041, g2), e11(1115, y2), e11(1182, y2), e11(1185, y2), e11(1186, s2), e11(1187, v2), e11(17, a2), e11(114, JSON.parse.bind(JSON)), e11(3802, JSON.parse.bind(JSON)), e11(199, S2), e11(3807, S2), e11(3907, g2), e11(2951, g2), e11(791, g2), e11(1183, g2), e11(1270, g2); + }, "init"); + t2.exports = { init: k2 }; + }), G = y((e10, t2) => { + function r2(e11) { + var t3 = e11.readInt32BE(0), r3 = e11.readUInt32BE(4), n2 = ""; + t3 < 0 && (t3 = ~t3 + (0 === r3), r3 = ~r3 + 1 >>> 0, n2 = "-"); + var i2, s2, a2, o2, l2, c2, u2 = ""; + if (i2 = t3 % 1e6, t3 = t3 / 1e6 >>> 0, r3 = (s2 = 4294967296 * i2 + r3) / 1e6 >>> 0, a2 = "" + (s2 - 1e6 * r3), 0 === r3 && 0 === t3) + return n2 + a2 + u2; + for (o2 = "", l2 = 6 - a2.length, c2 = 0; c2 < l2; c2++) + o2 += "0"; + if (u2 = o2 + a2 + u2, i2 = t3 % 1e6, t3 = t3 / 1e6 >>> 0, r3 = (s2 = 4294967296 * i2 + r3) / 1e6 >>> 0, a2 = "" + (s2 - 1e6 * r3), 0 === r3 && 0 === t3) + return n2 + a2 + u2; + for (o2 = "", l2 = 6 - a2.length, c2 = 0; c2 < l2; c2++) + o2 += "0"; + if (u2 = o2 + a2 + u2, i2 = t3 % 1e6, t3 = t3 / 1e6 >>> 0, r3 = (s2 = 4294967296 * i2 + r3) / 1e6 >>> 0, a2 = "" + (s2 - 1e6 * r3), 0 === r3 && 0 === t3) + return n2 + a2 + u2; + for (o2 = "", l2 = 6 - a2.length, c2 = 0; c2 < l2; c2++) + o2 += "0"; + return u2 = o2 + a2 + u2, n2 + (a2 = "" + (s2 = 4294967296 * (i2 = t3 % 1e6) + r3) % 1e6) + u2; + } + C(), m(r2, "readInt8"), t2.exports = r2; + }), Z = y((e10, t2) => { + C(); + var r2 = G(), n2 = m(function(e11, t3, r3, n3, i3) { + r3 = r3 || 0, n3 = n3 || false, i3 = i3 || function(e12, t4, r4) { + return e12 * Math.pow(2, r4) + t4; + }; + var s3 = r3 >> 3, a3 = m(function(e12) { + return n3 ? 255 & ~e12 : e12; + }, "inv"), o3 = 255, l3 = 8 - r3 % 8; + t3 < l3 && (o3 = 255 << 8 - t3 & 255, l3 = t3), r3 && (o3 >>= r3 % 8); + var c3 = 0; + r3 % 8 + t3 >= 8 && (c3 = i3(0, a3(e11[s3]) & o3, l3)); + for (var u3 = t3 + r3 >> 3, d3 = s3 + 1; d3 < u3; d3++) + c3 = i3(c3, a3(e11[d3]), 8); + var h3 = (t3 + r3) % 8; + return h3 > 0 && (c3 = i3(c3, a3(e11[u3]) >> 8 - h3, h3)), c3; + }, "parseBits"), i2 = m(function(e11, t3, r3) { + var i3 = Math.pow(2, r3 - 1) - 1, s3 = n2(e11, 1), a3 = n2(e11, r3, 1); + if (0 === a3) + return 0; + var o3 = 1, l3 = n2(e11, t3, r3 + 1, false, m(function(e12, t4, r4) { + 0 === e12 && (e12 = 1); + for (var n3 = 1; n3 <= r4; n3++) + o3 /= 2, (t4 & 1 << r4 - n3) > 0 && (e12 += o3); + return e12; + }, "parsePrecisionBits")); + return a3 == Math.pow(2, r3 + 1) - 1 ? 0 === l3 ? 0 === s3 ? 1 / 0 : -1 / 0 : NaN : (0 === s3 ? 1 : -1) * Math.pow(2, a3 - i3) * l3; + }, "parseFloatFromBits"), s2 = m(function(e11) { + return 1 == n2(e11, 1) ? -1 * (n2(e11, 15, 1, true) + 1) : n2(e11, 15, 1); + }, "parseInt16"), a2 = m(function(e11) { + return 1 == n2(e11, 1) ? -1 * (n2(e11, 31, 1, true) + 1) : n2(e11, 31, 1); + }, "parseInt32"), o2 = m(function(e11) { + return i2(e11, 23, 8); + }, "parseFloat32"), l2 = m(function(e11) { + return i2(e11, 52, 11); + }, "parseFloat64"), c2 = m(function(e11) { + var t3 = n2(e11, 16, 32); + if (49152 == t3) + return NaN; + for (var r3 = Math.pow(1e4, n2(e11, 16, 16)), i3 = 0, s3 = n2(e11, 16), a3 = 0; a3 < s3; a3++) + i3 += n2(e11, 16, 64 + 16 * a3) * r3, r3 /= 1e4; + var o3 = Math.pow(10, n2(e11, 16, 48)); + return (0 === t3 ? 1 : -1) * Math.round(i3 * o3) / o3; + }, "parseNumeric"), u2 = m(function(e11, t3) { + var r3 = n2(t3, 1), i3 = n2(t3, 63, 1), s3 = new Date((0 === r3 ? 1 : -1) * i3 / 1e3 + 9466848e5); + return e11 || s3.setTime(s3.getTime() + 6e4 * s3.getTimezoneOffset()), s3.usec = i3 % 1e3, s3.getMicroSeconds = function() { + return this.usec; + }, s3.setMicroSeconds = function(e12) { + this.usec = e12; + }, s3.getUTCMicroSeconds = function() { + return this.usec; + }, s3; + }, "parseDate"), d2 = m(function(e11) { + for (var t3 = n2(e11, 32), r3 = (n2(e11, 32, 32), n2(e11, 32, 64)), i3 = 96, s3 = [], a3 = 0; a3 < t3; a3++) + s3[a3] = n2(e11, 32, i3), i3 += 64; + var o3 = m(function(t4) { + var r4, s4 = n2(e11, 32, i3); + return (i3 += 32, 4294967295 == s4) ? null : 23 == t4 || 20 == t4 ? (r4 = n2(e11, 8 * s4, i3), i3 += 8 * s4, r4) : 25 == t4 ? e11.toString(this.encoding, i3 >> 3, (i3 += s4 << 3) >> 3) : void console.log("ERROR: ElementType not implemented: " + t4); + }, "parseElement"), l3 = m(function(e12, t4) { + var r4, n3 = []; + if (e12.length > 1) { + var i4 = e12.shift(); + for (r4 = 0; r4 < i4; r4++) + n3[r4] = l3(e12, t4); + e12.unshift(i4); + } else + for (r4 = 0; r4 < e12[0]; r4++) + n3[r4] = o3(t4); + return n3; + }, "parse"); + return l3(s3, r3); + }, "parseArray"), h2 = m(function(e11) { + return e11.toString("utf8"); + }, "parseText"), f2 = m(function(e11) { + return null === e11 ? null : n2(e11, 8) > 0; + }, "parseBool"), p2 = m(function(e11) { + e11(20, r2), e11(21, s2), e11(23, a2), e11(26, a2), e11(1700, c2), e11(700, o2), e11(701, l2), e11(16, f2), e11(1114, u2.bind(null, false)), e11(1184, u2.bind(null, true)), e11(1e3, d2), e11(1007, d2), e11(1016, d2), e11(1008, d2), e11(1009, d2), e11(25, h2); + }, "init"); + t2.exports = { init: p2 }; + }), K = y((e10, t2) => { + C(), t2.exports = { BOOL: 16, BYTEA: 17, CHAR: 18, INT8: 20, INT2: 21, INT4: 23, REGPROC: 24, TEXT: 25, OID: 26, TID: 27, XID: 28, CID: 29, JSON: 114, XML: 142, PG_NODE_TREE: 194, SMGR: 210, PATH: 602, POLYGON: 604, CIDR: 650, FLOAT4: 700, FLOAT8: 701, ABSTIME: 702, RELTIME: 703, TINTERVAL: 704, CIRCLE: 718, MACADDR8: 774, MONEY: 790, MACADDR: 829, INET: 869, ACLITEM: 1033, BPCHAR: 1042, VARCHAR: 1043, DATE: 1082, TIME: 1083, TIMESTAMP: 1114, TIMESTAMPTZ: 1184, INTERVAL: 1186, TIMETZ: 1266, BIT: 1560, VARBIT: 1562, NUMERIC: 1700, REFCURSOR: 1790, REGPROCEDURE: 2202, REGOPER: 2203, REGOPERATOR: 2204, REGCLASS: 2205, REGTYPE: 2206, UUID: 2950, TXID_SNAPSHOT: 2970, PG_LSN: 3220, PG_NDISTINCT: 3361, PG_DEPENDENCIES: 3402, TSVECTOR: 3614, TSQUERY: 3615, GTSVECTOR: 3642, REGCONFIG: 3734, REGDICTIONARY: 3769, JSONB: 3802, REGNAMESPACE: 4089, REGROLE: 4096 }; + }), J = y((e10) => { + C(); + var t2 = V(), r2 = Z(), n2 = q(), i2 = K(); + e10.getTypeParser = o2, e10.setTypeParser = l2, e10.arrayParser = n2, e10.builtins = i2; + var s2 = { text: {}, binary: {} }; + function a2(e11) { + return String(e11); + } + function o2(e11, t3) { + return s2[t3 = t3 || "text"] && s2[t3][e11] || a2; + } + function l2(e11, t3, r3) { + "function" == typeof t3 && (r3 = t3, t3 = "text"), s2[t3][e11] = r3; + } + m(a2, "noParse"), m(o2, "getTypeParser"), m(l2, "setTypeParser"), t2.init(function(e11, t3) { + s2.text[e11] = t3; + }), r2.init(function(e11, t3) { + s2.binary[e11] = t3; + }); + }), Y = y((e10, t2) => { + C(), t2.exports = { host: "localhost", user: "win32" === o.platform ? o.env.USERNAME : o.env.USER, database: void 0, password: null, connectionString: void 0, port: 5432, rows: 0, binary: false, max: 10, idleTimeoutMillis: 3e4, client_encoding: "", ssl: false, application_name: void 0, fallback_application_name: void 0, options: void 0, parseInputDatesAsUTC: false, statement_timeout: false, lock_timeout: false, idle_in_transaction_session_timeout: false, query_timeout: false, connect_timeout: 0, keepalives: 1, keepalives_idle: 0 }; + var r2 = J(), n2 = r2.getTypeParser(20, "text"), i2 = r2.getTypeParser(1016, "text"); + t2.exports.__defineSetter__("parseInt8", function(e11) { + r2.setTypeParser(20, "text", e11 ? r2.getTypeParser(23, "text") : n2), r2.setTypeParser(1016, "text", e11 ? r2.getTypeParser(1007, "text") : i2); + }); + }), X = y((e10, t2) => { + C(); + var r2 = (B(), x(L)), n2 = Y(); + function i2(e11) { + return '"' + e11.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"'; + } + function s2(e11) { + for (var t3 = "{", r3 = 0; r3 < e11.length; r3++) + r3 > 0 && (t3 += ","), null === e11[r3] || typeof e11[r3] > "u" ? t3 += "NULL" : Array.isArray(e11[r3]) ? t3 += s2(e11[r3]) : e11[r3] instanceof a ? t3 += "\\\\x" + e11[r3].toString("hex") : t3 += i2(o2(e11[r3])); + return t3 + "}"; + } + m(i2, "escapeElement"), m(s2, "arrayString"); + var o2 = m(function(e11, t3) { + if (null == e11) + return null; + if (e11 instanceof a) + return e11; + if (ArrayBuffer.isView(e11)) { + var r3 = a.from(e11.buffer, e11.byteOffset, e11.byteLength); + return r3.length === e11.byteLength ? r3 : r3.slice(e11.byteOffset, e11.byteOffset + e11.byteLength); + } + return e11 instanceof Date ? n2.parseInputDatesAsUTC ? d2(e11) : u2(e11) : Array.isArray(e11) ? s2(e11) : "object" == typeof e11 ? l2(e11, t3) : e11.toString(); + }, "prepareValue"); + function l2(e11, t3) { + if (e11 && "function" == typeof e11.toPostgres) { + if (-1 !== (t3 = t3 || []).indexOf(e11)) + throw Error('circular reference detected while preparing "' + e11 + '" for query'); + return t3.push(e11), o2(e11.toPostgres(o2), t3); + } + return JSON.stringify(e11); + } + function c2(e11, t3) { + for (e11 = "" + e11; e11.length < t3; ) + e11 = "0" + e11; + return e11; + } + function u2(e11) { + var t3 = -e11.getTimezoneOffset(), r3 = e11.getFullYear(), n3 = r3 < 1; + n3 && (r3 = Math.abs(r3) + 1); + var i3 = c2(r3, 4) + "-" + c2(e11.getMonth() + 1, 2) + "-" + c2(e11.getDate(), 2) + "T" + c2(e11.getHours(), 2) + ":" + c2(e11.getMinutes(), 2) + ":" + c2(e11.getSeconds(), 2) + "." + c2(e11.getMilliseconds(), 3); + return t3 < 0 ? (i3 += "-", t3 *= -1) : i3 += "+", i3 += c2(Math.floor(t3 / 60), 2) + ":" + c2(t3 % 60, 2), n3 && (i3 += " BC"), i3; + } + function d2(e11) { + var t3 = e11.getUTCFullYear(), r3 = t3 < 1; + r3 && (t3 = Math.abs(t3) + 1); + var n3 = c2(t3, 4) + "-" + c2(e11.getUTCMonth() + 1, 2) + "-" + c2(e11.getUTCDate(), 2) + "T" + c2(e11.getUTCHours(), 2) + ":" + c2(e11.getUTCMinutes(), 2) + ":" + c2(e11.getUTCSeconds(), 2) + "." + c2(e11.getUTCMilliseconds(), 3); + return n3 += "+00:00", r3 && (n3 += " BC"), n3; + } + function h2(e11, t3, r3) { + return e11 = "string" == typeof e11 ? { text: e11 } : e11, t3 && ("function" == typeof t3 ? e11.callback = t3 : e11.values = t3), r3 && (e11.callback = r3), e11; + } + m(l2, "prepareObject"), m(c2, "pad"), m(u2, "dateToString"), m(d2, "dateToStringUTC"), m(h2, "normalizeQueryConfig"); + var f2 = m(function(e11) { + return r2.createHash("md5").update(e11, "utf-8").digest("hex"); + }, "md5"), p2 = m(function(e11, t3, r3) { + var n3 = f2(t3 + e11); + return "md5" + f2(a.concat([a.from(n3), r3])); + }, "postgresMd5PasswordHash"); + t2.exports = { prepareValue: m(function(e11) { + return o2(e11); + }, "prepareValueWrapper"), normalizeQueryConfig: h2, postgresMd5PasswordHash: p2, md5: f2 }; + }), ee = y((e10, t2) => { + C(); + var r2 = (B(), x(L)); + function n2(e11) { + if (-1 === e11.indexOf("SCRAM-SHA-256")) + throw Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported"); + let t3 = r2.randomBytes(18).toString("base64"); + return { mechanism: "SCRAM-SHA-256", clientNonce: t3, response: "n,,n=*,r=" + t3, message: "SASLInitialResponse" }; + } + function i2(e11, t3, r3) { + if ("SASLInitialResponse" !== e11.message) + throw Error("SASL: Last message was not SASLInitialResponse"); + if ("string" != typeof t3) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string"); + if ("string" != typeof r3) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string"); + let n3 = u2(r3); + if (n3.nonce.startsWith(e11.clientNonce)) { + if (n3.nonce.length === e11.clientNonce.length) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short"); + } else + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); + var i3 = g2(t3, a.from(n3.salt, "base64"), n3.iteration), s3 = p2(i3, "Client Key"), o3 = f2(s3), l3 = "n=*,r=" + e11.clientNonce, c3 = "r=" + n3.nonce + ",s=" + n3.salt + ",i=" + n3.iteration, d3 = "c=biws,r=" + n3.nonce, m2 = l3 + "," + c3 + "," + d3, y2 = h2(s3, p2(o3, m2)).toString("base64"), v2 = p2(i3, "Server Key"), b2 = p2(v2, m2); + e11.message = "SASLResponse", e11.serverSignature = b2.toString("base64"), e11.response = d3 + ",p=" + y2; + } + function s2(e11, t3) { + if ("SASLResponse" !== e11.message) + throw Error("SASL: Last message was not SASLResponse"); + if ("string" != typeof t3) + throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string"); + let { serverSignature: r3 } = d2(t3); + if (r3 !== e11.serverSignature) + throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match"); + } + function o2(e11) { + if ("string" != typeof e11) + throw TypeError("SASL: text must be a string"); + return e11.split("").map((t3, r3) => e11.charCodeAt(r3)).every((e12) => e12 >= 33 && e12 <= 43 || e12 >= 45 && e12 <= 126); + } + function l2(e11) { + return /^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e11); + } + function c2(e11) { + if ("string" != typeof e11) + throw TypeError("SASL: attribute pairs text must be a string"); + return new Map(e11.split(",").map((e12) => { + if (!/^.=/.test(e12)) + throw Error("SASL: Invalid attribute pair entry"); + return [e12[0], e12.substring(2)]; + })); + } + function u2(e11) { + let t3 = c2(e11), r3 = t3.get("r"); + if (r3) { + if (!o2(r3)) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters"); + } else + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing"); + let n3 = t3.get("s"); + if (n3) { + if (!l2(n3)) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64"); + } else + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing"); + let i3 = t3.get("i"); + if (i3) { + if (!/^[1-9][0-9]*$/.test(i3)) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count"); + } else + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing"); + return { nonce: r3, salt: n3, iteration: parseInt(i3, 10) }; + } + function d2(e11) { + let t3 = c2(e11).get("v"); + if (t3) { + if (!l2(t3)) + throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64"); + } else + throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing"); + return { serverSignature: t3 }; + } + function h2(e11, t3) { + if (!a.isBuffer(e11)) + throw TypeError("first argument must be a Buffer"); + if (!a.isBuffer(t3)) + throw TypeError("second argument must be a Buffer"); + if (e11.length !== t3.length) + throw Error("Buffer lengths must match"); + if (0 === e11.length) + throw Error("Buffers cannot be empty"); + return a.from(e11.map((r3, n3) => e11[n3] ^ t3[n3])); + } + function f2(e11) { + return r2.createHash("sha256").update(e11).digest(); + } + function p2(e11, t3) { + return r2.createHmac("sha256", e11).update(t3).digest(); + } + function g2(e11, t3, r3) { + for (var n3 = p2(e11, a.concat([t3, a.from([0, 0, 0, 1])])), i3 = n3, s3 = 0; s3 < r3 - 1; s3++) + i3 = h2(i3, n3 = p2(e11, n3)); + return i3; + } + m(n2, "startSession"), m(i2, "continueSession"), m(s2, "finalizeSession"), m(o2, "isPrintableChars"), m(l2, "isBase64"), m(c2, "parseAttributePairs"), m(u2, "parseServerFirstMessage"), m(d2, "parseServerFinalMessage"), m(h2, "xorBuffers"), m(f2, "sha256"), m(p2, "hmacSha256"), m(g2, "Hi"), t2.exports = { startSession: n2, continueSession: i2, finalizeSession: s2 }; + }), et = {}; + function er(...e10) { + return e10.join("/"); + } + v(et, { join: () => er }); + var en = g(() => { + C(), m(er, "join"); + }), ei = {}; + function es(e10, t2) { + t2(Error("No filesystem")); + } + v(ei, { stat: () => es }); + var ea = g(() => { + C(), m(es, "stat"); + }), eo = {}; + v(eo, { default: () => el }); + var el, ec = g(() => { + C(), el = {}; + }), eu = {}; + v(eu, { StringDecoder: () => eh }); + var ed, eh, ef = g(() => { + C(), m(ed = class { + constructor(e10) { + S(this, "td"), this.td = new TextDecoder(e10); + } + write(e10) { + return this.td.decode(e10, { stream: true }); + } + end(e10) { + return this.td.decode(e10); + } + }, "StringDecoder"), eh = ed; + }), ep = y((e10, t2) => { + C(); + var { Transform: r2 } = (ec(), x(eo)), { StringDecoder: n2 } = (ef(), x(eu)), i2 = Symbol("last"), s2 = Symbol("decoder"); + function a2(e11, t3, r3) { + let n3; + if (this.overflow) { + if (1 === (n3 = this[s2].write(e11).split(this.matcher)).length) + return r3(); + n3.shift(), this.overflow = false; + } else + this[i2] += this[s2].write(e11), n3 = this[i2].split(this.matcher); + this[i2] = n3.pop(); + for (let e12 = 0; e12 < n3.length; e12++) + try { + l2(this, this.mapper(n3[e12])); + } catch (e13) { + return r3(e13); + } + if (this.overflow = this[i2].length > this.maxLength, this.overflow && !this.skipOverflow) { + r3(Error("maximum buffer reached")); + return; + } + r3(); + } + function o2(e11) { + if (this[i2] += this[s2].end(), this[i2]) + try { + l2(this, this.mapper(this[i2])); + } catch (t3) { + return e11(t3); + } + e11(); + } + function l2(e11, t3) { + void 0 !== t3 && e11.push(t3); + } + function c2(e11) { + return e11; + } + function u2(e11, t3, l3) { + switch (e11 = e11 || /\r?\n/, t3 = t3 || c2, l3 = l3 || {}, arguments.length) { + case 1: + "function" == typeof e11 ? (t3 = e11, e11 = /\r?\n/) : "object" != typeof e11 || e11 instanceof RegExp || e11[Symbol.split] || (l3 = e11, e11 = /\r?\n/); + break; + case 2: + "function" == typeof e11 ? (l3 = t3, t3 = e11, e11 = /\r?\n/) : "object" == typeof t3 && (l3 = t3, t3 = c2); + } + (l3 = Object.assign({}, l3)).autoDestroy = true, l3.transform = a2, l3.flush = o2, l3.readableObjectMode = true; + let u3 = new r2(l3); + return u3[i2] = "", u3[s2] = new n2("utf8"), u3.matcher = e11, u3.mapper = t3, u3.maxLength = l3.maxLength, u3.skipOverflow = l3.skipOverflow || false, u3.overflow = false, u3._destroy = function(e12, t4) { + this._writableState.errorEmitted = false, t4(e12); + }, u3; + } + m(a2, "transform"), m(o2, "flush"), m(l2, "push"), m(c2, "noop"), m(u2, "split"), t2.exports = u2; + }), em = y((e10, t2) => { + C(); + var r2 = (en(), x(et)), n2 = (ec(), x(eo)).Stream, i2 = ep(), s2 = (A(), x(P)), a2 = "win32" === o.platform, l2 = o.stderr; + function c2(e11) { + return (61440 & e11) == 32768; + } + m(c2, "isRegFile"); + var u2 = ["host", "port", "database", "user", "password"], d2 = u2.length, h2 = u2[d2 - 1]; + function f2() { + if (l2 instanceof n2 && true === l2.writable) { + var e11 = Array.prototype.slice.call(arguments).concat(` +`); + l2.write(s2.format.apply(s2, e11)); + } + } + m(f2, "warn"), Object.defineProperty(t2.exports, "isWin", { get: m(function() { + return a2; + }, "get"), set: m(function(e11) { + a2 = e11; + }, "set") }), t2.exports.warnTo = function(e11) { + var t3 = l2; + return l2 = e11, t3; + }, t2.exports.getFileName = function(e11) { + var t3 = e11 || o.env; + return t3.PGPASSFILE || (a2 ? r2.join(t3.APPDATA || "./", "postgresql", "pgpass.conf") : r2.join(t3.HOME || "./", ".pgpass")); + }, t2.exports.usePgPass = function(e11, t3) { + return !Object.prototype.hasOwnProperty.call(o.env, "PGPASSWORD") && (!!a2 || (t3 = t3 || "", c2(e11.mode) ? !(63 & e11.mode) || (f2('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less', t3), false) : (f2('WARNING: password file "%s" is not a plain file', t3), false))); + }; + var p2 = t2.exports.match = function(e11, t3) { + return u2.slice(0, -1).reduce(function(r3, n3, i3) { + return 1 == i3 && Number(e11[n3] || 5432) === Number(t3[n3]) ? r3 && true : r3 && ("*" === t3[n3] || t3[n3] === e11[n3]); + }, true); + }; + t2.exports.getPassword = function(e11, t3, r3) { + var n3, s3 = t3.pipe(i2()); + function a3(t4) { + var r4 = g2(t4); + r4 && y2(r4) && p2(e11, r4) && (n3 = r4[h2], s3.end()); + } + m(a3, "onLine"); + var o2 = m(function() { + t3.destroy(), r3(n3); + }, "onEnd"), l3 = m(function(e12) { + t3.destroy(), f2("WARNING: error on reading file: %s", e12), r3(void 0); + }, "onErr"); + t3.on("error", l3), s3.on("data", a3).on("end", o2).on("error", l3); + }; + var g2 = t2.exports.parseLine = function(e11) { + if (e11.length < 11 || e11.match(/^\s+#/)) + return null; + for (var t3 = "", r3 = "", n3 = 0, i3 = 0, s3 = {}, a3 = m(function(t4, r4, n4) { + var i4 = e11.substring(r4, n4); + Object.hasOwnProperty.call(o.env, "PGPASS_NO_DEESCAPE") || (i4 = i4.replace(/\\([:\\])/g, "$1")), s3[u2[t4]] = i4; + }, "addToObj"), l3 = 0; l3 < e11.length - 1; l3 += 1) { + if (t3 = e11.charAt(l3 + 1), r3 = e11.charAt(l3), n3 == d2 - 1) { + a3(n3, i3); + break; + } + l3 >= 0 && ":" == t3 && "\\" !== r3 && (a3(n3, i3, l3 + 1), i3 = l3 + 2, n3 += 1); + } + return s3 = Object.keys(s3).length === d2 ? s3 : null; + }, y2 = t2.exports.isValidEntry = function(e11) { + for (var t3 = { 0: function(e12) { + return e12.length > 0; + }, 1: function(e12) { + return "*" === e12 || isFinite(e12 = Number(e12)) && e12 > 0 && e12 < 9007199254740992 && Math.floor(e12) === e12; + }, 2: function(e12) { + return e12.length > 0; + }, 3: function(e12) { + return e12.length > 0; + }, 4: function(e12) { + return e12.length > 0; + } }, r3 = 0; r3 < u2.length; r3 += 1) + if (!(0, t3[r3])(e11[u2[r3]] || "")) + return false; + return true; + }; + }), eg = y((e10, t2) => { + C(), en(), x(et); + var r2 = (ea(), x(ei)), n2 = em(); + t2.exports = function(e11, t3) { + var i2 = n2.getFileName(); + r2.stat(i2, function(s2, a2) { + if (s2 || !n2.usePgPass(a2, i2)) + return t3(void 0); + var o2 = r2.createReadStream(i2); + n2.getPassword(e11, o2, t3); + }); + }, t2.exports.warnTo = n2.warnTo; + }), ey = y((e10, t2) => { + C(); + var r2 = J(); + function n2(e11) { + this._types = e11 || r2, this.text = {}, this.binary = {}; + } + m(n2, "TypeOverrides"), n2.prototype.getOverrides = function(e11) { + switch (e11) { + case "text": + return this.text; + case "binary": + return this.binary; + default: + return {}; + } + }, n2.prototype.setTypeParser = function(e11, t3, r3) { + "function" == typeof t3 && (r3 = t3, t3 = "text"), this.getOverrides(t3)[e11] = r3; + }, n2.prototype.getTypeParser = function(e11, t3) { + return t3 = t3 || "text", this.getOverrides(t3)[e11] || this._types.getTypeParser(e11, t3); + }, t2.exports = n2; + }), ev = {}; + v(ev, { default: () => eb }); + var eb, ew = g(() => { + C(), eb = {}; + }), ex = {}; + function eS(e10, t2 = false) { + let { protocol: r2 } = new URL(e10), { username: n2, password: i2, host: s2, hostname: a2, port: o2, pathname: l2, search: c2, searchParams: u2, hash: d2 } = new URL("http:" + e10.substring(r2.length)); + i2 = decodeURIComponent(i2), n2 = decodeURIComponent(n2), l2 = decodeURIComponent(l2); + let h2 = n2 + ":" + i2, f2 = t2 ? Object.fromEntries(u2.entries()) : c2; + return { href: e10, protocol: r2, auth: h2, username: n2, password: i2, host: s2, hostname: a2, port: o2, pathname: l2, search: c2, query: f2, hash: d2 }; + } + v(ex, { parse: () => eS }); + var e_ = g(() => { + C(), m(eS, "parse"); + }), eE = y((e10, t2) => { + C(); + var r2 = (e_(), x(ex)), n2 = (ea(), x(ei)); + function i2(e11) { + if ("/" === e11.charAt(0)) { + var t3 = e11.split(" "); + return { host: t3[0], database: t3[1] }; + } + var i3 = r2.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e11) ? encodeURI(e11).replace(/\%25(\d\d)/g, "%$1") : e11, true), t3 = i3.query; + for (var s2 in t3) + Array.isArray(t3[s2]) && (t3[s2] = t3[s2][t3[s2].length - 1]); + var a2 = (i3.auth || ":").split(":"); + if (t3.user = a2[0], t3.password = a2.splice(1).join(":"), t3.port = i3.port, "socket:" == i3.protocol) + return t3.host = decodeURI(i3.pathname), t3.database = i3.query.db, t3.client_encoding = i3.query.encoding, t3; + t3.host || (t3.host = i3.hostname); + var o2 = i3.pathname; + if (!t3.host && o2 && /^%2f/i.test(o2)) { + var l2 = o2.split("/"); + t3.host = decodeURIComponent(l2[0]), o2 = l2.splice(1).join("/"); + } + switch (o2 && "/" === o2.charAt(0) && (o2 = o2.slice(1) || null), t3.database = o2 && decodeURI(o2), ("true" === t3.ssl || "1" === t3.ssl) && (t3.ssl = true), "0" === t3.ssl && (t3.ssl = false), (t3.sslcert || t3.sslkey || t3.sslrootcert || t3.sslmode) && (t3.ssl = {}), t3.sslcert && (t3.ssl.cert = n2.readFileSync(t3.sslcert).toString()), t3.sslkey && (t3.ssl.key = n2.readFileSync(t3.sslkey).toString()), t3.sslrootcert && (t3.ssl.ca = n2.readFileSync(t3.sslrootcert).toString()), t3.sslmode) { + case "disable": + t3.ssl = false; + break; + case "prefer": + case "require": + case "verify-ca": + case "verify-full": + break; + case "no-verify": + t3.ssl.rejectUnauthorized = false; + } + return t3; + } + m(i2, "parse"), t2.exports = i2, i2.parse = i2; + }), ek = y((e10, t2) => { + C(); + var r2 = (ew(), x(ev)), n2 = Y(), i2 = eE().parse, s2 = m(function(e11, t3, r3) { + return void 0 === r3 ? r3 = o.env["PG" + e11.toUpperCase()] : false === r3 || (r3 = o.env[r3]), t3[e11] || r3 || n2[e11]; + }, "val"), a2 = m(function() { + switch (o.env.PGSSLMODE) { + case "disable": + return false; + case "prefer": + case "require": + case "verify-ca": + case "verify-full": + return true; + case "no-verify": + return { rejectUnauthorized: false }; + } + return n2.ssl; + }, "readSSLConfigFromEnvironment"), l2 = m(function(e11) { + return "'" + ("" + e11).replace(/\\/g, "\\\\").replace(/'/g, "\\'") + "'"; + }, "quoteParamValue"), c2 = m(function(e11, t3, r3) { + var n3 = t3[r3]; + null != n3 && e11.push(r3 + "=" + l2(n3)); + }, "add"), u2 = class { + constructor(e11) { + (e11 = "string" == typeof e11 ? i2(e11) : e11 || {}).connectionString && (e11 = Object.assign({}, e11, i2(e11.connectionString))), this.user = s2("user", e11), this.database = s2("database", e11), void 0 === this.database && (this.database = this.user), this.port = parseInt(s2("port", e11), 10), this.host = s2("host", e11), Object.defineProperty(this, "password", { configurable: true, enumerable: false, writable: true, value: s2("password", e11) }), this.binary = s2("binary", e11), this.options = s2("options", e11), this.ssl = typeof e11.ssl > "u" ? a2() : e11.ssl, "string" == typeof this.ssl && "true" === this.ssl && (this.ssl = true), "no-verify" === this.ssl && (this.ssl = { rejectUnauthorized: false }), this.ssl && this.ssl.key && Object.defineProperty(this.ssl, "key", { enumerable: false }), this.client_encoding = s2("client_encoding", e11), this.replication = s2("replication", e11), this.isDomainSocket = !(this.host || "").indexOf("/"), this.application_name = s2("application_name", e11, "PGAPPNAME"), this.fallback_application_name = s2("fallback_application_name", e11, false), this.statement_timeout = s2("statement_timeout", e11, false), this.lock_timeout = s2("lock_timeout", e11, false), this.idle_in_transaction_session_timeout = s2("idle_in_transaction_session_timeout", e11, false), this.query_timeout = s2("query_timeout", e11, false), void 0 === e11.connectionTimeoutMillis ? this.connect_timeout = o.env.PGCONNECT_TIMEOUT || 0 : this.connect_timeout = Math.floor(e11.connectionTimeoutMillis / 1e3), false === e11.keepAlive ? this.keepalives = 0 : true === e11.keepAlive && (this.keepalives = 1), "number" == typeof e11.keepAliveInitialDelayMillis && (this.keepalives_idle = Math.floor(e11.keepAliveInitialDelayMillis / 1e3)); + } + getLibpqConnectionString(e11) { + var t3 = []; + c2(t3, this, "user"), c2(t3, this, "password"), c2(t3, this, "port"), c2(t3, this, "application_name"), c2(t3, this, "fallback_application_name"), c2(t3, this, "connect_timeout"), c2(t3, this, "options"); + var n3 = "object" == typeof this.ssl ? this.ssl : this.ssl ? { sslmode: this.ssl } : {}; + if (c2(t3, n3, "sslmode"), c2(t3, n3, "sslca"), c2(t3, n3, "sslkey"), c2(t3, n3, "sslcert"), c2(t3, n3, "sslrootcert"), this.database && t3.push("dbname=" + l2(this.database)), this.replication && t3.push("replication=" + l2(this.replication)), this.host && t3.push("host=" + l2(this.host)), this.isDomainSocket) + return e11(null, t3.join(" ")); + this.client_encoding && t3.push("client_encoding=" + l2(this.client_encoding)), r2.lookup(this.host, function(r3, n4) { + return r3 ? e11(r3, null) : (t3.push("hostaddr=" + l2(n4)), e11(null, t3.join(" "))); + }); + } + }; + m(u2, "ConnectionParameters"), t2.exports = u2; + }), eC = y((e10, t2) => { + C(); + var r2 = J(), n2 = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, i2 = class { + constructor(e11, t3) { + this.command = null, this.rowCount = null, this.oid = null, this.rows = [], this.fields = [], this._parsers = void 0, this._types = t3, this.RowCtor = null, this.rowAsArray = "array" === e11, this.rowAsArray && (this.parseRow = this._parseRowAsArray); + } + addCommandComplete(e11) { + var t3; + (t3 = e11.text ? n2.exec(e11.text) : n2.exec(e11.command)) && (this.command = t3[1], t3[3] ? (this.oid = parseInt(t3[2], 10), this.rowCount = parseInt(t3[3], 10)) : t3[2] && (this.rowCount = parseInt(t3[2], 10))); + } + _parseRowAsArray(e11) { + for (var t3 = Array(e11.length), r3 = 0, n3 = e11.length; r3 < n3; r3++) { + var i3 = e11[r3]; + null !== i3 ? t3[r3] = this._parsers[r3](i3) : t3[r3] = null; + } + return t3; + } + parseRow(e11) { + for (var t3 = {}, r3 = 0, n3 = e11.length; r3 < n3; r3++) { + var i3 = e11[r3], s2 = this.fields[r3].name; + null !== i3 ? t3[s2] = this._parsers[r3](i3) : t3[s2] = null; + } + return t3; + } + addRow(e11) { + this.rows.push(e11); + } + addFields(e11) { + this.fields = e11, this.fields.length && (this._parsers = Array(e11.length)); + for (var t3 = 0; t3 < e11.length; t3++) { + var n3 = e11[t3]; + this._types ? this._parsers[t3] = this._types.getTypeParser(n3.dataTypeID, n3.format || "text") : this._parsers[t3] = r2.getTypeParser(n3.dataTypeID, n3.format || "text"); + } + } + }; + m(i2, "Result"), t2.exports = i2; + }), eR = y((e10, t2) => { + C(); + var { EventEmitter: r2 } = R(), n2 = eC(), i2 = X(), s2 = class extends r2 { + constructor(e11, t3, r3) { + super(), e11 = i2.normalizeQueryConfig(e11, t3, r3), this.text = e11.text, this.values = e11.values, this.rows = e11.rows, this.types = e11.types, this.name = e11.name, this.binary = e11.binary, this.portal = e11.portal || "", this.callback = e11.callback, this._rowMode = e11.rowMode, o.domain && e11.callback && (this.callback = o.domain.bind(e11.callback)), this._result = new n2(this._rowMode, this.types), this._results = this._result, this.isPreparedStatement = false, this._canceledDueToError = false, this._promise = null; + } + requiresPreparation() { + return !!this.name || !!this.rows || !!this.text && !!this.values && this.values.length > 0; + } + _checkForMultirow() { + this._result.command && (Array.isArray(this._results) || (this._results = [this._result]), this._result = new n2(this._rowMode, this.types), this._results.push(this._result)); + } + handleRowDescription(e11) { + this._checkForMultirow(), this._result.addFields(e11.fields), this._accumulateRows = this.callback || !this.listeners("row").length; + } + handleDataRow(e11) { + let t3; + if (!this._canceledDueToError) { + try { + t3 = this._result.parseRow(e11.fields); + } catch (e12) { + this._canceledDueToError = e12; + return; + } + this.emit("row", t3, this._result), this._accumulateRows && this._result.addRow(t3); + } + } + handleCommandComplete(e11, t3) { + this._checkForMultirow(), this._result.addCommandComplete(e11), this.rows && t3.sync(); + } + handleEmptyQuery(e11) { + this.rows && e11.sync(); + } + handleError(e11, t3) { + if (this._canceledDueToError && (e11 = this._canceledDueToError, this._canceledDueToError = false), this.callback) + return this.callback(e11); + this.emit("error", e11); + } + handleReadyForQuery(e11) { + if (this._canceledDueToError) + return this.handleError(this._canceledDueToError, e11); + if (this.callback) + try { + this.callback(null, this._results); + } catch (e12) { + o.nextTick(() => { + throw e12; + }); + } + this.emit("end", this._results); + } + submit(e11) { + if ("string" != typeof this.text && "string" != typeof this.name) + return Error("A query must have either text or a name. Supplying neither is unsupported."); + let t3 = e11.parsedStatements[this.name]; + return this.text && t3 && this.text !== t3 ? Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`) : this.values && !Array.isArray(this.values) ? Error("Query values must be an array") : (this.requiresPreparation() ? this.prepare(e11) : e11.query(this.text), null); + } + hasBeenParsed(e11) { + return this.name && e11.parsedStatements[this.name]; + } + handlePortalSuspended(e11) { + this._getRows(e11, this.rows); + } + _getRows(e11, t3) { + e11.execute({ portal: this.portal, rows: t3 }), t3 ? e11.flush() : e11.sync(); + } + prepare(e11) { + this.isPreparedStatement = true, this.hasBeenParsed(e11) || e11.parse({ text: this.text, name: this.name, types: this.types }); + try { + e11.bind({ portal: this.portal, statement: this.name, values: this.values, binary: this.binary, valueMapper: i2.prepareValue }); + } catch (t3) { + this.handleError(t3, e11); + return; + } + e11.describe({ type: "P", name: this.portal || "" }), this._getRows(e11, this.rows); + } + handleCopyInResponse(e11) { + e11.sendCopyFail("No source stream defined"); + } + handleCopyData(e11, t3) { + } + }; + m(s2, "Query"), t2.exports = s2; + }), eP = {}; + function eT(e10) { + return 0; + } + v(eP, { Socket: () => eN, isIP: () => eT }); + var eA, eO, eI, eN, eM = g(() => { + C(), eA = w(R(), 1), m(eT, "isIP"), eO = /^[^.]+\./, eI = class e10 extends eA.EventEmitter { + constructor() { + super(...arguments), S(this, "opts", {}), S(this, "connecting", false), S(this, "pending", true), S(this, "writable", true), S(this, "encrypted", false), S(this, "authorized", false), S(this, "destroyed", false), S(this, "ws", null), S(this, "writeBuffer"), S(this, "tlsState", 0), S(this, "tlsRead"), S(this, "tlsWrite"); + } + static get poolQueryViaFetch() { + return e10.opts.poolQueryViaFetch ?? e10.defaults.poolQueryViaFetch; + } + static set poolQueryViaFetch(t2) { + e10.opts.poolQueryViaFetch = t2; + } + static get fetchEndpoint() { + return e10.opts.fetchEndpoint ?? e10.defaults.fetchEndpoint; + } + static set fetchEndpoint(t2) { + e10.opts.fetchEndpoint = t2; + } + static get fetchConnectionCache() { + return true; + } + static set fetchConnectionCache(e11) { + console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)"); + } + static get fetchFunction() { + return e10.opts.fetchFunction ?? e10.defaults.fetchFunction; + } + static set fetchFunction(t2) { + e10.opts.fetchFunction = t2; + } + static get webSocketConstructor() { + return e10.opts.webSocketConstructor ?? e10.defaults.webSocketConstructor; + } + static set webSocketConstructor(t2) { + e10.opts.webSocketConstructor = t2; + } + get webSocketConstructor() { + return this.opts.webSocketConstructor ?? e10.webSocketConstructor; + } + set webSocketConstructor(e11) { + this.opts.webSocketConstructor = e11; + } + static get wsProxy() { + return e10.opts.wsProxy ?? e10.defaults.wsProxy; + } + static set wsProxy(t2) { + e10.opts.wsProxy = t2; + } + get wsProxy() { + return this.opts.wsProxy ?? e10.wsProxy; + } + set wsProxy(e11) { + this.opts.wsProxy = e11; + } + static get coalesceWrites() { + return e10.opts.coalesceWrites ?? e10.defaults.coalesceWrites; + } + static set coalesceWrites(t2) { + e10.opts.coalesceWrites = t2; + } + get coalesceWrites() { + return this.opts.coalesceWrites ?? e10.coalesceWrites; + } + set coalesceWrites(e11) { + this.opts.coalesceWrites = e11; + } + static get useSecureWebSocket() { + return e10.opts.useSecureWebSocket ?? e10.defaults.useSecureWebSocket; + } + static set useSecureWebSocket(t2) { + e10.opts.useSecureWebSocket = t2; + } + get useSecureWebSocket() { + return this.opts.useSecureWebSocket ?? e10.useSecureWebSocket; + } + set useSecureWebSocket(e11) { + this.opts.useSecureWebSocket = e11; + } + static get forceDisablePgSSL() { + return e10.opts.forceDisablePgSSL ?? e10.defaults.forceDisablePgSSL; + } + static set forceDisablePgSSL(t2) { + e10.opts.forceDisablePgSSL = t2; + } + get forceDisablePgSSL() { + return this.opts.forceDisablePgSSL ?? e10.forceDisablePgSSL; + } + set forceDisablePgSSL(e11) { + this.opts.forceDisablePgSSL = e11; + } + static get disableSNI() { + return e10.opts.disableSNI ?? e10.defaults.disableSNI; + } + static set disableSNI(t2) { + e10.opts.disableSNI = t2; + } + get disableSNI() { + return this.opts.disableSNI ?? e10.disableSNI; + } + set disableSNI(e11) { + this.opts.disableSNI = e11; + } + static get pipelineConnect() { + return e10.opts.pipelineConnect ?? e10.defaults.pipelineConnect; + } + static set pipelineConnect(t2) { + e10.opts.pipelineConnect = t2; + } + get pipelineConnect() { + return this.opts.pipelineConnect ?? e10.pipelineConnect; + } + set pipelineConnect(e11) { + this.opts.pipelineConnect = e11; + } + static get subtls() { + return e10.opts.subtls ?? e10.defaults.subtls; + } + static set subtls(t2) { + e10.opts.subtls = t2; + } + get subtls() { + return this.opts.subtls ?? e10.subtls; + } + set subtls(e11) { + this.opts.subtls = e11; + } + static get pipelineTLS() { + return e10.opts.pipelineTLS ?? e10.defaults.pipelineTLS; + } + static set pipelineTLS(t2) { + e10.opts.pipelineTLS = t2; + } + get pipelineTLS() { + return this.opts.pipelineTLS ?? e10.pipelineTLS; + } + set pipelineTLS(e11) { + this.opts.pipelineTLS = e11; + } + static get rootCerts() { + return e10.opts.rootCerts ?? e10.defaults.rootCerts; + } + static set rootCerts(t2) { + e10.opts.rootCerts = t2; + } + get rootCerts() { + return this.opts.rootCerts ?? e10.rootCerts; + } + set rootCerts(e11) { + this.opts.rootCerts = e11; + } + wsProxyAddrForHost(e11, t2) { + let r2 = this.wsProxy; + if (void 0 === r2) + throw Error("No WebSocket proxy is configured. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--string"); + return "function" == typeof r2 ? r2(e11, t2) : `${r2}?address=${e11}:${t2}`; + } + setNoDelay() { + return this; + } + setKeepAlive() { + return this; + } + ref() { + return this; + } + unref() { + return this; + } + connect(e11, t2, r2) { + this.connecting = true, r2 && this.once("connect", r2); + let n2 = m(() => { + this.connecting = false, this.pending = false, this.emit("connect"), this.emit("ready"); + }, "handleWebSocketOpen"), i2 = m((e12, t3 = false) => { + e12.binaryType = "arraybuffer", e12.addEventListener("error", (e13) => { + this.emit("error", e13), this.emit("close"); + }), e12.addEventListener("message", (e13) => { + if (0 === this.tlsState) { + let t4 = a.from(e13.data); + this.emit("data", t4); + } + }), e12.addEventListener("close", () => { + this.emit("close"); + }), t3 ? n2() : e12.addEventListener("open", n2); + }, "configureWebSocket"), s2; + try { + s2 = this.wsProxyAddrForHost(t2, "string" == typeof e11 ? parseInt(e11, 10) : e11); + } catch (e12) { + this.emit("error", e12), this.emit("close"); + return; + } + try { + let e12 = (this.useSecureWebSocket ? "wss:" : "ws:") + "//" + s2; + if (void 0 !== this.webSocketConstructor) + this.ws = new this.webSocketConstructor(e12), i2(this.ws); + else + try { + this.ws = new WebSocket(e12), i2(this.ws); + } catch { + this.ws = new __unstable_WebSocket(e12), i2(this.ws); + } + } catch (e12) { + fetch((this.useSecureWebSocket ? "https:" : "http:") + "//" + s2, { headers: { Upgrade: "websocket" } }).then((t3) => { + if (this.ws = t3.webSocket, null == this.ws) + throw e12; + this.ws.accept(), i2(this.ws, true); + }).catch((e13) => { + this.emit("error", Error(`All attempts to open a WebSocket to connect to the database failed. Please refer to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined. Details: ${e13.message}`)), this.emit("close"); + }); + } + } + async startTls(e11) { + if (void 0 === this.subtls) + throw Error("For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for more information."); + this.tlsState = 1; + let t2 = this.subtls.TrustedCert.fromPEM(this.rootCerts), r2 = new this.subtls.WebSocketReadQueue(this.ws), n2 = r2.read.bind(r2), i2 = this.rawWrite.bind(this), [s2, a2] = await this.subtls.startTls(e11, t2, n2, i2, { useSNI: !this.disableSNI, expectPreData: this.pipelineTLS ? new Uint8Array([83]) : void 0 }); + this.tlsRead = s2, this.tlsWrite = a2, this.tlsState = 2, this.encrypted = true, this.authorized = true, this.emit("secureConnection", this), this.tlsReadLoop(); + } + async tlsReadLoop() { + for (; ; ) { + let e11 = await this.tlsRead(); + if (void 0 === e11) + break; + { + let t2 = a.from(e11); + this.emit("data", t2); + } + } + } + rawWrite(e11) { + if (!this.coalesceWrites) { + this.ws.send(e11); + return; + } + if (void 0 === this.writeBuffer) + this.writeBuffer = e11, setTimeout(() => { + this.ws.send(this.writeBuffer), this.writeBuffer = void 0; + }, 0); + else { + let t2 = new Uint8Array(this.writeBuffer.length + e11.length); + t2.set(this.writeBuffer), t2.set(e11, this.writeBuffer.length), this.writeBuffer = t2; + } + } + write(e11, t2 = "utf8", r2 = (e12) => { + }) { + return 0 === e11.length ? r2() : ("string" == typeof e11 && (e11 = a.from(e11, t2)), 0 === this.tlsState ? (this.rawWrite(e11), r2()) : 1 === this.tlsState ? this.once("secureConnection", () => { + this.write(e11, t2, r2); + }) : (this.tlsWrite(e11), r2())), true; + } + end(e11 = a.alloc(0), t2 = "utf8", r2 = () => { + }) { + return this.write(e11, t2, () => { + this.ws.close(), r2(); + }), this; + } + destroy() { + return this.destroyed = true, this.end(); + } + }, m(eI, "Socket"), S(eI, "defaults", { poolQueryViaFetch: false, fetchEndpoint: m((e10, t2, r2) => "https://" + (r2?.jwtAuth ? e10.replace(eO, "apiauth.") : e10.replace(eO, "api.")) + "/sql", "fetchEndpoint"), fetchConnectionCache: true, fetchFunction: void 0, webSocketConstructor: void 0, wsProxy: m((e10) => e10 + "/v2", "wsProxy"), useSecureWebSocket: true, forceDisablePgSSL: true, coalesceWrites: true, pipelineConnect: "password", subtls: void 0, rootCerts: "", pipelineTLS: false, disableSNI: false }), S(eI, "opts", {}), eN = eI; + }), e$ = y((e10) => { + C(), Object.defineProperty(e10, "__esModule", { value: true }), e10.NoticeMessage = e10.DataRowMessage = e10.CommandCompleteMessage = e10.ReadyForQueryMessage = e10.NotificationResponseMessage = e10.BackendKeyDataMessage = e10.AuthenticationMD5Password = e10.ParameterStatusMessage = e10.ParameterDescriptionMessage = e10.RowDescriptionMessage = e10.Field = e10.CopyResponse = e10.CopyDataMessage = e10.DatabaseError = e10.copyDone = e10.emptyQuery = e10.replicationStart = e10.portalSuspended = e10.noData = e10.closeComplete = e10.bindComplete = e10.parseComplete = void 0, e10.parseComplete = { name: "parseComplete", length: 5 }, e10.bindComplete = { name: "bindComplete", length: 5 }, e10.closeComplete = { name: "closeComplete", length: 5 }, e10.noData = { name: "noData", length: 5 }, e10.portalSuspended = { name: "portalSuspended", length: 5 }, e10.replicationStart = { name: "replicationStart", length: 4 }, e10.emptyQuery = { name: "emptyQuery", length: 4 }, e10.copyDone = { name: "copyDone", length: 4 }; + var t2 = class extends Error { + constructor(e11, t3, r3) { + super(e11), this.length = t3, this.name = r3; + } + }; + m(t2, "DatabaseError"), e10.DatabaseError = t2; + var r2 = class { + constructor(e11, t3) { + this.length = e11, this.chunk = t3, this.name = "copyData"; + } + }; + m(r2, "CopyDataMessage"), e10.CopyDataMessage = r2; + var n2 = class { + constructor(e11, t3, r3, n3) { + this.length = e11, this.name = t3, this.binary = r3, this.columnTypes = Array(n3); + } + }; + m(n2, "CopyResponse"), e10.CopyResponse = n2; + var i2 = class { + constructor(e11, t3, r3, n3, i3, s3, a3) { + this.name = e11, this.tableID = t3, this.columnID = r3, this.dataTypeID = n3, this.dataTypeSize = i3, this.dataTypeModifier = s3, this.format = a3; + } + }; + m(i2, "Field"), e10.Field = i2; + var s2 = class { + constructor(e11, t3) { + this.length = e11, this.fieldCount = t3, this.name = "rowDescription", this.fields = Array(this.fieldCount); + } + }; + m(s2, "RowDescriptionMessage"), e10.RowDescriptionMessage = s2; + var a2 = class { + constructor(e11, t3) { + this.length = e11, this.parameterCount = t3, this.name = "parameterDescription", this.dataTypeIDs = Array(this.parameterCount); + } + }; + m(a2, "ParameterDescriptionMessage"), e10.ParameterDescriptionMessage = a2; + var o2 = class { + constructor(e11, t3, r3) { + this.length = e11, this.parameterName = t3, this.parameterValue = r3, this.name = "parameterStatus"; + } + }; + m(o2, "ParameterStatusMessage"), e10.ParameterStatusMessage = o2; + var l2 = class { + constructor(e11, t3) { + this.length = e11, this.salt = t3, this.name = "authenticationMD5Password"; + } + }; + m(l2, "AuthenticationMD5Password"), e10.AuthenticationMD5Password = l2; + var c2 = class { + constructor(e11, t3, r3) { + this.length = e11, this.processID = t3, this.secretKey = r3, this.name = "backendKeyData"; + } + }; + m(c2, "BackendKeyDataMessage"), e10.BackendKeyDataMessage = c2; + var u2 = class { + constructor(e11, t3, r3, n3) { + this.length = e11, this.processId = t3, this.channel = r3, this.payload = n3, this.name = "notification"; + } + }; + m(u2, "NotificationResponseMessage"), e10.NotificationResponseMessage = u2; + var d2 = class { + constructor(e11, t3) { + this.length = e11, this.status = t3, this.name = "readyForQuery"; + } + }; + m(d2, "ReadyForQueryMessage"), e10.ReadyForQueryMessage = d2; + var h2 = class { + constructor(e11, t3) { + this.length = e11, this.text = t3, this.name = "commandComplete"; + } + }; + m(h2, "CommandCompleteMessage"), e10.CommandCompleteMessage = h2; + var f2 = class { + constructor(e11, t3) { + this.length = e11, this.fields = t3, this.name = "dataRow", this.fieldCount = t3.length; + } + }; + m(f2, "DataRowMessage"), e10.DataRowMessage = f2; + var p2 = class { + constructor(e11, t3) { + this.length = e11, this.message = t3, this.name = "notice"; + } + }; + m(p2, "NoticeMessage"), e10.NoticeMessage = p2; + }), eL = y((e10) => { + C(), Object.defineProperty(e10, "__esModule", { value: true }), e10.Writer = void 0; + var t2 = class { + constructor(e11 = 256) { + this.size = e11, this.offset = 5, this.headerPosition = 0, this.buffer = a.allocUnsafe(e11); + } + ensure(e11) { + if (this.buffer.length - this.offset < e11) { + var t3 = this.buffer, r2 = t3.length + (t3.length >> 1) + e11; + this.buffer = a.allocUnsafe(r2), t3.copy(this.buffer); + } + } + addInt32(e11) { + return this.ensure(4), this.buffer[this.offset++] = e11 >>> 24 & 255, this.buffer[this.offset++] = e11 >>> 16 & 255, this.buffer[this.offset++] = e11 >>> 8 & 255, this.buffer[this.offset++] = e11 >>> 0 & 255, this; + } + addInt16(e11) { + return this.ensure(2), this.buffer[this.offset++] = e11 >>> 8 & 255, this.buffer[this.offset++] = e11 >>> 0 & 255, this; + } + addCString(e11) { + if (e11) { + var t3 = a.byteLength(e11); + this.ensure(t3 + 1), this.buffer.write(e11, this.offset, "utf-8"), this.offset += t3; + } else + this.ensure(1); + return this.buffer[this.offset++] = 0, this; + } + addString(e11 = "") { + var t3 = a.byteLength(e11); + return this.ensure(t3), this.buffer.write(e11, this.offset), this.offset += t3, this; + } + add(e11) { + return this.ensure(e11.length), e11.copy(this.buffer, this.offset), this.offset += e11.length, this; + } + join(e11) { + if (e11) { + this.buffer[this.headerPosition] = e11; + let t3 = this.offset - (this.headerPosition + 1); + this.buffer.writeInt32BE(t3, this.headerPosition + 1); + } + return this.buffer.slice(e11 ? 0 : 5, this.offset); + } + flush(e11) { + var t3 = this.join(e11); + return this.offset = 5, this.headerPosition = 0, this.buffer = a.allocUnsafe(this.size), t3; + } + }; + m(t2, "Writer"), e10.Writer = t2; + }), ej = y((e10) => { + C(), Object.defineProperty(e10, "__esModule", { value: true }), e10.serialize = void 0; + var t2 = eL(), r2 = new t2.Writer(), n2 = m((e11) => { + for (let t3 of (r2.addInt16(3).addInt16(0), Object.keys(e11))) + r2.addCString(t3).addCString(e11[t3]); + r2.addCString("client_encoding").addCString("UTF8"); + var n3 = r2.addCString("").flush(), i3 = n3.length + 4; + return new t2.Writer().addInt32(i3).add(n3).flush(); + }, "startup"), i2 = m(() => { + let e11 = a.allocUnsafe(8); + return e11.writeInt32BE(8, 0), e11.writeInt32BE(80877103, 4), e11; + }, "requestSsl"), s2 = m((e11) => r2.addCString(e11).flush(112), "password"), o2 = m(function(e11, t3) { + return r2.addCString(e11).addInt32(a.byteLength(t3)).addString(t3), r2.flush(112); + }, "sendSASLInitialResponseMessage"), l2 = m(function(e11) { + return r2.addString(e11).flush(112); + }, "sendSCRAMClientFinalMessage"), c2 = m((e11) => r2.addCString(e11).flush(81), "query"), u2 = [], d2 = m((e11) => { + let t3 = e11.name || ""; + t3.length > 63 && (console.error("Warning! Postgres only supports 63 characters for query names."), console.error("You supplied %s (%s)", t3, t3.length), console.error("This can cause conflicts and silent errors executing queries")); + let n3 = e11.types || u2; + for (var i3 = n3.length, s3 = r2.addCString(t3).addCString(e11.text).addInt16(i3), a2 = 0; a2 < i3; a2++) + s3.addInt32(n3[a2]); + return r2.flush(80); + }, "parse"), h2 = new t2.Writer(), f2 = m(function(e11, t3) { + for (let n3 = 0; n3 < e11.length; n3++) { + let i3 = t3 ? t3(e11[n3], n3) : e11[n3]; + null == i3 ? (r2.addInt16(0), h2.addInt32(-1)) : i3 instanceof a ? (r2.addInt16(1), h2.addInt32(i3.length), h2.add(i3)) : (r2.addInt16(0), h2.addInt32(a.byteLength(i3)), h2.addString(i3)); + } + }, "writeValues"), p2 = m((e11 = {}) => { + let t3 = e11.portal || "", n3 = e11.statement || "", i3 = e11.binary || false, s3 = e11.values || u2, a2 = s3.length; + return r2.addCString(t3).addCString(n3), r2.addInt16(a2), f2(s3, e11.valueMapper), r2.addInt16(a2), r2.add(h2.flush()), r2.addInt16(i3 ? 1 : 0), r2.flush(66); + }, "bind"), g2 = a.from([69, 0, 0, 0, 9, 0, 0, 0, 0, 0]), y2 = m((e11) => { + if (!e11 || !e11.portal && !e11.rows) + return g2; + let t3 = e11.portal || "", r3 = e11.rows || 0, n3 = a.byteLength(t3), i3 = 4 + n3 + 1 + 4, s3 = a.allocUnsafe(1 + i3); + return s3[0] = 69, s3.writeInt32BE(i3, 1), s3.write(t3, 5, "utf-8"), s3[n3 + 5] = 0, s3.writeUInt32BE(r3, s3.length - 4), s3; + }, "execute"), v2 = m((e11, t3) => { + let r3 = a.allocUnsafe(16); + return r3.writeInt32BE(16, 0), r3.writeInt16BE(1234, 4), r3.writeInt16BE(5678, 6), r3.writeInt32BE(e11, 8), r3.writeInt32BE(t3, 12), r3; + }, "cancel"), b2 = m((e11, t3) => { + let r3 = 4 + a.byteLength(t3) + 1, n3 = a.allocUnsafe(1 + r3); + return n3[0] = e11, n3.writeInt32BE(r3, 1), n3.write(t3, 5, "utf-8"), n3[r3] = 0, n3; + }, "cstringMessage"), w2 = r2.addCString("P").flush(68), x2 = r2.addCString("S").flush(68), S2 = m((e11) => e11.name ? b2(68, `${e11.type}${e11.name || ""}`) : "P" === e11.type ? w2 : x2, "describe"), _2 = m((e11) => b2(67, `${e11.type}${e11.name || ""}`), "close"), E2 = m((e11) => r2.add(e11).flush(100), "copyData"), k2 = m((e11) => b2(102, e11), "copyFail"), R2 = m((e11) => a.from([e11, 0, 0, 0, 4]), "codeOnlyBuffer"), P2 = R2(72), T2 = R2(83), A2 = R2(88), O2 = R2(99), I2 = { startup: n2, password: s2, requestSsl: i2, sendSASLInitialResponseMessage: o2, sendSCRAMClientFinalMessage: l2, query: c2, parse: d2, bind: p2, execute: y2, describe: S2, close: _2, flush: m(() => P2, "flush"), sync: m(() => T2, "sync"), end: m(() => A2, "end"), copyData: E2, copyDone: m(() => O2, "copyDone"), copyFail: k2, cancel: v2 }; + e10.serialize = I2; + }), eD = y((e10) => { + C(), Object.defineProperty(e10, "__esModule", { value: true }), e10.BufferReader = void 0; + var t2 = a.allocUnsafe(0), r2 = class { + constructor(e11 = 0) { + this.offset = e11, this.buffer = t2, this.encoding = "utf-8"; + } + setBuffer(e11, t3) { + this.offset = e11, this.buffer = t3; + } + int16() { + let e11 = this.buffer.readInt16BE(this.offset); + return this.offset += 2, e11; + } + byte() { + let e11 = this.buffer[this.offset]; + return this.offset++, e11; + } + int32() { + let e11 = this.buffer.readInt32BE(this.offset); + return this.offset += 4, e11; + } + string(e11) { + let t3 = this.buffer.toString(this.encoding, this.offset, this.offset + e11); + return this.offset += e11, t3; + } + cstring() { + let e11 = this.offset, t3 = e11; + for (; 0 !== this.buffer[t3++]; ) + ; + return this.offset = t3, this.buffer.toString(this.encoding, e11, t3 - 1); + } + bytes(e11) { + let t3 = this.buffer.slice(this.offset, this.offset + e11); + return this.offset += e11, t3; + } + }; + m(r2, "BufferReader"), e10.BufferReader = r2; + }), eF = y((e10) => { + C(), Object.defineProperty(e10, "__esModule", { value: true }), e10.Parser = void 0; + var t2 = e$(), r2 = eD(), n2 = a.allocUnsafe(0), i2 = class { + constructor(e11) { + if (this.buffer = n2, this.bufferLength = 0, this.bufferOffset = 0, this.reader = new r2.BufferReader(), e11?.mode === "binary") + throw Error("Binary mode not supported yet"); + this.mode = e11?.mode || "text"; + } + parse(e11, t3) { + this.mergeBuffer(e11); + let r3 = this.bufferOffset + this.bufferLength, i3 = this.bufferOffset; + for (; i3 + 5 <= r3; ) { + let e12 = this.buffer[i3], n3 = this.buffer.readUInt32BE(i3 + 1), s2 = 1 + n3; + if (s2 + i3 <= r3) + t3(this.handlePacket(i3 + 5, e12, n3, this.buffer)), i3 += s2; + else + break; + } + i3 === r3 ? (this.buffer = n2, this.bufferLength = 0, this.bufferOffset = 0) : (this.bufferLength = r3 - i3, this.bufferOffset = i3); + } + mergeBuffer(e11) { + if (this.bufferLength > 0) { + let t3 = this.bufferLength + e11.byteLength; + if (t3 + this.bufferOffset > this.buffer.byteLength) { + let e12; + if (t3 <= this.buffer.byteLength && this.bufferOffset >= this.bufferLength) + e12 = this.buffer; + else { + let r3 = 2 * this.buffer.byteLength; + for (; t3 >= r3; ) + r3 *= 2; + e12 = a.allocUnsafe(r3); + } + this.buffer.copy(e12, 0, this.bufferOffset, this.bufferOffset + this.bufferLength), this.buffer = e12, this.bufferOffset = 0; + } + e11.copy(this.buffer, this.bufferOffset + this.bufferLength), this.bufferLength = t3; + } else + this.buffer = e11, this.bufferOffset = 0, this.bufferLength = e11.byteLength; + } + handlePacket(e11, r3, n3, i3) { + switch (r3) { + case 50: + return t2.bindComplete; + case 49: + return t2.parseComplete; + case 51: + return t2.closeComplete; + case 110: + return t2.noData; + case 115: + return t2.portalSuspended; + case 99: + return t2.copyDone; + case 87: + return t2.replicationStart; + case 73: + return t2.emptyQuery; + case 68: + return this.parseDataRowMessage(e11, n3, i3); + case 67: + return this.parseCommandCompleteMessage(e11, n3, i3); + case 90: + return this.parseReadyForQueryMessage(e11, n3, i3); + case 65: + return this.parseNotificationMessage(e11, n3, i3); + case 82: + return this.parseAuthenticationResponse(e11, n3, i3); + case 83: + return this.parseParameterStatusMessage(e11, n3, i3); + case 75: + return this.parseBackendKeyData(e11, n3, i3); + case 69: + return this.parseErrorMessage(e11, n3, i3, "error"); + case 78: + return this.parseErrorMessage(e11, n3, i3, "notice"); + case 84: + return this.parseRowDescriptionMessage(e11, n3, i3); + case 116: + return this.parseParameterDescriptionMessage(e11, n3, i3); + case 71: + return this.parseCopyInMessage(e11, n3, i3); + case 72: + return this.parseCopyOutMessage(e11, n3, i3); + case 100: + return this.parseCopyData(e11, n3, i3); + default: + return new t2.DatabaseError("received invalid response: " + r3.toString(16), n3, "error"); + } + } + parseReadyForQueryMessage(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.string(1); + return new t2.ReadyForQueryMessage(r3, i3); + } + parseCommandCompleteMessage(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.cstring(); + return new t2.CommandCompleteMessage(r3, i3); + } + parseCopyData(e11, r3, n3) { + let i3 = n3.slice(e11, e11 + (r3 - 4)); + return new t2.CopyDataMessage(r3, i3); + } + parseCopyInMessage(e11, t3, r3) { + return this.parseCopyMessage(e11, t3, r3, "copyInResponse"); + } + parseCopyOutMessage(e11, t3, r3) { + return this.parseCopyMessage(e11, t3, r3, "copyOutResponse"); + } + parseCopyMessage(e11, r3, n3, i3) { + this.reader.setBuffer(e11, n3); + let s2 = 0 !== this.reader.byte(), a2 = this.reader.int16(), o2 = new t2.CopyResponse(r3, i3, s2, a2); + for (let e12 = 0; e12 < a2; e12++) + o2.columnTypes[e12] = this.reader.int16(); + return o2; + } + parseNotificationMessage(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.int32(), s2 = this.reader.cstring(), a2 = this.reader.cstring(); + return new t2.NotificationResponseMessage(r3, i3, s2, a2); + } + parseRowDescriptionMessage(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.int16(), s2 = new t2.RowDescriptionMessage(r3, i3); + for (let e12 = 0; e12 < i3; e12++) + s2.fields[e12] = this.parseField(); + return s2; + } + parseField() { + let e11 = this.reader.cstring(), r3 = this.reader.int32(), n3 = this.reader.int16(), i3 = this.reader.int32(), s2 = this.reader.int16(), a2 = this.reader.int32(), o2 = 0 === this.reader.int16() ? "text" : "binary"; + return new t2.Field(e11, r3, n3, i3, s2, a2, o2); + } + parseParameterDescriptionMessage(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.int16(), s2 = new t2.ParameterDescriptionMessage(r3, i3); + for (let e12 = 0; e12 < i3; e12++) + s2.dataTypeIDs[e12] = this.reader.int32(); + return s2; + } + parseDataRowMessage(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.int16(), s2 = Array(i3); + for (let e12 = 0; e12 < i3; e12++) { + let t3 = this.reader.int32(); + s2[e12] = -1 === t3 ? null : this.reader.string(t3); + } + return new t2.DataRowMessage(r3, s2); + } + parseParameterStatusMessage(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.cstring(), s2 = this.reader.cstring(); + return new t2.ParameterStatusMessage(r3, i3, s2); + } + parseBackendKeyData(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.int32(), s2 = this.reader.int32(); + return new t2.BackendKeyDataMessage(r3, i3, s2); + } + parseAuthenticationResponse(e11, r3, n3) { + this.reader.setBuffer(e11, n3); + let i3 = this.reader.int32(), s2 = { name: "authenticationOk", length: r3 }; + switch (i3) { + case 0: + break; + case 3: + 8 === s2.length && (s2.name = "authenticationCleartextPassword"); + break; + case 5: + if (12 === s2.length) { + s2.name = "authenticationMD5Password"; + let e12 = this.reader.bytes(4); + return new t2.AuthenticationMD5Password(r3, e12); + } + break; + case 10: + let a2; + s2.name = "authenticationSASL", s2.mechanisms = []; + do + (a2 = this.reader.cstring()) && s2.mechanisms.push(a2); + while (a2); + break; + case 11: + s2.name = "authenticationSASLContinue", s2.data = this.reader.string(r3 - 8); + break; + case 12: + s2.name = "authenticationSASLFinal", s2.data = this.reader.string(r3 - 8); + break; + default: + throw Error("Unknown authenticationOk message type " + i3); + } + return s2; + } + parseErrorMessage(e11, r3, n3, i3) { + this.reader.setBuffer(e11, n3); + let s2 = {}, a2 = this.reader.string(1); + for (; "\0" !== a2; ) + s2[a2] = this.reader.cstring(), a2 = this.reader.string(1); + let o2 = s2.M, l2 = "notice" === i3 ? new t2.NoticeMessage(r3, o2) : new t2.DatabaseError(o2, r3, i3); + return l2.severity = s2.S, l2.code = s2.C, l2.detail = s2.D, l2.hint = s2.H, l2.position = s2.P, l2.internalPosition = s2.p, l2.internalQuery = s2.q, l2.where = s2.W, l2.schema = s2.s, l2.table = s2.t, l2.column = s2.c, l2.dataType = s2.d, l2.constraint = s2.n, l2.file = s2.F, l2.line = s2.L, l2.routine = s2.R, l2; + } + }; + m(i2, "Parser"), e10.Parser = i2; + }), eB = y((e10) => { + C(), Object.defineProperty(e10, "__esModule", { value: true }), e10.DatabaseError = e10.serialize = e10.parse = void 0; + var t2 = e$(); + Object.defineProperty(e10, "DatabaseError", { enumerable: true, get: m(function() { + return t2.DatabaseError; + }, "get") }); + var r2 = ej(); + Object.defineProperty(e10, "serialize", { enumerable: true, get: m(function() { + return r2.serialize; + }, "get") }); + var n2 = eF(); + function i2(e11, t3) { + let r3 = new n2.Parser(); + return e11.on("data", (e12) => r3.parse(e12, t3)), new Promise((t4) => e11.on("end", () => t4())); + } + m(i2, "parse"), e10.parse = i2; + }), eU = {}; + function eq({ socket: e10, servername: t2 }) { + return e10.startTls(t2), e10; + } + v(eU, { connect: () => eq }); + var ez = g(() => { + C(), m(eq, "connect"); + }), eH = y((e10, t2) => { + C(); + var r2 = (eM(), x(eP)), n2 = R().EventEmitter, { parse: i2, serialize: s2 } = eB(), a2 = s2.flush(), o2 = s2.sync(), l2 = s2.end(), c2 = class extends n2 { + constructor(e11) { + super(), e11 = e11 || {}, this.stream = e11.stream || new r2.Socket(), this._keepAlive = e11.keepAlive, this._keepAliveInitialDelayMillis = e11.keepAliveInitialDelayMillis, this.lastBuffer = false, this.parsedStatements = {}, this.ssl = e11.ssl || false, this._ending = false, this._emitMessage = false; + var t3 = this; + this.on("newListener", function(e12) { + "message" === e12 && (t3._emitMessage = true); + }); + } + connect(e11, t3) { + var n3 = this; + this._connecting = true, this.stream.setNoDelay(true), this.stream.connect(e11, t3), this.stream.once("connect", function() { + n3._keepAlive && n3.stream.setKeepAlive(true, n3._keepAliveInitialDelayMillis), n3.emit("connect"); + }); + let i3 = m(function(e12) { + n3._ending && ("ECONNRESET" === e12.code || "EPIPE" === e12.code) || n3.emit("error", e12); + }, "reportStreamError"); + if (this.stream.on("error", i3), this.stream.on("close", function() { + n3.emit("end"); + }), !this.ssl) + return this.attachListeners(this.stream); + this.stream.once("data", function(e12) { + switch (e12.toString("utf8")) { + case "S": + break; + case "N": + return n3.stream.end(), n3.emit("error", Error("The server does not support SSL connections")); + default: + return n3.stream.end(), n3.emit("error", Error("There was an error establishing an SSL connection")); + } + var s3 = (ez(), x(eU)); + let a3 = { socket: n3.stream }; + true !== n3.ssl && (Object.assign(a3, n3.ssl), "key" in n3.ssl && (a3.key = n3.ssl.key)), 0 === r2.isIP(t3) && (a3.servername = t3); + try { + n3.stream = s3.connect(a3); + } catch (e13) { + return n3.emit("error", e13); + } + n3.attachListeners(n3.stream), n3.stream.on("error", i3), n3.emit("sslconnect"); + }); + } + attachListeners(e11) { + e11.on("end", () => { + this.emit("end"); + }), i2(e11, (e12) => { + var t3 = "error" === e12.name ? "errorMessage" : e12.name; + this._emitMessage && this.emit("message", e12), this.emit(t3, e12); + }); + } + requestSsl() { + this.stream.write(s2.requestSsl()); + } + startup(e11) { + this.stream.write(s2.startup(e11)); + } + cancel(e11, t3) { + this._send(s2.cancel(e11, t3)); + } + password(e11) { + this._send(s2.password(e11)); + } + sendSASLInitialResponseMessage(e11, t3) { + this._send(s2.sendSASLInitialResponseMessage(e11, t3)); + } + sendSCRAMClientFinalMessage(e11) { + this._send(s2.sendSCRAMClientFinalMessage(e11)); + } + _send(e11) { + return !!this.stream.writable && this.stream.write(e11); + } + query(e11) { + this._send(s2.query(e11)); + } + parse(e11) { + this._send(s2.parse(e11)); + } + bind(e11) { + this._send(s2.bind(e11)); + } + execute(e11) { + this._send(s2.execute(e11)); + } + flush() { + this.stream.writable && this.stream.write(a2); + } + sync() { + this._ending = true, this._send(a2), this._send(o2); + } + ref() { + this.stream.ref(); + } + unref() { + this.stream.unref(); + } + end() { + if (this._ending = true, !this._connecting || !this.stream.writable) { + this.stream.end(); + return; + } + return this.stream.write(l2, () => { + this.stream.end(); + }); + } + close(e11) { + this._send(s2.close(e11)); + } + describe(e11) { + this._send(s2.describe(e11)); + } + sendCopyFromChunk(e11) { + this._send(s2.copyData(e11)); + } + endCopyFrom() { + this._send(s2.copyDone()); + } + sendCopyFail(e11) { + this._send(s2.copyFail(e11)); + } + }; + m(c2, "Connection"), t2.exports = c2; + }), eW = y((e10, t2) => { + C(); + var r2 = R().EventEmitter, i2 = (A(), x(P), X()), s2 = ee(), a2 = eg(), l2 = ey(), c2 = ek(), u2 = eR(), d2 = Y(), h2 = eH(), f2 = class extends r2 { + constructor(e11) { + super(), this.connectionParameters = new c2(e11), this.user = this.connectionParameters.user, this.database = this.connectionParameters.database, this.port = this.connectionParameters.port, this.host = this.connectionParameters.host, Object.defineProperty(this, "password", { configurable: true, enumerable: false, writable: true, value: this.connectionParameters.password }), this.replication = this.connectionParameters.replication; + var t3 = e11 || {}; + this._Promise = t3.Promise || n.Promise, this._types = new l2(t3.types), this._ending = false, this._connecting = false, this._connected = false, this._connectionError = false, this._queryable = true, this.connection = t3.connection || new h2({ stream: t3.stream, ssl: this.connectionParameters.ssl, keepAlive: t3.keepAlive || false, keepAliveInitialDelayMillis: t3.keepAliveInitialDelayMillis || 0, encoding: this.connectionParameters.client_encoding || "utf8" }), this.queryQueue = [], this.binary = t3.binary || d2.binary, this.processID = null, this.secretKey = null, this.ssl = this.connectionParameters.ssl || false, this.ssl && this.ssl.key && Object.defineProperty(this.ssl, "key", { enumerable: false }), this._connectionTimeoutMillis = t3.connectionTimeoutMillis || 0; + } + _errorAllQueries(e11) { + let t3 = m((t4) => { + o.nextTick(() => { + t4.handleError(e11, this.connection); + }); + }, "enqueueError"); + this.activeQuery && (t3(this.activeQuery), this.activeQuery = null), this.queryQueue.forEach(t3), this.queryQueue.length = 0; + } + _connect(e11) { + var t3 = this, r3 = this.connection; + if (this._connectionCallback = e11, this._connecting || this._connected) { + let t4 = Error("Client has already been connected. You cannot reuse a client."); + o.nextTick(() => { + e11(t4); + }); + return; + } + this._connecting = true, this.connectionTimeoutHandle, this._connectionTimeoutMillis > 0 && (this.connectionTimeoutHandle = setTimeout(() => { + r3._ending = true, r3.stream.destroy(Error("timeout expired")); + }, this._connectionTimeoutMillis)), this.host && 0 === this.host.indexOf("/") ? r3.connect(this.host + "/.s.PGSQL." + this.port) : r3.connect(this.port, this.host), r3.on("connect", function() { + t3.ssl ? r3.requestSsl() : r3.startup(t3.getStartupConf()); + }), r3.on("sslconnect", function() { + r3.startup(t3.getStartupConf()); + }), this._attachListeners(r3), r3.once("end", () => { + let e12 = this._ending ? Error("Connection terminated") : Error("Connection terminated unexpectedly"); + clearTimeout(this.connectionTimeoutHandle), this._errorAllQueries(e12), this._ending || (this._connecting && !this._connectionError ? this._connectionCallback ? this._connectionCallback(e12) : this._handleErrorEvent(e12) : this._connectionError || this._handleErrorEvent(e12)), o.nextTick(() => { + this.emit("end"); + }); + }); + } + connect(e11) { + if (e11) { + this._connect(e11); + return; + } + return new this._Promise((e12, t3) => { + this._connect((r3) => { + r3 ? t3(r3) : e12(); + }); + }); + } + _attachListeners(e11) { + e11.on("authenticationCleartextPassword", this._handleAuthCleartextPassword.bind(this)), e11.on("authenticationMD5Password", this._handleAuthMD5Password.bind(this)), e11.on("authenticationSASL", this._handleAuthSASL.bind(this)), e11.on("authenticationSASLContinue", this._handleAuthSASLContinue.bind(this)), e11.on("authenticationSASLFinal", this._handleAuthSASLFinal.bind(this)), e11.on("backendKeyData", this._handleBackendKeyData.bind(this)), e11.on("error", this._handleErrorEvent.bind(this)), e11.on("errorMessage", this._handleErrorMessage.bind(this)), e11.on("readyForQuery", this._handleReadyForQuery.bind(this)), e11.on("notice", this._handleNotice.bind(this)), e11.on("rowDescription", this._handleRowDescription.bind(this)), e11.on("dataRow", this._handleDataRow.bind(this)), e11.on("portalSuspended", this._handlePortalSuspended.bind(this)), e11.on("emptyQuery", this._handleEmptyQuery.bind(this)), e11.on("commandComplete", this._handleCommandComplete.bind(this)), e11.on("parseComplete", this._handleParseComplete.bind(this)), e11.on("copyInResponse", this._handleCopyInResponse.bind(this)), e11.on("copyData", this._handleCopyData.bind(this)), e11.on("notification", this._handleNotification.bind(this)); + } + _checkPgPass(e11) { + let t3 = this.connection; + "function" == typeof this.password ? this._Promise.resolve().then(() => this.password()).then((r3) => { + if (void 0 !== r3) { + if ("string" != typeof r3) { + t3.emit("error", TypeError("Password must be a string")); + return; + } + this.connectionParameters.password = this.password = r3; + } else + this.connectionParameters.password = this.password = null; + e11(); + }).catch((e12) => { + t3.emit("error", e12); + }) : null !== this.password ? e11() : a2(this.connectionParameters, (t4) => { + void 0 !== t4 && (this.connectionParameters.password = this.password = t4), e11(); + }); + } + _handleAuthCleartextPassword(e11) { + this._checkPgPass(() => { + this.connection.password(this.password); + }); + } + _handleAuthMD5Password(e11) { + this._checkPgPass(() => { + let t3 = i2.postgresMd5PasswordHash(this.user, this.password, e11.salt); + this.connection.password(t3); + }); + } + _handleAuthSASL(e11) { + this._checkPgPass(() => { + this.saslSession = s2.startSession(e11.mechanisms), this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response); + }); + } + _handleAuthSASLContinue(e11) { + s2.continueSession(this.saslSession, this.password, e11.data), this.connection.sendSCRAMClientFinalMessage(this.saslSession.response); + } + _handleAuthSASLFinal(e11) { + s2.finalizeSession(this.saslSession, e11.data), this.saslSession = null; + } + _handleBackendKeyData(e11) { + this.processID = e11.processID, this.secretKey = e11.secretKey; + } + _handleReadyForQuery(e11) { + this._connecting && (this._connecting = false, this._connected = true, clearTimeout(this.connectionTimeoutHandle), this._connectionCallback && (this._connectionCallback(null, this), this._connectionCallback = null), this.emit("connect")); + let { activeQuery: t3 } = this; + this.activeQuery = null, this.readyForQuery = true, t3 && t3.handleReadyForQuery(this.connection), this._pulseQueryQueue(); + } + _handleErrorWhileConnecting(e11) { + if (!this._connectionError) { + if (this._connectionError = true, clearTimeout(this.connectionTimeoutHandle), this._connectionCallback) + return this._connectionCallback(e11); + this.emit("error", e11); + } + } + _handleErrorEvent(e11) { + if (this._connecting) + return this._handleErrorWhileConnecting(e11); + this._queryable = false, this._errorAllQueries(e11), this.emit("error", e11); + } + _handleErrorMessage(e11) { + if (this._connecting) + return this._handleErrorWhileConnecting(e11); + let t3 = this.activeQuery; + if (!t3) { + this._handleErrorEvent(e11); + return; + } + this.activeQuery = null, t3.handleError(e11, this.connection); + } + _handleRowDescription(e11) { + this.activeQuery.handleRowDescription(e11); + } + _handleDataRow(e11) { + this.activeQuery.handleDataRow(e11); + } + _handlePortalSuspended(e11) { + this.activeQuery.handlePortalSuspended(this.connection); + } + _handleEmptyQuery(e11) { + this.activeQuery.handleEmptyQuery(this.connection); + } + _handleCommandComplete(e11) { + this.activeQuery.handleCommandComplete(e11, this.connection); + } + _handleParseComplete(e11) { + this.activeQuery.name && (this.connection.parsedStatements[this.activeQuery.name] = this.activeQuery.text); + } + _handleCopyInResponse(e11) { + this.activeQuery.handleCopyInResponse(this.connection); + } + _handleCopyData(e11) { + this.activeQuery.handleCopyData(e11, this.connection); + } + _handleNotification(e11) { + this.emit("notification", e11); + } + _handleNotice(e11) { + this.emit("notice", e11); + } + getStartupConf() { + var e11 = this.connectionParameters, t3 = { user: e11.user, database: e11.database }, r3 = e11.application_name || e11.fallback_application_name; + return r3 && (t3.application_name = r3), e11.replication && (t3.replication = "" + e11.replication), e11.statement_timeout && (t3.statement_timeout = String(parseInt(e11.statement_timeout, 10))), e11.lock_timeout && (t3.lock_timeout = String(parseInt(e11.lock_timeout, 10))), e11.idle_in_transaction_session_timeout && (t3.idle_in_transaction_session_timeout = String(parseInt(e11.idle_in_transaction_session_timeout, 10))), e11.options && (t3.options = e11.options), t3; + } + cancel(e11, t3) { + if (e11.activeQuery === t3) { + var r3 = this.connection; + this.host && 0 === this.host.indexOf("/") ? r3.connect(this.host + "/.s.PGSQL." + this.port) : r3.connect(this.port, this.host), r3.on("connect", function() { + r3.cancel(e11.processID, e11.secretKey); + }); + } else + -1 !== e11.queryQueue.indexOf(t3) && e11.queryQueue.splice(e11.queryQueue.indexOf(t3), 1); + } + setTypeParser(e11, t3, r3) { + return this._types.setTypeParser(e11, t3, r3); + } + getTypeParser(e11, t3) { + return this._types.getTypeParser(e11, t3); + } + escapeIdentifier(e11) { + return '"' + e11.replace(/"/g, '""') + '"'; + } + escapeLiteral(e11) { + for (var t3 = false, r3 = "'", n2 = 0; n2 < e11.length; n2++) { + var i3 = e11[n2]; + "'" === i3 ? r3 += i3 + i3 : "\\" === i3 ? (r3 += i3 + i3, t3 = true) : r3 += i3; + } + return r3 += "'", true === t3 && (r3 = " E" + r3), r3; + } + _pulseQueryQueue() { + if (true === this.readyForQuery) { + if (this.activeQuery = this.queryQueue.shift(), this.activeQuery) { + this.readyForQuery = false, this.hasExecuted = true; + let e11 = this.activeQuery.submit(this.connection); + e11 && o.nextTick(() => { + this.activeQuery.handleError(e11, this.connection), this.readyForQuery = true, this._pulseQueryQueue(); + }); + } else + this.hasExecuted && (this.activeQuery = null, this.emit("drain")); + } + } + query(e11, t3, r3) { + var n2, i3, s3, a3, l3; + if (null == e11) + throw TypeError("Client was passed a null or undefined query"); + return "function" == typeof e11.submit ? (s3 = e11.query_timeout || this.connectionParameters.query_timeout, i3 = n2 = e11, "function" == typeof t3 && (n2.callback = n2.callback || t3)) : (s3 = this.connectionParameters.query_timeout, (n2 = new u2(e11, t3, r3)).callback || (i3 = new this._Promise((e12, t4) => { + n2.callback = (r4, n3) => r4 ? t4(r4) : e12(n3); + }))), s3 && (l3 = n2.callback, a3 = setTimeout(() => { + var e12 = Error("Query read timeout"); + o.nextTick(() => { + n2.handleError(e12, this.connection); + }), l3(e12), n2.callback = () => { + }; + var t4 = this.queryQueue.indexOf(n2); + t4 > -1 && this.queryQueue.splice(t4, 1), this._pulseQueryQueue(); + }, s3), n2.callback = (e12, t4) => { + clearTimeout(a3), l3(e12, t4); + }), this.binary && !n2.binary && (n2.binary = true), n2._result && !n2._result._types && (n2._result._types = this._types), this._queryable ? this._ending ? o.nextTick(() => { + n2.handleError(Error("Client was closed and is not queryable"), this.connection); + }) : (this.queryQueue.push(n2), this._pulseQueryQueue()) : o.nextTick(() => { + n2.handleError(Error("Client has encountered a connection error and is not queryable"), this.connection); + }), i3; + } + ref() { + this.connection.ref(); + } + unref() { + this.connection.unref(); + } + end(e11) { + if (this._ending = true, !this.connection._connecting) { + if (!e11) + return this._Promise.resolve(); + e11(); + } + if (this.activeQuery || !this._queryable ? this.connection.stream.destroy() : this.connection.end(), !e11) + return new this._Promise((e12) => { + this.connection.once("end", e12); + }); + this.connection.once("end", e11); + } + }; + m(f2, "Client"), f2.Query = u2, t2.exports = f2; + }), eQ = y((e10, t2) => { + C(); + var r2 = R().EventEmitter, s2 = m(function() { + }, "NOOP"), a2 = m((e11, t3) => { + let r3 = e11.findIndex(t3); + return -1 === r3 ? void 0 : e11.splice(r3, 1)[0]; + }, "removeWhere"), l2 = class { + constructor(e11, t3, r3) { + this.client = e11, this.idleListener = t3, this.timeoutId = r3; + } + }; + m(l2, "IdleItem"); + var c2 = class { + constructor(e11) { + this.callback = e11; + } + }; + function u2() { + throw Error("Release called on client which has already been released to the pool."); + } + function d2(e11, t3) { + let r3, n2; + return t3 ? { callback: t3, result: void 0 } : { callback: m(function(e12, t4) { + e12 ? r3(e12) : n2(t4); + }, "cb"), result: new e11(function(e12, t4) { + n2 = e12, r3 = t4; + }).catch((e12) => { + throw Error.captureStackTrace(e12), e12; + }) }; + } + function h2(e11, t3) { + return m(function r3(n2) { + n2.client = t3, t3.removeListener("error", r3), t3.on("error", () => { + e11.log("additional client error after disconnection due to error", n2); + }), e11._remove(t3), e11.emit("error", n2, t3); + }, "idleListener"); + } + m(c2, "PendingItem"), m(u2, "throwOnDoubleRelease"), m(d2, "promisify"), m(h2, "makeIdleListener"); + var f2 = class extends r2 { + constructor(e11, t3) { + super(), this.options = Object.assign({}, e11), null != e11 && "password" in e11 && Object.defineProperty(this.options, "password", { configurable: true, enumerable: false, writable: true, value: e11.password }), null != e11 && e11.ssl && e11.ssl.key && Object.defineProperty(this.options.ssl, "key", { enumerable: false }), this.options.max = this.options.max || this.options.poolSize || 10, this.options.maxUses = this.options.maxUses || 1 / 0, this.options.allowExitOnIdle = this.options.allowExitOnIdle || false, this.options.maxLifetimeSeconds = this.options.maxLifetimeSeconds || 0, this.log = this.options.log || function() { + }, this.Client = this.options.Client || t3 || e0().Client, this.Promise = this.options.Promise || n.Promise, typeof this.options.idleTimeoutMillis > "u" && (this.options.idleTimeoutMillis = 1e4), this._clients = [], this._idle = [], this._expired = /* @__PURE__ */ new WeakSet(), this._pendingQueue = [], this._endCallback = void 0, this.ending = false, this.ended = false; + } + _isFull() { + return this._clients.length >= this.options.max; + } + _pulseQueue() { + if (this.log("pulse queue"), this.ended) { + this.log("pulse queue ended"); + return; + } + if (this.ending) { + this.log("pulse queue on ending"), this._idle.length && this._idle.slice().map((e12) => { + this._remove(e12.client); + }), this._clients.length || (this.ended = true, this._endCallback()); + return; + } + if (!this._pendingQueue.length) { + this.log("no queued requests"); + return; + } + if (!this._idle.length && this._isFull()) + return; + let e11 = this._pendingQueue.shift(); + if (this._idle.length) { + let t3 = this._idle.pop(); + clearTimeout(t3.timeoutId); + let r3 = t3.client; + r3.ref && r3.ref(); + let n2 = t3.idleListener; + return this._acquireClient(r3, e11, n2, false); + } + if (!this._isFull()) + return this.newClient(e11); + throw Error("unexpected condition"); + } + _remove(e11) { + let t3 = a2(this._idle, (t4) => t4.client === e11); + void 0 !== t3 && clearTimeout(t3.timeoutId), this._clients = this._clients.filter((t4) => t4 !== e11), e11.end(), this.emit("remove", e11); + } + connect(e11) { + if (this.ending) { + let t4 = Error("Cannot use a pool after calling end on the pool"); + return e11 ? e11(t4) : this.Promise.reject(t4); + } + let t3 = d2(this.Promise, e11), r3 = t3.result; + if (this._isFull() || this._idle.length) { + if (this._idle.length && o.nextTick(() => this._pulseQueue()), !this.options.connectionTimeoutMillis) + return this._pendingQueue.push(new c2(t3.callback)), r3; + let e12 = m((e13, r4, n3) => { + clearTimeout(i2), t3.callback(e13, r4, n3); + }, "queueCallback"), n2 = new c2(e12), i2 = setTimeout(() => { + a2(this._pendingQueue, (t4) => t4.callback === e12), n2.timedOut = true, t3.callback(Error("timeout exceeded when trying to connect")); + }, this.options.connectionTimeoutMillis); + return this._pendingQueue.push(n2), r3; + } + return this.newClient(new c2(t3.callback)), r3; + } + newClient(e11) { + let t3 = new this.Client(this.options); + this._clients.push(t3); + let r3 = h2(this, t3); + this.log("checking client timeout"); + let n2, i2 = false; + this.options.connectionTimeoutMillis && (n2 = setTimeout(() => { + this.log("ending client due to timeout"), i2 = true, t3.connection ? t3.connection.stream.destroy() : t3.end(); + }, this.options.connectionTimeoutMillis)), this.log("connecting new client"), t3.connect((a3) => { + if (n2 && clearTimeout(n2), t3.on("error", r3), a3) + this.log("client failed to connect", a3), this._clients = this._clients.filter((e12) => e12 !== t3), i2 && (a3.message = "Connection terminated due to connection timeout"), this._pulseQueue(), e11.timedOut || e11.callback(a3, void 0, s2); + else { + if (this.log("new client connected"), 0 !== this.options.maxLifetimeSeconds) { + let e12 = setTimeout(() => { + this.log("ending client due to expired lifetime"), this._expired.add(t3), -1 !== this._idle.findIndex((e13) => e13.client === t3) && this._acquireClient(t3, new c2((e13, t4, r4) => r4()), r3, false); + }, 1e3 * this.options.maxLifetimeSeconds); + e12.unref(), t3.once("end", () => clearTimeout(e12)); + } + return this._acquireClient(t3, e11, r3, true); + } + }); + } + _acquireClient(e11, t3, r3, n2) { + n2 && this.emit("connect", e11), this.emit("acquire", e11), e11.release = this._releaseOnce(e11, r3), e11.removeListener("error", r3), t3.timedOut ? n2 && this.options.verify ? this.options.verify(e11, e11.release) : e11.release() : n2 && this.options.verify ? this.options.verify(e11, (r4) => { + if (r4) + return e11.release(r4), t3.callback(r4, void 0, s2); + t3.callback(void 0, e11, e11.release); + }) : t3.callback(void 0, e11, e11.release); + } + _releaseOnce(e11, t3) { + let r3 = false; + return (n2) => { + r3 && u2(), r3 = true, this._release(e11, t3, n2); + }; + } + _release(e11, t3, r3) { + let n2; + if (e11.on("error", t3), e11._poolUseCount = (e11._poolUseCount || 0) + 1, this.emit("release", r3, e11), r3 || this.ending || !e11._queryable || e11._ending || e11._poolUseCount >= this.options.maxUses) { + e11._poolUseCount >= this.options.maxUses && this.log("remove expended client"), this._remove(e11), this._pulseQueue(); + return; + } + if (this._expired.has(e11)) { + this.log("remove expired client"), this._expired.delete(e11), this._remove(e11), this._pulseQueue(); + return; + } + this.options.idleTimeoutMillis && (n2 = setTimeout(() => { + this.log("remove idle client"), this._remove(e11); + }, this.options.idleTimeoutMillis), this.options.allowExitOnIdle && n2.unref()), this.options.allowExitOnIdle && e11.unref(), this._idle.push(new l2(e11, t3, n2)), this._pulseQueue(); + } + query(e11, t3, r3) { + if ("function" == typeof e11) { + let t4 = d2(this.Promise, e11); + return i(function() { + return t4.callback(Error("Passing a function as the first parameter to pool.query is not supported")); + }), t4.result; + } + "function" == typeof t3 && (r3 = t3, t3 = void 0); + let n2 = d2(this.Promise, r3); + return r3 = n2.callback, this.connect((n3, i2) => { + if (n3) + return r3(n3); + let s3 = false, a3 = m((e12) => { + s3 || (s3 = true, i2.release(e12), r3(e12)); + }, "onError"); + i2.once("error", a3), this.log("dispatching query"); + try { + i2.query(e11, t3, (e12, t4) => { + if (this.log("query dispatched"), i2.removeListener("error", a3), !s3) + return s3 = true, i2.release(e12), e12 ? r3(e12) : r3(void 0, t4); + }); + } catch (e12) { + return i2.release(e12), r3(e12); + } + }), n2.result; + } + end(e11) { + if (this.log("ending"), this.ending) { + let t4 = Error("Called end on pool more than once"); + return e11 ? e11(t4) : this.Promise.reject(t4); + } + this.ending = true; + let t3 = d2(this.Promise, e11); + return this._endCallback = t3.callback, this._pulseQueue(), t3.result; + } + get waitingCount() { + return this._pendingQueue.length; + } + get idleCount() { + return this._idle.length; + } + get expiredCount() { + return this._clients.reduce((e11, t3) => e11 + (this._expired.has(t3) ? 1 : 0), 0); + } + get totalCount() { + return this._clients.length; + } + }; + m(f2, "Pool"), t2.exports = f2; + }), eV = {}; + v(eV, { default: () => eG }); + var eG, eZ = g(() => { + C(), eG = {}; + }), eK = y((e10, t2) => { + t2.exports = { name: "pg", version: "8.8.0", description: "PostgreSQL client - pure javascript & libpq with the same API", keywords: ["database", "libpq", "pg", "postgre", "postgres", "postgresql", "rdbms"], homepage: "https://github.com/brianc/node-postgres", repository: { type: "git", url: "git://github.com/brianc/node-postgres.git", directory: "packages/pg" }, author: "Brian Carlson ", main: "./lib", dependencies: { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", "pg-connection-string": "^2.5.0", "pg-pool": "^3.5.2", "pg-protocol": "^1.5.0", "pg-types": "^2.1.0", pgpass: "1.x" }, devDependencies: { async: "2.6.4", bluebird: "3.5.2", co: "4.6.0", "pg-copy-streams": "0.3.0" }, peerDependencies: { "pg-native": ">=3.0.1" }, peerDependenciesMeta: { "pg-native": { optional: true } }, scripts: { test: "make test-all" }, files: ["lib", "SPONSORS.md"], license: "MIT", engines: { node: ">= 8.0.0" }, gitHead: "c99fb2c127ddf8d712500db2c7b9a5491a178655" }; + }), eJ = y((e10, t2) => { + C(); + var r2 = R().EventEmitter, n2 = (A(), x(P)), s2 = X(), a2 = t2.exports = function(e11, t3, n3) { + r2.call(this), e11 = s2.normalizeQueryConfig(e11, t3, n3), this.text = e11.text, this.values = e11.values, this.name = e11.name, this.callback = e11.callback, this.state = "new", this._arrayMode = "array" === e11.rowMode, this._emitRowEvents = false, this.on("newListener", function(e12) { + "row" === e12 && (this._emitRowEvents = true); + }.bind(this)); + }; + n2.inherits(a2, r2); + var l2 = { sqlState: "code", statementPosition: "position", messagePrimary: "message", context: "where", schemaName: "schema", tableName: "table", columnName: "column", dataTypeName: "dataType", constraintName: "constraint", sourceFile: "file", sourceLine: "line", sourceFunction: "routine" }; + a2.prototype.handleError = function(e11) { + var t3 = this.native.pq.resultErrorFields(); + if (t3) + for (var r3 in t3) + e11[l2[r3] || r3] = t3[r3]; + this.callback ? this.callback(e11) : this.emit("error", e11), this.state = "error"; + }, a2.prototype.then = function(e11, t3) { + return this._getPromise().then(e11, t3); + }, a2.prototype.catch = function(e11) { + return this._getPromise().catch(e11); + }, a2.prototype._getPromise = function() { + return this._promise || (this._promise = new Promise(function(e11, t3) { + this._once("end", e11), this._once("error", t3); + }.bind(this))), this._promise; + }, a2.prototype.submit = function(e11) { + this.state = "running"; + var t3 = this; + this.native = e11.native, e11.native.arrayMode = this._arrayMode; + var r3 = m(function(r4, n4, s3) { + if (e11.native.arrayMode = false, i(function() { + t3.emit("_done"); + }), r4) + return t3.handleError(r4); + t3._emitRowEvents && (s3.length > 1 ? n4.forEach((e12, r5) => { + e12.forEach((e13) => { + t3.emit("row", e13, s3[r5]); + }); + }) : n4.forEach(function(e12) { + t3.emit("row", e12, s3); + })), t3.state = "end", t3.emit("end", s3), t3.callback && t3.callback(null, s3); + }, "after"); + if (o.domain && (r3 = o.domain.bind(r3)), this.name) { + this.name.length > 63 && (console.error("Warning! Postgres only supports 63 characters for query names."), console.error("You supplied %s (%s)", this.name, this.name.length), console.error("This can cause conflicts and silent errors executing queries")); + var n3 = (this.values || []).map(s2.prepareValue); + if (e11.namedQueries[this.name]) { + if (this.text && e11.namedQueries[this.name] !== this.text) { + let e12 = Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`); + return r3(e12); + } + return e11.native.execute(this.name, n3, r3); + } + return e11.native.prepare(this.name, this.text, n3.length, function(i2) { + return i2 ? r3(i2) : (e11.namedQueries[t3.name] = t3.text, t3.native.execute(t3.name, n3, r3)); + }); + } + if (this.values) { + if (!Array.isArray(this.values)) { + let e12 = Error("Query values must be an array"); + return r3(e12); + } + var a3 = this.values.map(s2.prepareValue); + e11.native.query(this.text, a3, r3); + } else + e11.native.query(this.text, r3); + }; + }), eY = y((e10, t2) => { + C(); + var r2 = (eZ(), x(eV)), i2 = ey(), s2 = (eK(), R().EventEmitter), a2 = (A(), x(P)), l2 = ek(), c2 = eJ(), u2 = t2.exports = function(e11) { + s2.call(this), e11 = e11 || {}, this._Promise = e11.Promise || n.Promise, this._types = new i2(e11.types), this.native = new r2({ types: this._types }), this._queryQueue = [], this._ending = false, this._connecting = false, this._connected = false, this._queryable = true; + var t3 = this.connectionParameters = new l2(e11); + this.user = t3.user, Object.defineProperty(this, "password", { configurable: true, enumerable: false, writable: true, value: t3.password }), this.database = t3.database, this.host = t3.host, this.port = t3.port, this.namedQueries = {}; + }; + u2.Query = c2, a2.inherits(u2, s2), u2.prototype._errorAllQueries = function(e11) { + let t3 = m((t4) => { + o.nextTick(() => { + t4.native = this.native, t4.handleError(e11); + }); + }, "enqueueError"); + this._hasActiveQuery() && (t3(this._activeQuery), this._activeQuery = null), this._queryQueue.forEach(t3), this._queryQueue.length = 0; + }, u2.prototype._connect = function(e11) { + var t3 = this; + if (this._connecting) { + o.nextTick(() => e11(Error("Client has already been connected. You cannot reuse a client."))); + return; + } + this._connecting = true, this.connectionParameters.getLibpqConnectionString(function(r3, n2) { + if (r3) + return e11(r3); + t3.native.connect(n2, function(r4) { + if (r4) + return t3.native.end(), e11(r4); + t3._connected = true, t3.native.on("error", function(e12) { + t3._queryable = false, t3._errorAllQueries(e12), t3.emit("error", e12); + }), t3.native.on("notification", function(e12) { + t3.emit("notification", { channel: e12.relname, payload: e12.extra }); + }), t3.emit("connect"), t3._pulseQueryQueue(true), e11(); + }); + }); + }, u2.prototype.connect = function(e11) { + if (e11) { + this._connect(e11); + return; + } + return new this._Promise((e12, t3) => { + this._connect((r3) => { + r3 ? t3(r3) : e12(); + }); + }); + }, u2.prototype.query = function(e11, t3, r3) { + var n2, i3, s3, a3, l3; + if (null == e11) + throw TypeError("Client was passed a null or undefined query"); + if ("function" == typeof e11.submit) + s3 = e11.query_timeout || this.connectionParameters.query_timeout, i3 = n2 = e11, "function" == typeof t3 && (e11.callback = t3); + else if (s3 = this.connectionParameters.query_timeout, !(n2 = new c2(e11, t3, r3)).callback) { + let e12, t4; + i3 = new this._Promise((r4, n3) => { + e12 = r4, t4 = n3; + }), n2.callback = (r4, n3) => r4 ? t4(r4) : e12(n3); + } + return s3 && (l3 = n2.callback, a3 = setTimeout(() => { + var e12 = Error("Query read timeout"); + o.nextTick(() => { + n2.handleError(e12, this.connection); + }), l3(e12), n2.callback = () => { + }; + var t4 = this._queryQueue.indexOf(n2); + t4 > -1 && this._queryQueue.splice(t4, 1), this._pulseQueryQueue(); + }, s3), n2.callback = (e12, t4) => { + clearTimeout(a3), l3(e12, t4); + }), this._queryable ? this._ending ? (n2.native = this.native, o.nextTick(() => { + n2.handleError(Error("Client was closed and is not queryable")); + })) : (this._queryQueue.push(n2), this._pulseQueryQueue()) : (n2.native = this.native, o.nextTick(() => { + n2.handleError(Error("Client has encountered a connection error and is not queryable")); + })), i3; + }, u2.prototype.end = function(e11) { + var t3, r3 = this; + return this._ending = true, this._connected || this.once("connect", this.end.bind(this, e11)), e11 || (t3 = new this._Promise(function(t4, r4) { + e11 = m((e12) => e12 ? r4(e12) : t4(), "cb"); + })), this.native.end(function() { + r3._errorAllQueries(Error("Connection terminated")), o.nextTick(() => { + r3.emit("end"), e11 && e11(); + }); + }), t3; + }, u2.prototype._hasActiveQuery = function() { + return this._activeQuery && "error" !== this._activeQuery.state && "end" !== this._activeQuery.state; + }, u2.prototype._pulseQueryQueue = function(e11) { + if (this._connected && !this._hasActiveQuery()) { + var t3 = this._queryQueue.shift(); + if (!t3) { + e11 || this.emit("drain"); + return; + } + this._activeQuery = t3, t3.submit(this); + var r3 = this; + t3.once("_done", function() { + r3._pulseQueryQueue(); + }); + } + }, u2.prototype.cancel = function(e11) { + this._activeQuery === e11 ? this.native.cancel(function() { + }) : -1 !== this._queryQueue.indexOf(e11) && this._queryQueue.splice(this._queryQueue.indexOf(e11), 1); + }, u2.prototype.ref = function() { + }, u2.prototype.unref = function() { + }, u2.prototype.setTypeParser = function(e11, t3, r3) { + return this._types.setTypeParser(e11, t3, r3); + }, u2.prototype.getTypeParser = function(e11, t3) { + return this._types.getTypeParser(e11, t3); + }; + }), eX = y((e10, t2) => { + C(), t2.exports = eY(); + }), e0 = y((e10, t2) => { + C(); + var r2 = eW(), n2 = Y(), i2 = eH(), s2 = eQ(), { DatabaseError: a2 } = eB(), l2 = m((e11) => { + var t3; + return m(t3 = class extends s2 { + constructor(t4) { + super(t4, e11); + } + }, "BoundPool"), t3; + }, "poolFactory"), c2 = m(function(e11) { + this.defaults = n2, this.Client = e11, this.Query = this.Client.Query, this.Pool = l2(this.Client), this._pools = [], this.Connection = i2, this.types = J(), this.DatabaseError = a2; + }, "PG"); + "u" > typeof o.env.NODE_PG_FORCE_NATIVE ? t2.exports = new c2(eX()) : (t2.exports = new c2(r2), Object.defineProperty(t2.exports, "native", { configurable: true, enumerable: false, get() { + var e11 = null; + try { + e11 = new c2(eX()); + } catch (e12) { + if ("MODULE_NOT_FOUND" !== e12.code) + throw e12; + } + return Object.defineProperty(t2.exports, "native", { value: e11 }), e11; + } })); + }); + C(); + var e1 = w(e0()); + eM(), C(), eM(), e_(); + var e2 = w(X()), e6 = w(ey()), e5 = class e10 extends Error { + constructor(t2) { + super(t2), S(this, "name", "NeonDbError"), S(this, "severity"), S(this, "code"), S(this, "detail"), S(this, "hint"), S(this, "position"), S(this, "internalPosition"), S(this, "internalQuery"), S(this, "where"), S(this, "schema"), S(this, "table"), S(this, "column"), S(this, "dataType"), S(this, "constraint"), S(this, "file"), S(this, "line"), S(this, "routine"), S(this, "sourceError"), "captureStackTrace" in Error && "function" == typeof Error.captureStackTrace && Error.captureStackTrace(this, e10); + } + }; + m(e5, "NeonDbError"); + var e4 = "transaction() expects an array of queries, or a function returning an array of queries", e3 = ["severity", "code", "detail", "hint", "position", "internalPosition", "internalQuery", "where", "schema", "table", "column", "dataType", "constraint", "file", "line", "routine"]; + function e8(e10, { arrayMode: t2, fullResults: r2, fetchOptions: n2, isolationLevel: i2, readOnly: s2, deferrable: a2, queryCallback: o2, resultCallback: l2, authToken: c2 } = {}) { + let u2; + if (!e10) + throw Error("No database connection string was provided to `neon()`. Perhaps an environment variable has not been set?"); + try { + u2 = eS(e10); + } catch { + throw Error("Database connection string provided to `neon()` is not a valid URL. Connection string: " + String(e10)); + } + let { protocol: d2, username: h2, hostname: f2, port: p2, pathname: g2 } = u2; + if ("postgres:" !== d2 && "postgresql:" !== d2 || !h2 || !f2 || !g2) + throw Error("Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value"); + function y2(e11, ...t3) { + let r3, n3; + if ("string" == typeof e11) + r3 = e11, n3 = t3[1], t3 = t3[0] ?? []; + else { + r3 = ""; + for (let n4 = 0; n4 < e11.length; n4++) + r3 += e11[n4], n4 < t3.length && (r3 += "$" + (n4 + 1)); + } + let i3 = { query: r3, params: t3 = t3.map((e12) => (0, e2.prepareValue)(e12)) }; + return o2 && o2(i3), e9(v2, i3, n3); + } + async function v2(o3, u3, d3) { + let h3, { fetchEndpoint: m2, fetchFunction: g3 } = eN, y3 = "function" == typeof m2 ? m2(f2, p2, { jwtAuth: void 0 !== c2 }) : m2, v3 = Array.isArray(o3) ? { queries: o3 } : o3, b2 = n2 ?? {}, w2 = t2 ?? false, x2 = r2 ?? false, S2 = i2, _2 = s2, E2 = a2; + void 0 !== d3 && (void 0 !== d3.fetchOptions && (b2 = { ...b2, ...d3.fetchOptions }), void 0 !== d3.arrayMode && (w2 = d3.arrayMode), void 0 !== d3.fullResults && (x2 = d3.fullResults), void 0 !== d3.isolationLevel && (S2 = d3.isolationLevel), void 0 !== d3.readOnly && (_2 = d3.readOnly), void 0 !== d3.deferrable && (E2 = d3.deferrable)), void 0 === u3 || Array.isArray(u3) || void 0 === u3.fetchOptions || (b2 = { ...b2, ...u3.fetchOptions }); + let k2 = { "Neon-Connection-String": e10, "Neon-Raw-Text-Output": "true", "Neon-Array-Mode": "true" }, C2 = await te(c2); + C2 && (k2.Authorization = `Bearer ${C2}`), Array.isArray(o3) && (void 0 !== S2 && (k2["Neon-Batch-Isolation-Level"] = S2), void 0 !== _2 && (k2["Neon-Batch-Read-Only"] = String(_2)), void 0 !== E2 && (k2["Neon-Batch-Deferrable"] = String(E2))); + try { + h3 = await (g3 ?? fetch)(y3, { method: "POST", body: JSON.stringify(v3), headers: k2, ...b2 }); + } catch (t3) { + let e11 = new e5(`Error connecting to database: ${t3.message}`); + throw e11.sourceError = t3, e11; + } + if (h3.ok) { + let e11 = await h3.json(); + if (Array.isArray(o3)) { + let t3 = e11.results; + if (!Array.isArray(t3)) + throw new e5("Neon internal error: unexpected result format"); + return t3.map((e12, t4) => { + let r3 = u3[t4] ?? {}; + return e7(e12, { arrayMode: r3.arrayMode ?? w2, fullResults: r3.fullResults ?? x2, parameterizedQuery: o3[t4], resultCallback: l2, types: r3.types }); + }); + } + { + let t3 = u3 ?? {}; + return e7(e11, { arrayMode: t3.arrayMode ?? w2, fullResults: t3.fullResults ?? x2, parameterizedQuery: o3, resultCallback: l2, types: t3.types }); + } + } + { + let { status: e11 } = h3; + if (400 === e11) { + let e12 = await h3.json(), t3 = new e5(e12.message); + for (let r3 of e3) + t3[r3] = e12[r3] ?? void 0; + throw t3; + } + { + let t3 = await h3.text(); + throw new e5(`Server error (HTTP status ${e11}): ${t3}`); + } + } + } + return m(y2, "resolve"), y2.transaction = async (e11, t3) => { + if ("function" == typeof e11 && (e11 = e11(y2)), !Array.isArray(e11)) + throw Error(e4); + return e11.forEach((e12) => { + if ("NeonQueryPromise" !== e12[Symbol.toStringTag]) + throw Error(e4); + }), v2(e11.map((e12) => e12.parameterizedQuery), e11.map((e12) => e12.opts ?? {}), t3); + }, m(v2, "execute"), y2; + } + function e9(e10, t2, r2) { + return { [Symbol.toStringTag]: "NeonQueryPromise", parameterizedQuery: t2, opts: r2, then: m((n2, i2) => e10(t2, r2).then(n2, i2), "then"), catch: m((n2) => e10(t2, r2).catch(n2), "catch"), finally: m((n2) => e10(t2, r2).finally(n2), "finally") }; + } + function e7(e10, { arrayMode: t2, fullResults: r2, parameterizedQuery: n2, resultCallback: i2, types: s2 }) { + let a2 = new e6.default(s2), o2 = e10.fields.map((e11) => e11.name), l2 = e10.fields.map((e11) => a2.getTypeParser(e11.dataTypeID)), c2 = true === t2 ? e10.rows.map((e11) => e11.map((e12, t3) => null === e12 ? null : l2[t3](e12))) : e10.rows.map((e11) => Object.fromEntries(e11.map((e12, t3) => [o2[t3], null === e12 ? null : l2[t3](e12)]))); + return i2 && i2(n2, e10, c2, { arrayMode: t2, fullResults: r2 }), r2 ? (e10.viaNeonFetch = true, e10.rowAsArray = t2, e10.rows = c2, e10._parsers = l2, e10._types = a2, e10) : c2; + } + async function te(e10) { + if ("string" == typeof e10) + return e10; + if ("function" == typeof e10) + try { + return await Promise.resolve(e10()); + } catch (t2) { + let e11 = new e5("Error getting auth token."); + throw t2 instanceof Error && (e11 = new e5(`Error getting auth token: ${t2.message}`)), e11; + } + } + m(e8, "neon"), m(e9, "createNeonQueryPromise"), m(e7, "processQueryResult"), m(te, "getAuthToken"); + var tt = w(ek()), tr = w(e0()), tn = class extends e1.Client { + constructor(e10) { + super(e10), this.config = e10; + } + get neonConfig() { + return this.connection.stream; + } + connect(e10) { + let { neonConfig: t2 } = this; + t2.forceDisablePgSSL && (this.ssl = this.connection.ssl = false), this.ssl && t2.useSecureWebSocket && console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection parameters or set forceDisablePgSSL = true."); + let r2 = this.config?.host !== void 0 || this.config?.connectionString !== void 0 || void 0 !== o.env.PGHOST, n2 = o.env.USER ?? o.env.USERNAME; + if (!r2 && "localhost" === this.host && this.user === n2 && this.database === n2 && null === this.password) + throw Error(`No database host or connection string was set, and key parameters have default values (host: localhost, user: ${n2}, db: ${n2}, password: null). Is an environment variable missing? Alternatively, if you intended to connect with these parameters, please set the host to 'localhost' explicitly.`); + let i2 = super.connect(e10), s2 = t2.pipelineTLS && this.ssl, a2 = "password" === t2.pipelineConnect; + if (!s2 && !t2.pipelineConnect) + return i2; + let l2 = this.connection; + if (s2 && l2.on("connect", () => l2.stream.emit("data", "S")), a2) { + l2.removeAllListeners("authenticationCleartextPassword"), l2.removeAllListeners("readyForQuery"), l2.once("readyForQuery", () => l2.on("readyForQuery", this._handleReadyForQuery.bind(this))); + let e11 = this.ssl ? "sslconnect" : "connect"; + l2.on(e11, () => { + this._handleAuthCleartextPassword(), this._handleReadyForQuery(); + }); + } + return i2; + } + async _handleAuthSASLContinue(e10) { + let t2 = this.saslSession, r2 = this.password, n2 = e10.data; + if ("SASLInitialResponse" !== t2.message || "string" != typeof r2 || "string" != typeof n2) + throw Error("SASL: protocol error"); + let i2 = Object.fromEntries(n2.split(",").map((e11) => { + if (!/^.=/.test(e11)) + throw Error("SASL: Invalid attribute pair entry"); + return [e11[0], e11.substring(2)]; + })), o2 = i2.r, l2 = i2.s, c2 = i2.i; + if (!o2 || !/^[!-+--~]+$/.test(o2)) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable"); + if (!l2 || !/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(l2)) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64"); + if (!c2 || !/^[1-9][0-9]*$/.test(c2)) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count"); + if (!o2.startsWith(t2.clientNonce)) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); + if (o2.length === t2.clientNonce.length) + throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short"); + let u2 = parseInt(c2, 10), d2 = a.from(l2, "base64"), h2 = new TextEncoder(), f2 = h2.encode(r2), p2 = await s.subtle.importKey("raw", f2, { name: "HMAC", hash: { name: "SHA-256" } }, false, ["sign"]), m2 = new Uint8Array(await s.subtle.sign("HMAC", p2, a.concat([d2, a.from([0, 0, 0, 1])]))), g2 = m2; + for (var y2 = 0; y2 < u2 - 1; y2++) + m2 = new Uint8Array(await s.subtle.sign("HMAC", p2, m2)), g2 = a.from(g2.map((e11, t3) => g2[t3] ^ m2[t3])); + let v2 = g2, b2 = await s.subtle.importKey("raw", v2, { name: "HMAC", hash: { name: "SHA-256" } }, false, ["sign"]), w2 = new Uint8Array(await s.subtle.sign("HMAC", b2, h2.encode("Client Key"))), x2 = await s.subtle.digest("SHA-256", w2), S2 = "n=*,r=" + t2.clientNonce, _2 = "r=" + o2 + ",s=" + l2 + ",i=" + u2, E2 = "c=biws,r=" + o2, k2 = S2 + "," + _2 + "," + E2, C2 = await s.subtle.importKey("raw", x2, { name: "HMAC", hash: { name: "SHA-256" } }, false, ["sign"]); + var R2 = new Uint8Array(await s.subtle.sign("HMAC", C2, h2.encode(k2))), P2 = a.from(w2.map((e11, t3) => w2[t3] ^ R2[t3])).toString("base64"); + let T2 = await s.subtle.importKey("raw", v2, { name: "HMAC", hash: { name: "SHA-256" } }, false, ["sign"]), A2 = await s.subtle.sign("HMAC", T2, h2.encode("Server Key")), O2 = await s.subtle.importKey("raw", A2, { name: "HMAC", hash: { name: "SHA-256" } }, false, ["sign"]); + var I2 = a.from(await s.subtle.sign("HMAC", O2, h2.encode(k2))); + t2.message = "SASLResponse", t2.serverSignature = I2.toString("base64"), t2.response = E2 + ",p=" + P2, this.connection.sendSCRAMClientFinalMessage(this.saslSession.response); + } + }; + function ti(e10, t2) { + let r2, n2; + return t2 ? { callback: t2, result: void 0 } : { callback: m(function(e11, t3) { + e11 ? r2(e11) : n2(t3); + }, "cb"), result: new e10(function(e11, t3) { + n2 = e11, r2 = t3; + }) }; + } + m(tn, "NeonClient"), m(ti, "promisify"), m(class extends e1.Pool { + constructor() { + super(...arguments), S(this, "Client", tn), S(this, "hasFetchUnsupportedListeners", false); + } + on(e10, t2) { + return "error" !== e10 && (this.hasFetchUnsupportedListeners = true), super.on(e10, t2); + } + query(e10, t2, r2) { + if (!eN.poolQueryViaFetch || this.hasFetchUnsupportedListeners || "function" == typeof e10) + return super.query(e10, t2, r2); + "function" == typeof t2 && (r2 = t2, t2 = void 0); + let n2 = ti(this.Promise, r2); + r2 = n2.callback; + try { + let n3 = new tt.default(this.options), i2 = encodeURIComponent, s2 = encodeURI, a2 = `postgresql://${i2(n3.user)}:${i2(n3.password)}@${i2(n3.host)}/${s2(n3.database)}`, o2 = "string" == typeof e10 ? e10 : e10.text, l2 = t2 ?? e10.values ?? []; + e8(a2, { fullResults: true, arrayMode: "array" === e10.rowMode })(o2, l2, { types: e10.types ?? this.options?.types }).then((e11) => r2(void 0, e11)).catch((e11) => r2(e11)); + } catch (e11) { + r2(e11); + } + return n2.result; + } + }, "NeonPool"), tr.ClientBase, tr.Connection, tr.DatabaseError, tr.Query, tr.defaults; + var ts = tr.types; + }; + __namedExportsObject5["__chunk_97475"] = (e, t, r) => { + "use strict"; + r.d(t, { m6: () => Z }); + let n = (e2) => { + let t2 = o(e2), { conflictingClassGroups: r2, conflictingClassGroupModifiers: n2 } = e2; + return { getClassGroupId: (e3) => { + let r3 = e3.split("-"); + return "" === r3[0] && 1 !== r3.length && r3.shift(), i(r3, t2) || a(e3); + }, getConflictingClassGroupIds: (e3, t3) => { + let i2 = r2[e3] || []; + return t3 && n2[e3] ? [...i2, ...n2[e3]] : i2; + } }; + }, i = (e2, t2) => { + if (0 === e2.length) + return t2.classGroupId; + let r2 = e2[0], n2 = t2.nextPart.get(r2), s2 = n2 ? i(e2.slice(1), n2) : void 0; + if (s2) + return s2; + if (0 === t2.validators.length) + return; + let a2 = e2.join("-"); + return t2.validators.find(({ validator: e3 }) => e3(a2))?.classGroupId; + }, s = /^\[(.+)\]$/, a = (e2) => { + if (s.test(e2)) { + let t2 = s.exec(e2)[1], r2 = t2?.substring(0, t2.indexOf(":")); + if (r2) + return "arbitrary.." + r2; + } + }, o = (e2) => { + let { theme: t2, prefix: r2 } = e2, n2 = { nextPart: /* @__PURE__ */ new Map(), validators: [] }; + return d(Object.entries(e2.classGroups), r2).forEach(([e3, r3]) => { + l(r3, n2, e3, t2); + }), n2; + }, l = (e2, t2, r2, n2) => { + e2.forEach((e3) => { + if ("string" == typeof e3) { + ("" === e3 ? t2 : c(t2, e3)).classGroupId = r2; + return; + } + if ("function" == typeof e3) { + if (u(e3)) { + l(e3(n2), t2, r2, n2); + return; + } + t2.validators.push({ validator: e3, classGroupId: r2 }); + return; + } + Object.entries(e3).forEach(([e4, i2]) => { + l(i2, c(t2, e4), r2, n2); + }); + }); + }, c = (e2, t2) => { + let r2 = e2; + return t2.split("-").forEach((e3) => { + r2.nextPart.has(e3) || r2.nextPart.set(e3, { nextPart: /* @__PURE__ */ new Map(), validators: [] }), r2 = r2.nextPart.get(e3); + }), r2; + }, u = (e2) => e2.isThemeGetter, d = (e2, t2) => t2 ? e2.map(([e3, r2]) => [e3, r2.map((e4) => "string" == typeof e4 ? t2 + e4 : "object" == typeof e4 ? Object.fromEntries(Object.entries(e4).map(([e5, r3]) => [t2 + e5, r3])) : e4)]) : e2, h = (e2) => { + if (e2 < 1) + return { get: () => void 0, set: () => { + } }; + let t2 = 0, r2 = /* @__PURE__ */ new Map(), n2 = /* @__PURE__ */ new Map(), i2 = (i3, s2) => { + r2.set(i3, s2), ++t2 > e2 && (t2 = 0, n2 = r2, r2 = /* @__PURE__ */ new Map()); + }; + return { get(e3) { + let t3 = r2.get(e3); + return void 0 !== t3 ? t3 : void 0 !== (t3 = n2.get(e3)) ? (i2(e3, t3), t3) : void 0; + }, set(e3, t3) { + r2.has(e3) ? r2.set(e3, t3) : i2(e3, t3); + } }; + }, f = (e2) => { + let { separator: t2, experimentalParseClassName: r2 } = e2, n2 = 1 === t2.length, i2 = t2[0], s2 = t2.length, a2 = (e3) => { + let r3; + let a3 = [], o2 = 0, l2 = 0; + for (let c3 = 0; c3 < e3.length; c3++) { + let u3 = e3[c3]; + if (0 === o2) { + if (u3 === i2 && (n2 || e3.slice(c3, c3 + s2) === t2)) { + a3.push(e3.slice(l2, c3)), l2 = c3 + s2; + continue; + } + if ("/" === u3) { + r3 = c3; + continue; + } + } + "[" === u3 ? o2++ : "]" === u3 && o2--; + } + let c2 = 0 === a3.length ? e3 : e3.substring(l2), u2 = c2.startsWith("!"), d2 = u2 ? c2.substring(1) : c2; + return { modifiers: a3, hasImportantModifier: u2, baseClassName: d2, maybePostfixModifierPosition: r3 && r3 > l2 ? r3 - l2 : void 0 }; + }; + return r2 ? (e3) => r2({ className: e3, parseClassName: a2 }) : a2; + }, p = (e2) => { + if (e2.length <= 1) + return e2; + let t2 = [], r2 = []; + return e2.forEach((e3) => { + "[" === e3[0] ? (t2.push(...r2.sort(), e3), r2 = []) : r2.push(e3); + }), t2.push(...r2.sort()), t2; + }, m = (e2) => ({ cache: h(e2.cacheSize), parseClassName: f(e2), ...n(e2) }), g = /\s+/, y = (e2, t2) => { + let { parseClassName: r2, getClassGroupId: n2, getConflictingClassGroupIds: i2 } = t2, s2 = [], a2 = e2.trim().split(g), o2 = ""; + for (let e3 = a2.length - 1; e3 >= 0; e3 -= 1) { + let t3 = a2[e3], { modifiers: l2, hasImportantModifier: c2, baseClassName: u2, maybePostfixModifierPosition: d2 } = r2(t3), h2 = !!d2, f2 = n2(h2 ? u2.substring(0, d2) : u2); + if (!f2) { + if (!h2 || !(f2 = n2(u2))) { + o2 = t3 + (o2.length > 0 ? " " + o2 : o2); + continue; + } + h2 = false; + } + let m2 = p(l2).join(":"), g2 = c2 ? m2 + "!" : m2, y2 = g2 + f2; + if (s2.includes(y2)) + continue; + s2.push(y2); + let v2 = i2(f2, h2); + for (let e4 = 0; e4 < v2.length; ++e4) { + let t4 = v2[e4]; + s2.push(g2 + t4); + } + o2 = t3 + (o2.length > 0 ? " " + o2 : o2); + } + return o2; + }; + function v() { + let e2, t2, r2 = 0, n2 = ""; + for (; r2 < arguments.length; ) + (e2 = arguments[r2++]) && (t2 = b(e2)) && (n2 && (n2 += " "), n2 += t2); + return n2; + } + let b = (e2) => { + let t2; + if ("string" == typeof e2) + return e2; + let r2 = ""; + for (let n2 = 0; n2 < e2.length; n2++) + e2[n2] && (t2 = b(e2[n2])) && (r2 && (r2 += " "), r2 += t2); + return r2; + }, w = (e2) => { + let t2 = (t3) => t3[e2] || []; + return t2.isThemeGetter = true, t2; + }, x = /^\[(?:([a-z-]+):)?(.+)\]$/i, S = /^\d+\/\d+$/, _ = /* @__PURE__ */ new Set(["px", "full", "screen"]), E = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, k = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, C = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, R = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, P = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, T = (e2) => O(e2) || _.has(e2) || S.test(e2), A = (e2) => H(e2, "length", W), O = (e2) => !!e2 && !Number.isNaN(Number(e2)), I = (e2) => H(e2, "number", O), N = (e2) => !!e2 && Number.isInteger(Number(e2)), M = (e2) => e2.endsWith("%") && O(e2.slice(0, -1)), $ = (e2) => x.test(e2), L = (e2) => E.test(e2), j = /* @__PURE__ */ new Set(["length", "size", "percentage"]), D = (e2) => H(e2, j, Q), F = (e2) => H(e2, "position", Q), B = /* @__PURE__ */ new Set(["image", "url"]), U = (e2) => H(e2, B, G), q = (e2) => H(e2, "", V), z = () => true, H = (e2, t2, r2) => { + let n2 = x.exec(e2); + return !!n2 && (n2[1] ? "string" == typeof t2 ? n2[1] === t2 : t2.has(n2[1]) : r2(n2[2])); + }, W = (e2) => k.test(e2) && !C.test(e2), Q = () => false, V = (e2) => R.test(e2), G = (e2) => P.test(e2); + Symbol.toStringTag; + let Z = /* @__PURE__ */ function(e2, ...t2) { + let r2, n2, i2; + let s2 = function(o2) { + return n2 = (r2 = m(t2.reduce((e3, t3) => t3(e3), e2()))).cache.get, i2 = r2.cache.set, s2 = a2, a2(o2); + }; + function a2(e3) { + let t3 = n2(e3); + if (t3) + return t3; + let s3 = y(e3, r2); + return i2(e3, s3), s3; + } + return function() { + return s2(v.apply(null, arguments)); + }; + }(() => { + let e2 = w("colors"), t2 = w("spacing"), r2 = w("blur"), n2 = w("brightness"), i2 = w("borderColor"), s2 = w("borderRadius"), a2 = w("borderSpacing"), o2 = w("borderWidth"), l2 = w("contrast"), c2 = w("grayscale"), u2 = w("hueRotate"), d2 = w("invert"), h2 = w("gap"), f2 = w("gradientColorStops"), p2 = w("gradientColorStopPositions"), m2 = w("inset"), g2 = w("margin"), y2 = w("opacity"), v2 = w("padding"), b2 = w("saturate"), x2 = w("scale"), S2 = w("sepia"), _2 = w("skew"), E2 = w("space"), k2 = w("translate"), C2 = () => ["auto", "contain", "none"], R2 = () => ["auto", "hidden", "clip", "visible", "scroll"], P2 = () => ["auto", $, t2], j2 = () => [$, t2], B2 = () => ["", T, A], H2 = () => ["auto", O, $], W2 = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], Q2 = () => ["solid", "dashed", "dotted", "double", "none"], V2 = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], G2 = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], Z2 = () => ["", "0", $], K = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], J = () => [O, $]; + return { cacheSize: 500, separator: ":", theme: { colors: [z], spacing: [T, A], blur: ["none", "", L, $], brightness: J(), borderColor: [e2], borderRadius: ["none", "", "full", L, $], borderSpacing: j2(), borderWidth: B2(), contrast: J(), grayscale: Z2(), hueRotate: J(), invert: Z2(), gap: j2(), gradientColorStops: [e2], gradientColorStopPositions: [M, A], inset: P2(), margin: P2(), opacity: J(), padding: j2(), saturate: J(), scale: J(), sepia: Z2(), skew: J(), space: j2(), translate: j2() }, classGroups: { aspect: [{ aspect: ["auto", "square", "video", $] }], container: ["container"], columns: [{ columns: [L] }], "break-after": [{ "break-after": K() }], "break-before": [{ "break-before": K() }], "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }], "box-decoration": [{ "box-decoration": ["slice", "clone"] }], box: [{ box: ["border", "content"] }], display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"], float: [{ float: ["right", "left", "none", "start", "end"] }], clear: [{ clear: ["left", "right", "both", "none", "start", "end"] }], isolation: ["isolate", "isolation-auto"], "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }], "object-position": [{ object: [...W2(), $] }], overflow: [{ overflow: R2() }], "overflow-x": [{ "overflow-x": R2() }], "overflow-y": [{ "overflow-y": R2() }], overscroll: [{ overscroll: C2() }], "overscroll-x": [{ "overscroll-x": C2() }], "overscroll-y": [{ "overscroll-y": C2() }], position: ["static", "fixed", "absolute", "relative", "sticky"], inset: [{ inset: [m2] }], "inset-x": [{ "inset-x": [m2] }], "inset-y": [{ "inset-y": [m2] }], start: [{ start: [m2] }], end: [{ end: [m2] }], top: [{ top: [m2] }], right: [{ right: [m2] }], bottom: [{ bottom: [m2] }], left: [{ left: [m2] }], visibility: ["visible", "invisible", "collapse"], z: [{ z: ["auto", N, $] }], basis: [{ basis: P2() }], "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }], "flex-wrap": [{ flex: ["wrap", "wrap-reverse", "nowrap"] }], flex: [{ flex: ["1", "auto", "initial", "none", $] }], grow: [{ grow: Z2() }], shrink: [{ shrink: Z2() }], order: [{ order: ["first", "last", "none", N, $] }], "grid-cols": [{ "grid-cols": [z] }], "col-start-end": [{ col: ["auto", { span: ["full", N, $] }, $] }], "col-start": [{ "col-start": H2() }], "col-end": [{ "col-end": H2() }], "grid-rows": [{ "grid-rows": [z] }], "row-start-end": [{ row: ["auto", { span: [N, $] }, $] }], "row-start": [{ "row-start": H2() }], "row-end": [{ "row-end": H2() }], "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }], "auto-cols": [{ "auto-cols": ["auto", "min", "max", "fr", $] }], "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", $] }], gap: [{ gap: [h2] }], "gap-x": [{ "gap-x": [h2] }], "gap-y": [{ "gap-y": [h2] }], "justify-content": [{ justify: ["normal", ...G2()] }], "justify-items": [{ "justify-items": ["start", "end", "center", "stretch"] }], "justify-self": [{ "justify-self": ["auto", "start", "end", "center", "stretch"] }], "align-content": [{ content: ["normal", ...G2(), "baseline"] }], "align-items": [{ items: ["start", "end", "center", "baseline", "stretch"] }], "align-self": [{ self: ["auto", "start", "end", "center", "stretch", "baseline"] }], "place-content": [{ "place-content": [...G2(), "baseline"] }], "place-items": [{ "place-items": ["start", "end", "center", "baseline", "stretch"] }], "place-self": [{ "place-self": ["auto", "start", "end", "center", "stretch"] }], p: [{ p: [v2] }], px: [{ px: [v2] }], py: [{ py: [v2] }], ps: [{ ps: [v2] }], pe: [{ pe: [v2] }], pt: [{ pt: [v2] }], pr: [{ pr: [v2] }], pb: [{ pb: [v2] }], pl: [{ pl: [v2] }], m: [{ m: [g2] }], mx: [{ mx: [g2] }], my: [{ my: [g2] }], ms: [{ ms: [g2] }], me: [{ me: [g2] }], mt: [{ mt: [g2] }], mr: [{ mr: [g2] }], mb: [{ mb: [g2] }], ml: [{ ml: [g2] }], "space-x": [{ "space-x": [E2] }], "space-x-reverse": ["space-x-reverse"], "space-y": [{ "space-y": [E2] }], "space-y-reverse": ["space-y-reverse"], w: [{ w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", $, t2] }], "min-w": [{ "min-w": [$, t2, "min", "max", "fit"] }], "max-w": [{ "max-w": [$, t2, "none", "full", "min", "max", "fit", "prose", { screen: [L] }, L] }], h: [{ h: [$, t2, "auto", "min", "max", "fit", "svh", "lvh", "dvh"] }], "min-h": [{ "min-h": [$, t2, "min", "max", "fit", "svh", "lvh", "dvh"] }], "max-h": [{ "max-h": [$, t2, "min", "max", "fit", "svh", "lvh", "dvh"] }], size: [{ size: [$, t2, "auto", "min", "max", "fit"] }], "font-size": [{ text: ["base", L, A] }], "font-smoothing": ["antialiased", "subpixel-antialiased"], "font-style": ["italic", "not-italic"], "font-weight": [{ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", I] }], "font-family": [{ font: [z] }], "fvn-normal": ["normal-nums"], "fvn-ordinal": ["ordinal"], "fvn-slashed-zero": ["slashed-zero"], "fvn-figure": ["lining-nums", "oldstyle-nums"], "fvn-spacing": ["proportional-nums", "tabular-nums"], "fvn-fraction": ["diagonal-fractions", "stacked-fractons"], tracking: [{ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", $] }], "line-clamp": [{ "line-clamp": ["none", O, I] }], leading: [{ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", T, $] }], "list-image": [{ "list-image": ["none", $] }], "list-style-type": [{ list: ["none", "disc", "decimal", $] }], "list-style-position": [{ list: ["inside", "outside"] }], "placeholder-color": [{ placeholder: [e2] }], "placeholder-opacity": [{ "placeholder-opacity": [y2] }], "text-alignment": [{ text: ["left", "center", "right", "justify", "start", "end"] }], "text-color": [{ text: [e2] }], "text-opacity": [{ "text-opacity": [y2] }], "text-decoration": ["underline", "overline", "line-through", "no-underline"], "text-decoration-style": [{ decoration: [...Q2(), "wavy"] }], "text-decoration-thickness": [{ decoration: ["auto", "from-font", T, A] }], "underline-offset": [{ "underline-offset": ["auto", T, $] }], "text-decoration-color": [{ decoration: [e2] }], "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"], "text-overflow": ["truncate", "text-ellipsis", "text-clip"], "text-wrap": [{ text: ["wrap", "nowrap", "balance", "pretty"] }], indent: [{ indent: j2() }], "vertical-align": [{ align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", $] }], whitespace: [{ whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"] }], break: [{ break: ["normal", "words", "all", "keep"] }], hyphens: [{ hyphens: ["none", "manual", "auto"] }], content: [{ content: ["none", $] }], "bg-attachment": [{ bg: ["fixed", "local", "scroll"] }], "bg-clip": [{ "bg-clip": ["border", "padding", "content", "text"] }], "bg-opacity": [{ "bg-opacity": [y2] }], "bg-origin": [{ "bg-origin": ["border", "padding", "content"] }], "bg-position": [{ bg: [...W2(), F] }], "bg-repeat": [{ bg: ["no-repeat", { repeat: ["", "x", "y", "round", "space"] }] }], "bg-size": [{ bg: ["auto", "cover", "contain", D] }], "bg-image": [{ bg: ["none", { "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"] }, U] }], "bg-color": [{ bg: [e2] }], "gradient-from-pos": [{ from: [p2] }], "gradient-via-pos": [{ via: [p2] }], "gradient-to-pos": [{ to: [p2] }], "gradient-from": [{ from: [f2] }], "gradient-via": [{ via: [f2] }], "gradient-to": [{ to: [f2] }], rounded: [{ rounded: [s2] }], "rounded-s": [{ "rounded-s": [s2] }], "rounded-e": [{ "rounded-e": [s2] }], "rounded-t": [{ "rounded-t": [s2] }], "rounded-r": [{ "rounded-r": [s2] }], "rounded-b": [{ "rounded-b": [s2] }], "rounded-l": [{ "rounded-l": [s2] }], "rounded-ss": [{ "rounded-ss": [s2] }], "rounded-se": [{ "rounded-se": [s2] }], "rounded-ee": [{ "rounded-ee": [s2] }], "rounded-es": [{ "rounded-es": [s2] }], "rounded-tl": [{ "rounded-tl": [s2] }], "rounded-tr": [{ "rounded-tr": [s2] }], "rounded-br": [{ "rounded-br": [s2] }], "rounded-bl": [{ "rounded-bl": [s2] }], "border-w": [{ border: [o2] }], "border-w-x": [{ "border-x": [o2] }], "border-w-y": [{ "border-y": [o2] }], "border-w-s": [{ "border-s": [o2] }], "border-w-e": [{ "border-e": [o2] }], "border-w-t": [{ "border-t": [o2] }], "border-w-r": [{ "border-r": [o2] }], "border-w-b": [{ "border-b": [o2] }], "border-w-l": [{ "border-l": [o2] }], "border-opacity": [{ "border-opacity": [y2] }], "border-style": [{ border: [...Q2(), "hidden"] }], "divide-x": [{ "divide-x": [o2] }], "divide-x-reverse": ["divide-x-reverse"], "divide-y": [{ "divide-y": [o2] }], "divide-y-reverse": ["divide-y-reverse"], "divide-opacity": [{ "divide-opacity": [y2] }], "divide-style": [{ divide: Q2() }], "border-color": [{ border: [i2] }], "border-color-x": [{ "border-x": [i2] }], "border-color-y": [{ "border-y": [i2] }], "border-color-s": [{ "border-s": [i2] }], "border-color-e": [{ "border-e": [i2] }], "border-color-t": [{ "border-t": [i2] }], "border-color-r": [{ "border-r": [i2] }], "border-color-b": [{ "border-b": [i2] }], "border-color-l": [{ "border-l": [i2] }], "divide-color": [{ divide: [i2] }], "outline-style": [{ outline: ["", ...Q2()] }], "outline-offset": [{ "outline-offset": [T, $] }], "outline-w": [{ outline: [T, A] }], "outline-color": [{ outline: [e2] }], "ring-w": [{ ring: B2() }], "ring-w-inset": ["ring-inset"], "ring-color": [{ ring: [e2] }], "ring-opacity": [{ "ring-opacity": [y2] }], "ring-offset-w": [{ "ring-offset": [T, A] }], "ring-offset-color": [{ "ring-offset": [e2] }], shadow: [{ shadow: ["", "inner", "none", L, q] }], "shadow-color": [{ shadow: [z] }], opacity: [{ opacity: [y2] }], "mix-blend": [{ "mix-blend": [...V2(), "plus-lighter", "plus-darker"] }], "bg-blend": [{ "bg-blend": V2() }], filter: [{ filter: ["", "none"] }], blur: [{ blur: [r2] }], brightness: [{ brightness: [n2] }], contrast: [{ contrast: [l2] }], "drop-shadow": [{ "drop-shadow": ["", "none", L, $] }], grayscale: [{ grayscale: [c2] }], "hue-rotate": [{ "hue-rotate": [u2] }], invert: [{ invert: [d2] }], saturate: [{ saturate: [b2] }], sepia: [{ sepia: [S2] }], "backdrop-filter": [{ "backdrop-filter": ["", "none"] }], "backdrop-blur": [{ "backdrop-blur": [r2] }], "backdrop-brightness": [{ "backdrop-brightness": [n2] }], "backdrop-contrast": [{ "backdrop-contrast": [l2] }], "backdrop-grayscale": [{ "backdrop-grayscale": [c2] }], "backdrop-hue-rotate": [{ "backdrop-hue-rotate": [u2] }], "backdrop-invert": [{ "backdrop-invert": [d2] }], "backdrop-opacity": [{ "backdrop-opacity": [y2] }], "backdrop-saturate": [{ "backdrop-saturate": [b2] }], "backdrop-sepia": [{ "backdrop-sepia": [S2] }], "border-collapse": [{ border: ["collapse", "separate"] }], "border-spacing": [{ "border-spacing": [a2] }], "border-spacing-x": [{ "border-spacing-x": [a2] }], "border-spacing-y": [{ "border-spacing-y": [a2] }], "table-layout": [{ table: ["auto", "fixed"] }], caption: [{ caption: ["top", "bottom"] }], transition: [{ transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", $] }], duration: [{ duration: J() }], ease: [{ ease: ["linear", "in", "out", "in-out", $] }], delay: [{ delay: J() }], animate: [{ animate: ["none", "spin", "ping", "pulse", "bounce", $] }], transform: [{ transform: ["", "gpu", "none"] }], scale: [{ scale: [x2] }], "scale-x": [{ "scale-x": [x2] }], "scale-y": [{ "scale-y": [x2] }], rotate: [{ rotate: [N, $] }], "translate-x": [{ "translate-x": [k2] }], "translate-y": [{ "translate-y": [k2] }], "skew-x": [{ "skew-x": [_2] }], "skew-y": [{ "skew-y": [_2] }], "transform-origin": [{ origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", $] }], accent: [{ accent: ["auto", e2] }], appearance: [{ appearance: ["none", "auto"] }], cursor: [{ cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", $] }], "caret-color": [{ caret: [e2] }], "pointer-events": [{ "pointer-events": ["none", "auto"] }], resize: [{ resize: ["none", "y", "x", ""] }], "scroll-behavior": [{ scroll: ["auto", "smooth"] }], "scroll-m": [{ "scroll-m": j2() }], "scroll-mx": [{ "scroll-mx": j2() }], "scroll-my": [{ "scroll-my": j2() }], "scroll-ms": [{ "scroll-ms": j2() }], "scroll-me": [{ "scroll-me": j2() }], "scroll-mt": [{ "scroll-mt": j2() }], "scroll-mr": [{ "scroll-mr": j2() }], "scroll-mb": [{ "scroll-mb": j2() }], "scroll-ml": [{ "scroll-ml": j2() }], "scroll-p": [{ "scroll-p": j2() }], "scroll-px": [{ "scroll-px": j2() }], "scroll-py": [{ "scroll-py": j2() }], "scroll-ps": [{ "scroll-ps": j2() }], "scroll-pe": [{ "scroll-pe": j2() }], "scroll-pt": [{ "scroll-pt": j2() }], "scroll-pr": [{ "scroll-pr": j2() }], "scroll-pb": [{ "scroll-pb": j2() }], "scroll-pl": [{ "scroll-pl": j2() }], "snap-align": [{ snap: ["start", "end", "center", "align-none"] }], "snap-stop": [{ snap: ["normal", "always"] }], "snap-type": [{ snap: ["none", "x", "y", "both"] }], "snap-strictness": [{ snap: ["mandatory", "proximity"] }], touch: [{ touch: ["auto", "none", "manipulation"] }], "touch-x": [{ "touch-pan": ["x", "left", "right"] }], "touch-y": [{ "touch-pan": ["y", "up", "down"] }], "touch-pz": ["touch-pinch-zoom"], select: [{ select: ["none", "text", "all", "auto"] }], "will-change": [{ "will-change": ["auto", "scroll", "contents", "transform", $] }], fill: [{ fill: [e2, "none"] }], "stroke-w": [{ stroke: [T, A, I] }], stroke: [{ stroke: [e2, "none"] }], sr: ["sr-only", "not-sr-only"], "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }] }, conflictingClassGroups: { overflow: ["overflow-x", "overflow-y"], overscroll: ["overscroll-x", "overscroll-y"], inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"], "inset-x": ["right", "left"], "inset-y": ["top", "bottom"], flex: ["basis", "grow", "shrink"], gap: ["gap-x", "gap-y"], p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"], px: ["pr", "pl"], py: ["pt", "pb"], m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"], mx: ["mr", "ml"], my: ["mt", "mb"], size: ["w", "h"], "font-size": ["leading"], "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"], "fvn-ordinal": ["fvn-normal"], "fvn-slashed-zero": ["fvn-normal"], "fvn-figure": ["fvn-normal"], "fvn-spacing": ["fvn-normal"], "fvn-fraction": ["fvn-normal"], "line-clamp": ["display", "overflow"], rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"], "rounded-s": ["rounded-ss", "rounded-es"], "rounded-e": ["rounded-se", "rounded-ee"], "rounded-t": ["rounded-tl", "rounded-tr"], "rounded-r": ["rounded-tr", "rounded-br"], "rounded-b": ["rounded-br", "rounded-bl"], "rounded-l": ["rounded-tl", "rounded-bl"], "border-spacing": ["border-spacing-x", "border-spacing-y"], "border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"], "border-w-x": ["border-w-r", "border-w-l"], "border-w-y": ["border-w-t", "border-w-b"], "border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"], "border-color-x": ["border-color-r", "border-color-l"], "border-color-y": ["border-color-t", "border-color-b"], "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"], "scroll-mx": ["scroll-mr", "scroll-ml"], "scroll-my": ["scroll-mt", "scroll-mb"], "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"], "scroll-px": ["scroll-pr", "scroll-pl"], "scroll-py": ["scroll-pt", "scroll-pb"], touch: ["touch-x", "touch-y", "touch-pz"], "touch-x": ["touch"], "touch-y": ["touch"], "touch-pz": ["touch"] }, conflictingClassGroupModifiers: { "font-size": ["leading"] } }; + }); + }; + __namedExportsObject5["__chunk_8865"] = (e, t, r) => { + "use strict"; + r.d(t, { A: () => g, Toaster: () => w }); + var n = r(49398), i = r(35703), s = (e2) => { + switch (e2) { + case "success": + return l; + case "info": + return u; + case "warning": + return c; + case "error": + return d; + default: + return null; + } + }, a = Array(12).fill(0), o = ({ visible: e2 }) => n.createElement("div", { className: "sonner-loading-wrapper", "data-visible": e2 }, n.createElement("div", { className: "sonner-spinner" }, a.map((e3, t2) => n.createElement("div", { className: "sonner-loading-bar", key: `spinner-bar-${t2}` })))), l = n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, n.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" })), c = n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: "20", width: "20" }, n.createElement("path", { fillRule: "evenodd", d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" })), u = n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, n.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" })), d = n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, n.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" })), h = () => { + let [e2, t2] = n.useState(document.hidden); + return n.useEffect(() => { + let e3 = () => { + t2(document.hidden); + }; + return document.addEventListener("visibilitychange", e3), () => window.removeEventListener("visibilitychange", e3); + }, []), e2; + }, f = 1, p = new class { + constructor() { + this.subscribe = (e2) => (this.subscribers.push(e2), () => { + let t2 = this.subscribers.indexOf(e2); + this.subscribers.splice(t2, 1); + }), this.publish = (e2) => { + this.subscribers.forEach((t2) => t2(e2)); + }, this.addToast = (e2) => { + this.publish(e2), this.toasts = [...this.toasts, e2]; + }, this.create = (e2) => { + var t2; + let { message: r2, ...n2 } = e2, i2 = "number" == typeof (null == e2 ? void 0 : e2.id) || (null == (t2 = e2.id) ? void 0 : t2.length) > 0 ? e2.id : f++, s2 = this.toasts.find((e3) => e3.id === i2), a2 = void 0 === e2.dismissible || e2.dismissible; + return s2 ? this.toasts = this.toasts.map((t3) => t3.id === i2 ? (this.publish({ ...t3, ...e2, id: i2, title: r2 }), { ...t3, ...e2, id: i2, dismissible: a2, title: r2 }) : t3) : this.addToast({ title: r2, ...n2, dismissible: a2, id: i2 }), i2; + }, this.dismiss = (e2) => (e2 || this.toasts.forEach((e3) => { + this.subscribers.forEach((t2) => t2({ id: e3.id, dismiss: true })); + }), this.subscribers.forEach((t2) => t2({ id: e2, dismiss: true })), e2), this.message = (e2, t2) => this.create({ ...t2, message: e2 }), this.error = (e2, t2) => this.create({ ...t2, message: e2, type: "error" }), this.success = (e2, t2) => this.create({ ...t2, type: "success", message: e2 }), this.info = (e2, t2) => this.create({ ...t2, type: "info", message: e2 }), this.warning = (e2, t2) => this.create({ ...t2, type: "warning", message: e2 }), this.loading = (e2, t2) => this.create({ ...t2, type: "loading", message: e2 }), this.promise = (e2, t2) => { + let r2; + if (!t2) + return; + void 0 !== t2.loading && (r2 = this.create({ ...t2, promise: e2, type: "loading", message: t2.loading, description: "function" != typeof t2.description ? t2.description : void 0 })); + let n2 = e2 instanceof Promise ? e2 : e2(), i2 = void 0 !== r2; + return n2.then(async (e3) => { + if (m(e3) && !e3.ok) { + i2 = false; + let n3 = "function" == typeof t2.error ? await t2.error(`HTTP error! status: ${e3.status}`) : t2.error, s2 = "function" == typeof t2.description ? await t2.description(`HTTP error! status: ${e3.status}`) : t2.description; + this.create({ id: r2, type: "error", message: n3, description: s2 }); + } else if (void 0 !== t2.success) { + i2 = false; + let n3 = "function" == typeof t2.success ? await t2.success(e3) : t2.success, s2 = "function" == typeof t2.description ? await t2.description(e3) : t2.description; + this.create({ id: r2, type: "success", message: n3, description: s2 }); + } + }).catch(async (e3) => { + if (void 0 !== t2.error) { + i2 = false; + let n3 = "function" == typeof t2.error ? await t2.error(e3) : t2.error, s2 = "function" == typeof t2.description ? await t2.description(e3) : t2.description; + this.create({ id: r2, type: "error", message: n3, description: s2 }); + } + }).finally(() => { + var e3; + i2 && (this.dismiss(r2), r2 = void 0), null == (e3 = t2.finally) || e3.call(t2); + }), r2; + }, this.custom = (e2, t2) => { + let r2 = (null == t2 ? void 0 : t2.id) || f++; + return this.create({ jsx: e2(r2), id: r2, ...t2 }), r2; + }, this.subscribers = [], this.toasts = []; + } + }(), m = (e2) => e2 && "object" == typeof e2 && "ok" in e2 && "boolean" == typeof e2.ok && "status" in e2 && "number" == typeof e2.status, g = Object.assign((e2, t2) => { + let r2 = (null == t2 ? void 0 : t2.id) || f++; + return p.addToast({ title: e2, ...t2, id: r2 }), r2; + }, { success: p.success, info: p.info, warning: p.warning, error: p.error, custom: p.custom, message: p.message, promise: p.promise, dismiss: p.dismiss, loading: p.loading }, { getHistory: () => p.toasts }); + function y(e2) { + return void 0 !== e2.label; + } + function v(...e2) { + return e2.filter(Boolean).join(" "); + } + !function(e2, { insertAt: t2 } = {}) { + if (!e2 || "undefined" == typeof document) + return; + let r2 = document.head || document.getElementsByTagName("head")[0], n2 = document.createElement("style"); + n2.type = "text/css", "top" === t2 && r2.firstChild ? r2.insertBefore(n2, r2.firstChild) : r2.appendChild(n2), n2.styleSheet ? n2.styleSheet.cssText = e2 : n2.appendChild(document.createTextNode(e2)); + }(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} +`); + var b = (e2) => { + var t2, r2, i2, a2, l2, c2, u2, d2, f2, p2; + let { invert: m2, toast: g2, unstyled: v2, interacting: b2, setHeights: w2, visibleToasts: x, heights: S, index: _, toasts: E, expanded: k, removeToast: C, defaultRichColors: R, closeButton: P, style: T, cancelButtonStyle: A, actionButtonStyle: O, className: I = "", descriptionClassName: N = "", duration: M, position: $, gap: L, loadingIcon: j, expandByDefault: D, classNames: F, icons: B, closeButtonAriaLabel: U = "Close toast", pauseWhenPageIsHidden: q, cn: z } = e2, [H, W] = n.useState(false), [Q, V] = n.useState(false), [G, Z] = n.useState(false), [K, J] = n.useState(false), [Y, X] = n.useState(0), [ee, et] = n.useState(0), er = n.useRef(null), en = n.useRef(null), ei = 0 === _, es = _ + 1 <= x, ea = g2.type, eo = false !== g2.dismissible, el = g2.className || "", ec = g2.descriptionClassName || "", eu = n.useMemo(() => S.findIndex((e3) => e3.toastId === g2.id) || 0, [S, g2.id]), ed = n.useMemo(() => { + var e3; + return null != (e3 = g2.closeButton) ? e3 : P; + }, [g2.closeButton, P]), eh = n.useMemo(() => g2.duration || M || 4e3, [g2.duration, M]), ef = n.useRef(0), ep = n.useRef(0), em = n.useRef(0), eg = n.useRef(null), [ey, ev] = $.split("-"), eb = n.useMemo(() => S.reduce((e3, t3, r3) => r3 >= eu ? e3 : e3 + t3.height, 0), [S, eu]), ew = h(), ex = g2.invert || m2, eS = "loading" === ea; + ep.current = n.useMemo(() => eu * L + eb, [eu, eb]), n.useEffect(() => { + W(true); + }, []), n.useLayoutEffect(() => { + if (!H) + return; + let e3 = en.current, t3 = e3.style.height; + e3.style.height = "auto"; + let r3 = e3.getBoundingClientRect().height; + e3.style.height = t3, et(r3), w2((e4) => e4.find((e5) => e5.toastId === g2.id) ? e4.map((e5) => e5.toastId === g2.id ? { ...e5, height: r3 } : e5) : [{ toastId: g2.id, height: r3, position: g2.position }, ...e4]); + }, [H, g2.title, g2.description, w2, g2.id]); + let e_ = n.useCallback(() => { + V(true), X(ep.current), w2((e3) => e3.filter((e4) => e4.toastId !== g2.id)), setTimeout(() => { + C(g2); + }, 200); + }, [g2, C, w2, ep]); + return n.useEffect(() => { + if (g2.promise && "loading" === ea || g2.duration === 1 / 0 || "loading" === g2.type) + return; + let e3, t3 = eh; + return k || b2 || q && ew ? (() => { + if (em.current < ef.current) { + let e4 = (/* @__PURE__ */ new Date()).getTime() - ef.current; + t3 -= e4; + } + em.current = (/* @__PURE__ */ new Date()).getTime(); + })() : t3 !== 1 / 0 && (ef.current = (/* @__PURE__ */ new Date()).getTime(), e3 = setTimeout(() => { + var e4; + null == (e4 = g2.onAutoClose) || e4.call(g2, g2), e_(); + }, t3)), () => clearTimeout(e3); + }, [k, b2, D, g2, eh, e_, g2.promise, ea, q, ew]), n.useEffect(() => { + let e3 = en.current; + if (e3) { + let t3 = e3.getBoundingClientRect().height; + return et(t3), w2((e4) => [{ toastId: g2.id, height: t3, position: g2.position }, ...e4]), () => w2((e4) => e4.filter((e5) => e5.toastId !== g2.id)); + } + }, [w2, g2.id]), n.useEffect(() => { + g2.delete && e_(); + }, [e_, g2.delete]), n.createElement("li", { "aria-live": g2.important ? "assertive" : "polite", "aria-atomic": "true", role: "status", tabIndex: 0, ref: en, className: z(I, el, null == F ? void 0 : F.toast, null == (t2 = null == g2 ? void 0 : g2.classNames) ? void 0 : t2.toast, null == F ? void 0 : F.default, null == F ? void 0 : F[ea], null == (r2 = null == g2 ? void 0 : g2.classNames) ? void 0 : r2[ea]), "data-sonner-toast": "", "data-rich-colors": null != (i2 = g2.richColors) ? i2 : R, "data-styled": !(g2.jsx || g2.unstyled || v2), "data-mounted": H, "data-promise": !!g2.promise, "data-removed": Q, "data-visible": es, "data-y-position": ey, "data-x-position": ev, "data-index": _, "data-front": ei, "data-swiping": G, "data-dismissible": eo, "data-type": ea, "data-invert": ex, "data-swipe-out": K, "data-expanded": !!(k || D && H), style: { "--index": _, "--toasts-before": _, "--z-index": E.length - _, "--offset": `${Q ? Y : ep.current}px`, "--initial-height": D ? "auto" : `${ee}px`, ...T, ...g2.style }, onPointerDown: (e3) => { + eS || !eo || (er.current = /* @__PURE__ */ new Date(), X(ep.current), e3.target.setPointerCapture(e3.pointerId), "BUTTON" !== e3.target.tagName && (Z(true), eg.current = { x: e3.clientX, y: e3.clientY })); + }, onPointerUp: () => { + var e3, t3, r3, n2; + if (K || !eo) + return; + eg.current = null; + let i3 = Number((null == (e3 = en.current) ? void 0 : e3.style.getPropertyValue("--swipe-amount").replace("px", "")) || 0), s2 = Math.abs(i3) / ((/* @__PURE__ */ new Date()).getTime() - (null == (t3 = er.current) ? void 0 : t3.getTime())); + if (Math.abs(i3) >= 20 || s2 > 0.11) { + X(ep.current), null == (r3 = g2.onDismiss) || r3.call(g2, g2), e_(), J(true); + return; + } + null == (n2 = en.current) || n2.style.setProperty("--swipe-amount", "0px"), Z(false); + }, onPointerMove: (e3) => { + var t3; + if (!eg.current || !eo) + return; + let r3 = e3.clientY - eg.current.y, n2 = e3.clientX - eg.current.x, i3 = ("top" === ey ? Math.min : Math.max)(0, r3), s2 = "touch" === e3.pointerType ? 10 : 2; + Math.abs(i3) > s2 ? null == (t3 = en.current) || t3.style.setProperty("--swipe-amount", `${r3}px`) : Math.abs(n2) > s2 && (eg.current = null); + } }, ed && !g2.jsx ? n.createElement("button", { "aria-label": U, "data-disabled": eS, "data-close-button": true, onClick: eS || !eo ? () => { + } : () => { + var e3; + e_(), null == (e3 = g2.onDismiss) || e3.call(g2, g2); + }, className: z(null == F ? void 0 : F.closeButton, null == (a2 = null == g2 ? void 0 : g2.classNames) ? void 0 : a2.closeButton) }, n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }, n.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), n.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))) : null, g2.jsx || n.isValidElement(g2.title) ? g2.jsx || g2.title : n.createElement(n.Fragment, null, ea || g2.icon || g2.promise ? n.createElement("div", { "data-icon": "", className: z(null == F ? void 0 : F.icon, null == (l2 = null == g2 ? void 0 : g2.classNames) ? void 0 : l2.icon) }, g2.promise || "loading" === g2.type && !g2.icon ? g2.icon || (null != B && B.loading ? n.createElement("div", { className: "sonner-loader", "data-visible": "loading" === ea }, B.loading) : j ? n.createElement("div", { className: "sonner-loader", "data-visible": "loading" === ea }, j) : n.createElement(o, { visible: "loading" === ea })) : null, "loading" !== g2.type ? g2.icon || (null == B ? void 0 : B[ea]) || s(ea) : null) : null, n.createElement("div", { "data-content": "", className: z(null == F ? void 0 : F.content, null == (c2 = null == g2 ? void 0 : g2.classNames) ? void 0 : c2.content) }, n.createElement("div", { "data-title": "", className: z(null == F ? void 0 : F.title, null == (u2 = null == g2 ? void 0 : g2.classNames) ? void 0 : u2.title) }, g2.title), g2.description ? n.createElement("div", { "data-description": "", className: z(N, ec, null == F ? void 0 : F.description, null == (d2 = null == g2 ? void 0 : g2.classNames) ? void 0 : d2.description) }, g2.description) : null), n.isValidElement(g2.cancel) ? g2.cancel : g2.cancel && y(g2.cancel) ? n.createElement("button", { "data-button": true, "data-cancel": true, style: g2.cancelButtonStyle || A, onClick: (e3) => { + var t3, r3; + y(g2.cancel) && eo && (null == (r3 = (t3 = g2.cancel).onClick) || r3.call(t3, e3), e_()); + }, className: z(null == F ? void 0 : F.cancelButton, null == (f2 = null == g2 ? void 0 : g2.classNames) ? void 0 : f2.cancelButton) }, g2.cancel.label) : null, n.isValidElement(g2.action) ? g2.action : g2.action && y(g2.action) ? n.createElement("button", { "data-button": true, "data-action": true, style: g2.actionButtonStyle || O, onClick: (e3) => { + var t3, r3; + y(g2.action) && (e3.defaultPrevented || (null == (r3 = (t3 = g2.action).onClick) || r3.call(t3, e3), e_())); + }, className: z(null == F ? void 0 : F.actionButton, null == (p2 = null == g2 ? void 0 : g2.classNames) ? void 0 : p2.actionButton) }, g2.action.label) : null)); + }, w = (e2) => { + let { invert: t2, position: r2 = "bottom-right", hotkey: s2 = ["altKey", "KeyT"], expand: a2, closeButton: o2, className: l2, offset: c2, theme: u2 = "light", richColors: d2, duration: h2, style: f2, visibleToasts: m2 = 3, toastOptions: g2, dir: y2 = "ltr", gap: w2 = 14, loadingIcon: x, icons: S, containerAriaLabel: _ = "Notifications", pauseWhenPageIsHidden: E, cn: k = v } = e2, [C, R] = n.useState([]), P = n.useMemo(() => Array.from(new Set([r2].concat(C.filter((e3) => e3.position).map((e3) => e3.position)))), [C, r2]), [T, A] = n.useState([]), [O, I] = n.useState(false), [N, M] = n.useState(false), [$, L] = n.useState("system" !== u2 ? u2 : "light"), j = n.useRef(null), D = s2.join("+").replace(/Key/g, "").replace(/Digit/g, ""), F = n.useRef(null), B = n.useRef(false), U = n.useCallback((e3) => { + var t3; + null != (t3 = C.find((t4) => t4.id === e3.id)) && t3.delete || p.dismiss(e3.id), R((t4) => t4.filter(({ id: t5 }) => t5 !== e3.id)); + }, [C]); + return n.useEffect(() => p.subscribe((e3) => { + if (e3.dismiss) { + R((t3) => t3.map((t4) => t4.id === e3.id ? { ...t4, delete: true } : t4)); + return; + } + setTimeout(() => { + i.flushSync(() => { + R((t3) => { + let r3 = t3.findIndex((t4) => t4.id === e3.id); + return -1 !== r3 ? [...t3.slice(0, r3), { ...t3[r3], ...e3 }, ...t3.slice(r3 + 1)] : [e3, ...t3]; + }); + }); + }); + }), []), n.useEffect(() => { + if ("system" !== u2) { + L(u2); + return; + } + "system" === u2 && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? L("dark") : L("light")); + }, [u2]), n.useEffect(() => { + C.length <= 1 && I(false); + }, [C]), n.useEffect(() => { + let e3 = (e4) => { + var t3, r3; + s2.every((t4) => e4[t4] || e4.code === t4) && (I(true), null == (t3 = j.current) || t3.focus()), "Escape" === e4.code && (document.activeElement === j.current || null != (r3 = j.current) && r3.contains(document.activeElement)) && I(false); + }; + return document.addEventListener("keydown", e3), () => document.removeEventListener("keydown", e3); + }, [s2]), n.useEffect(() => { + if (j.current) + return () => { + F.current && (F.current.focus({ preventScroll: true }), F.current = null, B.current = false); + }; + }, [j.current]), C.length ? n.createElement("section", { "aria-label": `${_} ${D}`, tabIndex: -1 }, P.map((e3, r3) => { + var i2; + let [s3, u3] = e3.split("-"); + return n.createElement("ol", { key: e3, dir: "auto" === y2 ? "ltr" : y2, tabIndex: -1, ref: j, className: l2, "data-sonner-toaster": true, "data-theme": $, "data-y-position": s3, "data-x-position": u3, style: { "--front-toast-height": `${(null == (i2 = T[0]) ? void 0 : i2.height) || 0}px`, "--offset": "number" == typeof c2 ? `${c2}px` : c2 || "32px", "--width": "356px", "--gap": `${w2}px`, ...f2 }, onBlur: (e4) => { + B.current && !e4.currentTarget.contains(e4.relatedTarget) && (B.current = false, F.current && (F.current.focus({ preventScroll: true }), F.current = null)); + }, onFocus: (e4) => { + e4.target instanceof HTMLElement && "false" === e4.target.dataset.dismissible || B.current || (B.current = true, F.current = e4.relatedTarget); + }, onMouseEnter: () => I(true), onMouseMove: () => I(true), onMouseLeave: () => { + N || I(false); + }, onPointerDown: (e4) => { + e4.target instanceof HTMLElement && "false" === e4.target.dataset.dismissible || M(true); + }, onPointerUp: () => M(false) }, C.filter((t3) => !t3.position && 0 === r3 || t3.position === e3).map((r4, i3) => { + var s4, l3; + return n.createElement(b, { key: r4.id, icons: S, index: i3, toast: r4, defaultRichColors: d2, duration: null != (s4 = null == g2 ? void 0 : g2.duration) ? s4 : h2, className: null == g2 ? void 0 : g2.className, descriptionClassName: null == g2 ? void 0 : g2.descriptionClassName, invert: t2, visibleToasts: m2, closeButton: null != (l3 = null == g2 ? void 0 : g2.closeButton) ? l3 : o2, interacting: N, position: e3, style: null == g2 ? void 0 : g2.style, unstyled: null == g2 ? void 0 : g2.unstyled, classNames: null == g2 ? void 0 : g2.classNames, cancelButtonStyle: null == g2 ? void 0 : g2.cancelButtonStyle, actionButtonStyle: null == g2 ? void 0 : g2.actionButtonStyle, removeToast: U, toasts: C.filter((e4) => e4.position == r4.position), heights: T.filter((e4) => e4.position == r4.position), setHeights: A, expandByDefault: a2, gap: w2, loadingIcon: x, expanded: O, pauseWhenPageIsHidden: E, cn: k }); + })); + })) : null; + }; + }; + __namedExportsObject5["__chunk_18137"] = (e, t, r) => { + "use strict"; + function n() { + for (var e2, t2, r2 = 0, n2 = "", i = arguments.length; r2 < i; r2++) + (e2 = arguments[r2]) && (t2 = function e3(t3) { + var r3, n3, i2 = ""; + if ("string" == typeof t3 || "number" == typeof t3) + i2 += t3; + else if ("object" == typeof t3) { + if (Array.isArray(t3)) { + var s = t3.length; + for (r3 = 0; r3 < s; r3++) + t3[r3] && (n3 = e3(t3[r3])) && (i2 && (i2 += " "), i2 += n3); + } else + for (n3 in t3) + t3[n3] && (i2 && (i2 += " "), i2 += n3); + } + return i2; + }(e2)) && (n2 && (n2 += " "), n2 += t2); + return n2; + } + r.d(t, { W: () => n }); + }; + __namedExportsObject5["__chunk_44877"] = (e, t, r) => { + "use strict"; + r.d(t, { j: () => s }); + let n = (e2) => "boolean" == typeof e2 ? "".concat(e2) : 0 === e2 ? "0" : e2, i = function() { + for (var e2, t2, r2 = 0, n2 = ""; r2 < arguments.length; ) + (e2 = arguments[r2++]) && (t2 = function e3(t3) { + var r3, n3, i2 = ""; + if ("string" == typeof t3 || "number" == typeof t3) + i2 += t3; + else if ("object" == typeof t3) { + if (Array.isArray(t3)) + for (r3 = 0; r3 < t3.length; r3++) + t3[r3] && (n3 = e3(t3[r3])) && (i2 && (i2 += " "), i2 += n3); + else + for (r3 in t3) + t3[r3] && (i2 && (i2 += " "), i2 += r3); + } + return i2; + }(e2)) && (n2 && (n2 += " "), n2 += t2); + return n2; + }, s = (e2, t2) => (r2) => { + var s2; + if ((null == t2 ? void 0 : t2.variants) == null) + return i(e2, null == r2 ? void 0 : r2.class, null == r2 ? void 0 : r2.className); + let { variants: a, defaultVariants: o } = t2, l = Object.keys(a).map((e3) => { + let t3 = null == r2 ? void 0 : r2[e3], i2 = null == o ? void 0 : o[e3]; + if (null === t3) + return null; + let s3 = n(t3) || n(i2); + return a[e3][s3]; + }), c = r2 && Object.entries(r2).reduce((e3, t3) => { + let [r3, n2] = t3; + return void 0 === n2 || (e3[r3] = n2), e3; + }, {}); + return i(e2, l, null == t2 ? void 0 : null === (s2 = t2.compoundVariants) || void 0 === s2 ? void 0 : s2.reduce((e3, t3) => { + let { class: r3, className: n2, ...i2 } = t3; + return Object.entries(i2).every((e4) => { + let [t4, r4] = e4; + return Array.isArray(r4) ? r4.includes({ ...o, ...c }[t4]) : { ...o, ...c }[t4] === r4; + }) ? [...e3, r3, n2] : e3; + }, []), null == r2 ? void 0 : r2.class, null == r2 ? void 0 : r2.className); + }; + }; + __namedExportsObject5["__chunk_18561"] = (e, t, r) => { + "use strict"; + r.d(t, { Analytics: () => n }), r(49398); + function n(e2) { + return null; + } + }; + __namedExportsObject5["__chunk_28111"] = (e, t, r) => { + "use strict"; + r.d(t, { b: () => i }); + var n = r(49398), i = globalThis2?.document ? n.useLayoutEffect : () => { + }; + }; + __namedExportsObject5["__chunk_74313"] = (e, t, r) => { + "use strict"; + r.d(t, { W: () => i }); + var n = r(49398); + function i(e2) { + let t2 = n.useRef(e2); + return n.useEffect(() => { + t2.current = e2; + }), n.useMemo(() => (...e3) => t2.current?.(...e3), []); + } + }; + __namedExportsObject5["__chunk_87796"] = (e, t, r) => { + "use strict"; + r.d(t, { g7: () => a }); + var n = r(49398), i = r(63554), s = r(73435), a = n.forwardRef((e2, t2) => { + let { children: r2, ...i2 } = e2, a2 = n.Children.toArray(r2), l2 = a2.find(c); + if (l2) { + let e3 = l2.props.children, r3 = a2.map((t3) => t3 !== l2 ? t3 : n.Children.count(e3) > 1 ? n.Children.only(null) : n.isValidElement(e3) ? e3.props.children : null); + return (0, s.jsx)(o, { ...i2, ref: t2, children: n.isValidElement(e3) ? n.cloneElement(e3, void 0, r3) : null }); + } + return (0, s.jsx)(o, { ...i2, ref: t2, children: r2 }); + }); + a.displayName = "Slot"; + var o = n.forwardRef((e2, t2) => { + let { children: r2, ...s2 } = e2; + if (n.isValidElement(r2)) { + let e3 = function(e4) { + let t3 = Object.getOwnPropertyDescriptor(e4.props, "ref")?.get, r3 = t3 && "isReactWarning" in t3 && t3.isReactWarning; + return r3 ? e4.ref : (r3 = (t3 = Object.getOwnPropertyDescriptor(e4, "ref")?.get) && "isReactWarning" in t3 && t3.isReactWarning) ? e4.props.ref : e4.props.ref || e4.ref; + }(r2); + return n.cloneElement(r2, { ...function(e4, t3) { + let r3 = { ...t3 }; + for (let n2 in t3) { + let i2 = e4[n2], s3 = t3[n2]; + /^on[A-Z]/.test(n2) ? i2 && s3 ? r3[n2] = (...e5) => { + s3(...e5), i2(...e5); + } : i2 && (r3[n2] = i2) : "style" === n2 ? r3[n2] = { ...i2, ...s3 } : "className" === n2 && (r3[n2] = [i2, s3].filter(Boolean).join(" ")); + } + return { ...e4, ...r3 }; + }(s2, r2.props), ref: t2 ? (0, i.F)(t2, e3) : e3 }); + } + return n.Children.count(r2) > 1 ? n.Children.only(null) : null; + }); + o.displayName = "SlotClone"; + var l = ({ children: e2 }) => (0, s.jsx)(s.Fragment, { children: e2 }); + function c(e2) { + return n.isValidElement(e2) && e2.type === l; + } + }; + __namedExportsObject5["__chunk_72340"] = (e, t, r) => { + "use strict"; + r.d(t, { Ns: () => G, fC: () => Q, gb: () => S, q4: () => N, l_: () => V }); + var n = r(49398), i = r(62518), s = r(27217), a = r(45432), o = r(63554), l = r(74313), c = r(73435), u = n.createContext(void 0), d = r(28111), h = r(78777), f = "ScrollArea", [p, m] = (0, a.b)(f), [g, y] = p(f), v = n.forwardRef((e2, t2) => { + let { __scopeScrollArea: r2, type: s2 = "hover", dir: a2, scrollHideDelay: l2 = 600, ...d2 } = e2, [h2, f2] = n.useState(null), [p2, m2] = n.useState(null), [y2, v2] = n.useState(null), [b2, w2] = n.useState(null), [x2, S2] = n.useState(null), [_2, E2] = n.useState(0), [k2, C2] = n.useState(0), [R2, P2] = n.useState(false), [T2, A2] = n.useState(false), O2 = (0, o.e)(t2, (e3) => f2(e3)), I2 = function(e3) { + let t3 = n.useContext(u); + return e3 || t3 || "ltr"; + }(a2); + return (0, c.jsx)(g, { scope: r2, type: s2, dir: I2, scrollHideDelay: l2, scrollArea: h2, viewport: p2, onViewportChange: m2, content: y2, onContentChange: v2, scrollbarX: b2, onScrollbarXChange: w2, scrollbarXEnabled: R2, onScrollbarXEnabledChange: P2, scrollbarY: x2, onScrollbarYChange: S2, scrollbarYEnabled: T2, onScrollbarYEnabledChange: A2, onCornerWidthChange: E2, onCornerHeightChange: C2, children: (0, c.jsx)(i.WV.div, { dir: I2, ...d2, ref: O2, style: { position: "relative", "--radix-scroll-area-corner-width": _2 + "px", "--radix-scroll-area-corner-height": k2 + "px", ...e2.style } }) }); + }); + v.displayName = f; + var b = "ScrollAreaViewport", w = n.forwardRef((e2, t2) => { + let { __scopeScrollArea: r2, children: s2, asChild: a2, nonce: l2, ...u2 } = e2, d2 = y(b, r2), h2 = n.useRef(null), f2 = (0, o.e)(t2, h2, d2.onViewportChange); + return (0, c.jsxs)(c.Fragment, { children: [(0, c.jsx)("style", { dangerouslySetInnerHTML: { __html: ` +[data-radix-scroll-area-viewport] { + scrollbar-width: none; + -ms-overflow-style: none; + -webkit-overflow-scrolling: touch; +} +[data-radix-scroll-area-viewport]::-webkit-scrollbar { + display: none; +} +:where([data-radix-scroll-area-viewport]) { + display: flex; + flex-direction: column; + align-items: stretch; +} +:where([data-radix-scroll-area-content]) { + flex-grow: 1; +} +` }, nonce: l2 }), (0, c.jsx)(i.WV.div, { "data-radix-scroll-area-viewport": "", ...u2, asChild: a2, ref: f2, style: { overflowX: d2.scrollbarXEnabled ? "scroll" : "hidden", overflowY: d2.scrollbarYEnabled ? "scroll" : "hidden", ...e2.style }, children: function(e3, t3) { + let { asChild: r3, children: i2 } = e3; + if (!r3) + return "function" == typeof t3 ? t3(i2) : t3; + let s3 = n.Children.only(i2); + return n.cloneElement(s3, { children: "function" == typeof t3 ? t3(s3.props.children) : t3 }); + }({ asChild: a2, children: s2 }, (e3) => (0, c.jsx)("div", { "data-radix-scroll-area-content": "", ref: d2.onContentChange, style: { minWidth: d2.scrollbarXEnabled ? "fit-content" : void 0 }, children: e3 })) })] }); + }); + w.displayName = b; + var x = "ScrollAreaScrollbar", S = n.forwardRef((e2, t2) => { + let { forceMount: r2, ...i2 } = e2, s2 = y(x, e2.__scopeScrollArea), { onScrollbarXEnabledChange: a2, onScrollbarYEnabledChange: o2 } = s2, l2 = "horizontal" === e2.orientation; + return n.useEffect(() => (l2 ? a2(true) : o2(true), () => { + l2 ? a2(false) : o2(false); + }), [l2, a2, o2]), "hover" === s2.type ? (0, c.jsx)(_, { ...i2, ref: t2, forceMount: r2 }) : "scroll" === s2.type ? (0, c.jsx)(E, { ...i2, ref: t2, forceMount: r2 }) : "auto" === s2.type ? (0, c.jsx)(k, { ...i2, ref: t2, forceMount: r2 }) : "always" === s2.type ? (0, c.jsx)(C, { ...i2, ref: t2 }) : null; + }); + S.displayName = x; + var _ = n.forwardRef((e2, t2) => { + let { forceMount: r2, ...i2 } = e2, a2 = y(x, e2.__scopeScrollArea), [o2, l2] = n.useState(false); + return n.useEffect(() => { + let e3 = a2.scrollArea, t3 = 0; + if (e3) { + let r3 = () => { + window.clearTimeout(t3), l2(true); + }, n2 = () => { + t3 = window.setTimeout(() => l2(false), a2.scrollHideDelay); + }; + return e3.addEventListener("pointerenter", r3), e3.addEventListener("pointerleave", n2), () => { + window.clearTimeout(t3), e3.removeEventListener("pointerenter", r3), e3.removeEventListener("pointerleave", n2); + }; + } + }, [a2.scrollArea, a2.scrollHideDelay]), (0, c.jsx)(s.z, { present: r2 || o2, children: (0, c.jsx)(k, { "data-state": o2 ? "visible" : "hidden", ...i2, ref: t2 }) }); + }), E = n.forwardRef((e2, t2) => { + var r2, i2; + let { forceMount: a2, ...o2 } = e2, l2 = y(x, e2.__scopeScrollArea), u2 = "horizontal" === e2.orientation, d2 = H(() => p2("SCROLL_END"), 100), [f2, p2] = (r2 = "hidden", i2 = { hidden: { SCROLL: "scrolling" }, scrolling: { SCROLL_END: "idle", POINTER_ENTER: "interacting" }, interacting: { SCROLL: "interacting", POINTER_LEAVE: "idle" }, idle: { HIDE: "hidden", SCROLL: "scrolling", POINTER_ENTER: "interacting" } }, n.useReducer((e3, t3) => i2[e3][t3] ?? e3, r2)); + return n.useEffect(() => { + if ("idle" === f2) { + let e3 = window.setTimeout(() => p2("HIDE"), l2.scrollHideDelay); + return () => window.clearTimeout(e3); + } + }, [f2, l2.scrollHideDelay, p2]), n.useEffect(() => { + let e3 = l2.viewport, t3 = u2 ? "scrollLeft" : "scrollTop"; + if (e3) { + let r3 = e3[t3], n2 = () => { + let n3 = e3[t3]; + r3 !== n3 && (p2("SCROLL"), d2()), r3 = n3; + }; + return e3.addEventListener("scroll", n2), () => e3.removeEventListener("scroll", n2); + } + }, [l2.viewport, u2, p2, d2]), (0, c.jsx)(s.z, { present: a2 || "hidden" !== f2, children: (0, c.jsx)(C, { "data-state": "hidden" === f2 ? "hidden" : "visible", ...o2, ref: t2, onPointerEnter: (0, h.M)(e2.onPointerEnter, () => p2("POINTER_ENTER")), onPointerLeave: (0, h.M)(e2.onPointerLeave, () => p2("POINTER_LEAVE")) }) }); + }), k = n.forwardRef((e2, t2) => { + let r2 = y(x, e2.__scopeScrollArea), { forceMount: i2, ...a2 } = e2, [o2, l2] = n.useState(false), u2 = "horizontal" === e2.orientation, d2 = H(() => { + if (r2.viewport) { + let e3 = r2.viewport.offsetWidth < r2.viewport.scrollWidth, t3 = r2.viewport.offsetHeight < r2.viewport.scrollHeight; + l2(u2 ? e3 : t3); + } + }, 10); + return W(r2.viewport, d2), W(r2.content, d2), (0, c.jsx)(s.z, { present: i2 || o2, children: (0, c.jsx)(C, { "data-state": o2 ? "visible" : "hidden", ...a2, ref: t2 }) }); + }), C = n.forwardRef((e2, t2) => { + let { orientation: r2 = "vertical", ...i2 } = e2, s2 = y(x, e2.__scopeScrollArea), a2 = n.useRef(null), o2 = n.useRef(0), [l2, u2] = n.useState({ content: 0, viewport: 0, scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 } }), d2 = F(l2.viewport, l2.content), h2 = { ...i2, sizes: l2, onSizesChange: u2, hasThumb: !!(d2 > 0 && d2 < 1), onThumbChange: (e3) => a2.current = e3, onThumbPointerUp: () => o2.current = 0, onThumbPointerDown: (e3) => o2.current = e3 }; + function f2(e3, t3) { + return function(e4, t4, r3, n2 = "ltr") { + let i3 = B(r3), s3 = t4 || i3 / 2, a3 = r3.scrollbar.paddingStart + s3, o3 = r3.scrollbar.size - r3.scrollbar.paddingEnd - (i3 - s3), l3 = r3.content - r3.viewport; + return q([a3, o3], "ltr" === n2 ? [0, l3] : [-1 * l3, 0])(e4); + }(e3, o2.current, l2, t3); + } + return "horizontal" === r2 ? (0, c.jsx)(R, { ...h2, ref: t2, onThumbPositionChange: () => { + if (s2.viewport && a2.current) { + let e3 = U(s2.viewport.scrollLeft, l2, s2.dir); + a2.current.style.transform = `translate3d(${e3}px, 0, 0)`; + } + }, onWheelScroll: (e3) => { + s2.viewport && (s2.viewport.scrollLeft = e3); + }, onDragScroll: (e3) => { + s2.viewport && (s2.viewport.scrollLeft = f2(e3, s2.dir)); + } }) : "vertical" === r2 ? (0, c.jsx)(P, { ...h2, ref: t2, onThumbPositionChange: () => { + if (s2.viewport && a2.current) { + let e3 = U(s2.viewport.scrollTop, l2); + a2.current.style.transform = `translate3d(0, ${e3}px, 0)`; + } + }, onWheelScroll: (e3) => { + s2.viewport && (s2.viewport.scrollTop = e3); + }, onDragScroll: (e3) => { + s2.viewport && (s2.viewport.scrollTop = f2(e3)); + } }) : null; + }), R = n.forwardRef((e2, t2) => { + let { sizes: r2, onSizesChange: i2, ...s2 } = e2, a2 = y(x, e2.__scopeScrollArea), [l2, u2] = n.useState(), d2 = n.useRef(null), h2 = (0, o.e)(t2, d2, a2.onScrollbarXChange); + return n.useEffect(() => { + d2.current && u2(getComputedStyle(d2.current)); + }, [d2]), (0, c.jsx)(O, { "data-orientation": "horizontal", ...s2, ref: h2, sizes: r2, style: { bottom: 0, left: "rtl" === a2.dir ? "var(--radix-scroll-area-corner-width)" : 0, right: "ltr" === a2.dir ? "var(--radix-scroll-area-corner-width)" : 0, "--radix-scroll-area-thumb-width": B(r2) + "px", ...e2.style }, onThumbPointerDown: (t3) => e2.onThumbPointerDown(t3.x), onDragScroll: (t3) => e2.onDragScroll(t3.x), onWheelScroll: (t3, r3) => { + if (a2.viewport) { + let n2 = a2.viewport.scrollLeft + t3.deltaX; + e2.onWheelScroll(n2), function(e3, t4) { + return e3 > 0 && e3 < t4; + }(n2, r3) && t3.preventDefault(); + } + }, onResize: () => { + d2.current && a2.viewport && l2 && i2({ content: a2.viewport.scrollWidth, viewport: a2.viewport.offsetWidth, scrollbar: { size: d2.current.clientWidth, paddingStart: D(l2.paddingLeft), paddingEnd: D(l2.paddingRight) } }); + } }); + }), P = n.forwardRef((e2, t2) => { + let { sizes: r2, onSizesChange: i2, ...s2 } = e2, a2 = y(x, e2.__scopeScrollArea), [l2, u2] = n.useState(), d2 = n.useRef(null), h2 = (0, o.e)(t2, d2, a2.onScrollbarYChange); + return n.useEffect(() => { + d2.current && u2(getComputedStyle(d2.current)); + }, [d2]), (0, c.jsx)(O, { "data-orientation": "vertical", ...s2, ref: h2, sizes: r2, style: { top: 0, right: "ltr" === a2.dir ? 0 : void 0, left: "rtl" === a2.dir ? 0 : void 0, bottom: "var(--radix-scroll-area-corner-height)", "--radix-scroll-area-thumb-height": B(r2) + "px", ...e2.style }, onThumbPointerDown: (t3) => e2.onThumbPointerDown(t3.y), onDragScroll: (t3) => e2.onDragScroll(t3.y), onWheelScroll: (t3, r3) => { + if (a2.viewport) { + let n2 = a2.viewport.scrollTop + t3.deltaY; + e2.onWheelScroll(n2), function(e3, t4) { + return e3 > 0 && e3 < t4; + }(n2, r3) && t3.preventDefault(); + } + }, onResize: () => { + d2.current && a2.viewport && l2 && i2({ content: a2.viewport.scrollHeight, viewport: a2.viewport.offsetHeight, scrollbar: { size: d2.current.clientHeight, paddingStart: D(l2.paddingTop), paddingEnd: D(l2.paddingBottom) } }); + } }); + }), [T, A] = p(x), O = n.forwardRef((e2, t2) => { + let { __scopeScrollArea: r2, sizes: s2, hasThumb: a2, onThumbChange: u2, onThumbPointerUp: d2, onThumbPointerDown: f2, onThumbPositionChange: p2, onDragScroll: m2, onWheelScroll: g2, onResize: v2, ...b2 } = e2, w2 = y(x, r2), [S2, _2] = n.useState(null), E2 = (0, o.e)(t2, (e3) => _2(e3)), k2 = n.useRef(null), C2 = n.useRef(""), R2 = w2.viewport, P2 = s2.content - s2.viewport, A2 = (0, l.W)(g2), O2 = (0, l.W)(p2), I2 = H(v2, 10); + function N2(e3) { + k2.current && m2({ x: e3.clientX - k2.current.left, y: e3.clientY - k2.current.top }); + } + return n.useEffect(() => { + let e3 = (e4) => { + let t3 = e4.target; + S2?.contains(t3) && A2(e4, P2); + }; + return document.addEventListener("wheel", e3, { passive: false }), () => document.removeEventListener("wheel", e3, { passive: false }); + }, [R2, S2, P2, A2]), n.useEffect(O2, [s2, O2]), W(S2, I2), W(w2.content, I2), (0, c.jsx)(T, { scope: r2, scrollbar: S2, hasThumb: a2, onThumbChange: (0, l.W)(u2), onThumbPointerUp: (0, l.W)(d2), onThumbPositionChange: O2, onThumbPointerDown: (0, l.W)(f2), children: (0, c.jsx)(i.WV.div, { ...b2, ref: E2, style: { position: "absolute", ...b2.style }, onPointerDown: (0, h.M)(e2.onPointerDown, (e3) => { + 0 === e3.button && (e3.target.setPointerCapture(e3.pointerId), k2.current = S2.getBoundingClientRect(), C2.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", w2.viewport && (w2.viewport.style.scrollBehavior = "auto"), N2(e3)); + }), onPointerMove: (0, h.M)(e2.onPointerMove, N2), onPointerUp: (0, h.M)(e2.onPointerUp, (e3) => { + let t3 = e3.target; + t3.hasPointerCapture(e3.pointerId) && t3.releasePointerCapture(e3.pointerId), document.body.style.webkitUserSelect = C2.current, w2.viewport && (w2.viewport.style.scrollBehavior = ""), k2.current = null; + }) }) }); + }), I = "ScrollAreaThumb", N = n.forwardRef((e2, t2) => { + let { forceMount: r2, ...n2 } = e2, i2 = A(I, e2.__scopeScrollArea); + return (0, c.jsx)(s.z, { present: r2 || i2.hasThumb, children: (0, c.jsx)(M, { ref: t2, ...n2 }) }); + }), M = n.forwardRef((e2, t2) => { + let { __scopeScrollArea: r2, style: s2, ...a2 } = e2, l2 = y(I, r2), u2 = A(I, r2), { onThumbPositionChange: d2 } = u2, f2 = (0, o.e)(t2, (e3) => u2.onThumbChange(e3)), p2 = n.useRef(), m2 = H(() => { + p2.current && (p2.current(), p2.current = void 0); + }, 100); + return n.useEffect(() => { + let e3 = l2.viewport; + if (e3) { + let t3 = () => { + if (m2(), !p2.current) { + let t4 = z(e3, d2); + p2.current = t4, d2(); + } + }; + return d2(), e3.addEventListener("scroll", t3), () => e3.removeEventListener("scroll", t3); + } + }, [l2.viewport, m2, d2]), (0, c.jsx)(i.WV.div, { "data-state": u2.hasThumb ? "visible" : "hidden", ...a2, ref: f2, style: { width: "var(--radix-scroll-area-thumb-width)", height: "var(--radix-scroll-area-thumb-height)", ...s2 }, onPointerDownCapture: (0, h.M)(e2.onPointerDownCapture, (e3) => { + let t3 = e3.target.getBoundingClientRect(), r3 = e3.clientX - t3.left, n2 = e3.clientY - t3.top; + u2.onThumbPointerDown({ x: r3, y: n2 }); + }), onPointerUp: (0, h.M)(e2.onPointerUp, u2.onThumbPointerUp) }); + }); + N.displayName = I; + var $ = "ScrollAreaCorner", L = n.forwardRef((e2, t2) => { + let r2 = y($, e2.__scopeScrollArea), n2 = !!(r2.scrollbarX && r2.scrollbarY); + return "scroll" !== r2.type && n2 ? (0, c.jsx)(j, { ...e2, ref: t2 }) : null; + }); + L.displayName = $; + var j = n.forwardRef((e2, t2) => { + let { __scopeScrollArea: r2, ...s2 } = e2, a2 = y($, r2), [o2, l2] = n.useState(0), [u2, d2] = n.useState(0), h2 = !!(o2 && u2); + return W(a2.scrollbarX, () => { + let e3 = a2.scrollbarX?.offsetHeight || 0; + a2.onCornerHeightChange(e3), d2(e3); + }), W(a2.scrollbarY, () => { + let e3 = a2.scrollbarY?.offsetWidth || 0; + a2.onCornerWidthChange(e3), l2(e3); + }), h2 ? (0, c.jsx)(i.WV.div, { ...s2, ref: t2, style: { width: o2, height: u2, position: "absolute", right: "ltr" === a2.dir ? 0 : void 0, left: "rtl" === a2.dir ? 0 : void 0, bottom: 0, ...e2.style } }) : null; + }); + function D(e2) { + return e2 ? parseInt(e2, 10) : 0; + } + function F(e2, t2) { + let r2 = e2 / t2; + return isNaN(r2) ? 0 : r2; + } + function B(e2) { + let t2 = F(e2.viewport, e2.content), r2 = e2.scrollbar.paddingStart + e2.scrollbar.paddingEnd; + return Math.max((e2.scrollbar.size - r2) * t2, 18); + } + function U(e2, t2, r2 = "ltr") { + let n2 = B(t2), i2 = t2.scrollbar.paddingStart + t2.scrollbar.paddingEnd, s2 = t2.scrollbar.size - i2, a2 = t2.content - t2.viewport, o2 = function(e3, [t3, r3]) { + return Math.min(r3, Math.max(t3, e3)); + }(e2, "ltr" === r2 ? [0, a2] : [-1 * a2, 0]); + return q([0, a2], [0, s2 - n2])(o2); + } + function q(e2, t2) { + return (r2) => { + if (e2[0] === e2[1] || t2[0] === t2[1]) + return t2[0]; + let n2 = (t2[1] - t2[0]) / (e2[1] - e2[0]); + return t2[0] + n2 * (r2 - e2[0]); + }; + } + var z = (e2, t2 = () => { + }) => { + let r2 = { left: e2.scrollLeft, top: e2.scrollTop }, n2 = 0; + return !function i2() { + let s2 = { left: e2.scrollLeft, top: e2.scrollTop }, a2 = r2.left !== s2.left, o2 = r2.top !== s2.top; + (a2 || o2) && t2(), r2 = s2, n2 = window.requestAnimationFrame(i2); + }(), () => window.cancelAnimationFrame(n2); + }; + function H(e2, t2) { + let r2 = (0, l.W)(e2), i2 = n.useRef(0); + return n.useEffect(() => () => window.clearTimeout(i2.current), []), n.useCallback(() => { + window.clearTimeout(i2.current), i2.current = window.setTimeout(r2, t2); + }, [r2, t2]); + } + function W(e2, t2) { + let r2 = (0, l.W)(t2); + (0, d.b)(() => { + let t3 = 0; + if (e2) { + let n2 = new ResizeObserver(() => { + cancelAnimationFrame(t3), t3 = window.requestAnimationFrame(r2); + }); + return n2.observe(e2), () => { + window.cancelAnimationFrame(t3), n2.unobserve(e2); + }; + } + }, [e2, r2]); + } + var Q = v, V = w, G = L; + }; + __namedExportsObject5["__chunk_62518"] = (e, t, r) => { + "use strict"; + r.d(t, { WV: () => o, jH: () => l }); + var n = r(49398), i = r(35703), s = r(87796), a = r(73435), o = ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul"].reduce((e2, t2) => { + let r2 = n.forwardRef((e3, r3) => { + let { asChild: n2, ...i2 } = e3, o2 = n2 ? s.g7 : t2; + return "undefined" != typeof window && (window[Symbol.for("radix-ui")] = true), (0, a.jsx)(o2, { ...i2, ref: r3 }); + }); + return r2.displayName = `Primitive.${t2}`, { ...e2, [t2]: r2 }; + }, {}); + function l(e2, t2) { + e2 && i.flushSync(() => e2.dispatchEvent(t2)); + } + }; + __namedExportsObject5["__chunk_27217"] = (e, t, r) => { + "use strict"; + r.d(t, { z: () => a }); + var n = r(49398), i = r(63554), s = r(28111), a = (e2) => { + let { present: t2, children: r2 } = e2, a2 = function(e3) { + var t3, r3; + let [i2, a3] = n.useState(), l2 = n.useRef({}), c2 = n.useRef(e3), u = n.useRef("none"), [d, h] = (t3 = e3 ? "mounted" : "unmounted", r3 = { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } }, n.useReducer((e4, t4) => r3[e4][t4] ?? e4, t3)); + return n.useEffect(() => { + let e4 = o(l2.current); + u.current = "mounted" === d ? e4 : "none"; + }, [d]), (0, s.b)(() => { + let t4 = l2.current, r4 = c2.current; + if (r4 !== e3) { + let n2 = u.current, i3 = o(t4); + e3 ? h("MOUNT") : "none" === i3 || t4?.display === "none" ? h("UNMOUNT") : r4 && n2 !== i3 ? h("ANIMATION_OUT") : h("UNMOUNT"), c2.current = e3; + } + }, [e3, h]), (0, s.b)(() => { + if (i2) { + let e4; + let t4 = i2.ownerDocument.defaultView ?? window, r4 = (r5) => { + let n3 = o(l2.current).includes(r5.animationName); + if (r5.target === i2 && n3 && (h("ANIMATION_END"), !c2.current)) { + let r6 = i2.style.animationFillMode; + i2.style.animationFillMode = "forwards", e4 = t4.setTimeout(() => { + "forwards" === i2.style.animationFillMode && (i2.style.animationFillMode = r6); + }); + } + }, n2 = (e5) => { + e5.target === i2 && (u.current = o(l2.current)); + }; + return i2.addEventListener("animationstart", n2), i2.addEventListener("animationcancel", r4), i2.addEventListener("animationend", r4), () => { + t4.clearTimeout(e4), i2.removeEventListener("animationstart", n2), i2.removeEventListener("animationcancel", r4), i2.removeEventListener("animationend", r4); + }; + } + h("ANIMATION_END"); + }, [i2, h]), { isPresent: ["mounted", "unmountSuspended"].includes(d), ref: n.useCallback((e4) => { + e4 && (l2.current = getComputedStyle(e4)), a3(e4); + }, []) }; + }(t2), l = "function" == typeof r2 ? r2({ present: a2.isPresent }) : n.Children.only(r2), c = (0, i.e)(a2.ref, function(e3) { + let t3 = Object.getOwnPropertyDescriptor(e3.props, "ref")?.get, r3 = t3 && "isReactWarning" in t3 && t3.isReactWarning; + return r3 ? e3.ref : (r3 = (t3 = Object.getOwnPropertyDescriptor(e3, "ref")?.get) && "isReactWarning" in t3 && t3.isReactWarning) ? e3.props.ref : e3.props.ref || e3.ref; + }(l)); + return "function" == typeof r2 || a2.isPresent ? n.cloneElement(l, { ref: c }) : null; + }; + function o(e2) { + return e2?.animationName || "none"; + } + a.displayName = "Presence"; + }; + __namedExportsObject5["__chunk_71281"] = (e, t, r) => { + "use strict"; + r.d(t, { ee: () => rp, VY: () => ry, h_: () => rg, fC: () => rf, xz: () => rm }); + var n, i, s, a = r(49398), o = r.t(a, 2), l = r(78777), c = r(63554), u = r(45432), d = r(62518), h = r(74313), f = r(73435), p = "dismissableLayer.update", m = a.createContext({ layers: /* @__PURE__ */ new Set(), layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), branches: /* @__PURE__ */ new Set() }), g = a.forwardRef((e10, t10) => { + let { disableOutsidePointerEvents: r2 = false, onEscapeKeyDown: n2, onPointerDownOutside: s2, onFocusOutside: o2, onInteractOutside: u2, onDismiss: g2, ...b2 } = e10, w2 = a.useContext(m), [x2, S2] = a.useState(null), _2 = x2?.ownerDocument ?? globalThis2?.document, [, E2] = a.useState({}), k2 = (0, c.e)(t10, (e11) => S2(e11)), C2 = Array.from(w2.layers), [R2] = [...w2.layersWithOutsidePointerEventsDisabled].slice(-1), P2 = C2.indexOf(R2), T2 = x2 ? C2.indexOf(x2) : -1, A2 = w2.layersWithOutsidePointerEventsDisabled.size > 0, O2 = T2 >= P2, I2 = function(e11, t11 = globalThis2?.document) { + let r3 = (0, h.W)(e11), n3 = a.useRef(false), i2 = a.useRef(() => { + }); + return a.useEffect(() => { + let e12 = (e13) => { + if (e13.target && !n3.current) { + let n4 = function() { + v("dismissableLayer.pointerDownOutside", r3, s4, { discrete: true }); + }, s4 = { originalEvent: e13 }; + "touch" === e13.pointerType ? (t11.removeEventListener("click", i2.current), i2.current = n4, t11.addEventListener("click", i2.current, { once: true })) : n4(); + } else + t11.removeEventListener("click", i2.current); + n3.current = false; + }, s3 = window.setTimeout(() => { + t11.addEventListener("pointerdown", e12); + }, 0); + return () => { + window.clearTimeout(s3), t11.removeEventListener("pointerdown", e12), t11.removeEventListener("click", i2.current); + }; + }, [t11, r3]), { onPointerDownCapture: () => n3.current = true }; + }((e11) => { + let t11 = e11.target, r3 = [...w2.branches].some((e12) => e12.contains(t11)); + !O2 || r3 || (s2?.(e11), u2?.(e11), e11.defaultPrevented || g2?.()); + }, _2), N2 = function(e11, t11 = globalThis2?.document) { + let r3 = (0, h.W)(e11), n3 = a.useRef(false); + return a.useEffect(() => { + let e12 = (e13) => { + e13.target && !n3.current && v("dismissableLayer.focusOutside", r3, { originalEvent: e13 }, { discrete: false }); + }; + return t11.addEventListener("focusin", e12), () => t11.removeEventListener("focusin", e12); + }, [t11, r3]), { onFocusCapture: () => n3.current = true, onBlurCapture: () => n3.current = false }; + }((e11) => { + let t11 = e11.target; + [...w2.branches].some((e12) => e12.contains(t11)) || (o2?.(e11), u2?.(e11), e11.defaultPrevented || g2?.()); + }, _2); + return !function(e11, t11 = globalThis2?.document) { + let r3 = (0, h.W)(e11); + a.useEffect(() => { + let e12 = (e13) => { + "Escape" === e13.key && r3(e13); + }; + return t11.addEventListener("keydown", e12, { capture: true }), () => t11.removeEventListener("keydown", e12, { capture: true }); + }, [r3, t11]); + }((e11) => { + T2 !== w2.layers.size - 1 || (n2?.(e11), !e11.defaultPrevented && g2 && (e11.preventDefault(), g2())); + }, _2), a.useEffect(() => { + if (x2) + return r2 && (0 === w2.layersWithOutsidePointerEventsDisabled.size && (i = _2.body.style.pointerEvents, _2.body.style.pointerEvents = "none"), w2.layersWithOutsidePointerEventsDisabled.add(x2)), w2.layers.add(x2), y(), () => { + r2 && 1 === w2.layersWithOutsidePointerEventsDisabled.size && (_2.body.style.pointerEvents = i); + }; + }, [x2, _2, r2, w2]), a.useEffect(() => () => { + x2 && (w2.layers.delete(x2), w2.layersWithOutsidePointerEventsDisabled.delete(x2), y()); + }, [x2, w2]), a.useEffect(() => { + let e11 = () => E2({}); + return document.addEventListener(p, e11), () => document.removeEventListener(p, e11); + }, []), (0, f.jsx)(d.WV.div, { ...b2, ref: k2, style: { pointerEvents: A2 ? O2 ? "auto" : "none" : void 0, ...e10.style }, onFocusCapture: (0, l.M)(e10.onFocusCapture, N2.onFocusCapture), onBlurCapture: (0, l.M)(e10.onBlurCapture, N2.onBlurCapture), onPointerDownCapture: (0, l.M)(e10.onPointerDownCapture, I2.onPointerDownCapture) }); + }); + function y() { + let e10 = new CustomEvent(p); + document.dispatchEvent(e10); + } + function v(e10, t10, r2, { discrete: n2 }) { + let i2 = r2.originalEvent.target, s2 = new CustomEvent(e10, { bubbles: false, cancelable: true, detail: r2 }); + t10 && i2.addEventListener(e10, t10, { once: true }), n2 ? (0, d.jH)(i2, s2) : i2.dispatchEvent(s2); + } + g.displayName = "DismissableLayer", a.forwardRef((e10, t10) => { + let r2 = a.useContext(m), n2 = a.useRef(null), i2 = (0, c.e)(t10, n2); + return a.useEffect(() => { + let e11 = n2.current; + if (e11) + return r2.branches.add(e11), () => { + r2.branches.delete(e11); + }; + }, [r2.branches]), (0, f.jsx)(d.WV.div, { ...e10, ref: i2 }); + }).displayName = "DismissableLayerBranch"; + var b = 0; + function w() { + let e10 = document.createElement("span"); + return e10.setAttribute("data-radix-focus-guard", ""), e10.tabIndex = 0, e10.style.outline = "none", e10.style.opacity = "0", e10.style.position = "fixed", e10.style.pointerEvents = "none", e10; + } + var x = "focusScope.autoFocusOnMount", S = "focusScope.autoFocusOnUnmount", _ = { bubbles: false, cancelable: true }, E = a.forwardRef((e10, t10) => { + let { loop: r2 = false, trapped: n2 = false, onMountAutoFocus: i2, onUnmountAutoFocus: s2, ...o2 } = e10, [l2, u2] = a.useState(null), p2 = (0, h.W)(i2), m2 = (0, h.W)(s2), g2 = a.useRef(null), y2 = (0, c.e)(t10, (e11) => u2(e11)), v2 = a.useRef({ paused: false, pause() { + this.paused = true; + }, resume() { + this.paused = false; + } }).current; + a.useEffect(() => { + if (n2) { + let e11 = function(e12) { + if (v2.paused || !l2) + return; + let t12 = e12.target; + l2.contains(t12) ? g2.current = t12 : R(g2.current, { select: true }); + }, t11 = function(e12) { + if (v2.paused || !l2) + return; + let t12 = e12.relatedTarget; + null === t12 || l2.contains(t12) || R(g2.current, { select: true }); + }; + document.addEventListener("focusin", e11), document.addEventListener("focusout", t11); + let r3 = new MutationObserver(function(e12) { + if (document.activeElement === document.body) + for (let t12 of e12) + t12.removedNodes.length > 0 && R(l2); + }); + return l2 && r3.observe(l2, { childList: true, subtree: true }), () => { + document.removeEventListener("focusin", e11), document.removeEventListener("focusout", t11), r3.disconnect(); + }; + } + }, [n2, l2, v2.paused]), a.useEffect(() => { + if (l2) { + P.add(v2); + let e11 = document.activeElement; + if (!l2.contains(e11)) { + let t11 = new CustomEvent(x, _); + l2.addEventListener(x, p2), l2.dispatchEvent(t11), t11.defaultPrevented || (function(e12, { select: t12 = false } = {}) { + let r3 = document.activeElement; + for (let n3 of e12) + if (R(n3, { select: t12 }), document.activeElement !== r3) + return; + }(k(l2).filter((e12) => "A" !== e12.tagName), { select: true }), document.activeElement === e11 && R(l2)); + } + return () => { + l2.removeEventListener(x, p2), setTimeout(() => { + let t11 = new CustomEvent(S, _); + l2.addEventListener(S, m2), l2.dispatchEvent(t11), t11.defaultPrevented || R(e11 ?? document.body, { select: true }), l2.removeEventListener(S, m2), P.remove(v2); + }, 0); + }; + } + }, [l2, p2, m2, v2]); + let b2 = a.useCallback((e11) => { + if (!r2 && !n2 || v2.paused) + return; + let t11 = "Tab" === e11.key && !e11.altKey && !e11.ctrlKey && !e11.metaKey, i3 = document.activeElement; + if (t11 && i3) { + let t12 = e11.currentTarget, [n3, s3] = function(e12) { + let t13 = k(e12); + return [C(t13, e12), C(t13.reverse(), e12)]; + }(t12); + n3 && s3 ? e11.shiftKey || i3 !== s3 ? e11.shiftKey && i3 === n3 && (e11.preventDefault(), r2 && R(s3, { select: true })) : (e11.preventDefault(), r2 && R(n3, { select: true })) : i3 === t12 && e11.preventDefault(); + } + }, [r2, n2, v2.paused]); + return (0, f.jsx)(d.WV.div, { tabIndex: -1, ...o2, ref: y2, onKeyDown: b2 }); + }); + function k(e10) { + let t10 = [], r2 = document.createTreeWalker(e10, NodeFilter.SHOW_ELEMENT, { acceptNode: (e11) => { + let t11 = "INPUT" === e11.tagName && "hidden" === e11.type; + return e11.disabled || e11.hidden || t11 ? NodeFilter.FILTER_SKIP : e11.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } }); + for (; r2.nextNode(); ) + t10.push(r2.currentNode); + return t10; + } + function C(e10, t10) { + for (let r2 of e10) + if (!function(e11, { upTo: t11 }) { + if ("hidden" === getComputedStyle(e11).visibility) + return true; + for (; e11 && (void 0 === t11 || e11 !== t11); ) { + if ("none" === getComputedStyle(e11).display) + return true; + e11 = e11.parentElement; + } + return false; + }(r2, { upTo: t10 })) + return r2; + } + function R(e10, { select: t10 = false } = {}) { + if (e10 && e10.focus) { + var r2; + let n2 = document.activeElement; + e10.focus({ preventScroll: true }), e10 !== n2 && (r2 = e10) instanceof HTMLInputElement && "select" in r2 && t10 && e10.select(); + } + } + E.displayName = "FocusScope"; + var P = /* @__PURE__ */ function() { + let e10 = []; + return { add(t10) { + let r2 = e10[0]; + t10 !== r2 && r2?.pause(), (e10 = T(e10, t10)).unshift(t10); + }, remove(t10) { + e10 = T(e10, t10), e10[0]?.resume(); + } }; + }(); + function T(e10, t10) { + let r2 = [...e10], n2 = r2.indexOf(t10); + return -1 !== n2 && r2.splice(n2, 1), r2; + } + var A = r(28111), O = o["useId".toString()] || (() => void 0), I = 0; + let N = ["top", "right", "bottom", "left"], M = Math.min, $ = Math.max, L = Math.round, j = Math.floor, D = (e10) => ({ x: e10, y: e10 }), F = { left: "right", right: "left", bottom: "top", top: "bottom" }, B = { start: "end", end: "start" }; + function U(e10, t10) { + return "function" == typeof e10 ? e10(t10) : e10; + } + function q(e10) { + return e10.split("-")[0]; + } + function z(e10) { + return e10.split("-")[1]; + } + function H(e10) { + return "x" === e10 ? "y" : "x"; + } + function W(e10) { + return "y" === e10 ? "height" : "width"; + } + function Q(e10) { + return ["top", "bottom"].includes(q(e10)) ? "y" : "x"; + } + function V(e10) { + return e10.replace(/start|end/g, (e11) => B[e11]); + } + function G(e10) { + return e10.replace(/left|right|bottom|top/g, (e11) => F[e11]); + } + function Z(e10) { + return "number" != typeof e10 ? { top: 0, right: 0, bottom: 0, left: 0, ...e10 } : { top: e10, right: e10, bottom: e10, left: e10 }; + } + function K(e10) { + let { x: t10, y: r2, width: n2, height: i2 } = e10; + return { width: n2, height: i2, top: r2, left: t10, right: t10 + n2, bottom: r2 + i2, x: t10, y: r2 }; + } + function J(e10, t10, r2) { + let n2, { reference: i2, floating: s2 } = e10, a2 = Q(t10), o2 = H(Q(t10)), l2 = W(o2), c2 = q(t10), u2 = "y" === a2, d2 = i2.x + i2.width / 2 - s2.width / 2, h2 = i2.y + i2.height / 2 - s2.height / 2, f2 = i2[l2] / 2 - s2[l2] / 2; + switch (c2) { + case "top": + n2 = { x: d2, y: i2.y - s2.height }; + break; + case "bottom": + n2 = { x: d2, y: i2.y + i2.height }; + break; + case "right": + n2 = { x: i2.x + i2.width, y: h2 }; + break; + case "left": + n2 = { x: i2.x - s2.width, y: h2 }; + break; + default: + n2 = { x: i2.x, y: i2.y }; + } + switch (z(t10)) { + case "start": + n2[o2] -= f2 * (r2 && u2 ? -1 : 1); + break; + case "end": + n2[o2] += f2 * (r2 && u2 ? -1 : 1); + } + return n2; + } + let Y = async (e10, t10, r2) => { + let { placement: n2 = "bottom", strategy: i2 = "absolute", middleware: s2 = [], platform: a2 } = r2, o2 = s2.filter(Boolean), l2 = await (null == a2.isRTL ? void 0 : a2.isRTL(t10)), c2 = await a2.getElementRects({ reference: e10, floating: t10, strategy: i2 }), { x: u2, y: d2 } = J(c2, n2, l2), h2 = n2, f2 = {}, p2 = 0; + for (let r3 = 0; r3 < o2.length; r3++) { + let { name: s3, fn: m2 } = o2[r3], { x: g2, y: y2, data: v2, reset: b2 } = await m2({ x: u2, y: d2, initialPlacement: n2, placement: h2, strategy: i2, middlewareData: f2, rects: c2, platform: a2, elements: { reference: e10, floating: t10 } }); + u2 = null != g2 ? g2 : u2, d2 = null != y2 ? y2 : d2, f2 = { ...f2, [s3]: { ...f2[s3], ...v2 } }, b2 && p2 <= 50 && (p2++, "object" == typeof b2 && (b2.placement && (h2 = b2.placement), b2.rects && (c2 = true === b2.rects ? await a2.getElementRects({ reference: e10, floating: t10, strategy: i2 }) : b2.rects), { x: u2, y: d2 } = J(c2, h2, l2)), r3 = -1); + } + return { x: u2, y: d2, placement: h2, strategy: i2, middlewareData: f2 }; + }; + async function X(e10, t10) { + var r2; + void 0 === t10 && (t10 = {}); + let { x: n2, y: i2, platform: s2, rects: a2, elements: o2, strategy: l2 } = e10, { boundary: c2 = "clippingAncestors", rootBoundary: u2 = "viewport", elementContext: d2 = "floating", altBoundary: h2 = false, padding: f2 = 0 } = U(t10, e10), p2 = Z(f2), m2 = o2[h2 ? "floating" === d2 ? "reference" : "floating" : d2], g2 = K(await s2.getClippingRect({ element: null == (r2 = await (null == s2.isElement ? void 0 : s2.isElement(m2))) || r2 ? m2 : m2.contextElement || await (null == s2.getDocumentElement ? void 0 : s2.getDocumentElement(o2.floating)), boundary: c2, rootBoundary: u2, strategy: l2 })), y2 = "floating" === d2 ? { x: n2, y: i2, width: a2.floating.width, height: a2.floating.height } : a2.reference, v2 = await (null == s2.getOffsetParent ? void 0 : s2.getOffsetParent(o2.floating)), b2 = await (null == s2.isElement ? void 0 : s2.isElement(v2)) && await (null == s2.getScale ? void 0 : s2.getScale(v2)) || { x: 1, y: 1 }, w2 = K(s2.convertOffsetParentRelativeRectToViewportRelativeRect ? await s2.convertOffsetParentRelativeRectToViewportRelativeRect({ elements: o2, rect: y2, offsetParent: v2, strategy: l2 }) : y2); + return { top: (g2.top - w2.top + p2.top) / b2.y, bottom: (w2.bottom - g2.bottom + p2.bottom) / b2.y, left: (g2.left - w2.left + p2.left) / b2.x, right: (w2.right - g2.right + p2.right) / b2.x }; + } + function ee(e10, t10) { + return { top: e10.top - t10.height, right: e10.right - t10.width, bottom: e10.bottom - t10.height, left: e10.left - t10.width }; + } + function et(e10) { + return N.some((t10) => e10[t10] >= 0); + } + async function er(e10, t10) { + let { placement: r2, platform: n2, elements: i2 } = e10, s2 = await (null == n2.isRTL ? void 0 : n2.isRTL(i2.floating)), a2 = q(r2), o2 = z(r2), l2 = "y" === Q(r2), c2 = ["left", "top"].includes(a2) ? -1 : 1, u2 = s2 && l2 ? -1 : 1, d2 = U(t10, e10), { mainAxis: h2, crossAxis: f2, alignmentAxis: p2 } = "number" == typeof d2 ? { mainAxis: d2, crossAxis: 0, alignmentAxis: null } : { mainAxis: d2.mainAxis || 0, crossAxis: d2.crossAxis || 0, alignmentAxis: d2.alignmentAxis }; + return o2 && "number" == typeof p2 && (f2 = "end" === o2 ? -1 * p2 : p2), l2 ? { x: f2 * u2, y: h2 * c2 } : { x: h2 * c2, y: f2 * u2 }; + } + function en() { + return "undefined" != typeof window; + } + function ei(e10) { + return eo(e10) ? (e10.nodeName || "").toLowerCase() : "#document"; + } + function es(e10) { + var t10; + return (null == e10 || null == (t10 = e10.ownerDocument) ? void 0 : t10.defaultView) || window; + } + function ea(e10) { + var t10; + return null == (t10 = (eo(e10) ? e10.ownerDocument : e10.document) || window.document) ? void 0 : t10.documentElement; + } + function eo(e10) { + return !!en() && (e10 instanceof Node || e10 instanceof es(e10).Node); + } + function el(e10) { + return !!en() && (e10 instanceof Element || e10 instanceof es(e10).Element); + } + function ec(e10) { + return !!en() && (e10 instanceof HTMLElement || e10 instanceof es(e10).HTMLElement); + } + function eu(e10) { + return !!en() && "undefined" != typeof ShadowRoot && (e10 instanceof ShadowRoot || e10 instanceof es(e10).ShadowRoot); + } + function ed(e10) { + let { overflow: t10, overflowX: r2, overflowY: n2, display: i2 } = eg(e10); + return /auto|scroll|overlay|hidden|clip/.test(t10 + n2 + r2) && !["inline", "contents"].includes(i2); + } + function eh(e10) { + return [":popover-open", ":modal"].some((t10) => { + try { + return e10.matches(t10); + } catch (e11) { + return false; + } + }); + } + function ef(e10) { + let t10 = ep(), r2 = el(e10) ? eg(e10) : e10; + return "none" !== r2.transform || "none" !== r2.perspective || !!r2.containerType && "normal" !== r2.containerType || !t10 && !!r2.backdropFilter && "none" !== r2.backdropFilter || !t10 && !!r2.filter && "none" !== r2.filter || ["transform", "perspective", "filter"].some((e11) => (r2.willChange || "").includes(e11)) || ["paint", "layout", "strict", "content"].some((e11) => (r2.contain || "").includes(e11)); + } + function ep() { + return "undefined" != typeof CSS && !!CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); + } + function em(e10) { + return ["html", "body", "#document"].includes(ei(e10)); + } + function eg(e10) { + return es(e10).getComputedStyle(e10); + } + function ey(e10) { + return el(e10) ? { scrollLeft: e10.scrollLeft, scrollTop: e10.scrollTop } : { scrollLeft: e10.scrollX, scrollTop: e10.scrollY }; + } + function ev(e10) { + if ("html" === ei(e10)) + return e10; + let t10 = e10.assignedSlot || e10.parentNode || eu(e10) && e10.host || ea(e10); + return eu(t10) ? t10.host : t10; + } + function eb(e10, t10, r2) { + var n2; + void 0 === t10 && (t10 = []), void 0 === r2 && (r2 = true); + let i2 = function e11(t11) { + let r3 = ev(t11); + return em(r3) ? t11.ownerDocument ? t11.ownerDocument.body : t11.body : ec(r3) && ed(r3) ? r3 : e11(r3); + }(e10), s2 = i2 === (null == (n2 = e10.ownerDocument) ? void 0 : n2.body), a2 = es(i2); + if (s2) { + let e11 = ew(a2); + return t10.concat(a2, a2.visualViewport || [], ed(i2) ? i2 : [], e11 && r2 ? eb(e11) : []); + } + return t10.concat(i2, eb(i2, [], r2)); + } + function ew(e10) { + return e10.parent && Object.getPrototypeOf(e10.parent) ? e10.frameElement : null; + } + function ex(e10) { + let t10 = eg(e10), r2 = parseFloat(t10.width) || 0, n2 = parseFloat(t10.height) || 0, i2 = ec(e10), s2 = i2 ? e10.offsetWidth : r2, a2 = i2 ? e10.offsetHeight : n2, o2 = L(r2) !== s2 || L(n2) !== a2; + return o2 && (r2 = s2, n2 = a2), { width: r2, height: n2, $: o2 }; + } + function eS(e10) { + return el(e10) ? e10 : e10.contextElement; + } + function e_(e10) { + let t10 = eS(e10); + if (!ec(t10)) + return D(1); + let r2 = t10.getBoundingClientRect(), { width: n2, height: i2, $: s2 } = ex(t10), a2 = (s2 ? L(r2.width) : r2.width) / n2, o2 = (s2 ? L(r2.height) : r2.height) / i2; + return a2 && Number.isFinite(a2) || (a2 = 1), o2 && Number.isFinite(o2) || (o2 = 1), { x: a2, y: o2 }; + } + let eE = D(0); + function ek(e10) { + let t10 = es(e10); + return ep() && t10.visualViewport ? { x: t10.visualViewport.offsetLeft, y: t10.visualViewport.offsetTop } : eE; + } + function eC(e10, t10, r2, n2) { + var i2; + void 0 === t10 && (t10 = false), void 0 === r2 && (r2 = false); + let s2 = e10.getBoundingClientRect(), a2 = eS(e10), o2 = D(1); + t10 && (n2 ? el(n2) && (o2 = e_(n2)) : o2 = e_(e10)); + let l2 = (void 0 === (i2 = r2) && (i2 = false), n2 && (!i2 || n2 === es(a2)) && i2) ? ek(a2) : D(0), c2 = (s2.left + l2.x) / o2.x, u2 = (s2.top + l2.y) / o2.y, d2 = s2.width / o2.x, h2 = s2.height / o2.y; + if (a2) { + let e11 = es(a2), t11 = n2 && el(n2) ? es(n2) : n2, r3 = e11, i3 = ew(r3); + for (; i3 && n2 && t11 !== r3; ) { + let e12 = e_(i3), t12 = i3.getBoundingClientRect(), n3 = eg(i3), s3 = t12.left + (i3.clientLeft + parseFloat(n3.paddingLeft)) * e12.x, a3 = t12.top + (i3.clientTop + parseFloat(n3.paddingTop)) * e12.y; + c2 *= e12.x, u2 *= e12.y, d2 *= e12.x, h2 *= e12.y, c2 += s3, u2 += a3, i3 = ew(r3 = es(i3)); + } + } + return K({ width: d2, height: h2, x: c2, y: u2 }); + } + function eR(e10, t10) { + let r2 = ey(e10).scrollLeft; + return t10 ? t10.left + r2 : eC(ea(e10)).left + r2; + } + function eP(e10, t10, r2) { + let n2; + if ("viewport" === t10) + n2 = function(e11, t11) { + let r3 = es(e11), n3 = ea(e11), i2 = r3.visualViewport, s2 = n3.clientWidth, a2 = n3.clientHeight, o2 = 0, l2 = 0; + if (i2) { + s2 = i2.width, a2 = i2.height; + let e12 = ep(); + (!e12 || e12 && "fixed" === t11) && (o2 = i2.offsetLeft, l2 = i2.offsetTop); + } + return { width: s2, height: a2, x: o2, y: l2 }; + }(e10, r2); + else if ("document" === t10) + n2 = function(e11) { + let t11 = ea(e11), r3 = ey(e11), n3 = e11.ownerDocument.body, i2 = $(t11.scrollWidth, t11.clientWidth, n3.scrollWidth, n3.clientWidth), s2 = $(t11.scrollHeight, t11.clientHeight, n3.scrollHeight, n3.clientHeight), a2 = -r3.scrollLeft + eR(e11), o2 = -r3.scrollTop; + return "rtl" === eg(n3).direction && (a2 += $(t11.clientWidth, n3.clientWidth) - i2), { width: i2, height: s2, x: a2, y: o2 }; + }(ea(e10)); + else if (el(t10)) + n2 = function(e11, t11) { + let r3 = eC(e11, true, "fixed" === t11), n3 = r3.top + e11.clientTop, i2 = r3.left + e11.clientLeft, s2 = ec(e11) ? e_(e11) : D(1), a2 = e11.clientWidth * s2.x; + return { width: a2, height: e11.clientHeight * s2.y, x: i2 * s2.x, y: n3 * s2.y }; + }(t10, r2); + else { + let r3 = ek(e10); + n2 = { ...t10, x: t10.x - r3.x, y: t10.y - r3.y }; + } + return K(n2); + } + function eT(e10) { + return "static" === eg(e10).position; + } + function eA(e10, t10) { + if (!ec(e10) || "fixed" === eg(e10).position) + return null; + if (t10) + return t10(e10); + let r2 = e10.offsetParent; + return ea(e10) === r2 && (r2 = r2.ownerDocument.body), r2; + } + function eO(e10, t10) { + let r2 = es(e10); + if (eh(e10)) + return r2; + if (!ec(e10)) { + let t11 = ev(e10); + for (; t11 && !em(t11); ) { + if (el(t11) && !eT(t11)) + return t11; + t11 = ev(t11); + } + return r2; + } + let n2 = eA(e10, t10); + for (; n2 && ["table", "td", "th"].includes(ei(n2)) && eT(n2); ) + n2 = eA(n2, t10); + return n2 && em(n2) && eT(n2) && !ef(n2) ? r2 : n2 || function(e11) { + let t11 = ev(e11); + for (; ec(t11) && !em(t11); ) { + if (ef(t11)) + return t11; + if (eh(t11)) + break; + t11 = ev(t11); + } + return null; + }(e10) || r2; + } + let eI = async function(e10) { + let t10 = this.getOffsetParent || eO, r2 = this.getDimensions, n2 = await r2(e10.floating); + return { reference: function(e11, t11, r3) { + let n3 = ec(t11), i2 = ea(t11), s2 = "fixed" === r3, a2 = eC(e11, true, s2, t11), o2 = { scrollLeft: 0, scrollTop: 0 }, l2 = D(0); + if (n3 || !n3 && !s2) { + if (("body" !== ei(t11) || ed(i2)) && (o2 = ey(t11)), n3) { + let e12 = eC(t11, true, s2, t11); + l2.x = e12.x + t11.clientLeft, l2.y = e12.y + t11.clientTop; + } else + i2 && (l2.x = eR(i2)); + } + let c2 = 0, u2 = 0; + if (i2 && !n3 && !s2) { + let e12 = i2.getBoundingClientRect(); + u2 = e12.top + o2.scrollTop, c2 = e12.left + o2.scrollLeft - eR(i2, e12); + } + return { x: a2.left + o2.scrollLeft - l2.x - c2, y: a2.top + o2.scrollTop - l2.y - u2, width: a2.width, height: a2.height }; + }(e10.reference, await t10(e10.floating), e10.strategy), floating: { x: 0, y: 0, width: n2.width, height: n2.height } }; + }, eN = { convertOffsetParentRelativeRectToViewportRelativeRect: function(e10) { + let { elements: t10, rect: r2, offsetParent: n2, strategy: i2 } = e10, s2 = "fixed" === i2, a2 = ea(n2), o2 = !!t10 && eh(t10.floating); + if (n2 === a2 || o2 && s2) + return r2; + let l2 = { scrollLeft: 0, scrollTop: 0 }, c2 = D(1), u2 = D(0), d2 = ec(n2); + if ((d2 || !d2 && !s2) && (("body" !== ei(n2) || ed(a2)) && (l2 = ey(n2)), ec(n2))) { + let e11 = eC(n2); + c2 = e_(n2), u2.x = e11.x + n2.clientLeft, u2.y = e11.y + n2.clientTop; + } + return { width: r2.width * c2.x, height: r2.height * c2.y, x: r2.x * c2.x - l2.scrollLeft * c2.x + u2.x, y: r2.y * c2.y - l2.scrollTop * c2.y + u2.y }; + }, getDocumentElement: ea, getClippingRect: function(e10) { + let { element: t10, boundary: r2, rootBoundary: n2, strategy: i2 } = e10, s2 = [..."clippingAncestors" === r2 ? eh(t10) ? [] : function(e11, t11) { + let r3 = t11.get(e11); + if (r3) + return r3; + let n3 = eb(e11, [], false).filter((e12) => el(e12) && "body" !== ei(e12)), i3 = null, s3 = "fixed" === eg(e11).position, a3 = s3 ? ev(e11) : e11; + for (; el(a3) && !em(a3); ) { + let t12 = eg(a3), r4 = ef(a3); + r4 || "fixed" !== t12.position || (i3 = null), (s3 ? !r4 && !i3 : !r4 && "static" === t12.position && !!i3 && ["absolute", "fixed"].includes(i3.position) || ed(a3) && !r4 && function e12(t13, r5) { + let n4 = ev(t13); + return !(n4 === r5 || !el(n4) || em(n4)) && ("fixed" === eg(n4).position || e12(n4, r5)); + }(e11, a3)) ? n3 = n3.filter((e12) => e12 !== a3) : i3 = t12, a3 = ev(a3); + } + return t11.set(e11, n3), n3; + }(t10, this._c) : [].concat(r2), n2], a2 = s2[0], o2 = s2.reduce((e11, r3) => { + let n3 = eP(t10, r3, i2); + return e11.top = $(n3.top, e11.top), e11.right = M(n3.right, e11.right), e11.bottom = M(n3.bottom, e11.bottom), e11.left = $(n3.left, e11.left), e11; + }, eP(t10, a2, i2)); + return { width: o2.right - o2.left, height: o2.bottom - o2.top, x: o2.left, y: o2.top }; + }, getOffsetParent: eO, getElementRects: eI, getClientRects: function(e10) { + return Array.from(e10.getClientRects()); + }, getDimensions: function(e10) { + let { width: t10, height: r2 } = ex(e10); + return { width: t10, height: r2 }; + }, getScale: e_, isElement: el, isRTL: function(e10) { + return "rtl" === eg(e10).direction; + } }, eM = (e10) => ({ name: "arrow", options: e10, async fn(t10) { + let { x: r2, y: n2, placement: i2, rects: s2, platform: a2, elements: o2, middlewareData: l2 } = t10, { element: c2, padding: u2 = 0 } = U(e10, t10) || {}; + if (null == c2) + return {}; + let d2 = Z(u2), h2 = { x: r2, y: n2 }, f2 = H(Q(i2)), p2 = W(f2), m2 = await a2.getDimensions(c2), g2 = "y" === f2, y2 = g2 ? "clientHeight" : "clientWidth", v2 = s2.reference[p2] + s2.reference[f2] - h2[f2] - s2.floating[p2], b2 = h2[f2] - s2.reference[f2], w2 = await (null == a2.getOffsetParent ? void 0 : a2.getOffsetParent(c2)), x2 = w2 ? w2[y2] : 0; + x2 && await (null == a2.isElement ? void 0 : a2.isElement(w2)) || (x2 = o2.floating[y2] || s2.floating[p2]); + let S2 = x2 / 2 - m2[p2] / 2 - 1, _2 = M(d2[g2 ? "top" : "left"], S2), E2 = M(d2[g2 ? "bottom" : "right"], S2), k2 = x2 - m2[p2] - E2, C2 = x2 / 2 - m2[p2] / 2 + (v2 / 2 - b2 / 2), R2 = $(_2, M(C2, k2)), P2 = !l2.arrow && null != z(i2) && C2 !== R2 && s2.reference[p2] / 2 - (C2 < _2 ? _2 : E2) - m2[p2] / 2 < 0, T2 = P2 ? C2 < _2 ? C2 - _2 : C2 - k2 : 0; + return { [f2]: h2[f2] + T2, data: { [f2]: R2, centerOffset: C2 - R2 - T2, ...P2 && { alignmentOffset: T2 } }, reset: P2 }; + } }), e$ = (e10, t10, r2) => { + let n2 = /* @__PURE__ */ new Map(), i2 = { platform: eN, ...r2 }, s2 = { ...i2.platform, _c: n2 }; + return Y(e10, t10, { ...i2, platform: s2 }); + }; + var eL = r(35703), ej = "undefined" != typeof document ? a.useLayoutEffect : a.useEffect; + function eD(e10, t10) { + let r2, n2, i2; + if (e10 === t10) + return true; + if (typeof e10 != typeof t10) + return false; + if ("function" == typeof e10 && e10.toString() === t10.toString()) + return true; + if (e10 && t10 && "object" == typeof e10) { + if (Array.isArray(e10)) { + if ((r2 = e10.length) !== t10.length) + return false; + for (n2 = r2; 0 != n2--; ) + if (!eD(e10[n2], t10[n2])) + return false; + return true; + } + if ((r2 = (i2 = Object.keys(e10)).length) !== Object.keys(t10).length) + return false; + for (n2 = r2; 0 != n2--; ) + if (!{}.hasOwnProperty.call(t10, i2[n2])) + return false; + for (n2 = r2; 0 != n2--; ) { + let r3 = i2[n2]; + if (("_owner" !== r3 || !e10.$$typeof) && !eD(e10[r3], t10[r3])) + return false; + } + return true; + } + return e10 != e10 && t10 != t10; + } + function eF(e10) { + return "undefined" == typeof window ? 1 : (e10.ownerDocument.defaultView || window).devicePixelRatio || 1; + } + function eB(e10, t10) { + let r2 = eF(e10); + return Math.round(t10 * r2) / r2; + } + function eU(e10) { + let t10 = a.useRef(e10); + return ej(() => { + t10.current = e10; + }), t10; + } + let eq = (e10) => ({ name: "arrow", options: e10, fn(t10) { + let { element: r2, padding: n2 } = "function" == typeof e10 ? e10(t10) : e10; + return r2 && {}.hasOwnProperty.call(r2, "current") ? null != r2.current ? eM({ element: r2.current, padding: n2 }).fn(t10) : {} : r2 ? eM({ element: r2, padding: n2 }).fn(t10) : {}; + } }), ez = (e10, t10) => ({ ...function(e11) { + return void 0 === e11 && (e11 = 0), { name: "offset", options: e11, async fn(t11) { + var r2, n2; + let { x: i2, y: s2, placement: a2, middlewareData: o2 } = t11, l2 = await er(t11, e11); + return a2 === (null == (r2 = o2.offset) ? void 0 : r2.placement) && null != (n2 = o2.arrow) && n2.alignmentOffset ? {} : { x: i2 + l2.x, y: s2 + l2.y, data: { ...l2, placement: a2 } }; + } }; + }(e10), options: [e10, t10] }), eH = (e10, t10) => ({ ...function(e11) { + return void 0 === e11 && (e11 = {}), { name: "shift", options: e11, async fn(t11) { + let { x: r2, y: n2, placement: i2 } = t11, { mainAxis: s2 = true, crossAxis: a2 = false, limiter: o2 = { fn: (e12) => { + let { x: t12, y: r3 } = e12; + return { x: t12, y: r3 }; + } }, ...l2 } = U(e11, t11), c2 = { x: r2, y: n2 }, u2 = await X(t11, l2), d2 = Q(q(i2)), h2 = H(d2), f2 = c2[h2], p2 = c2[d2]; + if (s2) { + let e12 = "y" === h2 ? "top" : "left", t12 = "y" === h2 ? "bottom" : "right", r3 = f2 + u2[e12], n3 = f2 - u2[t12]; + f2 = $(r3, M(f2, n3)); + } + if (a2) { + let e12 = "y" === d2 ? "top" : "left", t12 = "y" === d2 ? "bottom" : "right", r3 = p2 + u2[e12], n3 = p2 - u2[t12]; + p2 = $(r3, M(p2, n3)); + } + let m2 = o2.fn({ ...t11, [h2]: f2, [d2]: p2 }); + return { ...m2, data: { x: m2.x - r2, y: m2.y - n2, enabled: { [h2]: s2, [d2]: a2 } } }; + } }; + }(e10), options: [e10, t10] }), eW = (e10, t10) => ({ ...function(e11) { + return void 0 === e11 && (e11 = {}), { options: e11, fn(t11) { + let { x: r2, y: n2, placement: i2, rects: s2, middlewareData: a2 } = t11, { offset: o2 = 0, mainAxis: l2 = true, crossAxis: c2 = true } = U(e11, t11), u2 = { x: r2, y: n2 }, d2 = Q(i2), h2 = H(d2), f2 = u2[h2], p2 = u2[d2], m2 = U(o2, t11), g2 = "number" == typeof m2 ? { mainAxis: m2, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...m2 }; + if (l2) { + let e12 = "y" === h2 ? "height" : "width", t12 = s2.reference[h2] - s2.floating[e12] + g2.mainAxis, r3 = s2.reference[h2] + s2.reference[e12] - g2.mainAxis; + f2 < t12 ? f2 = t12 : f2 > r3 && (f2 = r3); + } + if (c2) { + var y2, v2; + let e12 = "y" === h2 ? "width" : "height", t12 = ["top", "left"].includes(q(i2)), r3 = s2.reference[d2] - s2.floating[e12] + (t12 && (null == (y2 = a2.offset) ? void 0 : y2[d2]) || 0) + (t12 ? 0 : g2.crossAxis), n3 = s2.reference[d2] + s2.reference[e12] + (t12 ? 0 : (null == (v2 = a2.offset) ? void 0 : v2[d2]) || 0) - (t12 ? g2.crossAxis : 0); + p2 < r3 ? p2 = r3 : p2 > n3 && (p2 = n3); + } + return { [h2]: f2, [d2]: p2 }; + } }; + }(e10), options: [e10, t10] }), eQ = (e10, t10) => ({ ...function(e11) { + return void 0 === e11 && (e11 = {}), { name: "flip", options: e11, async fn(t11) { + var r2, n2, i2, s2, a2; + let { placement: o2, middlewareData: l2, rects: c2, initialPlacement: u2, platform: d2, elements: h2 } = t11, { mainAxis: f2 = true, crossAxis: p2 = true, fallbackPlacements: m2, fallbackStrategy: g2 = "bestFit", fallbackAxisSideDirection: y2 = "none", flipAlignment: v2 = true, ...b2 } = U(e11, t11); + if (null != (r2 = l2.arrow) && r2.alignmentOffset) + return {}; + let w2 = q(o2), x2 = Q(u2), S2 = q(u2) === u2, _2 = await (null == d2.isRTL ? void 0 : d2.isRTL(h2.floating)), E2 = m2 || (S2 || !v2 ? [G(u2)] : function(e12) { + let t12 = G(e12); + return [V(e12), t12, V(t12)]; + }(u2)), k2 = "none" !== y2; + !m2 && k2 && E2.push(...function(e12, t12, r3, n3) { + let i3 = z(e12), s3 = function(e13, t13, r4) { + let n4 = ["left", "right"], i4 = ["right", "left"]; + switch (e13) { + case "top": + case "bottom": + if (r4) + return t13 ? i4 : n4; + return t13 ? n4 : i4; + case "left": + case "right": + return t13 ? ["top", "bottom"] : ["bottom", "top"]; + default: + return []; + } + }(q(e12), "start" === r3, n3); + return i3 && (s3 = s3.map((e13) => e13 + "-" + i3), t12 && (s3 = s3.concat(s3.map(V)))), s3; + }(u2, v2, y2, _2)); + let C2 = [u2, ...E2], R2 = await X(t11, b2), P2 = [], T2 = (null == (n2 = l2.flip) ? void 0 : n2.overflows) || []; + if (f2 && P2.push(R2[w2]), p2) { + let e12 = function(e13, t12, r3) { + void 0 === r3 && (r3 = false); + let n3 = z(e13), i3 = H(Q(e13)), s3 = W(i3), a3 = "x" === i3 ? n3 === (r3 ? "end" : "start") ? "right" : "left" : "start" === n3 ? "bottom" : "top"; + return t12.reference[s3] > t12.floating[s3] && (a3 = G(a3)), [a3, G(a3)]; + }(o2, c2, _2); + P2.push(R2[e12[0]], R2[e12[1]]); + } + if (T2 = [...T2, { placement: o2, overflows: P2 }], !P2.every((e12) => e12 <= 0)) { + let e12 = ((null == (i2 = l2.flip) ? void 0 : i2.index) || 0) + 1, t12 = C2[e12]; + if (t12) + return { data: { index: e12, overflows: T2 }, reset: { placement: t12 } }; + let r3 = null == (s2 = T2.filter((e13) => e13.overflows[0] <= 0).sort((e13, t13) => e13.overflows[1] - t13.overflows[1])[0]) ? void 0 : s2.placement; + if (!r3) + switch (g2) { + case "bestFit": { + let e13 = null == (a2 = T2.filter((e14) => { + if (k2) { + let t13 = Q(e14.placement); + return t13 === x2 || "y" === t13; + } + return true; + }).map((e14) => [e14.placement, e14.overflows.filter((e15) => e15 > 0).reduce((e15, t13) => e15 + t13, 0)]).sort((e14, t13) => e14[1] - t13[1])[0]) ? void 0 : a2[0]; + e13 && (r3 = e13); + break; + } + case "initialPlacement": + r3 = u2; + } + if (o2 !== r3) + return { reset: { placement: r3 } }; + } + return {}; + } }; + }(e10), options: [e10, t10] }), eV = (e10, t10) => ({ ...function(e11) { + return void 0 === e11 && (e11 = {}), { name: "size", options: e11, async fn(t11) { + var r2, n2; + let i2, s2; + let { placement: a2, rects: o2, platform: l2, elements: c2 } = t11, { apply: u2 = () => { + }, ...d2 } = U(e11, t11), h2 = await X(t11, d2), f2 = q(a2), p2 = z(a2), m2 = "y" === Q(a2), { width: g2, height: y2 } = o2.floating; + "top" === f2 || "bottom" === f2 ? (i2 = f2, s2 = p2 === (await (null == l2.isRTL ? void 0 : l2.isRTL(c2.floating)) ? "start" : "end") ? "left" : "right") : (s2 = f2, i2 = "end" === p2 ? "top" : "bottom"); + let v2 = y2 - h2.top - h2.bottom, b2 = g2 - h2.left - h2.right, w2 = M(y2 - h2[i2], v2), x2 = M(g2 - h2[s2], b2), S2 = !t11.middlewareData.shift, _2 = w2, E2 = x2; + if (null != (r2 = t11.middlewareData.shift) && r2.enabled.x && (E2 = b2), null != (n2 = t11.middlewareData.shift) && n2.enabled.y && (_2 = v2), S2 && !p2) { + let e12 = $(h2.left, 0), t12 = $(h2.right, 0), r3 = $(h2.top, 0), n3 = $(h2.bottom, 0); + m2 ? E2 = g2 - 2 * (0 !== e12 || 0 !== t12 ? e12 + t12 : $(h2.left, h2.right)) : _2 = y2 - 2 * (0 !== r3 || 0 !== n3 ? r3 + n3 : $(h2.top, h2.bottom)); + } + await u2({ ...t11, availableWidth: E2, availableHeight: _2 }); + let k2 = await l2.getDimensions(c2.floating); + return g2 !== k2.width || y2 !== k2.height ? { reset: { rects: true } } : {}; + } }; + }(e10), options: [e10, t10] }), eG = (e10, t10) => ({ ...function(e11) { + return void 0 === e11 && (e11 = {}), { name: "hide", options: e11, async fn(t11) { + let { rects: r2 } = t11, { strategy: n2 = "referenceHidden", ...i2 } = U(e11, t11); + switch (n2) { + case "referenceHidden": { + let e12 = ee(await X(t11, { ...i2, elementContext: "reference" }), r2.reference); + return { data: { referenceHiddenOffsets: e12, referenceHidden: et(e12) } }; + } + case "escaped": { + let e12 = ee(await X(t11, { ...i2, altBoundary: true }), r2.floating); + return { data: { escapedOffsets: e12, escaped: et(e12) } }; + } + default: + return {}; + } + } }; + }(e10), options: [e10, t10] }), eZ = (e10, t10) => ({ ...eq(e10), options: [e10, t10] }); + var eK = a.forwardRef((e10, t10) => { + let { children: r2, width: n2 = 10, height: i2 = 5, ...s2 } = e10; + return (0, f.jsx)(d.WV.svg, { ...s2, ref: t10, width: n2, height: i2, viewBox: "0 0 30 10", preserveAspectRatio: "none", children: e10.asChild ? r2 : (0, f.jsx)("polygon", { points: "0,0 30,0 15,10" }) }); + }); + eK.displayName = "Arrow"; + var eJ = "Popper", [eY, eX] = function(e10, t10 = []) { + let r2 = [], n2 = () => { + let t11 = r2.map((e11) => a.createContext(e11)); + return function(r3) { + let n3 = r3?.[e10] || t11; + return a.useMemo(() => ({ [`__scope${e10}`]: { ...r3, [e10]: n3 } }), [r3, n3]); + }; + }; + return n2.scopeName = e10, [function(t11, n3) { + let i2 = a.createContext(n3), s2 = r2.length; + function o2(t12) { + let { scope: r3, children: n4, ...o3 } = t12, l2 = r3?.[e10][s2] || i2, c2 = a.useMemo(() => o3, Object.values(o3)); + return (0, f.jsx)(l2.Provider, { value: c2, children: n4 }); + } + return r2 = [...r2, n3], o2.displayName = t11 + "Provider", [o2, function(r3, o3) { + let l2 = o3?.[e10][s2] || i2, c2 = a.useContext(l2); + if (c2) + return c2; + if (void 0 !== n3) + return n3; + throw Error(`\`${r3}\` must be used within \`${t11}\``); + }]; + }, function(...e11) { + let t11 = e11[0]; + if (1 === e11.length) + return t11; + let r3 = () => { + let r4 = e11.map((e12) => ({ useScope: e12(), scopeName: e12.scopeName })); + return function(e12) { + let n3 = r4.reduce((t12, { useScope: r5, scopeName: n4 }) => { + let i2 = r5(e12)[`__scope${n4}`]; + return { ...t12, ...i2 }; + }, {}); + return a.useMemo(() => ({ [`__scope${t11.scopeName}`]: n3 }), [n3]); + }; + }; + return r3.scopeName = t11.scopeName, r3; + }(n2, ...t10)]; + }(eJ), [e0, e1] = eY(eJ), e2 = (e10) => { + let { __scopePopper: t10, children: r2 } = e10, [n2, i2] = a.useState(null); + return (0, f.jsx)(e0, { scope: t10, anchor: n2, onAnchorChange: i2, children: r2 }); + }; + e2.displayName = eJ; + var e6 = "PopperAnchor", e5 = a.forwardRef((e10, t10) => { + let { __scopePopper: r2, virtualRef: n2, ...i2 } = e10, s2 = e1(e6, r2), o2 = a.useRef(null), l2 = (0, c.e)(t10, o2); + return a.useEffect(() => { + s2.onAnchorChange(n2?.current || o2.current); + }), n2 ? null : (0, f.jsx)(d.WV.div, { ...i2, ref: l2 }); + }); + e5.displayName = e6; + var e4 = "PopperContent", [e3, e8] = eY(e4), e9 = a.forwardRef((e10, t10) => { + let { __scopePopper: r2, side: n2 = "bottom", sideOffset: i2 = 0, align: s2 = "center", alignOffset: o2 = 0, arrowPadding: l2 = 0, avoidCollisions: u2 = true, collisionBoundary: p2 = [], collisionPadding: m2 = 0, sticky: g2 = "partial", hideWhenDetached: y2 = false, updatePositionStrategy: v2 = "optimized", onPlaced: b2, ...w2 } = e10, x2 = e1(e4, r2), [S2, _2] = a.useState(null), E2 = (0, c.e)(t10, (e11) => _2(e11)), [k2, C2] = a.useState(null), R2 = function(e11) { + let [t11, r3] = a.useState(void 0); + return (0, A.b)(() => { + if (e11) { + r3({ width: e11.offsetWidth, height: e11.offsetHeight }); + let t12 = new ResizeObserver((t13) => { + let n3, i3; + if (!Array.isArray(t13) || !t13.length) + return; + let s3 = t13[0]; + if ("borderBoxSize" in s3) { + let e12 = s3.borderBoxSize, t14 = Array.isArray(e12) ? e12[0] : e12; + n3 = t14.inlineSize, i3 = t14.blockSize; + } else + n3 = e11.offsetWidth, i3 = e11.offsetHeight; + r3({ width: n3, height: i3 }); + }); + return t12.observe(e11, { box: "border-box" }), () => t12.unobserve(e11); + } + r3(void 0); + }, [e11]), t11; + }(k2), P2 = R2?.width ?? 0, T2 = R2?.height ?? 0, O2 = "number" == typeof m2 ? m2 : { top: 0, right: 0, bottom: 0, left: 0, ...m2 }, I2 = Array.isArray(p2) ? p2 : [p2], N2 = I2.length > 0, L2 = { padding: O2, boundary: I2.filter(tr), altBoundary: N2 }, { refs: D2, floatingStyles: F2, placement: B2, isPositioned: U2, middlewareData: q2 } = function(e11) { + void 0 === e11 && (e11 = {}); + let { placement: t11 = "bottom", strategy: r3 = "absolute", middleware: n3 = [], platform: i3, elements: { reference: s3, floating: o3 } = {}, transform: l3 = true, whileElementsMounted: c2, open: u3 } = e11, [d2, h2] = a.useState({ x: 0, y: 0, strategy: r3, placement: t11, middlewareData: {}, isPositioned: false }), [f2, p3] = a.useState(n3); + eD(f2, n3) || p3(n3); + let [m3, g3] = a.useState(null), [y3, v3] = a.useState(null), b3 = a.useCallback((e12) => { + e12 !== _3.current && (_3.current = e12, g3(e12)); + }, []), w3 = a.useCallback((e12) => { + e12 !== E3.current && (E3.current = e12, v3(e12)); + }, []), x3 = s3 || m3, S3 = o3 || y3, _3 = a.useRef(null), E3 = a.useRef(null), k3 = a.useRef(d2), C3 = null != c2, R3 = eU(c2), P3 = eU(i3), T3 = eU(u3), A2 = a.useCallback(() => { + if (!_3.current || !E3.current) + return; + let e12 = { placement: t11, strategy: r3, middleware: f2 }; + P3.current && (e12.platform = P3.current), e$(_3.current, E3.current, e12).then((e13) => { + let t12 = { ...e13, isPositioned: false !== T3.current }; + O3.current && !eD(k3.current, t12) && (k3.current = t12, eL.flushSync(() => { + h2(t12); + })); + }); + }, [f2, t11, r3, P3, T3]); + ej(() => { + false === u3 && k3.current.isPositioned && (k3.current.isPositioned = false, h2((e12) => ({ ...e12, isPositioned: false }))); + }, [u3]); + let O3 = a.useRef(false); + ej(() => (O3.current = true, () => { + O3.current = false; + }), []), ej(() => { + if (x3 && (_3.current = x3), S3 && (E3.current = S3), x3 && S3) { + if (R3.current) + return R3.current(x3, S3, A2); + A2(); + } + }, [x3, S3, A2, R3, C3]); + let I3 = a.useMemo(() => ({ reference: _3, floating: E3, setReference: b3, setFloating: w3 }), [b3, w3]), N3 = a.useMemo(() => ({ reference: x3, floating: S3 }), [x3, S3]), M2 = a.useMemo(() => { + let e12 = { position: r3, left: 0, top: 0 }; + if (!N3.floating) + return e12; + let t12 = eB(N3.floating, d2.x), n4 = eB(N3.floating, d2.y); + return l3 ? { ...e12, transform: "translate(" + t12 + "px, " + n4 + "px)", ...eF(N3.floating) >= 1.5 && { willChange: "transform" } } : { position: r3, left: t12, top: n4 }; + }, [r3, l3, N3.floating, d2.x, d2.y]); + return a.useMemo(() => ({ ...d2, update: A2, refs: I3, elements: N3, floatingStyles: M2 }), [d2, A2, I3, N3, M2]); + }({ strategy: "fixed", placement: n2 + ("center" !== s2 ? "-" + s2 : ""), whileElementsMounted: (...e11) => function(e12, t11, r3, n3) { + let i3; + void 0 === n3 && (n3 = {}); + let { ancestorScroll: s3 = true, ancestorResize: a2 = true, elementResize: o3 = "function" == typeof ResizeObserver, layoutShift: l3 = "function" == typeof IntersectionObserver, animationFrame: c2 = false } = n3, u3 = eS(e12), d2 = s3 || a2 ? [...u3 ? eb(u3) : [], ...eb(t11)] : []; + d2.forEach((e13) => { + s3 && e13.addEventListener("scroll", r3, { passive: true }), a2 && e13.addEventListener("resize", r3); + }); + let h2 = u3 && l3 ? function(e13, t12) { + let r4, n4 = null, i4 = ea(e13); + function s4() { + var e14; + clearTimeout(r4), null == (e14 = n4) || e14.disconnect(), n4 = null; + } + return !function a3(o4, l4) { + void 0 === o4 && (o4 = false), void 0 === l4 && (l4 = 1), s4(); + let { left: c3, top: u4, width: d3, height: h3 } = e13.getBoundingClientRect(); + if (o4 || t12(), !d3 || !h3) + return; + let f3 = j(u4), p4 = j(i4.clientWidth - (c3 + d3)), m4 = { rootMargin: -f3 + "px " + -p4 + "px " + -j(i4.clientHeight - (u4 + h3)) + "px " + -j(c3) + "px", threshold: $(0, M(1, l4)) || 1 }, g3 = true; + function y3(e14) { + let t13 = e14[0].intersectionRatio; + if (t13 !== l4) { + if (!g3) + return a3(); + t13 ? a3(false, t13) : r4 = setTimeout(() => { + a3(false, 1e-7); + }, 1e3); + } + g3 = false; + } + try { + n4 = new IntersectionObserver(y3, { ...m4, root: i4.ownerDocument }); + } catch (e14) { + n4 = new IntersectionObserver(y3, m4); + } + n4.observe(e13); + }(true), s4; + }(u3, r3) : null, f2 = -1, p3 = null; + o3 && (p3 = new ResizeObserver((e13) => { + let [n4] = e13; + n4 && n4.target === u3 && p3 && (p3.unobserve(t11), cancelAnimationFrame(f2), f2 = requestAnimationFrame(() => { + var e14; + null == (e14 = p3) || e14.observe(t11); + })), r3(); + }), u3 && !c2 && p3.observe(u3), p3.observe(t11)); + let m3 = c2 ? eC(e12) : null; + return c2 && function t12() { + let n4 = eC(e12); + m3 && (n4.x !== m3.x || n4.y !== m3.y || n4.width !== m3.width || n4.height !== m3.height) && r3(), m3 = n4, i3 = requestAnimationFrame(t12); + }(), r3(), () => { + var e13; + d2.forEach((e14) => { + s3 && e14.removeEventListener("scroll", r3), a2 && e14.removeEventListener("resize", r3); + }), null == h2 || h2(), null == (e13 = p3) || e13.disconnect(), p3 = null, c2 && cancelAnimationFrame(i3); + }; + }(...e11, { animationFrame: "always" === v2 }), elements: { reference: x2.anchor }, middleware: [ez({ mainAxis: i2 + T2, alignmentAxis: o2 }), u2 && eH({ mainAxis: true, crossAxis: false, limiter: "partial" === g2 ? eW() : void 0, ...L2 }), u2 && eQ({ ...L2 }), eV({ ...L2, apply: ({ elements: e11, rects: t11, availableWidth: r3, availableHeight: n3 }) => { + let { width: i3, height: s3 } = t11.reference, a2 = e11.floating.style; + a2.setProperty("--radix-popper-available-width", `${r3}px`), a2.setProperty("--radix-popper-available-height", `${n3}px`), a2.setProperty("--radix-popper-anchor-width", `${i3}px`), a2.setProperty("--radix-popper-anchor-height", `${s3}px`); + } }), k2 && eZ({ element: k2, padding: l2 }), tn({ arrowWidth: P2, arrowHeight: T2 }), y2 && eG({ strategy: "referenceHidden", ...L2 })] }), [z2, H2] = ti(B2), W2 = (0, h.W)(b2); + (0, A.b)(() => { + U2 && W2?.(); + }, [U2, W2]); + let Q2 = q2.arrow?.x, V2 = q2.arrow?.y, G2 = q2.arrow?.centerOffset !== 0, [Z2, K2] = a.useState(); + return (0, A.b)(() => { + S2 && K2(window.getComputedStyle(S2).zIndex); + }, [S2]), (0, f.jsx)("div", { ref: D2.setFloating, "data-radix-popper-content-wrapper": "", style: { ...F2, transform: U2 ? F2.transform : "translate(0, -200%)", minWidth: "max-content", zIndex: Z2, "--radix-popper-transform-origin": [q2.transformOrigin?.x, q2.transformOrigin?.y].join(" "), ...q2.hide?.referenceHidden && { visibility: "hidden", pointerEvents: "none" } }, dir: e10.dir, children: (0, f.jsx)(e3, { scope: r2, placedSide: z2, onArrowChange: C2, arrowX: Q2, arrowY: V2, shouldHideArrow: G2, children: (0, f.jsx)(d.WV.div, { "data-side": z2, "data-align": H2, ...w2, ref: E2, style: { ...w2.style, animation: U2 ? void 0 : "none" } }) }) }); + }); + e9.displayName = e4; + var e7 = "PopperArrow", te = { top: "bottom", right: "left", bottom: "top", left: "right" }, tt = a.forwardRef(function(e10, t10) { + let { __scopePopper: r2, ...n2 } = e10, i2 = e8(e7, r2), s2 = te[i2.placedSide]; + return (0, f.jsx)("span", { ref: i2.onArrowChange, style: { position: "absolute", left: i2.arrowX, top: i2.arrowY, [s2]: 0, transformOrigin: { top: "", right: "0 0", bottom: "center 0", left: "100% 0" }[i2.placedSide], transform: { top: "translateY(100%)", right: "translateY(50%) rotate(90deg) translateX(-50%)", bottom: "rotate(180deg)", left: "translateY(50%) rotate(-90deg) translateX(50%)" }[i2.placedSide], visibility: i2.shouldHideArrow ? "hidden" : void 0 }, children: (0, f.jsx)(eK, { ...n2, ref: t10, style: { ...n2.style, display: "block" } }) }); + }); + function tr(e10) { + return null !== e10; + } + tt.displayName = e7; + var tn = (e10) => ({ name: "transformOrigin", options: e10, fn(t10) { + let { placement: r2, rects: n2, middlewareData: i2 } = t10, s2 = i2.arrow?.centerOffset !== 0, a2 = s2 ? 0 : e10.arrowWidth, o2 = s2 ? 0 : e10.arrowHeight, [l2, c2] = ti(r2), u2 = { start: "0%", center: "50%", end: "100%" }[c2], d2 = (i2.arrow?.x ?? 0) + a2 / 2, h2 = (i2.arrow?.y ?? 0) + o2 / 2, f2 = "", p2 = ""; + return "bottom" === l2 ? (f2 = s2 ? u2 : `${d2}px`, p2 = `${-o2}px`) : "top" === l2 ? (f2 = s2 ? u2 : `${d2}px`, p2 = `${n2.floating.height + o2}px`) : "right" === l2 ? (f2 = `${-o2}px`, p2 = s2 ? u2 : `${h2}px`) : "left" === l2 && (f2 = `${n2.floating.width + o2}px`, p2 = s2 ? u2 : `${h2}px`), { data: { x: f2, y: p2 } }; + } }); + function ti(e10) { + let [t10, r2 = "center"] = e10.split("-"); + return [t10, r2]; + } + var ts = a.forwardRef((e10, t10) => { + let { container: r2, ...n2 } = e10, [i2, s2] = a.useState(false); + (0, A.b)(() => s2(true), []); + let o2 = r2 || i2 && globalThis2?.document?.body; + return o2 ? eL.createPortal((0, f.jsx)(d.WV.div, { ...n2, ref: t10 }), o2) : null; + }); + ts.displayName = "Portal"; + var ta = r(27217), to = r(87796), tl = /* @__PURE__ */ new WeakMap(), tc = /* @__PURE__ */ new WeakMap(), tu = {}, td = 0, th = function(e10) { + return e10 && (e10.host || th(e10.parentNode)); + }, tf = function(e10, t10, r2, n2) { + var i2 = (Array.isArray(e10) ? e10 : [e10]).map(function(e11) { + if (t10.contains(e11)) + return e11; + var r3 = th(e11); + return r3 && t10.contains(r3) ? r3 : (console.error("aria-hidden", e11, "in not contained inside", t10, ". Doing nothing"), null); + }).filter(function(e11) { + return !!e11; + }); + tu[r2] || (tu[r2] = /* @__PURE__ */ new WeakMap()); + var s2 = tu[r2], a2 = [], o2 = /* @__PURE__ */ new Set(), l2 = new Set(i2), c2 = function(e11) { + !e11 || o2.has(e11) || (o2.add(e11), c2(e11.parentNode)); + }; + i2.forEach(c2); + var u2 = function(e11) { + !e11 || l2.has(e11) || Array.prototype.forEach.call(e11.children, function(e12) { + if (o2.has(e12)) + u2(e12); + else + try { + var t11 = e12.getAttribute(n2), i3 = null !== t11 && "false" !== t11, l3 = (tl.get(e12) || 0) + 1, c3 = (s2.get(e12) || 0) + 1; + tl.set(e12, l3), s2.set(e12, c3), a2.push(e12), 1 === l3 && i3 && tc.set(e12, true), 1 === c3 && e12.setAttribute(r2, "true"), i3 || e12.setAttribute(n2, "true"); + } catch (t12) { + console.error("aria-hidden: cannot operate on ", e12, t12); + } + }); + }; + return u2(t10), o2.clear(), td++, function() { + a2.forEach(function(e11) { + var t11 = tl.get(e11) - 1, i3 = s2.get(e11) - 1; + tl.set(e11, t11), s2.set(e11, i3), t11 || (tc.has(e11) || e11.removeAttribute(n2), tc.delete(e11)), i3 || e11.removeAttribute(r2); + }), --td || (tl = /* @__PURE__ */ new WeakMap(), tl = /* @__PURE__ */ new WeakMap(), tc = /* @__PURE__ */ new WeakMap(), tu = {}); + }; + }, tp = function(e10, t10, r2) { + void 0 === r2 && (r2 = "data-aria-hidden"); + var n2, i2 = Array.from(Array.isArray(e10) ? e10 : [e10]), s2 = t10 || (n2 = e10, "undefined" == typeof document ? null : (Array.isArray(n2) ? n2[0] : n2).ownerDocument.body); + return s2 ? (i2.push.apply(i2, Array.from(s2.querySelectorAll("[aria-live]"))), tf(i2, s2, r2, "aria-hidden")) : function() { + return null; + }; + }, tm = function() { + return (tm = Object.assign || function(e10) { + for (var t10, r2 = 1, n2 = arguments.length; r2 < n2; r2++) + for (var i2 in t10 = arguments[r2]) + Object.prototype.hasOwnProperty.call(t10, i2) && (e10[i2] = t10[i2]); + return e10; + }).apply(this, arguments); + }; + function tg(e10, t10) { + var r2 = {}; + for (var n2 in e10) + Object.prototype.hasOwnProperty.call(e10, n2) && 0 > t10.indexOf(n2) && (r2[n2] = e10[n2]); + if (null != e10 && "function" == typeof Object.getOwnPropertySymbols) + for (var i2 = 0, n2 = Object.getOwnPropertySymbols(e10); i2 < n2.length; i2++) + 0 > t10.indexOf(n2[i2]) && Object.prototype.propertyIsEnumerable.call(e10, n2[i2]) && (r2[n2[i2]] = e10[n2[i2]]); + return r2; + } + Object.create, Object.create, "function" == typeof SuppressedError && SuppressedError; + var ty = "right-scroll-bar-position", tv = "width-before-scroll-bar"; + function tb(e10, t10) { + return "function" == typeof e10 ? e10(t10) : e10 && (e10.current = t10), e10; + } + var tw = "undefined" != typeof window ? a.useLayoutEffect : a.useEffect, tx = /* @__PURE__ */ new WeakMap(); + function tS(e10) { + return e10; + } + var t_ = function(e10) { + void 0 === e10 && (e10 = {}); + var t10, r2, n2, i2 = (void 0 === t10 && (t10 = tS), r2 = [], n2 = false, { read: function() { + if (n2) + throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`."); + return r2.length ? r2[r2.length - 1] : null; + }, useMedium: function(e11) { + var i3 = t10(e11, n2); + return r2.push(i3), function() { + r2 = r2.filter(function(e12) { + return e12 !== i3; + }); + }; + }, assignSyncMedium: function(e11) { + for (n2 = true; r2.length; ) { + var t11 = r2; + r2 = [], t11.forEach(e11); + } + r2 = { push: function(t12) { + return e11(t12); + }, filter: function() { + return r2; + } }; + }, assignMedium: function(e11) { + n2 = true; + var t11 = []; + if (r2.length) { + var i3 = r2; + r2 = [], i3.forEach(e11), t11 = r2; + } + var s2 = function() { + var r3 = t11; + t11 = [], r3.forEach(e11); + }, a2 = function() { + return Promise.resolve().then(s2); + }; + a2(), r2 = { push: function(e12) { + t11.push(e12), a2(); + }, filter: function(e12) { + return t11 = t11.filter(e12), r2; + } }; + } }); + return i2.options = tm({ async: true, ssr: false }, e10), i2; + }(), tE = function() { + }, tk = a.forwardRef(function(e10, t10) { + var r2, n2, i2, s2, o2 = a.useRef(null), l2 = a.useState({ onScrollCapture: tE, onWheelCapture: tE, onTouchMoveCapture: tE }), c2 = l2[0], u2 = l2[1], d2 = e10.forwardProps, h2 = e10.children, f2 = e10.className, p2 = e10.removeScrollBar, m2 = e10.enabled, g2 = e10.shards, y2 = e10.sideCar, v2 = e10.noIsolation, b2 = e10.inert, w2 = e10.allowPinchZoom, x2 = e10.as, S2 = e10.gapMode, _2 = tg(e10, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E2 = (r2 = [o2, t10], n2 = function(e11) { + return r2.forEach(function(t11) { + return tb(t11, e11); + }); + }, (i2 = (0, a.useState)(function() { + return { value: null, callback: n2, facade: { get current() { + return i2.value; + }, set current(value) { + var e11 = i2.value; + e11 !== value && (i2.value = value, i2.callback(value, e11)); + } } }; + })[0]).callback = n2, s2 = i2.facade, tw(function() { + var e11 = tx.get(s2); + if (e11) { + var t11 = new Set(e11), n3 = new Set(r2), i3 = s2.current; + t11.forEach(function(e12) { + n3.has(e12) || tb(e12, null); + }), n3.forEach(function(e12) { + t11.has(e12) || tb(e12, i3); + }); + } + tx.set(s2, r2); + }, [r2]), s2), k2 = tm(tm({}, _2), c2); + return a.createElement(a.Fragment, null, m2 && a.createElement(y2, { sideCar: t_, removeScrollBar: p2, shards: g2, noIsolation: v2, inert: b2, setCallbacks: u2, allowPinchZoom: !!w2, lockRef: o2, gapMode: S2 }), d2 ? a.cloneElement(a.Children.only(h2), tm(tm({}, k2), { ref: E2 })) : a.createElement(void 0 === x2 ? "div" : x2, tm({}, k2, { className: f2, ref: E2 }), h2)); + }); + tk.defaultProps = { enabled: true, removeScrollBar: true, inert: false }, tk.classNames = { fullWidth: tv, zeroRight: ty }; + var tC = function(e10) { + var t10 = e10.sideCar, r2 = tg(e10, ["sideCar"]); + if (!t10) + throw Error("Sidecar: please provide `sideCar` property to import the right car"); + var n2 = t10.read(); + if (!n2) + throw Error("Sidecar medium not found"); + return a.createElement(n2, tm({}, r2)); + }; + tC.isSideCarExport = true; + var tR = function() { + var e10 = 0, t10 = null; + return { add: function(n2) { + if (0 == e10 && (t10 = function() { + if (!document) + return null; + var e11 = document.createElement("style"); + e11.type = "text/css"; + var t11 = s || r.nc; + return t11 && e11.setAttribute("nonce", t11), e11; + }())) { + var i2, a2; + (i2 = t10).styleSheet ? i2.styleSheet.cssText = n2 : i2.appendChild(document.createTextNode(n2)), a2 = t10, (document.head || document.getElementsByTagName("head")[0]).appendChild(a2); + } + e10++; + }, remove: function() { + --e10 || !t10 || (t10.parentNode && t10.parentNode.removeChild(t10), t10 = null); + } }; + }, tP = function() { + var e10 = tR(); + return function(t10, r2) { + a.useEffect(function() { + return e10.add(t10), function() { + e10.remove(); + }; + }, [t10 && r2]); + }; + }, tT = function() { + var e10 = tP(); + return function(t10) { + return e10(t10.styles, t10.dynamic), null; + }; + }, tA = { left: 0, top: 0, right: 0, gap: 0 }, tO = function(e10) { + return parseInt(e10 || "", 10) || 0; + }, tI = function(e10) { + var t10 = window.getComputedStyle(document.body), r2 = t10["padding" === e10 ? "paddingLeft" : "marginLeft"], n2 = t10["padding" === e10 ? "paddingTop" : "marginTop"], i2 = t10["padding" === e10 ? "paddingRight" : "marginRight"]; + return [tO(r2), tO(n2), tO(i2)]; + }, tN = function(e10) { + if (void 0 === e10 && (e10 = "margin"), "undefined" == typeof window) + return tA; + var t10 = tI(e10), r2 = document.documentElement.clientWidth, n2 = window.innerWidth; + return { left: t10[0], top: t10[1], right: t10[2], gap: Math.max(0, n2 - r2 + t10[2] - t10[0]) }; + }, tM = tT(), t$ = "data-scroll-locked", tL = function(e10, t10, r2, n2) { + var i2 = e10.left, s2 = e10.top, a2 = e10.right, o2 = e10.gap; + return void 0 === r2 && (r2 = "margin"), "\n .".concat("with-scroll-bars-hidden", " {\n overflow: hidden ").concat(n2, ";\n padding-right: ").concat(o2, "px ").concat(n2, ";\n }\n body[").concat(t$, "] {\n overflow: hidden ").concat(n2, ";\n overscroll-behavior: contain;\n ").concat([t10 && "position: relative ".concat(n2, ";"), "margin" === r2 && "\n padding-left: ".concat(i2, "px;\n padding-top: ").concat(s2, "px;\n padding-right: ").concat(a2, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o2, "px ").concat(n2, ";\n "), "padding" === r2 && "padding-right: ".concat(o2, "px ").concat(n2, ";")].filter(Boolean).join(""), "\n }\n \n .").concat(ty, " {\n right: ").concat(o2, "px ").concat(n2, ";\n }\n \n .").concat(tv, " {\n margin-right: ").concat(o2, "px ").concat(n2, ";\n }\n \n .").concat(ty, " .").concat(ty, " {\n right: 0 ").concat(n2, ";\n }\n \n .").concat(tv, " .").concat(tv, " {\n margin-right: 0 ").concat(n2, ";\n }\n \n body[").concat(t$, "] {\n ").concat("--removed-body-scroll-bar-size", ": ").concat(o2, "px;\n }\n"); + }, tj = function() { + var e10 = parseInt(document.body.getAttribute(t$) || "0", 10); + return isFinite(e10) ? e10 : 0; + }, tD = function() { + a.useEffect(function() { + return document.body.setAttribute(t$, (tj() + 1).toString()), function() { + var e10 = tj() - 1; + e10 <= 0 ? document.body.removeAttribute(t$) : document.body.setAttribute(t$, e10.toString()); + }; + }, []); + }, tF = function(e10) { + var t10 = e10.noRelative, r2 = e10.noImportant, n2 = e10.gapMode, i2 = void 0 === n2 ? "margin" : n2; + tD(); + var s2 = a.useMemo(function() { + return tN(i2); + }, [i2]); + return a.createElement(tM, { styles: tL(s2, !t10, i2, r2 ? "" : "!important") }); + }, tB = false; + if ("undefined" != typeof window) + try { + var tU = Object.defineProperty({}, "passive", { get: function() { + return tB = true, true; + } }); + window.addEventListener("test", tU, tU), window.removeEventListener("test", tU, tU); + } catch (e10) { + tB = false; + } + var tq = !!tB && { passive: false }, tz = function(e10, t10) { + if (!(e10 instanceof Element)) + return false; + var r2 = window.getComputedStyle(e10); + return "hidden" !== r2[t10] && !(r2.overflowY === r2.overflowX && "TEXTAREA" !== e10.tagName && "visible" === r2[t10]); + }, tH = function(e10, t10) { + var r2 = t10.ownerDocument, n2 = t10; + do { + if ("undefined" != typeof ShadowRoot && n2 instanceof ShadowRoot && (n2 = n2.host), tW(e10, n2)) { + var i2 = tQ(e10, n2); + if (i2[1] > i2[2]) + return true; + } + n2 = n2.parentNode; + } while (n2 && n2 !== r2.body); + return false; + }, tW = function(e10, t10) { + return "v" === e10 ? tz(t10, "overflowY") : tz(t10, "overflowX"); + }, tQ = function(e10, t10) { + return "v" === e10 ? [t10.scrollTop, t10.scrollHeight, t10.clientHeight] : [t10.scrollLeft, t10.scrollWidth, t10.clientWidth]; + }, tV = function(e10, t10, r2, n2, i2) { + var s2, a2 = (s2 = window.getComputedStyle(t10).direction, "h" === e10 && "rtl" === s2 ? -1 : 1), o2 = a2 * n2, l2 = r2.target, c2 = t10.contains(l2), u2 = false, d2 = o2 > 0, h2 = 0, f2 = 0; + do { + var p2 = tQ(e10, l2), m2 = p2[0], g2 = p2[1] - p2[2] - a2 * m2; + (m2 || g2) && tW(e10, l2) && (h2 += g2, f2 += m2), l2 instanceof ShadowRoot ? l2 = l2.host : l2 = l2.parentNode; + } while (!c2 && l2 !== document.body || c2 && (t10.contains(l2) || t10 === l2)); + return d2 && (i2 && 1 > Math.abs(h2) || !i2 && o2 > h2) ? u2 = true : !d2 && (i2 && 1 > Math.abs(f2) || !i2 && -o2 > f2) && (u2 = true), u2; + }, tG = function(e10) { + return "changedTouches" in e10 ? [e10.changedTouches[0].clientX, e10.changedTouches[0].clientY] : [0, 0]; + }, tZ = function(e10) { + return [e10.deltaX, e10.deltaY]; + }, tK = function(e10) { + return e10 && "current" in e10 ? e10.current : e10; + }, tJ = 0, tY = []; + let tX = (n = function(e10) { + var t10 = a.useRef([]), r2 = a.useRef([0, 0]), n2 = a.useRef(), i2 = a.useState(tJ++)[0], s2 = a.useState(tT)[0], o2 = a.useRef(e10); + a.useEffect(function() { + o2.current = e10; + }, [e10]), a.useEffect(function() { + if (e10.inert) { + document.body.classList.add("block-interactivity-".concat(i2)); + var t11 = function(e11, t12, r3) { + if (r3 || 2 == arguments.length) + for (var n3, i3 = 0, s3 = t12.length; i3 < s3; i3++) + !n3 && i3 in t12 || (n3 || (n3 = Array.prototype.slice.call(t12, 0, i3)), n3[i3] = t12[i3]); + return e11.concat(n3 || Array.prototype.slice.call(t12)); + }([e10.lockRef.current], (e10.shards || []).map(tK), true).filter(Boolean); + return t11.forEach(function(e11) { + return e11.classList.add("allow-interactivity-".concat(i2)); + }), function() { + document.body.classList.remove("block-interactivity-".concat(i2)), t11.forEach(function(e11) { + return e11.classList.remove("allow-interactivity-".concat(i2)); + }); + }; + } + }, [e10.inert, e10.lockRef.current, e10.shards]); + var l2 = a.useCallback(function(e11, t11) { + if ("touches" in e11 && 2 === e11.touches.length || "wheel" === e11.type && e11.ctrlKey) + return !o2.current.allowPinchZoom; + var i3, s3 = tG(e11), a2 = r2.current, l3 = "deltaX" in e11 ? e11.deltaX : a2[0] - s3[0], c3 = "deltaY" in e11 ? e11.deltaY : a2[1] - s3[1], u3 = e11.target, d3 = Math.abs(l3) > Math.abs(c3) ? "h" : "v"; + if ("touches" in e11 && "h" === d3 && "range" === u3.type) + return false; + var h3 = tH(d3, u3); + if (!h3) + return true; + if (h3 ? i3 = d3 : (i3 = "v" === d3 ? "h" : "v", h3 = tH(d3, u3)), !h3) + return false; + if (!n2.current && "changedTouches" in e11 && (l3 || c3) && (n2.current = i3), !i3) + return true; + var f3 = n2.current || i3; + return tV(f3, t11, e11, "h" === f3 ? l3 : c3, true); + }, []), c2 = a.useCallback(function(e11) { + if (tY.length && tY[tY.length - 1] === s2) { + var r3 = "deltaY" in e11 ? tZ(e11) : tG(e11), n3 = t10.current.filter(function(t11) { + var n4; + return t11.name === e11.type && (t11.target === e11.target || e11.target === t11.shadowParent) && (n4 = t11.delta)[0] === r3[0] && n4[1] === r3[1]; + })[0]; + if (n3 && n3.should) { + e11.cancelable && e11.preventDefault(); + return; + } + if (!n3) { + var i3 = (o2.current.shards || []).map(tK).filter(Boolean).filter(function(t11) { + return t11.contains(e11.target); + }); + (i3.length > 0 ? l2(e11, i3[0]) : !o2.current.noIsolation) && e11.cancelable && e11.preventDefault(); + } + } + }, []), u2 = a.useCallback(function(e11, r3, n3, i3) { + var s3 = { name: e11, delta: r3, target: n3, should: i3, shadowParent: function(e12) { + for (var t11 = null; null !== e12; ) + e12 instanceof ShadowRoot && (t11 = e12.host, e12 = e12.host), e12 = e12.parentNode; + return t11; + }(n3) }; + t10.current.push(s3), setTimeout(function() { + t10.current = t10.current.filter(function(e12) { + return e12 !== s3; + }); + }, 1); + }, []), d2 = a.useCallback(function(e11) { + r2.current = tG(e11), n2.current = void 0; + }, []), h2 = a.useCallback(function(t11) { + u2(t11.type, tZ(t11), t11.target, l2(t11, e10.lockRef.current)); + }, []), f2 = a.useCallback(function(t11) { + u2(t11.type, tG(t11), t11.target, l2(t11, e10.lockRef.current)); + }, []); + a.useEffect(function() { + return tY.push(s2), e10.setCallbacks({ onScrollCapture: h2, onWheelCapture: h2, onTouchMoveCapture: f2 }), document.addEventListener("wheel", c2, tq), document.addEventListener("touchmove", c2, tq), document.addEventListener("touchstart", d2, tq), function() { + tY = tY.filter(function(e11) { + return e11 !== s2; + }), document.removeEventListener("wheel", c2, tq), document.removeEventListener("touchmove", c2, tq), document.removeEventListener("touchstart", d2, tq); + }; + }, []); + var p2 = e10.removeScrollBar, m2 = e10.inert; + return a.createElement(a.Fragment, null, m2 ? a.createElement(s2, { styles: "\n .block-interactivity-".concat(i2, " {pointer-events: none;}\n .allow-interactivity-").concat(i2, " {pointer-events: all;}\n") }) : null, p2 ? a.createElement(tF, { gapMode: e10.gapMode }) : null); + }, t_.useMedium(n), tC); + var t0 = a.forwardRef(function(e10, t10) { + return a.createElement(tk, tm({}, e10, { ref: t10, sideCar: tX })); + }); + t0.classNames = tk.classNames; + var t1 = "Popover", [t2, t6] = (0, u.b)(t1, [eX]), t5 = eX(), [t4, t3] = t2(t1), t8 = (e10) => { + let { __scopePopover: t10, children: r2, open: n2, defaultOpen: i2, onOpenChange: s2, modal: o2 = false } = e10, l2 = t5(t10), c2 = a.useRef(null), [u2, d2] = a.useState(false), [p2 = false, m2] = function({ prop: e11, defaultProp: t11, onChange: r3 = () => { + } }) { + let [n3, i3] = function({ defaultProp: e12, onChange: t12 }) { + let r4 = a.useState(e12), [n4] = r4, i4 = a.useRef(n4), s4 = (0, h.W)(t12); + return a.useEffect(() => { + i4.current !== n4 && (s4(n4), i4.current = n4); + }, [n4, i4, s4]), r4; + }({ defaultProp: t11, onChange: r3 }), s3 = void 0 !== e11, o3 = s3 ? e11 : n3, l3 = (0, h.W)(r3); + return [o3, a.useCallback((t12) => { + if (s3) { + let r4 = "function" == typeof t12 ? t12(e11) : t12; + r4 !== e11 && l3(r4); + } else + i3(t12); + }, [s3, e11, i3, l3])]; + }({ prop: n2, defaultProp: i2, onChange: s2 }); + return (0, f.jsx)(e2, { ...l2, children: (0, f.jsx)(t4, { scope: t10, contentId: function(e11) { + let [t11, r3] = a.useState(O()); + return (0, A.b)(() => { + r3((e12) => e12 ?? String(I++)); + }, [void 0]), t11 ? `radix-${t11}` : ""; + }(), triggerRef: c2, open: p2, onOpenChange: m2, onOpenToggle: a.useCallback(() => m2((e11) => !e11), [m2]), hasCustomAnchor: u2, onCustomAnchorAdd: a.useCallback(() => d2(true), []), onCustomAnchorRemove: a.useCallback(() => d2(false), []), modal: o2, children: r2 }) }); + }; + t8.displayName = t1; + var t9 = "PopoverAnchor", t7 = a.forwardRef((e10, t10) => { + let { __scopePopover: r2, ...n2 } = e10, i2 = t3(t9, r2), s2 = t5(r2), { onCustomAnchorAdd: o2, onCustomAnchorRemove: l2 } = i2; + return a.useEffect(() => (o2(), () => l2()), [o2, l2]), (0, f.jsx)(e5, { ...s2, ...n2, ref: t10 }); + }); + t7.displayName = t9; + var re = "PopoverTrigger", rt = a.forwardRef((e10, t10) => { + let { __scopePopover: r2, ...n2 } = e10, i2 = t3(re, r2), s2 = t5(r2), a2 = (0, c.e)(t10, i2.triggerRef), o2 = (0, f.jsx)(d.WV.button, { type: "button", "aria-haspopup": "dialog", "aria-expanded": i2.open, "aria-controls": i2.contentId, "data-state": rh(i2.open), ...n2, ref: a2, onClick: (0, l.M)(e10.onClick, i2.onOpenToggle) }); + return i2.hasCustomAnchor ? o2 : (0, f.jsx)(e5, { asChild: true, ...s2, children: o2 }); + }); + rt.displayName = re; + var rr = "PopoverPortal", [rn, ri] = t2(rr, { forceMount: void 0 }), rs = (e10) => { + let { __scopePopover: t10, forceMount: r2, children: n2, container: i2 } = e10, s2 = t3(rr, t10); + return (0, f.jsx)(rn, { scope: t10, forceMount: r2, children: (0, f.jsx)(ta.z, { present: r2 || s2.open, children: (0, f.jsx)(ts, { asChild: true, container: i2, children: n2 }) }) }); + }; + rs.displayName = rr; + var ra = "PopoverContent", ro = a.forwardRef((e10, t10) => { + let r2 = ri(ra, e10.__scopePopover), { forceMount: n2 = r2.forceMount, ...i2 } = e10, s2 = t3(ra, e10.__scopePopover); + return (0, f.jsx)(ta.z, { present: n2 || s2.open, children: s2.modal ? (0, f.jsx)(rl, { ...i2, ref: t10 }) : (0, f.jsx)(rc, { ...i2, ref: t10 }) }); + }); + ro.displayName = ra; + var rl = a.forwardRef((e10, t10) => { + let r2 = t3(ra, e10.__scopePopover), n2 = a.useRef(null), i2 = (0, c.e)(t10, n2), s2 = a.useRef(false); + return a.useEffect(() => { + let e11 = n2.current; + if (e11) + return tp(e11); + }, []), (0, f.jsx)(t0, { as: to.g7, allowPinchZoom: true, children: (0, f.jsx)(ru, { ...e10, ref: i2, trapFocus: r2.open, disableOutsidePointerEvents: true, onCloseAutoFocus: (0, l.M)(e10.onCloseAutoFocus, (e11) => { + e11.preventDefault(), s2.current || r2.triggerRef.current?.focus(); + }), onPointerDownOutside: (0, l.M)(e10.onPointerDownOutside, (e11) => { + let t11 = e11.detail.originalEvent, r3 = 0 === t11.button && true === t11.ctrlKey, n3 = 2 === t11.button || r3; + s2.current = n3; + }, { checkForDefaultPrevented: false }), onFocusOutside: (0, l.M)(e10.onFocusOutside, (e11) => e11.preventDefault(), { checkForDefaultPrevented: false }) }) }); + }), rc = a.forwardRef((e10, t10) => { + let r2 = t3(ra, e10.__scopePopover), n2 = a.useRef(false), i2 = a.useRef(false); + return (0, f.jsx)(ru, { ...e10, ref: t10, trapFocus: false, disableOutsidePointerEvents: false, onCloseAutoFocus: (t11) => { + e10.onCloseAutoFocus?.(t11), t11.defaultPrevented || (n2.current || r2.triggerRef.current?.focus(), t11.preventDefault()), n2.current = false, i2.current = false; + }, onInteractOutside: (t11) => { + e10.onInteractOutside?.(t11), t11.defaultPrevented || (n2.current = true, "pointerdown" !== t11.detail.originalEvent.type || (i2.current = true)); + let s2 = t11.target; + r2.triggerRef.current?.contains(s2) && t11.preventDefault(), "focusin" === t11.detail.originalEvent.type && i2.current && t11.preventDefault(); + } }); + }), ru = a.forwardRef((e10, t10) => { + let { __scopePopover: r2, trapFocus: n2, onOpenAutoFocus: i2, onCloseAutoFocus: s2, disableOutsidePointerEvents: o2, onEscapeKeyDown: l2, onPointerDownOutside: c2, onFocusOutside: u2, onInteractOutside: d2, ...h2 } = e10, p2 = t3(ra, r2), m2 = t5(r2); + return a.useEffect(() => { + let e11 = document.querySelectorAll("[data-radix-focus-guard]"); + return document.body.insertAdjacentElement("afterbegin", e11[0] ?? w()), document.body.insertAdjacentElement("beforeend", e11[1] ?? w()), b++, () => { + 1 === b && document.querySelectorAll("[data-radix-focus-guard]").forEach((e12) => e12.remove()), b--; + }; + }, []), (0, f.jsx)(E, { asChild: true, loop: true, trapped: n2, onMountAutoFocus: i2, onUnmountAutoFocus: s2, children: (0, f.jsx)(g, { asChild: true, disableOutsidePointerEvents: o2, onInteractOutside: d2, onEscapeKeyDown: l2, onPointerDownOutside: c2, onFocusOutside: u2, onDismiss: () => p2.onOpenChange(false), children: (0, f.jsx)(e9, { "data-state": rh(p2.open), role: "dialog", id: p2.contentId, ...m2, ...h2, ref: t10, style: { ...h2.style, "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)", "--radix-popover-content-available-width": "var(--radix-popper-available-width)", "--radix-popover-content-available-height": "var(--radix-popper-available-height)", "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)", "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)" } }) }) }); + }), rd = "PopoverClose"; + function rh(e10) { + return e10 ? "open" : "closed"; + } + a.forwardRef((e10, t10) => { + let { __scopePopover: r2, ...n2 } = e10, i2 = t3(rd, r2); + return (0, f.jsx)(d.WV.button, { type: "button", ...n2, ref: t10, onClick: (0, l.M)(e10.onClick, () => i2.onOpenChange(false)) }); + }).displayName = rd, a.forwardRef((e10, t10) => { + let { __scopePopover: r2, ...n2 } = e10, i2 = t5(r2); + return (0, f.jsx)(tt, { ...i2, ...n2, ref: t10 }); + }).displayName = "PopoverArrow"; + var rf = t8, rp = t7, rm = rt, rg = rs, ry = ro; + }; + __namedExportsObject5["__chunk_45432"] = (e, t, r) => { + "use strict"; + r.d(t, { b: () => s }); + var n = r(49398), i = r(73435); + function s(e2, t2 = []) { + let r2 = [], a = () => { + let t3 = r2.map((e3) => n.createContext(e3)); + return function(r3) { + let i2 = r3?.[e2] || t3; + return n.useMemo(() => ({ [`__scope${e2}`]: { ...r3, [e2]: i2 } }), [r3, i2]); + }; + }; + return a.scopeName = e2, [function(t3, s2) { + let a2 = n.createContext(s2), o = r2.length; + r2 = [...r2, s2]; + let l = (t4) => { + let { scope: r3, children: s3, ...l2 } = t4, c = r3?.[e2]?.[o] || a2, u = n.useMemo(() => l2, Object.values(l2)); + return (0, i.jsx)(c.Provider, { value: u, children: s3 }); + }; + return l.displayName = t3 + "Provider", [l, function(r3, i2) { + let l2 = i2?.[e2]?.[o] || a2, c = n.useContext(l2); + if (c) + return c; + if (void 0 !== s2) + return s2; + throw Error(`\`${r3}\` must be used within \`${t3}\``); + }]; + }, function(...e3) { + let t3 = e3[0]; + if (1 === e3.length) + return t3; + let r3 = () => { + let r4 = e3.map((e4) => ({ useScope: e4(), scopeName: e4.scopeName })); + return function(e4) { + let i2 = r4.reduce((t4, { useScope: r5, scopeName: n2 }) => { + let i3 = r5(e4)[`__scope${n2}`]; + return { ...t4, ...i3 }; + }, {}); + return n.useMemo(() => ({ [`__scope${t3.scopeName}`]: i2 }), [i2]); + }; + }; + return r3.scopeName = t3.scopeName, r3; + }(a, ...t2)]; + } + }; + __namedExportsObject5["__chunk_63554"] = (e, t, r) => { + "use strict"; + r.d(t, { F: () => i, e: () => s }); + var n = r(49398); + function i(...e2) { + return (t2) => e2.forEach((e3) => { + "function" == typeof e3 ? e3(t2) : null != e3 && (e3.current = t2); + }); + } + function s(...e2) { + return n.useCallback(i(...e2), e2); + } + }; + __namedExportsObject5["__chunk_78777"] = (e, t, r) => { + "use strict"; + function n(e2, t2, { checkForDefaultPrevented: r2 = true } = {}) { + return function(n2) { + if (e2?.(n2), false === r2 || !n2.defaultPrevented) + return t2?.(n2); + }; + } + r.d(t, { M: () => n }); + }; + __namedExportsObject5["__chunk_4072"] = (e) => { + (() => { + "undefined" != typeof __nccwpck_require__ && (__nccwpck_require__.ab = "//"); + var t = {}; + ({ 318: function(e2, t2) { + (function(e3) { + "use strict"; + class t3 extends TypeError { + constructor(e4, t4) { + let r2; + let { message: n2, explanation: i2, ...s2 } = e4, { path: a2 } = e4, o2 = 0 === a2.length ? n2 : `At path: ${a2.join(".")} -- ${n2}`; + super(i2 ?? o2), null != i2 && (this.cause = o2), Object.assign(this, s2), this.name = this.constructor.name, this.failures = () => r2 ?? (r2 = [e4, ...t4()]); + } + } + function r(e4) { + return "object" == typeof e4 && null != e4; + } + function n(e4) { + if ("[object Object]" !== Object.prototype.toString.call(e4)) + return false; + let t4 = Object.getPrototypeOf(e4); + return null === t4 || t4 === Object.prototype; + } + function i(e4) { + return "symbol" == typeof e4 ? e4.toString() : "string" == typeof e4 ? JSON.stringify(e4) : `${e4}`; + } + function* s(e4, t4, n2, s2) { + var a2; + for (let o2 of (r(a2 = e4) && "function" == typeof a2[Symbol.iterator] || (e4 = [e4]), e4)) { + let e5 = function(e6, t5, r2, n3) { + if (true === e6) + return; + false === e6 ? e6 = {} : "string" == typeof e6 && (e6 = { message: e6 }); + let { path: s3, branch: a3 } = t5, { type: o3 } = r2, { refinement: l2, message: c2 = `Expected a value of type \`${o3}\`${l2 ? ` with refinement \`${l2}\`` : ""}, but received: \`${i(n3)}\`` } = e6; + return { value: n3, type: o3, refinement: l2, key: s3[s3.length - 1], path: s3, branch: a3, ...e6, message: c2 }; + }(o2, t4, n2, s2); + e5 && (yield e5); + } + } + function* a(e4, t4, n2 = {}) { + let { path: i2 = [], branch: s2 = [e4], coerce: o2 = false, mask: l2 = false } = n2, c2 = { path: i2, branch: s2 }; + if (o2 && (e4 = t4.coercer(e4, c2), l2 && "type" !== t4.type && r(t4.schema) && r(e4) && !Array.isArray(e4))) + for (let r2 in e4) + void 0 === t4.schema[r2] && delete e4[r2]; + let u2 = "valid"; + for (let r2 of t4.validator(e4, c2)) + r2.explanation = n2.message, u2 = "not_valid", yield [r2, void 0]; + for (let [d2, h2, f2] of t4.entries(e4, c2)) + for (let t5 of a(h2, f2, { path: void 0 === d2 ? i2 : [...i2, d2], branch: void 0 === d2 ? s2 : [...s2, h2], coerce: o2, mask: l2, message: n2.message })) + t5[0] ? (u2 = null != t5[0].refinement ? "not_refined" : "not_valid", yield [t5[0], void 0]) : o2 && (h2 = t5[1], void 0 === d2 ? e4 = h2 : e4 instanceof Map ? e4.set(d2, h2) : e4 instanceof Set ? e4.add(h2) : r(e4) && (void 0 !== h2 || d2 in e4) && (e4[d2] = h2)); + if ("not_valid" !== u2) + for (let r2 of t4.refiner(e4, c2)) + r2.explanation = n2.message, u2 = "not_refined", yield [r2, void 0]; + "valid" === u2 && (yield [void 0, e4]); + } + class o { + constructor(e4) { + let { type: t4, schema: r2, validator: n2, refiner: i2, coercer: a2 = (e5) => e5, entries: o2 = function* () { + } } = e4; + this.type = t4, this.schema = r2, this.entries = o2, this.coercer = a2, n2 ? this.validator = (e5, t5) => s(n2(e5, t5), t5, this, e5) : this.validator = () => [], i2 ? this.refiner = (e5, t5) => s(i2(e5, t5), t5, this, e5) : this.refiner = () => []; + } + assert(e4, t4) { + return l(e4, this, t4); + } + create(e4, t4) { + return c(e4, this, t4); + } + is(e4) { + return d(e4, this); + } + mask(e4, t4) { + return u(e4, this, t4); + } + validate(e4, t4 = {}) { + return h(e4, this, t4); + } + } + function l(e4, t4, r2) { + let n2 = h(e4, t4, { message: r2 }); + if (n2[0]) + throw n2[0]; + } + function c(e4, t4, r2) { + let n2 = h(e4, t4, { coerce: true, message: r2 }); + if (!n2[0]) + return n2[1]; + throw n2[0]; + } + function u(e4, t4, r2) { + let n2 = h(e4, t4, { coerce: true, mask: true, message: r2 }); + if (!n2[0]) + return n2[1]; + throw n2[0]; + } + function d(e4, t4) { + return !h(e4, t4)[0]; + } + function h(e4, r2, n2 = {}) { + let i2 = a(e4, r2, n2), s2 = function(e5) { + let { done: t4, value: r3 } = e5.next(); + return t4 ? void 0 : r3; + }(i2); + return s2[0] ? [new t3(s2[0], function* () { + for (let e5 of i2) + e5[0] && (yield e5[0]); + }), void 0] : [void 0, s2[1]]; + } + function f(e4, t4) { + return new o({ type: e4, schema: null, validator: t4 }); + } + function p() { + return f("never", () => false); + } + function m(e4) { + let t4 = e4 ? Object.keys(e4) : [], n2 = p(); + return new o({ type: "object", schema: e4 || null, *entries(i2) { + if (e4 && r(i2)) { + let r2 = new Set(Object.keys(i2)); + for (let n3 of t4) + r2.delete(n3), yield [n3, i2[n3], e4[n3]]; + for (let e5 of r2) + yield [e5, i2[e5], n2]; + } + }, validator: (e5) => r(e5) || `Expected an object, but received: ${i(e5)}`, coercer: (e5) => r(e5) ? { ...e5 } : e5 }); + } + function g(e4) { + return new o({ ...e4, validator: (t4, r2) => void 0 === t4 || e4.validator(t4, r2), refiner: (t4, r2) => void 0 === t4 || e4.refiner(t4, r2) }); + } + function y() { + return f("string", (e4) => "string" == typeof e4 || `Expected a string, but received: ${i(e4)}`); + } + function v(e4) { + let t4 = Object.keys(e4); + return new o({ type: "type", schema: e4, *entries(n2) { + if (r(n2)) + for (let r2 of t4) + yield [r2, n2[r2], e4[r2]]; + }, validator: (e5) => r(e5) || `Expected an object, but received: ${i(e5)}`, coercer: (e5) => r(e5) ? { ...e5 } : e5 }); + } + function b() { + return f("unknown", () => true); + } + function w(e4, t4, r2) { + return new o({ ...e4, coercer: (n2, i2) => d(n2, t4) ? e4.coercer(r2(n2, i2), i2) : e4.coercer(n2, i2) }); + } + function x(e4) { + return e4 instanceof Map || e4 instanceof Set ? e4.size : e4.length; + } + function S(e4, t4, r2) { + return new o({ ...e4, *refiner(n2, i2) { + for (let a2 of (yield* e4.refiner(n2, i2), s(r2(n2, i2), i2, e4, n2))) + yield { ...a2, refinement: t4 }; + } }); + } + e3.Struct = o, e3.StructError = t3, e3.any = function() { + return f("any", () => true); + }, e3.array = function(e4) { + return new o({ type: "array", schema: e4, *entries(t4) { + if (e4 && Array.isArray(t4)) + for (let [r2, n2] of t4.entries()) + yield [r2, n2, e4]; + }, coercer: (e5) => Array.isArray(e5) ? e5.slice() : e5, validator: (e5) => Array.isArray(e5) || `Expected an array value, but received: ${i(e5)}` }); + }, e3.assert = l, e3.assign = function(...e4) { + let t4 = "type" === e4[0].type, r2 = Object.assign({}, ...e4.map((e5) => e5.schema)); + return t4 ? v(r2) : m(r2); + }, e3.bigint = function() { + return f("bigint", (e4) => "bigint" == typeof e4); + }, e3.boolean = function() { + return f("boolean", (e4) => "boolean" == typeof e4); + }, e3.coerce = w, e3.create = c, e3.date = function() { + return f("date", (e4) => e4 instanceof Date && !isNaN(e4.getTime()) || `Expected a valid \`Date\` object, but received: ${i(e4)}`); + }, e3.defaulted = function(e4, t4, r2 = {}) { + return w(e4, b(), (e5) => { + let i2 = "function" == typeof t4 ? t4() : t4; + if (void 0 === e5) + return i2; + if (!r2.strict && n(e5) && n(i2)) { + let t5 = { ...e5 }, r3 = false; + for (let e6 in i2) + void 0 === t5[e6] && (t5[e6] = i2[e6], r3 = true); + if (r3) + return t5; + } + return e5; + }); + }, e3.define = f, e3.deprecated = function(e4, t4) { + return new o({ ...e4, refiner: (t5, r2) => void 0 === t5 || e4.refiner(t5, r2), validator: (r2, n2) => void 0 === r2 || (t4(r2, n2), e4.validator(r2, n2)) }); + }, e3.dynamic = function(e4) { + return new o({ type: "dynamic", schema: null, *entries(t4, r2) { + let n2 = e4(t4, r2); + yield* n2.entries(t4, r2); + }, validator: (t4, r2) => e4(t4, r2).validator(t4, r2), coercer: (t4, r2) => e4(t4, r2).coercer(t4, r2), refiner: (t4, r2) => e4(t4, r2).refiner(t4, r2) }); + }, e3.empty = function(e4) { + return S(e4, "empty", (t4) => { + let r2 = x(t4); + return 0 === r2 || `Expected an empty ${e4.type} but received one with a size of \`${r2}\``; + }); + }, e3.enums = function(e4) { + let t4 = {}, r2 = e4.map((e5) => i(e5)).join(); + for (let r3 of e4) + t4[r3] = r3; + return new o({ type: "enums", schema: t4, validator: (t5) => e4.includes(t5) || `Expected one of \`${r2}\`, but received: ${i(t5)}` }); + }, e3.func = function() { + return f("func", (e4) => "function" == typeof e4 || `Expected a function, but received: ${i(e4)}`); + }, e3.instance = function(e4) { + return f("instance", (t4) => t4 instanceof e4 || `Expected a \`${e4.name}\` instance, but received: ${i(t4)}`); + }, e3.integer = function() { + return f("integer", (e4) => "number" == typeof e4 && !isNaN(e4) && Number.isInteger(e4) || `Expected an integer, but received: ${i(e4)}`); + }, e3.intersection = function(e4) { + return new o({ type: "intersection", schema: null, *entries(t4, r2) { + for (let n2 of e4) + yield* n2.entries(t4, r2); + }, *validator(t4, r2) { + for (let n2 of e4) + yield* n2.validator(t4, r2); + }, *refiner(t4, r2) { + for (let n2 of e4) + yield* n2.refiner(t4, r2); + } }); + }, e3.is = d, e3.lazy = function(e4) { + let t4; + return new o({ type: "lazy", schema: null, *entries(r2, n2) { + t4 ?? (t4 = e4()), yield* t4.entries(r2, n2); + }, validator: (r2, n2) => (t4 ?? (t4 = e4()), t4.validator(r2, n2)), coercer: (r2, n2) => (t4 ?? (t4 = e4()), t4.coercer(r2, n2)), refiner: (r2, n2) => (t4 ?? (t4 = e4()), t4.refiner(r2, n2)) }); + }, e3.literal = function(e4) { + let t4 = i(e4), r2 = typeof e4; + return new o({ type: "literal", schema: "string" === r2 || "number" === r2 || "boolean" === r2 ? e4 : null, validator: (r3) => r3 === e4 || `Expected the literal \`${t4}\`, but received: ${i(r3)}` }); + }, e3.map = function(e4, t4) { + return new o({ type: "map", schema: null, *entries(r2) { + if (e4 && t4 && r2 instanceof Map) + for (let [n2, i2] of r2.entries()) + yield [n2, n2, e4], yield [n2, i2, t4]; + }, coercer: (e5) => e5 instanceof Map ? new Map(e5) : e5, validator: (e5) => e5 instanceof Map || `Expected a \`Map\` object, but received: ${i(e5)}` }); + }, e3.mask = u, e3.max = function(e4, t4, r2 = {}) { + let { exclusive: n2 } = r2; + return S(e4, "max", (r3) => n2 ? r3 < t4 : r3 <= t4 || `Expected a ${e4.type} less than ${n2 ? "" : "or equal to "}${t4} but received \`${r3}\``); + }, e3.min = function(e4, t4, r2 = {}) { + let { exclusive: n2 } = r2; + return S(e4, "min", (r3) => n2 ? r3 > t4 : r3 >= t4 || `Expected a ${e4.type} greater than ${n2 ? "" : "or equal to "}${t4} but received \`${r3}\``); + }, e3.never = p, e3.nonempty = function(e4) { + return S(e4, "nonempty", (t4) => x(t4) > 0 || `Expected a nonempty ${e4.type} but received an empty one`); + }, e3.nullable = function(e4) { + return new o({ ...e4, validator: (t4, r2) => null === t4 || e4.validator(t4, r2), refiner: (t4, r2) => null === t4 || e4.refiner(t4, r2) }); + }, e3.number = function() { + return f("number", (e4) => "number" == typeof e4 && !isNaN(e4) || `Expected a number, but received: ${i(e4)}`); + }, e3.object = m, e3.omit = function(e4, t4) { + let { schema: r2 } = e4, n2 = { ...r2 }; + for (let e5 of t4) + delete n2[e5]; + return "type" === e4.type ? v(n2) : m(n2); + }, e3.optional = g, e3.partial = function(e4) { + let t4 = e4 instanceof o ? { ...e4.schema } : { ...e4 }; + for (let e5 in t4) + t4[e5] = g(t4[e5]); + return m(t4); + }, e3.pattern = function(e4, t4) { + return S(e4, "pattern", (r2) => t4.test(r2) || `Expected a ${e4.type} matching \`/${t4.source}/\` but received "${r2}"`); + }, e3.pick = function(e4, t4) { + let { schema: r2 } = e4, n2 = {}; + for (let e5 of t4) + n2[e5] = r2[e5]; + return m(n2); + }, e3.record = function(e4, t4) { + return new o({ type: "record", schema: null, *entries(n2) { + if (r(n2)) + for (let r2 in n2) { + let i2 = n2[r2]; + yield [r2, r2, e4], yield [r2, i2, t4]; + } + }, validator: (e5) => r(e5) || `Expected an object, but received: ${i(e5)}` }); + }, e3.refine = S, e3.regexp = function() { + return f("regexp", (e4) => e4 instanceof RegExp); + }, e3.set = function(e4) { + return new o({ type: "set", schema: null, *entries(t4) { + if (e4 && t4 instanceof Set) + for (let r2 of t4) + yield [r2, r2, e4]; + }, coercer: (e5) => e5 instanceof Set ? new Set(e5) : e5, validator: (e5) => e5 instanceof Set || `Expected a \`Set\` object, but received: ${i(e5)}` }); + }, e3.size = function(e4, t4, r2 = t4) { + let n2 = `Expected a ${e4.type}`, i2 = t4 === r2 ? `of \`${t4}\`` : `between \`${t4}\` and \`${r2}\``; + return S(e4, "size", (e5) => { + if ("number" == typeof e5 || e5 instanceof Date) + return t4 <= e5 && e5 <= r2 || `${n2} ${i2} but received \`${e5}\``; + if (e5 instanceof Map || e5 instanceof Set) { + let { size: s2 } = e5; + return t4 <= s2 && s2 <= r2 || `${n2} with a size ${i2} but received one with a size of \`${s2}\``; + } + { + let { length: s2 } = e5; + return t4 <= s2 && s2 <= r2 || `${n2} with a length ${i2} but received one with a length of \`${s2}\``; + } + }); + }, e3.string = y, e3.struct = function(e4, t4) { + return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."), f(e4, t4); + }, e3.trimmed = function(e4) { + return w(e4, y(), (e5) => e5.trim()); + }, e3.tuple = function(e4) { + let t4 = p(); + return new o({ type: "tuple", schema: null, *entries(r2) { + if (Array.isArray(r2)) { + let n2 = Math.max(e4.length, r2.length); + for (let i2 = 0; i2 < n2; i2++) + yield [i2, r2[i2], e4[i2] || t4]; + } + }, validator: (e5) => Array.isArray(e5) || `Expected an array, but received: ${i(e5)}` }); + }, e3.type = v, e3.union = function(e4) { + let t4 = e4.map((e5) => e5.type).join(" | "); + return new o({ type: "union", schema: null, coercer(t5) { + for (let r2 of e4) { + let [e5, n2] = r2.validate(t5, { coerce: true }); + if (!e5) + return n2; + } + return t5; + }, validator(r2, n2) { + let s2 = []; + for (let t5 of e4) { + let [...e5] = a(r2, t5, n2), [i2] = e5; + if (!i2[0]) + return []; + for (let [t6] of e5) + t6 && s2.push(t6); + } + return [`Expected the value to satisfy a union of \`${t4}\`, but received: ${i(r2)}`, ...s2]; + } }); + }, e3.unknown = b, e3.validate = h; + })(t2); + } })[318](0, t), e.exports = t; + })(); + }; + __namedExportsObject5["__chunk_541"] = (e, t, r) => { + e.exports = r(60971); + }; + __namedExportsObject5["__chunk_95737"] = (e, t, r) => { + "use strict"; + r.d(t, { b1: () => d, ye: () => h, yO: () => a, Ht: () => e0, O4: () => C, fk: () => e2, hQ: () => p.hQ, b5: () => o, p$: () => e1, Wz: () => u.W, v4: () => eU, XH: () => E.XH, $h: () => x, qj: () => E.qj, p5: () => E.p5, Kn: () => b, Bt: () => w, u7: () => n.u7, Hs: () => n.Hs, dH: () => n.dH, kf: () => n.kf, eH: () => e9, $P: () => e3, C5: () => e4, oH: () => e5, V4: () => i.V, aW: () => n.aW, GP: () => k, nr: () => e8, eP: () => l.workAsyncStorage, Sz: () => c.S }); + var n = r(71676), i = r(62796), s = r(63861); + let a = (0, s.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/next@15.0.0-canary.200_e4kbeb3oepbyvs7ql5y74riunu/node_modules/next/dist/esm/client/components/layout-router.js`).default, o = (0, s.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/next@15.0.0-canary.200_e4kbeb3oepbyvs7ql5y74riunu/node_modules/next/dist/esm/client/components/render-from-template-context.js`).default; + var l = r(57418), c = r(49216), u = r(15291); + let d = (0, s.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/next@15.0.0-canary.200_e4kbeb3oepbyvs7ql5y74riunu/node_modules/next/dist/esm/client/components/client-page.js`).ClientPageRoot, h = (0, s.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/next@15.0.0-canary.200_e4kbeb3oepbyvs7ql5y74riunu/node_modules/next/dist/esm/client/components/client-segment.js`).ClientSegmentRoot; + var f = r(70938), p = r(12991), m = r(83336), g = r(45933), y = r(85491), v = r(87206); + let b = w; + function w(e7, t2) { + var r2, n2; + return t2.isStaticGeneration ? function(e10) { + if (e10.forceStatic) + return Promise.resolve({}); + let t3 = c.S.getStore(); + if (t3) { + if ("prerender" === t3.type) + return function(e11, t4) { + let r3 = S.get(t4); + if (r3) + return r3; + let n3 = (0, g.R)(t4.renderSignal, "`searchParams`"), i2 = new Proxy(n3, { get(r4, i3, s2) { + if (Object.hasOwn(n3, i3)) + return f.g.get(r4, i3, s2); + switch (i3) { + case "then": + return (0, p.Lb)("`await searchParams`, `searchParams.then`, or similar", t4), f.g.get(r4, i3, s2); + case "status": + return (0, p.Lb)("`use(searchParams)`, `searchParams.status`, or similar", t4), f.g.get(r4, i3, s2); + case "hasOwnProperty": + case "isPrototypeOf": + case "propertyIsEnumerable": + case "toString": + case "valueOf": + case "toLocaleString": + case "catch": + case "finally": + case "toJSON": + case "$$typeof": + case "__esModule": + return f.g.get(r4, i3, s2); + default: + if ("string" == typeof i3) { + let r5 = (0, v.N5)("searchParams", i3), n4 = _(e11, r5); + (0, p.SD)(e11, r5, n4, t4); + } + return f.g.get(r4, i3, s2); + } + }, has(r4, n4) { + if ("string" == typeof n4) { + let r5 = (0, v.U6)("searchParams", n4), i3 = _(e11, r5); + (0, p.SD)(e11, r5, i3, t4); + } + return f.g.has(r4, n4); + }, ownKeys() { + let r4 = "`{...searchParams}`, `Object.keys(searchParams)`, or similar", n4 = _(e11, r4); + (0, p.SD)(e11, r4, n4, t4); + } }); + return S.set(t4, i2), i2; + }(e10.route, t3); + if ("prerender-legacy" === t3.type || "prerender-ppr" === t3.type) + return function(e11, t4) { + let r3 = S.get(e11); + if (r3) + return r3; + let n3 = Promise.resolve({}), i2 = new Proxy(n3, { get(r4, i3, s2) { + if (Object.hasOwn(n3, i3)) + return f.g.get(r4, i3, s2); + switch (i3) { + case "hasOwnProperty": + case "isPrototypeOf": + case "propertyIsEnumerable": + case "toString": + case "valueOf": + case "toLocaleString": + case "catch": + case "finally": + case "toJSON": + case "$$typeof": + case "__esModule": + return f.g.get(r4, i3, s2); + case "then": { + let r5 = "`await searchParams`, `searchParams.then`, or similar"; + e11.dynamicShouldError ? (0, v.ET)(e11.route, r5) : "prerender-ppr" === t4.type ? (0, p.$T)(e11.route, r5, t4.dynamicTracking) : (0, p.j6)(r5, e11, t4); + return; + } + case "status": { + let r5 = "`use(searchParams)`, `searchParams.status`, or similar"; + e11.dynamicShouldError ? (0, v.ET)(e11.route, r5) : "prerender-ppr" === t4.type ? (0, p.$T)(e11.route, r5, t4.dynamicTracking) : (0, p.j6)(r5, e11, t4); + return; + } + default: + if ("string" == typeof i3) { + let r5 = (0, v.N5)("searchParams", i3); + e11.dynamicShouldError ? (0, v.ET)(e11.route, r5) : "prerender-ppr" === t4.type ? (0, p.$T)(e11.route, r5, t4.dynamicTracking) : (0, p.j6)(r5, e11, t4); + } + return f.g.get(r4, i3, s2); + } + }, has(r4, n4) { + if ("string" == typeof n4) { + let r5 = (0, v.U6)("searchParams", n4); + return e11.dynamicShouldError ? (0, v.ET)(e11.route, r5) : "prerender-ppr" === t4.type ? (0, p.$T)(e11.route, r5, t4.dynamicTracking) : (0, p.j6)(r5, e11, t4), false; + } + return f.g.has(r4, n4); + }, ownKeys() { + let r4 = "`{...searchParams}`, `Object.keys(searchParams)`, or similar"; + e11.dynamicShouldError ? (0, v.ET)(e11.route, r4) : "prerender-ppr" === t4.type ? (0, p.$T)(e11.route, r4, t4.dynamicTracking) : (0, p.j6)(r4, e11, t4); + } }); + return S.set(e11, i2), i2; + }(e10, t3); + } + throw new m.e("createPrerenderSearchParams called without a prerenderStore in scope. This is a bug in Next.js"); + }(t2) : (r2 = e7, (n2 = t2).forceStatic ? Promise.resolve({}) : function(e10, t3) { + let r3 = S.get(e10); + if (r3) + return r3; + let n3 = Promise.resolve(e10); + return S.set(e10, n3), Object.keys(e10).forEach((r4) => { + switch (r4) { + case "hasOwnProperty": + case "isPrototypeOf": + case "propertyIsEnumerable": + case "toString": + case "valueOf": + case "toLocaleString": + case "then": + case "catch": + case "finally": + case "status": + case "toJSON": + case "$$typeof": + case "__esModule": + break; + default: + Object.defineProperty(n3, r4, { get() { + let n4 = c.S.getStore(); + return (0, p.tS)(t3, n4), e10[r4]; + }, set(e11) { + Object.defineProperty(n3, r4, { value: e11, writable: true, enumerable: true }); + }, enumerable: true, configurable: true }); + } + }), n3; + }(r2, n2)); + } + function x(e7) { + if (e7.forceStatic) + return Promise.resolve({}); + let t2 = c.S.getStore(); + return t2 && "prerender" === t2.type ? (0, g.R)(t2.renderSignal, "`searchParams`") : Promise.resolve({}); + } + let S = /* @__PURE__ */ new WeakMap(); + function _(e7, t2) { + return Error(`Route "${e7}" used ${t2}. \`searchParams\` is now a Promise and should be \`awaited\` before accessing search param values. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-params`); + } + (0, y.R)(function(e7, t2) { + let r2 = e7 ? ` In route ${e7} a ` : "A "; + return Error(`${r2}searchParam property was accessed directly with ${t2}. \`searchParams\` should be awaited before accessing properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + }), (0, y.R)(function(e7, t2) { + let r2 = e7 ? ` In route ${e7} ` : ""; + if (!t2.length) + return Error(`${r2}searchParams are being enumerated. \`searchParams\` should be awaited before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + { + let e10 = function(e11) { + switch (e11.length) { + case 0: + throw new m.e("Expected describeListOfPropertyNames to be called with a non-empty list of strings."); + case 1: + return `\`${e11[0]}\``; + case 2: + return `\`${e11[0]}\` and \`${e11[1]}\``; + default: { + let t3 = ""; + for (let r3 = 0; r3 < e11.length - 1; r3++) + t3 += `\`${e11[r3]}\`, `; + return t3 + `, and \`${e11[e11.length - 1]}\``; + } + } + }(t2); + return Error(`${r2}searchParams are being enumerated incompletely missing these properties: ${e10}. \`searchParams\` should be awaited before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + } + }); + var E = r(41534), k = r(88334); + let C = (0, s.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/next@15.0.0-canary.200_e4kbeb3oepbyvs7ql5y74riunu/node_modules/next/dist/esm/client/components/not-found-boundary.js`).NotFoundBoundary; + var R = r(21158), P = r(23034); + function T(e7) { + return null != e7; + } + function A({ name: e7, property: t2, content: r2, media: n2 }) { + return null != r2 && "" !== r2 ? (0, R.jsx)("meta", { ...e7 ? { name: e7 } : { property: t2 }, ...n2 ? { media: n2 } : void 0, content: "string" == typeof r2 ? r2 : r2.toString() }) : null; + } + function O(e7) { + let t2 = []; + for (let r2 of e7) + Array.isArray(r2) ? t2.push(...r2.filter(T)) : T(r2) && t2.push(r2); + return t2; + } + let I = /* @__PURE__ */ new Set(["og:image", "twitter:image", "og:video", "og:audio"]); + function N(e7, t2) { + return I.has(e7) && "url" === t2 ? e7 : ((e7.startsWith("og:") || e7.startsWith("twitter:")) && (t2 = t2.replace(/([A-Z])/g, function(e10) { + return "_" + e10.toLowerCase(); + })), e7 + ":" + t2); + } + function M({ propertyPrefix: e7, namePrefix: t2, contents: r2 }) { + return null == r2 ? null : O(r2.map((r3) => "string" == typeof r3 || "number" == typeof r3 || r3 instanceof URL ? A({ ...e7 ? { property: e7 } : { name: t2 }, content: r3 }) : function({ content: e10, namePrefix: t3, propertyPrefix: r4 }) { + return e10 ? O(Object.entries(e10).map(([e11, n2]) => void 0 === n2 ? null : A({ ...r4 && { property: N(r4, e11) }, ...t3 && { name: N(t3, e11) }, content: "string" == typeof n2 ? n2 : null == n2 ? void 0 : n2.toString() }))) : null; + }({ namePrefix: t2, propertyPrefix: e7, content: r3 }))); + } + let $ = { width: "width", height: "height", initialScale: "initial-scale", minimumScale: "minimum-scale", maximumScale: "maximum-scale", viewportFit: "viewport-fit", userScalable: "user-scalable", interactiveWidget: "interactive-widget" }, L = ["icon", "shortcut", "apple", "other"]; + function j(e7) { + return Array.isArray(e7) ? e7 : [e7]; + } + function D(e7) { + if (null != e7) + return j(e7); + } + let F = ["telephone", "date", "address", "email", "url"]; + function B({ descriptor: e7, ...t2 }) { + return e7.url ? (0, R.jsx)("link", { ...t2, ...e7.title && { title: e7.title }, href: e7.url.toString() }) : null; + } + function U({ app: e7, type: t2 }) { + var r2, n2; + return [A({ name: `twitter:app:name:${t2}`, content: e7.name }), A({ name: `twitter:app:id:${t2}`, content: e7.id[t2] }), A({ name: `twitter:app:url:${t2}`, content: null == (n2 = e7.url) ? void 0 : null == (r2 = n2[t2]) ? void 0 : r2.toString() })]; + } + function q({ icon: e7 }) { + let { url: t2, rel: r2 = "icon", ...n2 } = e7; + return (0, R.jsx)("link", { rel: r2, href: t2.toString(), ...n2 }); + } + function z({ rel: e7, icon: t2 }) { + if ("object" == typeof t2 && !(t2 instanceof URL)) + return !t2.rel && e7 && (t2.rel = e7), q({ icon: t2 }); + { + let r2 = t2.toString(); + return (0, R.jsx)("link", { rel: e7, href: r2 }); + } + } + var H = r(84953), W = r.n(H); + function Q(e7) { + return "string" == typeof e7 || e7 instanceof URL; + } + function V() { + return new URL(`http://localhost:${"80"}`); + } + function G(e7, t2) { + if (e7 instanceof URL) + return e7; + if (!e7) + return null; + try { + return new URL(e7); + } catch { + } + t2 || (t2 = V()); + let r2 = t2.pathname || ""; + return new URL(W().posix.join(r2, e7), t2); + } + let Z = /^(?:\/((?!\.well-known(?:\/.*)?)(?:[^/]+\/)*[^/]+\.\w+))(\/?|$)/i; + function K(e7, t2, { trailingSlash: r2, pathname: n2 }) { + var i2, s2; + e7 = "string" == typeof (i2 = e7) && i2.startsWith("./") ? W().posix.resolve(n2, i2) : i2; + let a2 = "", o2 = t2 ? G(e7, t2) : e7; + if (a2 = "string" == typeof o2 ? o2 : "/" === o2.pathname ? o2.origin : o2.href, r2 && !a2.endsWith("/")) { + let e10 = a2.startsWith("/"), r3 = a2.includes("?"), n3 = false, i3 = false; + if (!e10) { + try { + let e11 = new URL(a2); + n3 = null != t2 && e11.origin !== t2.origin, s2 = e11.pathname, i3 = Z.test(s2); + } catch { + n3 = true; + } + if (!i3 && !n3 && !r3) + return `${a2}/`; + } + } + return a2; + } + function J(e7, t2) { + return e7 ? e7.replace(/%s/g, t2) : t2; + } + function Y(e7, t2) { + let r2; + let n2 = "string" != typeof e7 && e7 && "template" in e7 ? e7.template : null; + return ("string" == typeof e7 ? r2 = J(t2, e7) : e7 && ("default" in e7 && (r2 = J(t2, e7.default)), "absolute" in e7 && e7.absolute && (r2 = e7.absolute)), e7 && "string" != typeof e7) ? { template: n2, absolute: r2 || "" } : { absolute: r2 || e7 || "", template: n2 }; + } + r(56225); + var X = r(9720); + let ee = { article: ["authors", "tags"], song: ["albums", "musicians"], playlist: ["albums", "musicians"], radio: ["creators"], video: ["actors", "directors", "writers", "tags"], basic: ["emails", "phoneNumbers", "faxNumbers", "alternateLocale", "audio", "videos"] }; + function et(e7, t2, r2) { + let n2 = D(e7); + if (!n2) + return n2; + let { isMetadataBaseMissing: i2, fallbackMetadataBase: s2 } = function(e10) { + let t3 = V(), r3 = function() { + let e11 = process.env.FLEEK_URL; + return e11 ? new URL(`https://${e11}`) : void 0; + }(), n3 = function() { + let e11 = ""; + return e11 ? new URL(`https://${e11}`) : void 0; + }(); + return { fallbackMetadataBase: r3 && false ? r3 : e10 || n3 || t3, isMetadataBaseMissing: !e10 }; + }(t2), a2 = []; + for (let e10 of n2) { + let t3 = function(e11, t4, r3, n3) { + var i3, s3, a3; + if (!e11) + return; + let o2 = Q(e11), l2 = o2 ? e11 : e11.url; + if (!l2) + return; + let c2 = false; + return (n3 || c2) && (i3 = l2, s3 = t4, a3 = r3, "string" == typeof i3 && !/https?:\/\//.test(i3) && a3 && (0, X.O4)(`metadataBase property in metadata export is not set for resolving social open graph or twitter images, using "${s3.origin}". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase`)), o2 ? { url: G(l2, t4) } : { ...e11, url: G(l2, t4) }; + }(e10, s2, i2, r2); + t3 && a2.push(t3); + } + return a2; + } + let er = { article: ee.article, book: ee.article, "music.song": ee.song, "music.album": ee.song, "music.playlist": ee.playlist, "music.radio_station": ee.radio, "video.movie": ee.video, "video.episode": ee.video }, en = (e7, t2, r2, n2) => { + if (!e7) + return null; + let i2 = { ...e7, title: Y(e7.title, n2) }; + return !function(e10, n3) { + var i3; + for (let t3 of (i3 = n3 && "type" in n3 ? n3.type : void 0) && i3 in er ? er[i3].concat(ee.basic) : ee.basic) + if (t3 in n3 && "url" !== t3) { + let r3 = n3[t3]; + e10[t3] = r3 ? j(r3) : null; + } + e10.images = et(n3.images, t2, r2.isStandaloneMode); + }(i2, e7), i2.url = e7.url ? K(e7.url, t2, r2) : null, i2; + }, ei = ["site", "siteId", "creator", "creatorId", "description"], es = (e7, t2, r2, n2) => { + var i2; + if (!e7) + return null; + let s2 = "card" in e7 ? e7.card : void 0, a2 = { ...e7, title: Y(e7.title, n2) }; + for (let t3 of ei) + a2[t3] = e7[t3] || null; + if (a2.images = et(e7.images, t2, r2.isStandaloneMode), s2 = s2 || ((null == (i2 = a2.images) ? void 0 : i2.length) ? "summary_large_image" : "summary"), a2.card = s2, "card" in a2) + switch (a2.card) { + case "player": + a2.players = D(a2.players) || []; + break; + case "app": + a2.app = a2.app || {}; + } + return a2; + }; + var ea = r(51465); + async function eo(e7) { + let t2, r2, n2; + let { layout: i2, page: s2, defaultPage: a2 } = e7[2], o2 = void 0 !== i2, l2 = void 0 !== s2, c2 = void 0 !== a2 && e7[0] === ea.av; + return o2 ? (t2 = await i2[0](), r2 = "layout", n2 = i2[1]) : l2 ? (t2 = await s2[0](), r2 = "page", n2 = s2[1]) : c2 && (t2 = await a2[0](), r2 = "page", n2 = a2[1]), { mod: t2, modType: r2, filePath: n2 }; + } + async function el(e7, t2) { + let { [t2]: r2 } = e7[2]; + if (void 0 !== r2) + return await r2[0](); + } + function ec(e7, t2, r2) { + if (e7 instanceof URL) { + let t3 = new URL(r2.pathname, e7); + e7.searchParams.forEach((e10, r3) => t3.searchParams.set(r3, e10)), e7 = t3; + } + return K(e7, t2, r2); + } + let eu = (e7) => { + var t2; + if (!e7) + return null; + let r2 = []; + return null == (t2 = D(e7)) || t2.forEach((e10) => { + "string" == typeof e10 ? r2.push({ color: e10 }) : "object" == typeof e10 && r2.push({ color: e10.color, media: e10.media }); + }), r2; + }; + function ed(e7, t2, r2) { + if (!e7) + return null; + let n2 = {}; + for (let [i2, s2] of Object.entries(e7)) + "string" == typeof s2 || s2 instanceof URL ? n2[i2] = [{ url: ec(s2, t2, r2) }] : (n2[i2] = [], null == s2 || s2.forEach((e10, s3) => { + let a2 = ec(e10.url, t2, r2); + n2[i2][s3] = { url: a2, title: e10.title }; + })); + return n2; + } + let eh = (e7, t2, r2) => { + if (!e7) + return null; + let n2 = function(e10, t3, r3) { + return e10 ? { url: ec("string" == typeof e10 || e10 instanceof URL ? e10 : e10.url, t3, r3) } : null; + }(e7.canonical, t2, r2), i2 = ed(e7.languages, t2, r2); + return { canonical: n2, languages: i2, media: ed(e7.media, t2, r2), types: ed(e7.types, t2, r2) }; + }, ef = ["noarchive", "nosnippet", "noimageindex", "nocache", "notranslate", "indexifembedded", "nositelinkssearchbox", "unavailable_after", "max-video-preview", "max-image-preview", "max-snippet"], ep = (e7) => { + if (!e7) + return null; + if ("string" == typeof e7) + return e7; + let t2 = []; + for (let r2 of (e7.index ? t2.push("index") : "boolean" == typeof e7.index && t2.push("noindex"), e7.follow ? t2.push("follow") : "boolean" == typeof e7.follow && t2.push("nofollow"), ef)) { + let n2 = e7[r2]; + void 0 !== n2 && false !== n2 && t2.push("boolean" == typeof n2 ? r2 : `${r2}:${n2}`); + } + return t2.join(", "); + }, em = (e7) => e7 ? { basic: ep(e7), googleBot: "string" != typeof e7 ? ep(e7.googleBot) : null } : null, eg = ["google", "yahoo", "yandex", "me", "other"], ey = (e7) => { + if (!e7) + return null; + let t2 = {}; + for (let r2 of eg) { + let n2 = e7[r2]; + if (n2) { + if ("other" === r2) + for (let r3 in t2.other = {}, e7.other) { + let n3 = D(e7.other[r3]); + n3 && (t2.other[r3] = n3); + } + else + t2[r2] = D(n2); + } + } + return t2; + }, ev = (e7) => { + var t2; + if (!e7) + return null; + if (true === e7) + return { capable: true }; + let r2 = e7.startupImage ? null == (t2 = D(e7.startupImage)) ? void 0 : t2.map((e10) => "string" == typeof e10 ? { url: e10 } : e10) : null; + return { capable: !("capable" in e7) || !!e7.capable, title: e7.title || null, startupImage: r2, statusBarStyle: e7.statusBarStyle || "default" }; + }, eb = (e7) => { + if (!e7) + return null; + for (let t2 in e7) + e7[t2] = D(e7[t2]); + return e7; + }, ew = (e7, t2, r2) => e7 ? { appId: e7.appId, appArgument: e7.appArgument ? ec(e7.appArgument, t2, r2) : void 0 } : null, ex = (e7) => e7 ? { appId: e7.appId, admins: D(e7.admins) } : null; + function eS(e7) { + return Q(e7) ? { url: e7 } : (Array.isArray(e7), e7); + } + let e_ = (e7) => { + if (!e7) + return null; + let t2 = { icon: [], apple: [] }; + if (Array.isArray(e7)) + t2.icon = e7.map(eS).filter(Boolean); + else if (Q(e7)) + t2.icon = [eS(e7)]; + else + for (let r2 of L) { + let n2 = D(e7[r2]); + n2 && (t2[r2] = n2.map(eS)); + } + return t2; + }; + var eE = r(8155), ek = r(83748); + async function eC(e7, t2, r2) { + if ("function" == typeof e7.generateViewport) { + let { route: n2 } = r2; + return (r3) => (0, eE.Yz)().trace(ek._s.generateViewport, { spanName: `generateViewport ${n2}`, attributes: { "next.page": n2 } }, () => e7.generateViewport(t2, r3)); + } + return e7.viewport || null; + } + async function eR(e7, t2, r2) { + if ("function" == typeof e7.generateMetadata) { + let { route: n2 } = r2; + return (r3) => (0, eE.Yz)().trace(ek._s.generateMetadata, { spanName: `generateMetadata ${n2}`, attributes: { "next.page": n2 } }, () => e7.generateMetadata(t2, r3)); + } + return e7.metadata || null; + } + async function eP(e7, t2, r2) { + var n2; + if (!(null == e7 ? void 0 : e7[r2])) + return; + let i2 = e7[r2].map(async (e10) => { + var r3; + return (r3 = await e10(t2)).default || r3; + }); + return (null == i2 ? void 0 : i2.length) > 0 ? null == (n2 = await Promise.all(i2)) ? void 0 : n2.flat() : void 0; + } + async function eT(e7, t2) { + let { metadata: r2 } = e7; + if (!r2) + return null; + let [n2, i2, s2, a2] = await Promise.all([eP(r2, t2, "icon"), eP(r2, t2, "apple"), eP(r2, t2, "openGraph"), eP(r2, t2, "twitter")]); + return { icon: n2, apple: i2, openGraph: s2, twitter: a2, manifest: r2.manifest }; + } + async function eA({ tree: e7, metadataItems: t2, errorMetadataItem: r2, props: n2, route: i2, errorConvention: s2 }) { + let a2, o2; + let l2 = !!(s2 && e7[2][s2]); + if (s2) + a2 = await el(e7, "layout"), o2 = s2; + else { + let { mod: t3, modType: r3 } = await eo(e7); + a2 = t3, o2 = r3; + } + o2 && (i2 += `/${o2}`); + let c2 = await eT(e7[2], n2), u2 = a2 ? await eR(a2, n2, { route: i2 }) : null, d2 = a2 ? await eC(a2, n2, { route: i2 }) : null; + if (t2.push([u2, c2, d2]), l2 && s2) { + let t3 = await el(e7, s2), a3 = t3 ? await eC(t3, n2, { route: i2 }) : null, o3 = t3 ? await eR(t3, n2, { route: i2 }) : null; + r2[0] = o3, r2[1] = c2, r2[2] = a3; + } + } + let eO = (0, P.cache)(eI); + async function eI(e7, t2, r2, n2, i2, s2) { + return eN([], e7, void 0, {}, t2, r2, [null, null, null], n2, i2, s2); + } + async function eN(e7, t2, r2, n2, i2, s2, a2, o2, l2, c2) { + let u2; + let [d2, h2, { page: f2 }] = t2, p2 = r2 && r2.length ? [...r2, d2] : [d2], m2 = o2(d2), g2 = n2; + m2 && null !== m2.value && (g2 = { ...n2, [m2.param]: m2.value }); + let y2 = l2(g2, c2); + for (let r3 in u2 = void 0 !== f2 ? { params: y2, searchParams: i2 } : { params: y2 }, await eA({ tree: t2, metadataItems: e7, errorMetadataItem: a2, errorConvention: s2, props: u2, route: p2.filter((e10) => e10 !== ea.GC).join("/") }), h2) { + let t3 = h2[r3]; + await eN(e7, t3, p2, g2, i2, s2, a2, o2, l2, c2); + } + return 0 === Object.keys(h2).length && s2 && e7.push(a2), e7; + } + let eM = (e7) => !!(null == e7 ? void 0 : e7.absolute), e$ = (e7) => eM(null == e7 ? void 0 : e7.title); + function eL(e7, t2) { + e7 && (!e$(e7) && e$(t2) && (e7.title = t2.title), !e7.description && t2.description && (e7.description = t2.description)); + } + async function ej(e7, t2, r2, n2, i2, s2) { + let a2 = e7(r2[n2]), o2 = t2.resolvers, l2 = null; + if ("function" == typeof a2) { + if (!o2.length) + for (let t3 = n2; t3 < r2.length; t3++) { + let n3 = e7(r2[t3]); + "function" == typeof n3 && function(e10, t4, r3) { + let n4 = t4(new Promise((e11) => { + r3.push(e11); + })); + n4 instanceof Promise && n4.catch((e11) => ({ __nextError: e11 })), e10.push(n4); + }(s2, n3, o2); + } + let a3 = o2[t2.resolvingIndex], c2 = s2[t2.resolvingIndex++]; + if (a3(i2), (l2 = c2 instanceof Promise ? await c2 : c2) && "object" == typeof l2 && "__nextError" in l2) + throw l2.__nextError; + } else + null !== a2 && "object" == typeof a2 && (l2 = a2); + return l2; + } + async function eD(e7, t2) { + let r2; + let n2 = { viewport: null, themeColor: null, colorScheme: null, metadataBase: null, title: null, description: null, applicationName: null, authors: null, generator: null, keywords: null, referrer: null, creator: null, publisher: null, robots: null, manifest: null, alternates: { canonical: null, languages: null, media: null, types: null }, icons: null, openGraph: null, twitter: null, verification: {}, appleWebApp: null, formatDetection: null, itunes: null, facebook: null, abstract: null, appLinks: null, archives: null, assets: null, bookmarks: null, category: null, classification: null, other: {} }, i2 = [], s2 = { title: null, twitter: null, openGraph: null }, a2 = { resolvers: [], resolvingIndex: 0 }, o2 = { warnings: /* @__PURE__ */ new Set() }, l2 = { icon: [], apple: [] }; + for (let m2 = 0; m2 < e7.length; m2++) { + var c2, u2, d2, h2, f2, p2; + let g2 = e7[m2][1]; + if (m2 <= 1 && (p2 = null == g2 ? void 0 : null == (c2 = g2.icon) ? void 0 : c2[0]) && ("/favicon.ico" === p2.url || p2.url.toString().startsWith("/favicon.ico?")) && "image/x-icon" === p2.type) { + let e10 = null == g2 ? void 0 : null == (u2 = g2.icon) ? void 0 : u2.shift(); + 0 === m2 && (r2 = e10); + } + let y2 = await ej((e10) => e10[0], a2, e7, m2, n2, i2); + !function({ source: e10, target: t3, staticFilesMetadata: r3, titleTemplates: n3, metadataContext: i3, buildState: s3, leafSegmentStaticIcons: a3 }) { + let o3 = void 0 !== (null == e10 ? void 0 : e10.metadataBase) ? e10.metadataBase : t3.metadataBase; + for (let r4 in e10) + switch (r4) { + case "title": + t3.title = Y(e10.title, n3.title); + break; + case "alternates": + t3.alternates = eh(e10.alternates, o3, i3); + break; + case "openGraph": + t3.openGraph = en(e10.openGraph, o3, i3, n3.openGraph); + break; + case "twitter": + t3.twitter = es(e10.twitter, o3, i3, n3.twitter); + break; + case "facebook": + t3.facebook = ex(e10.facebook); + break; + case "verification": + t3.verification = ey(e10.verification); + break; + case "icons": + t3.icons = e_(e10.icons); + break; + case "appleWebApp": + t3.appleWebApp = ev(e10.appleWebApp); + break; + case "appLinks": + t3.appLinks = eb(e10.appLinks); + break; + case "robots": + t3.robots = em(e10.robots); + break; + case "archives": + case "assets": + case "bookmarks": + case "keywords": + t3[r4] = D(e10[r4]); + break; + case "authors": + t3[r4] = D(e10.authors); + break; + case "itunes": + t3[r4] = ew(e10.itunes, o3, i3); + break; + case "applicationName": + case "description": + case "generator": + case "creator": + case "publisher": + case "category": + case "classification": + case "referrer": + case "formatDetection": + case "manifest": + t3[r4] = e10[r4] || null; + break; + case "other": + t3.other = Object.assign({}, t3.other, e10.other); + break; + case "metadataBase": + t3.metadataBase = o3; + break; + default: + ("viewport" === r4 || "themeColor" === r4 || "colorScheme" === r4) && null != e10[r4] && s3.warnings.add(`Unsupported metadata ${r4} is configured in metadata export in ${i3.pathname}. Please move it to viewport export instead. +Read more: https://nextjs.org/docs/app/api-reference/functions/generate-viewport`); + } + !function(e11, t4, r4, n4, i4, s4) { + var a4, o4; + if (!r4) + return; + let { icon: l3, apple: c3, openGraph: u3, twitter: d3, manifest: h3 } = r4; + if (l3 && (s4.icon = l3), c3 && (s4.apple = c3), d3 && !(null == e11 ? void 0 : null == (a4 = e11.twitter) ? void 0 : a4.hasOwnProperty("images"))) { + let e12 = es({ ...t4.twitter, images: d3 }, t4.metadataBase, n4, i4.twitter); + t4.twitter = e12; + } + if (u3 && !(null == e11 ? void 0 : null == (o4 = e11.openGraph) ? void 0 : o4.hasOwnProperty("images"))) { + let e12 = en({ ...t4.openGraph, images: u3 }, t4.metadataBase, n4, i4.openGraph); + t4.openGraph = e12; + } + h3 && (t4.manifest = h3); + }(e10, t3, r3, i3, n3, a3); + }({ target: n2, source: y2, metadataContext: t2, staticFilesMetadata: g2, titleTemplates: s2, buildState: o2, leafSegmentStaticIcons: l2 }), m2 < e7.length - 2 && (s2 = { title: (null == (d2 = n2.title) ? void 0 : d2.template) || null, openGraph: (null == (h2 = n2.openGraph) ? void 0 : h2.title.template) || null, twitter: (null == (f2 = n2.twitter) ? void 0 : f2.title.template) || null }); + } + if ((l2.icon.length > 0 || l2.apple.length > 0) && !n2.icons && (n2.icons = { icon: [], apple: [] }, l2.icon.length > 0 && n2.icons.icon.unshift(...l2.icon), l2.apple.length > 0 && n2.icons.apple.unshift(...l2.apple)), o2.warnings.size > 0) + for (let e10 of o2.warnings) + X.ZK(e10); + return function(e10, t3, r3, n3) { + let { openGraph: i3, twitter: s3 } = e10; + if (i3) { + let t4 = {}, a3 = e$(s3), o3 = null == s3 ? void 0 : s3.description, l3 = !!((null == s3 ? void 0 : s3.hasOwnProperty("images")) && s3.images); + if (!a3 && (eM(i3.title) ? t4.title = i3.title : e10.title && eM(e10.title) && (t4.title = e10.title)), o3 || (t4.description = i3.description || e10.description || void 0), l3 || (t4.images = i3.images), Object.keys(t4).length > 0) { + let i4 = es(t4, e10.metadataBase, n3, r3.twitter); + e10.twitter ? e10.twitter = Object.assign({}, e10.twitter, { ...!a3 && { title: null == i4 ? void 0 : i4.title }, ...!o3 && { description: null == i4 ? void 0 : i4.description }, ...!l3 && { images: null == i4 ? void 0 : i4.images } }) : e10.twitter = i4; + } + } + return eL(i3, e10), eL(s3, e10), t3 && (e10.icons || (e10.icons = { icon: [], apple: [] }), e10.icons.icon.unshift(t3)), e10; + }(n2, r2, s2, t2); + } + async function eF(e7) { + let t2 = { width: "device-width", initialScale: 1, themeColor: null, colorScheme: null }, r2 = [], n2 = { resolvers: [], resolvingIndex: 0 }; + for (let i2 = 0; i2 < e7.length; i2++) { + let s2 = await ej((e10) => e10[2], n2, e7, i2, t2, r2); + !function({ target: e10, source: t3 }) { + if (t3) + for (let r3 in t3) + switch (r3) { + case "themeColor": + e10.themeColor = eu(t3.themeColor); + break; + case "colorScheme": + e10.colorScheme = t3.colorScheme || null; + break; + default: + void 0 !== t3[r3] && (e10[r3] = t3[r3]); + } + }({ target: t2, source: s2 }); + } + return t2; + } + var eB = r(51182); + function eU({ tree: e7, searchParams: t2, metadataContext: r2, getDynamicParamFromSegment: n2, appUsingSizeAdjustment: i2, errorType: s2, createServerParamsForMetadata: a2, workStore: o2, MetadataBoundary: l2, ViewportBoundary: c2 }) { + async function u2() { + return eQ(e7, t2, n2, a2, o2, s2); + } + async function d2() { + try { + return await u2(); + } catch (r3) { + if (!s2 && (0, eB.X)(r3)) + try { + return await eG(e7, t2, n2, a2, o2); + } catch { + } + return null; + } + } + async function h2() { + return eq(e7, t2, n2, r2, a2, o2, s2); + } + async function f2() { + try { + return await h2(); + } catch (i3) { + if (!s2 && (0, eB.X)(i3)) + try { + return await eH(e7, t2, n2, r2, a2, o2); + } catch { + } + return null; + } + } + return [function() { + return (0, R.jsxs)(R.Fragment, { children: [(0, R.jsx)(l2, { children: (0, R.jsx)(f2, {}) }), (0, R.jsx)(c2, { children: (0, R.jsx)(d2, {}) }), i2 ? (0, R.jsx)("meta", { name: "next-size-adjust" }) : null] }); + }, async function() { + await u2(), await h2(); + }]; + } + let eq = (0, P.cache)(ez); + async function ez(e7, t2, r2, n2, i2, s2, a2) { + let o2 = await eO(e7, t2, "redirect" === a2 ? void 0 : a2, r2, i2, s2), l2 = eK(await eD(o2, n2)); + return (0, R.jsx)(R.Fragment, { children: l2.map((e10, t3) => (0, P.cloneElement)(e10, { key: t3 })) }); + } + let eH = (0, P.cache)(eW); + async function eW(e7, t2, r2, n2, i2, s2) { + let a2 = await eO(e7, t2, "not-found", r2, i2, s2), o2 = eK(await eD(a2, n2)); + return (0, R.jsx)(R.Fragment, { children: o2.map((e10, t3) => (0, P.cloneElement)(e10, { key: t3 })) }); + } + let eQ = (0, P.cache)(eV); + async function eV(e7, t2, r2, n2, i2, s2) { + let a2 = await eO(e7, t2, "redirect" === s2 ? void 0 : s2, r2, n2, i2), o2 = eJ(await eF(a2)); + return (0, R.jsx)(R.Fragment, { children: o2.map((e10, t3) => (0, P.cloneElement)(e10, { key: t3 })) }); + } + let eG = (0, P.cache)(eZ); + async function eZ(e7, t2, r2, n2, i2) { + let s2 = await eO(e7, t2, "not-found", r2, n2, i2), a2 = eJ(await eF(s2)); + return (0, R.jsx)(R.Fragment, { children: a2.map((e10, t3) => (0, P.cloneElement)(e10, { key: t3 })) }); + } + function eK(e7) { + return O([function({ metadata: e10 }) { + var t2, r2, n2; + let i2 = e10.manifest ? function(e11) { + let t3; + if ("string" == typeof e11) + try { + t3 = (e11 = new URL(e11)).origin; + } catch { + } + return t3; + }(e10.manifest) : void 0; + return O([(0, R.jsx)("meta", { charSet: "utf-8" }), null !== e10.title && e10.title.absolute ? (0, R.jsx)("title", { children: e10.title.absolute }) : null, A({ name: "description", content: e10.description }), A({ name: "application-name", content: e10.applicationName }), ...e10.authors ? e10.authors.map((e11) => [e11.url ? (0, R.jsx)("link", { rel: "author", href: e11.url.toString() }) : null, A({ name: "author", content: e11.name })]) : [], e10.manifest ? (0, R.jsx)("link", { rel: "manifest", href: e10.manifest.toString(), crossOrigin: i2 || true ? void 0 : "use-credentials" }) : null, A({ name: "generator", content: e10.generator }), A({ name: "keywords", content: null == (t2 = e10.keywords) ? void 0 : t2.join(",") }), A({ name: "referrer", content: e10.referrer }), A({ name: "creator", content: e10.creator }), A({ name: "publisher", content: e10.publisher }), A({ name: "robots", content: null == (r2 = e10.robots) ? void 0 : r2.basic }), A({ name: "googlebot", content: null == (n2 = e10.robots) ? void 0 : n2.googleBot }), A({ name: "abstract", content: e10.abstract }), ...e10.archives ? e10.archives.map((e11) => (0, R.jsx)("link", { rel: "archives", href: e11 })) : [], ...e10.assets ? e10.assets.map((e11) => (0, R.jsx)("link", { rel: "assets", href: e11 })) : [], ...e10.bookmarks ? e10.bookmarks.map((e11) => (0, R.jsx)("link", { rel: "bookmarks", href: e11 })) : [], A({ name: "category", content: e10.category }), A({ name: "classification", content: e10.classification }), ...e10.other ? Object.entries(e10.other).map(([e11, t3]) => Array.isArray(t3) ? t3.map((t4) => A({ name: e11, content: t4 })) : A({ name: e11, content: t3 })) : []]); + }({ metadata: e7 }), function({ alternates: e10 }) { + if (!e10) + return null; + let { canonical: t2, languages: r2, media: n2, types: i2 } = e10; + return O([t2 ? B({ rel: "canonical", descriptor: t2 }) : null, r2 ? Object.entries(r2).flatMap(([e11, t3]) => null == t3 ? void 0 : t3.map((t4) => B({ rel: "alternate", hrefLang: e11, descriptor: t4 }))) : null, n2 ? Object.entries(n2).flatMap(([e11, t3]) => null == t3 ? void 0 : t3.map((t4) => B({ rel: "alternate", media: e11, descriptor: t4 }))) : null, i2 ? Object.entries(i2).flatMap(([e11, t3]) => null == t3 ? void 0 : t3.map((t4) => B({ rel: "alternate", type: e11, descriptor: t4 }))) : null]); + }({ alternates: e7.alternates }), function({ itunes: e10 }) { + if (!e10) + return null; + let { appId: t2, appArgument: r2 } = e10, n2 = `app-id=${t2}`; + return r2 && (n2 += `, app-argument=${r2}`), (0, R.jsx)("meta", { name: "apple-itunes-app", content: n2 }); + }({ itunes: e7.itunes }), function({ facebook: e10 }) { + if (!e10) + return null; + let { appId: t2, admins: r2 } = e10; + return O([t2 ? (0, R.jsx)("meta", { property: "fb:app_id", content: t2 }) : null, ...r2 ? r2.map((e11) => (0, R.jsx)("meta", { property: "fb:admins", content: e11 })) : []]); + }({ facebook: e7.facebook }), function({ formatDetection: e10 }) { + if (!e10) + return null; + let t2 = ""; + for (let r2 of F) + r2 in e10 && (t2 && (t2 += ", "), t2 += `${r2}=no`); + return (0, R.jsx)("meta", { name: "format-detection", content: t2 }); + }({ formatDetection: e7.formatDetection }), function({ verification: e10 }) { + return e10 ? O([M({ namePrefix: "google-site-verification", contents: e10.google }), M({ namePrefix: "y_key", contents: e10.yahoo }), M({ namePrefix: "yandex-verification", contents: e10.yandex }), M({ namePrefix: "me", contents: e10.me }), ...e10.other ? Object.entries(e10.other).map(([e11, t2]) => M({ namePrefix: e11, contents: t2 })) : []]) : null; + }({ verification: e7.verification }), function({ appleWebApp: e10 }) { + if (!e10) + return null; + let { capable: t2, title: r2, startupImage: n2, statusBarStyle: i2 } = e10; + return O([t2 ? A({ name: "mobile-web-app-capable", content: "yes" }) : null, A({ name: "apple-mobile-web-app-title", content: r2 }), n2 ? n2.map((e11) => (0, R.jsx)("link", { href: e11.url, media: e11.media, rel: "apple-touch-startup-image" })) : null, i2 ? A({ name: "apple-mobile-web-app-status-bar-style", content: i2 }) : null]); + }({ appleWebApp: e7.appleWebApp }), function({ openGraph: e10 }) { + var t2, r2, n2, i2, s2, a2, o2; + let l2; + if (!e10) + return null; + if ("type" in e10) { + let t3 = e10.type; + switch (t3) { + case "website": + l2 = [A({ property: "og:type", content: "website" })]; + break; + case "article": + l2 = [A({ property: "og:type", content: "article" }), A({ property: "article:published_time", content: null == (i2 = e10.publishedTime) ? void 0 : i2.toString() }), A({ property: "article:modified_time", content: null == (s2 = e10.modifiedTime) ? void 0 : s2.toString() }), A({ property: "article:expiration_time", content: null == (a2 = e10.expirationTime) ? void 0 : a2.toString() }), M({ propertyPrefix: "article:author", contents: e10.authors }), A({ property: "article:section", content: e10.section }), M({ propertyPrefix: "article:tag", contents: e10.tags })]; + break; + case "book": + l2 = [A({ property: "og:type", content: "book" }), A({ property: "book:isbn", content: e10.isbn }), A({ property: "book:release_date", content: e10.releaseDate }), M({ propertyPrefix: "book:author", contents: e10.authors }), M({ propertyPrefix: "book:tag", contents: e10.tags })]; + break; + case "profile": + l2 = [A({ property: "og:type", content: "profile" }), A({ property: "profile:first_name", content: e10.firstName }), A({ property: "profile:last_name", content: e10.lastName }), A({ property: "profile:username", content: e10.username }), A({ property: "profile:gender", content: e10.gender })]; + break; + case "music.song": + l2 = [A({ property: "og:type", content: "music.song" }), A({ property: "music:duration", content: null == (o2 = e10.duration) ? void 0 : o2.toString() }), M({ propertyPrefix: "music:album", contents: e10.albums }), M({ propertyPrefix: "music:musician", contents: e10.musicians })]; + break; + case "music.album": + l2 = [A({ property: "og:type", content: "music.album" }), M({ propertyPrefix: "music:song", contents: e10.songs }), M({ propertyPrefix: "music:musician", contents: e10.musicians }), A({ property: "music:release_date", content: e10.releaseDate })]; + break; + case "music.playlist": + l2 = [A({ property: "og:type", content: "music.playlist" }), M({ propertyPrefix: "music:song", contents: e10.songs }), M({ propertyPrefix: "music:creator", contents: e10.creators })]; + break; + case "music.radio_station": + l2 = [A({ property: "og:type", content: "music.radio_station" }), M({ propertyPrefix: "music:creator", contents: e10.creators })]; + break; + case "video.movie": + l2 = [A({ property: "og:type", content: "video.movie" }), M({ propertyPrefix: "video:actor", contents: e10.actors }), M({ propertyPrefix: "video:director", contents: e10.directors }), M({ propertyPrefix: "video:writer", contents: e10.writers }), A({ property: "video:duration", content: e10.duration }), A({ property: "video:release_date", content: e10.releaseDate }), M({ propertyPrefix: "video:tag", contents: e10.tags })]; + break; + case "video.episode": + l2 = [A({ property: "og:type", content: "video.episode" }), M({ propertyPrefix: "video:actor", contents: e10.actors }), M({ propertyPrefix: "video:director", contents: e10.directors }), M({ propertyPrefix: "video:writer", contents: e10.writers }), A({ property: "video:duration", content: e10.duration }), A({ property: "video:release_date", content: e10.releaseDate }), M({ propertyPrefix: "video:tag", contents: e10.tags }), A({ property: "video:series", content: e10.series })]; + break; + case "video.tv_show": + l2 = [A({ property: "og:type", content: "video.tv_show" })]; + break; + case "video.other": + l2 = [A({ property: "og:type", content: "video.other" })]; + break; + default: + throw Error(`Invalid OpenGraph type: ${t3}`); + } + } + return O([A({ property: "og:determiner", content: e10.determiner }), A({ property: "og:title", content: null == (t2 = e10.title) ? void 0 : t2.absolute }), A({ property: "og:description", content: e10.description }), A({ property: "og:url", content: null == (r2 = e10.url) ? void 0 : r2.toString() }), A({ property: "og:site_name", content: e10.siteName }), A({ property: "og:locale", content: e10.locale }), A({ property: "og:country_name", content: e10.countryName }), A({ property: "og:ttl", content: null == (n2 = e10.ttl) ? void 0 : n2.toString() }), M({ propertyPrefix: "og:image", contents: e10.images }), M({ propertyPrefix: "og:video", contents: e10.videos }), M({ propertyPrefix: "og:audio", contents: e10.audio }), M({ propertyPrefix: "og:email", contents: e10.emails }), M({ propertyPrefix: "og:phone_number", contents: e10.phoneNumbers }), M({ propertyPrefix: "og:fax_number", contents: e10.faxNumbers }), M({ propertyPrefix: "og:locale:alternate", contents: e10.alternateLocale }), ...l2 || []]); + }({ openGraph: e7.openGraph }), function({ twitter: e10 }) { + var t2; + if (!e10) + return null; + let { card: r2 } = e10; + return O([A({ name: "twitter:card", content: r2 }), A({ name: "twitter:site", content: e10.site }), A({ name: "twitter:site:id", content: e10.siteId }), A({ name: "twitter:creator", content: e10.creator }), A({ name: "twitter:creator:id", content: e10.creatorId }), A({ name: "twitter:title", content: null == (t2 = e10.title) ? void 0 : t2.absolute }), A({ name: "twitter:description", content: e10.description }), M({ namePrefix: "twitter:image", contents: e10.images }), ..."player" === r2 ? e10.players.flatMap((e11) => [A({ name: "twitter:player", content: e11.playerUrl.toString() }), A({ name: "twitter:player:stream", content: e11.streamUrl.toString() }), A({ name: "twitter:player:width", content: e11.width }), A({ name: "twitter:player:height", content: e11.height })]) : [], ..."app" === r2 ? [U({ app: e10.app, type: "iphone" }), U({ app: e10.app, type: "ipad" }), U({ app: e10.app, type: "googleplay" })] : []]); + }({ twitter: e7.twitter }), function({ appLinks: e10 }) { + return e10 ? O([M({ propertyPrefix: "al:ios", contents: e10.ios }), M({ propertyPrefix: "al:iphone", contents: e10.iphone }), M({ propertyPrefix: "al:ipad", contents: e10.ipad }), M({ propertyPrefix: "al:android", contents: e10.android }), M({ propertyPrefix: "al:windows_phone", contents: e10.windows_phone }), M({ propertyPrefix: "al:windows", contents: e10.windows }), M({ propertyPrefix: "al:windows_universal", contents: e10.windows_universal }), M({ propertyPrefix: "al:web", contents: e10.web })]) : null; + }({ appLinks: e7.appLinks }), function({ icons: e10 }) { + if (!e10) + return null; + let t2 = e10.shortcut, r2 = e10.icon, n2 = e10.apple, i2 = e10.other; + return O([t2 ? t2.map((e11) => z({ rel: "shortcut icon", icon: e11 })) : null, r2 ? r2.map((e11) => z({ rel: "icon", icon: e11 })) : null, n2 ? n2.map((e11) => z({ rel: "apple-touch-icon", icon: e11 })) : null, i2 ? i2.map((e11) => q({ icon: e11 })) : null]); + }({ icons: e7.icons })]); + } + function eJ(e7) { + return O([function({ viewport: e10 }) { + return O([A({ name: "viewport", content: function(e11) { + let t2 = null; + if (e11 && "object" == typeof e11) { + for (let r2 in t2 = "", $) + if (r2 in e11) { + let n2 = e11[r2]; + "boolean" == typeof n2 && (n2 = n2 ? "yes" : "no"), t2 && (t2 += ", "), t2 += `${$[r2]}=${n2}`; + } + } + return t2; + }(e10) }), ...e10.themeColor ? e10.themeColor.map((e11) => A({ name: "theme-color", content: e11.color, media: e11.media })) : [], A({ name: "color-scheme", content: e10.colorScheme })]); + }({ viewport: e7 })]); + } + var eY = r(88420); + r(4927); + let eX = (0, s.D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/next@15.0.0-canary.200_e4kbeb3oepbyvs7ql5y74riunu/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js`), e0 = eX.MetadataBoundary, e1 = eX.ViewportBoundary, e2 = eX.OutletBoundary; + var e6 = r(2844); + function e5(e7, t2, r2) { + let n2 = { as: "style" }; + "string" == typeof t2 && (n2.crossOrigin = t2), "string" == typeof r2 && (n2.nonce = r2), e6.preload(e7, n2); + } + function e4(e7, t2, r2, n2) { + let i2 = { as: "font", type: t2 }; + "string" == typeof r2 && (i2.crossOrigin = r2), "string" == typeof n2 && (i2.nonce = n2), e6.preload(e7, i2); + } + function e3(e7, t2, r2) { + let n2 = {}; + "string" == typeof t2 && (n2.crossOrigin = t2), "string" == typeof r2 && (n2.nonce = r2), e6.preconnect(e7, n2); + } + let e8 = function() { + throw Error("Taint can only be used with the taint flag."); + }; + function e9() { + return (0, eY.XH)({ workAsyncStorage: l.workAsyncStorage, workUnitAsyncStorage: c.S }); + } + }; + __namedExportsObject5["__chunk_40109"] = (e, t, r) => { + "use strict"; + var n, i, s, a, o, l, c, u, d, h, f, p; + let m; + r(78077), r(74832), function(e2) { + e2.handleRequest = "BaseServer.handleRequest", e2.run = "BaseServer.run", e2.pipe = "BaseServer.pipe", e2.getStaticHTML = "BaseServer.getStaticHTML", e2.render = "BaseServer.render", e2.renderToResponseWithComponents = "BaseServer.renderToResponseWithComponents", e2.renderToResponse = "BaseServer.renderToResponse", e2.renderToHTML = "BaseServer.renderToHTML", e2.renderError = "BaseServer.renderError", e2.renderErrorToResponse = "BaseServer.renderErrorToResponse", e2.renderErrorToHTML = "BaseServer.renderErrorToHTML", e2.render404 = "BaseServer.render404"; + }(n || (n = {})), function(e2) { + e2.loadDefaultErrorComponents = "LoadComponents.loadDefaultErrorComponents", e2.loadComponents = "LoadComponents.loadComponents"; + }(i || (i = {})), function(e2) { + e2.getRequestHandler = "NextServer.getRequestHandler", e2.getServer = "NextServer.getServer", e2.getServerRequestHandler = "NextServer.getServerRequestHandler", e2.createServer = "createServer.createServer"; + }(s || (s = {})), function(e2) { + e2.compression = "NextNodeServer.compression", e2.getBuildId = "NextNodeServer.getBuildId", e2.createComponentTree = "NextNodeServer.createComponentTree", e2.clientComponentLoading = "NextNodeServer.clientComponentLoading", e2.getLayoutOrPageModule = "NextNodeServer.getLayoutOrPageModule", e2.generateStaticRoutes = "NextNodeServer.generateStaticRoutes", e2.generateFsStaticRoutes = "NextNodeServer.generateFsStaticRoutes", e2.generatePublicRoutes = "NextNodeServer.generatePublicRoutes", e2.generateImageRoutes = "NextNodeServer.generateImageRoutes.route", e2.sendRenderResult = "NextNodeServer.sendRenderResult", e2.proxyRequest = "NextNodeServer.proxyRequest", e2.runApi = "NextNodeServer.runApi", e2.render = "NextNodeServer.render", e2.renderHTML = "NextNodeServer.renderHTML", e2.imageOptimizer = "NextNodeServer.imageOptimizer", e2.getPagePath = "NextNodeServer.getPagePath", e2.getRoutesManifest = "NextNodeServer.getRoutesManifest", e2.findPageComponents = "NextNodeServer.findPageComponents", e2.getFontManifest = "NextNodeServer.getFontManifest", e2.getServerComponentManifest = "NextNodeServer.getServerComponentManifest", e2.getRequestHandler = "NextNodeServer.getRequestHandler", e2.renderToHTML = "NextNodeServer.renderToHTML", e2.renderError = "NextNodeServer.renderError", e2.renderErrorToHTML = "NextNodeServer.renderErrorToHTML", e2.render404 = "NextNodeServer.render404", e2.startResponse = "NextNodeServer.startResponse", e2.route = "route", e2.onProxyReq = "onProxyReq", e2.apiResolver = "apiResolver", e2.internalFetch = "internalFetch"; + }(a || (a = {})), (o || (o = {})).startServer = "startServer.startServer", function(e2) { + e2.getServerSideProps = "Render.getServerSideProps", e2.getStaticProps = "Render.getStaticProps", e2.renderToString = "Render.renderToString", e2.renderDocument = "Render.renderDocument", e2.createBodyResult = "Render.createBodyResult"; + }(l || (l = {})), function(e2) { + e2.renderToString = "AppRender.renderToString", e2.renderToReadableStream = "AppRender.renderToReadableStream", e2.getBodyResult = "AppRender.getBodyResult", e2.fetch = "AppRender.fetch"; + }(c || (c = {})), (u || (u = {})).executeRoute = "Router.executeRoute", (d || (d = {})).runHandler = "Node.runHandler", (h || (h = {})).runHandler = "AppRouteRouteHandlers.runHandler", function(e2) { + e2.generateMetadata = "ResolveMetadata.generateMetadata", e2.generateViewport = "ResolveMetadata.generateViewport"; + }(f || (f = {})), (p || (p = {})).execute = "Middleware.execute"; + let g = ["Middleware.execute", "BaseServer.handleRequest", "Render.getServerSideProps", "Render.getStaticProps", "AppRender.fetch", "AppRender.getBodyResult", "Render.renderDocument", "Node.runHandler", "AppRouteRouteHandlers.runHandler", "ResolveMetadata.generateMetadata", "ResolveMetadata.generateViewport", "NextNodeServer.createComponentTree", "NextNodeServer.findPageComponents", "NextNodeServer.getLayoutOrPageModule", "NextNodeServer.startResponse", "NextNodeServer.clientComponentLoading"], y = ["NextNodeServer.findPageComponents", "NextNodeServer.createComponentTree", "NextNodeServer.clientComponentLoading"], { context: v, propagation: b, trace: w, SpanStatusCode: x, SpanKind: S, ROOT_CONTEXT: _ } = m = r(42803); + class E extends Error { + constructor(e2, t2) { + super(), this.bubble = e2, this.result = t2; + } + } + let k = (e2, t2) => { + (function(e3) { + return "object" == typeof e3 && null !== e3 && e3 instanceof E; + })(t2) && t2.bubble ? e2.setAttribute("next.bubble", true) : (t2 && e2.recordException(t2), e2.setStatus({ code: x.ERROR, message: null == t2 ? void 0 : t2.message })), e2.end(); + }, C = /* @__PURE__ */ new Map(), R = m.createContextKey("next.rootSpanId"), P = 0, T = () => P++, A = { set(e2, t2, r2) { + e2.push({ key: t2, value: r2 }); + } }; + class O { + getTracerInstance() { + return w.getTracer("next.js", "0.0.1"); + } + getContext() { + return v; + } + getTracePropagationData() { + let e2 = v.active(), t2 = []; + return b.inject(e2, t2, A), t2; + } + getActiveScopeSpan() { + return w.getSpan(null == v ? void 0 : v.active()); + } + withPropagatedContext(e2, t2, r2) { + let n2 = v.active(); + if (w.getSpanContext(n2)) + return t2(); + let i2 = b.extract(n2, e2, r2); + return v.with(i2, t2); + } + trace(...e2) { + var t2; + let [r2, n2, i2] = e2, { fn: s2, options: a2 } = "function" == typeof n2 ? { fn: n2, options: {} } : { fn: i2, options: { ...n2 } }, o2 = a2.spanName ?? r2; + if (!g.includes(r2) && "1" !== 0 || a2.hideSpan) + return s2(); + let l2 = this.getSpanContext((null == a2 ? void 0 : a2.parentSpan) ?? this.getActiveScopeSpan()), c2 = false; + l2 ? (null == (t2 = w.getSpanContext(l2)) ? void 0 : t2.isRemote) && (c2 = true) : (l2 = (null == v ? void 0 : v.active()) ?? _, c2 = true); + let u2 = T(); + return a2.attributes = { "next.span_name": o2, "next.span_type": r2, ...a2.attributes }, v.with(l2.setValue(R, u2), () => this.getTracerInstance().startActiveSpan(o2, a2, (e3) => { + let t3 = "performance" in globalThis2 && "measure" in performance ? globalThis2.performance.now() : void 0, n3 = () => { + C.delete(u2), t3 && ""; + }; + c2 && C.set(u2, new Map(Object.entries(a2.attributes ?? {}))); + try { + if (s2.length > 1) + return s2(e3, (t5) => k(e3, t5)); + let t4 = s2(e3); + if (null !== t4 && "object" == typeof t4 && "then" in t4 && "function" == typeof t4.then) + return t4.then((t5) => (e3.end(), t5)).catch((t5) => { + throw k(e3, t5), t5; + }).finally(n3); + return e3.end(), n3(), t4; + } catch (t4) { + throw k(e3, t4), n3(), t4; + } + })); + } + wrap(...e2) { + let t2 = this, [r2, n2, i2] = 3 === e2.length ? e2 : [e2[0], {}, e2[1]]; + return g.includes(r2) || "1" === 0 ? function() { + let e3 = n2; + "function" == typeof e3 && "function" == typeof i2 && (e3 = e3.apply(this, arguments)); + let s2 = arguments.length - 1, a2 = arguments[s2]; + if ("function" != typeof a2) + return t2.trace(r2, e3, () => i2.apply(this, arguments)); + { + let n3 = t2.getContext().bind(v.active(), a2); + return t2.trace(r2, e3, (e4, t3) => (arguments[s2] = function(e5) { + return null == t3 || t3(e5), n3.apply(this, arguments); + }, i2.apply(this, arguments))); + } + } : i2; + } + startSpan(...e2) { + let [t2, r2] = e2, n2 = this.getSpanContext((null == r2 ? void 0 : r2.parentSpan) ?? this.getActiveScopeSpan()); + return this.getTracerInstance().startSpan(t2, r2, n2); + } + getSpanContext(e2) { + return e2 ? w.setSpan(v.active(), e2) : void 0; + } + getRootSpanAttributes() { + let e2 = v.active().getValue(R); + return C.get(e2); + } + setRootSpanAttribute(e2, t2) { + let r2 = v.active().getValue(R), n2 = C.get(r2); + n2 && n2.set(e2, t2); + } + } + (() => { + let e2 = new O(); + return () => e2; + })(), new Uint8Array([60, 104, 116, 109, 108]), new Uint8Array([60, 98, 111, 100, 121]), new Uint8Array([60, 47, 104, 101, 97, 100, 62]), new Uint8Array([60, 47, 98, 111, 100, 121, 62]), new Uint8Array([60, 47, 104, 116, 109, 108, 62]), new Uint8Array([60, 47, 98, 111, 100, 121, 62, 60, 47, 104, 116, 109, 108, 62]), r(26195).Buffer, new TextEncoder(), Symbol.for("next.server.action-manifests"), new TextEncoder(), new TextDecoder(); + }; + __namedExportsObject5["__chunk_40186"] = (e, t, r) => { + "use strict"; + r.d(t, { Sg: () => l }); + var n = r(84953), i = r.n(n), s = r(53467), a = r(75222), o = r(54889); + function l(e2, t2, r2) { + let n2; + let l2 = (0, o.w)(e2), c = (0, a.JV)(l2, false), u = (0, s.oE)(l2, t2, c), d = (n2 = "", (e2.includes("(") && e2.includes(")") || e2.includes("@")) && (n2 = function(e3) { + let t3 = 5381; + for (let r3 = 0; r3 < e3.length; r3++) + t3 = (t3 << 5) + t3 + e3.charCodeAt(r3) & 4294967295; + return t3 >>> 0; + }(e2).toString(36).slice(0, 6)), n2), h = d ? `-${d}` : "", { name: f, ext: p } = i().parse(r2); + return i().join(u, `${f}${h}${p}`).replace(/\\/g, "/"); + } + }; + __namedExportsObject5["__chunk_4927"] = (e, t, r) => { + "use strict"; + r.d(t, { ZP: () => i }); + let n = (0, r(63861).D)(String.raw`/Users/gabrielpinto/repos/next/NextMaster/node_modules/.pnpm/next@15.0.0-canary.200_e4kbeb3oepbyvs7ql5y74riunu/node_modules/next/dist/esm/client/components/error-boundary.js`); + n.ErrorBoundaryHandler, n.GlobalError; + let i = n.default; + n.ErrorBoundary; + }; + __namedExportsObject5["__chunk_33499"] = (e, t, r) => { + "use strict"; + r.d(t, { j: () => n.jF }); + var n = r(78077); + }; + __namedExportsObject5["__chunk_3491"] = (e, t, r) => { + "use strict"; + function n(e2) { + for (let t2 = 0; t2 < e2.length; t2++) { + let r2 = e2[t2]; + if ("function" != typeof r2) + throw Error(`A "use server" file can only export async functions, found ${typeof r2}. +Read more: https://nextjs.org/docs/messages/invalid-use-server-value`); + } + } + r.d(t, { h: () => n }); + }; + __namedExportsObject5["__chunk_42629"] = (e, t, r) => { + "use strict"; + r.d(t, { Qk: () => _, A: () => I }); + var n = r(92969); + class i { + static get(e2, t2, r2) { + let n2 = Reflect.get(e2, t2, r2); + return "function" == typeof n2 ? n2.bind(e2) : n2; + } + static set(e2, t2, r2, n2) { + return Reflect.set(e2, t2, r2, n2); + } + static has(e2, t2) { + return Reflect.has(e2, t2); + } + static deleteProperty(e2, t2) { + return Reflect.deleteProperty(e2, t2); + } + } + var s = r(57418), a = r(49216); + class o extends Error { + constructor() { + super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options"); + } + static callable() { + throw new o(); + } + } + class l { + static seal(e2) { + return new Proxy(e2, { get(e3, t2, r2) { + switch (t2) { + case "clear": + case "delete": + case "set": + return o.callable; + default: + return i.get(e3, t2, r2); + } + } }); + } + } + Symbol.for("next.mutated.cookies"); + var c = r(70219); + class u extends Error { + constructor(e2) { + super("Dynamic server usage: " + e2), this.description = e2, this.digest = "DYNAMIC_SERVER_USAGE"; + } + } + class d extends Error { + constructor(...e2) { + super(...e2), this.code = "NEXT_STATIC_GEN_BAILOUT"; + } + } + let h = "function" == typeof c.unstable_postpone; + function f(e2, t2, r2) { + let n2 = new u(`Route ${t2.route} couldn't be rendered statically because it used \`${e2}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`); + throw r2.revalidate = 0, t2.dynamicUsageDescription = e2, t2.dynamicUsageStack = n2.stack, n2; + } + function p(e2, t2) { + t2 && "cache" !== t2.type && "unstable-cache" !== t2.type && ("prerender" === t2.type || "prerender-legacy" === t2.type) && (t2.revalidate = 0); + } + function m(e2, t2, r2, n2) { + let i2 = n2.dynamicTracking; + throw i2 && null === i2.syncDynamicErrorWithStack && (i2.syncDynamicExpression = t2, i2.syncDynamicErrorWithStack = r2), function(e3, t3, r3) { + let n3 = v(`Route ${e3} needs to bail out of prerendering at this point because it used ${t3}.`); + r3.controller && r3.controller.abort(n3); + let i3 = r3.dynamicTracking; + i3 && i3.dynamicAccesses.push({ stack: i3.isDebugDynamicAccesses ? Error().stack : void 0, expression: t3 }); + }(e2, t2, n2), v(`Route ${e2} needs to bail out of prerendering at this point because it used ${t2}.`); + } + function g(e2, t2, r2) { + (function() { + if (!h) + throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"); + })(), r2 && r2.dynamicAccesses.push({ stack: r2.isDebugDynamicAccesses ? Error().stack : void 0, expression: t2 }), c.unstable_postpone(y(e2, t2)); + } + function y(e2, t2) { + return `Route ${e2} needs to bail out of prerendering at this point because it used ${t2}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`; + } + if (false === function(e2) { + return e2.includes("needs to bail out of prerendering at this point because it used") && e2.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error"); + }(y("%%%", "^^^"))) + throw Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"); + function v(e2) { + let t2 = Error(e2); + return t2.digest = "NEXT_PRERENDER_INTERRUPTED", t2; + } + function b(e2) { + let t2 = Promise.resolve(e2); + return t2.status = "fulfilled", t2.value = e2, t2; + } + function w(e2, t2) { + let r2 = new Promise((r3, n2) => { + e2.addEventListener("abort", () => { + n2(Error(`During prerendering, ${t2} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${t2} to a different context by using \`setTimeout\`, \`unstable_after\`, or similar functions you may observe this error and you should handle it in that context.`)); + }); + }); + return r2.catch(() => { + }), r2; + } + RegExp(`\\n\\s+at __next_metadata_boundary__[\\n\\s]`), RegExp(`\\n\\s+at __next_viewport_boundary__[\\n\\s]`), RegExp(`\\n\\s+at __next_outlet_boundary__[\\n\\s]`); + let x = { current: null }; + function S(e2) { + return function(...t2) { + console.error(e2(...t2)); + }; + } + function _() { + let e2 = "cookies", t2 = s.workAsyncStorage.getStore(), r2 = a.S.getStore(); + if (t2) { + if (t2.forceStatic) + return k(l.seal(new n.RequestCookies(new Headers({})))); + if (r2) { + if ("cache" === r2.type) + throw Error(`Route ${t2.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`); + if ("unstable-cache" === r2.type) + throw Error(`Route ${t2.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`); + if ("after" === r2.phase) + throw Error(`Route ${t2.route} used "cookies" inside "unstable_after(...)". This is not supported. If you need this data inside an "unstable_after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/unstable_after`); + } + if (t2.dynamicShouldError) + throw new d(`Route ${t2.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`); + if (r2) { + if ("prerender" === r2.type) + return function(e3, t3) { + let r3 = E.get(t3); + if (r3) + return r3; + let n2 = w(t3.renderSignal, "`cookies()`"); + return E.set(t3, n2), Object.defineProperties(n2, { [Symbol.iterator]: { value: function() { + let r4 = "cookies()[Symbol.iterator]()", n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, size: { get() { + let r4 = "cookies().size", n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, get: { value: function() { + let r4; + r4 = 0 == arguments.length ? "cookies().get()" : `cookies().get(${C(arguments[0])})`; + let n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, getAll: { value: function() { + let r4; + r4 = 0 == arguments.length ? "cookies().getAll()" : `cookies().getAll(${C(arguments[0])})`; + let n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, has: { value: function() { + let r4; + r4 = 0 == arguments.length ? "cookies().has()" : `cookies().has(${C(arguments[0])})`; + let n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, set: { value: function() { + let r4; + if (0 == arguments.length) + r4 = "cookies().set()"; + else { + let e4 = arguments[0]; + r4 = e4 ? `cookies().set(${C(e4)}, ...)` : "cookies().set(...)"; + } + let n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, delete: { value: function() { + let r4; + r4 = 0 == arguments.length ? "cookies().delete()" : 1 == arguments.length ? `cookies().delete(${C(arguments[0])})` : `cookies().delete(${C(arguments[0])}, ...)`; + let n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, clear: { value: function() { + let r4 = "cookies().clear()", n3 = T(e3, r4); + m(e3, r4, n3, t3); + } }, toString: { value: function() { + let r4 = "cookies().toString()", n3 = T(e3, r4); + m(e3, r4, n3, t3); + } } }), n2; + }(t2.route, r2); + "prerender-ppr" === r2.type ? g(t2.route, e2, r2.dynamicTracking) : "prerender-legacy" === r2.type && f(e2, t2, r2); + } + p(t2, r2); + } + let i2 = (0, a.F)(e2); + return k("action" === i2.phase ? i2.userspaceMutableCookies : i2.cookies); + } + ("function" == typeof c.cache ? c.cache : (e2) => e2)((e2) => { + try { + console.error(x.current); + } finally { + x.current = null; + } + }); + let E = /* @__PURE__ */ new WeakMap(); + function k(e2) { + let t2 = E.get(e2); + if (t2) + return t2; + let r2 = b(e2); + return E.set(e2, r2), Object.defineProperties(r2, { [Symbol.iterator]: { value: e2[Symbol.iterator] ? e2[Symbol.iterator].bind(e2) : R.bind(e2) }, size: { get: () => e2.size }, get: { value: e2.get.bind(e2) }, getAll: { value: e2.getAll.bind(e2) }, has: { value: e2.has.bind(e2) }, set: { value: e2.set.bind(e2) }, delete: { value: e2.delete.bind(e2) }, clear: { value: "function" == typeof e2.clear ? e2.clear.bind(e2) : P.bind(e2, r2) }, toString: { value: e2.toString.bind(e2) } }), r2; + } + function C(e2) { + return "object" == typeof e2 && null !== e2 && "string" == typeof e2.name ? `'${e2.name}'` : "string" == typeof e2 ? `'${e2}'` : "..."; + } + function R() { + return this.getAll().map((e2) => [e2.name, e2]).values(); + } + function P(e2) { + for (let e3 of this.getAll()) + this.delete(e3.name); + return e2; + } + function T(e2, t2) { + return Error(`Route "${e2}" used ${t2}. \`cookies()\` now returns a Promise and should be \`awaited\` before using it's value. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`); + } + S(function(e2) { + let t2 = e2 ? ` In route ${e2} ` : ""; + return Error(`${t2}cookies were iterated over. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + }), S(function(e2, t2) { + let r2 = e2 ? ` In route ${e2} a ` : "A "; + return Error(`${r2}cookie property was accessed directly with \`${t2}\`. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + }); + class A extends Error { + constructor() { + super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers"); + } + static callable() { + throw new A(); + } + } + class O extends Headers { + constructor(e2) { + super(), this.headers = new Proxy(e2, { get(t2, r2, n2) { + if ("symbol" == typeof r2) + return i.get(t2, r2, n2); + let s2 = r2.toLowerCase(), a2 = Object.keys(e2).find((e3) => e3.toLowerCase() === s2); + if (void 0 !== a2) + return i.get(t2, a2, n2); + }, set(t2, r2, n2, s2) { + if ("symbol" == typeof r2) + return i.set(t2, r2, n2, s2); + let a2 = r2.toLowerCase(), o2 = Object.keys(e2).find((e3) => e3.toLowerCase() === a2); + return i.set(t2, o2 ?? r2, n2, s2); + }, has(t2, r2) { + if ("symbol" == typeof r2) + return i.has(t2, r2); + let n2 = r2.toLowerCase(), s2 = Object.keys(e2).find((e3) => e3.toLowerCase() === n2); + return void 0 !== s2 && i.has(t2, s2); + }, deleteProperty(t2, r2) { + if ("symbol" == typeof r2) + return i.deleteProperty(t2, r2); + let n2 = r2.toLowerCase(), s2 = Object.keys(e2).find((e3) => e3.toLowerCase() === n2); + return void 0 === s2 || i.deleteProperty(t2, s2); + } }); + } + static seal(e2) { + return new Proxy(e2, { get(e3, t2, r2) { + switch (t2) { + case "append": + case "delete": + case "set": + return A.callable; + default: + return i.get(e3, t2, r2); + } + } }); + } + merge(e2) { + return Array.isArray(e2) ? e2.join(", ") : e2; + } + static from(e2) { + return e2 instanceof Headers ? e2 : new O(e2); + } + append(e2, t2) { + let r2 = this.headers[e2]; + "string" == typeof r2 ? this.headers[e2] = [r2, t2] : Array.isArray(r2) ? r2.push(t2) : this.headers[e2] = t2; + } + delete(e2) { + delete this.headers[e2]; + } + get(e2) { + let t2 = this.headers[e2]; + return void 0 !== t2 ? this.merge(t2) : null; + } + has(e2) { + return void 0 !== this.headers[e2]; + } + set(e2, t2) { + this.headers[e2] = t2; + } + forEach(e2, t2) { + for (let [r2, n2] of this.entries()) + e2.call(t2, n2, r2, this); + } + *entries() { + for (let e2 of Object.keys(this.headers)) { + let t2 = e2.toLowerCase(), r2 = this.get(t2); + yield [t2, r2]; + } + } + *keys() { + for (let e2 of Object.keys(this.headers)) { + let t2 = e2.toLowerCase(); + yield t2; + } + } + *values() { + for (let e2 of Object.keys(this.headers)) { + let t2 = this.get(e2); + yield t2; + } + } + [Symbol.iterator]() { + return this.entries(); + } + } + function I() { + let e2 = s.workAsyncStorage.getStore(), t2 = a.S.getStore(); + if (e2) { + if (e2.forceStatic) + return M(O.seal(new Headers({}))); + if (t2) { + if ("cache" === t2.type) + throw Error(`Route ${e2.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`); + if ("unstable-cache" === t2.type) + throw Error(`Route ${e2.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`); + if ("after" === t2.phase) + throw Error(`Route ${e2.route} used "headers" inside "unstable_after(...)". This is not supported. If you need this data inside an "unstable_after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/unstable_after`); + } + if (e2.dynamicShouldError) + throw new d(`Route ${e2.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`); + if (t2) { + if ("prerender" === t2.type) + return function(e3, t3) { + let r2 = N.get(t3); + if (r2) + return r2; + let n2 = w(t3.renderSignal, "`headers()`"); + return N.set(t3, n2), Object.defineProperties(n2, { append: { value: function() { + let r3 = `headers().append(${$(arguments[0])}, ...)`, n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, delete: { value: function() { + let r3 = `headers().delete(${$(arguments[0])})`, n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, get: { value: function() { + let r3 = `headers().get(${$(arguments[0])})`, n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, has: { value: function() { + let r3 = `headers().has(${$(arguments[0])})`, n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, set: { value: function() { + let r3 = `headers().set(${$(arguments[0])}, ...)`, n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, getSetCookie: { value: function() { + let r3 = "headers().getSetCookie()", n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, forEach: { value: function() { + let r3 = "headers().forEach(...)", n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, keys: { value: function() { + let r3 = "headers().keys()", n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, values: { value: function() { + let r3 = "headers().values()", n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, entries: { value: function() { + let r3 = "headers().entries()", n3 = L(e3, r3); + m(e3, r3, n3, t3); + } }, [Symbol.iterator]: { value: function() { + let r3 = "headers()[Symbol.iterator]()", n3 = L(e3, r3); + m(e3, r3, n3, t3); + } } }), n2; + }(e2.route, t2); + "prerender-ppr" === t2.type ? g(e2.route, "headers", t2.dynamicTracking) : "prerender-legacy" === t2.type && f("headers", e2, t2); + } + p(e2, t2); + } + return M((0, a.F)("headers").headers); + } + let N = /* @__PURE__ */ new WeakMap(); + function M(e2) { + let t2 = N.get(e2); + if (t2) + return t2; + let r2 = b(e2); + return N.set(e2, r2), Object.defineProperties(r2, { append: { value: e2.append.bind(e2) }, delete: { value: e2.delete.bind(e2) }, get: { value: e2.get.bind(e2) }, has: { value: e2.has.bind(e2) }, set: { value: e2.set.bind(e2) }, getSetCookie: { value: e2.getSetCookie.bind(e2) }, forEach: { value: e2.forEach.bind(e2) }, keys: { value: e2.keys.bind(e2) }, values: { value: e2.values.bind(e2) }, entries: { value: e2.entries.bind(e2) }, [Symbol.iterator]: { value: e2[Symbol.iterator].bind(e2) } }), r2; + } + function $(e2) { + return "string" == typeof e2 ? `'${e2}'` : "..."; + } + function L(e2, t2) { + return Error(`Route "${e2}" used ${t2}. \`headers()\` now returns a Promise and should be \`awaited\` before using it's value. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`); + } + S(function(e2) { + let t2 = e2 ? ` In route ${e2} ` : ""; + return Error(`${t2}headers were iterated over. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + }), S(function(e2, t2) { + let r2 = e2 ? ` In route ${e2} a ` : "A "; + return Error(`${r2}header property was accessed directly with \`${t2}\`. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); + }), /* @__PURE__ */ new WeakMap(); + function j(e2) { + let t2 = workAsyncStorage.getStore(), r2 = workUnitAsyncStorage.getStore(); + if (t2) { + if (r2) { + if ("cache" === r2.type) + throw Error(`Route ${t2.route} used "${e2}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`); + if ("unstable-cache" === r2.type) + throw Error(`Route ${t2.route} used "${e2}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`); + } + if (t2.dynamicShouldError) + throw new StaticGenBailoutError(`Route ${t2.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${e2}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`); + if (r2) { + if ("prerender" === r2.type) { + let n2 = Error(`Route ${t2.route} used ${e2} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`); + abortAndThrowOnSynchronousRequestDataAccess(t2.route, e2, n2, r2); + } else if ("prerender-ppr" === r2.type) + postponeWithTracking(t2.route, e2, r2.dynamicTracking); + else if ("prerender-legacy" === r2.type) { + r2.revalidate = 0; + let n2 = new DynamicServerError(`Route ${t2.route} couldn't be rendered statically because it used \`${e2}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`); + throw t2.dynamicUsageDescription = e2, t2.dynamicUsageStack = n2.stack, n2; + } + } + } + } + S(function(e2, t2) { + let r2 = e2 ? ` In route ${e2} a ` : "A "; + return Error(`${r2}\`draftMode()\` property was accessed directly with \`${t2}\`. \`draftMode()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/draft-mode-sync-access`); + }); + }; + __namedExportsObject5["__chunk_70219"] = (e, t, r) => { + "use strict"; + e.exports = r(26981); + }; + __namedExportsObject5["__chunk_21158"] = (e, t, r) => { + "use strict"; + e.exports = r(55388); + }; + __namedExportsObject5["__chunk_26981"] = (e, t) => { + "use strict"; + var r = { H: null, A: null }; + function n(e2) { + var t2 = "https://react.dev/errors/" + e2; + if (1 < arguments.length) { + t2 += "?args[]=" + encodeURIComponent(arguments[1]); + for (var r2 = 2; r2 < arguments.length; r2++) + t2 += "&args[]=" + encodeURIComponent(arguments[r2]); + } + return "Minified React error #" + e2 + "; visit " + t2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; + } + var i = Array.isArray, s = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), h = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), p = Symbol.iterator, m = Object.prototype.hasOwnProperty, g = Object.assign; + function y(e2, t2, r2, n2, i2, a2, o2) { + return { $$typeof: s, type: e2, key: t2, ref: void 0 !== (r2 = o2.ref) ? r2 : null, props: o2 }; + } + function v(e2) { + return "object" == typeof e2 && null !== e2 && e2.$$typeof === s; + } + var b = /\/+/g; + function w(e2, t2) { + var r2, n2; + return "object" == typeof e2 && null !== e2 && null != e2.key ? (r2 = "" + e2.key, n2 = { "=": "=0", ":": "=2" }, "$" + r2.replace(/[=:]/g, function(e3) { + return n2[e3]; + })) : t2.toString(36); + } + function x() { + } + function S(e2, t2, r2) { + if (null == e2) + return e2; + var o2 = [], l2 = 0; + return !function e3(t3, r3, o3, l3, c2) { + var u2, d2, h2, m2 = typeof t3; + ("undefined" === m2 || "boolean" === m2) && (t3 = null); + var g2 = false; + if (null === t3) + g2 = true; + else + switch (m2) { + case "bigint": + case "string": + case "number": + g2 = true; + break; + case "object": + switch (t3.$$typeof) { + case s: + case a: + g2 = true; + break; + case f: + return e3((g2 = t3._init)(t3._payload), r3, o3, l3, c2); + } + } + if (g2) + return c2 = c2(t3), g2 = "" === l3 ? "." + w(t3, 0) : l3, i(c2) ? (o3 = "", null != g2 && (o3 = g2.replace(b, "$&/") + "/"), e3(c2, r3, o3, "", function(e4) { + return e4; + })) : null != c2 && (v(c2) && (u2 = c2, d2 = o3 + (null == c2.key || t3 && t3.key === c2.key ? "" : ("" + c2.key).replace(b, "$&/") + "/") + g2, c2 = y(u2.type, d2, null, void 0, void 0, void 0, u2.props)), r3.push(c2)), 1; + g2 = 0; + var S2 = "" === l3 ? "." : l3 + ":"; + if (i(t3)) + for (var _2 = 0; _2 < t3.length; _2++) + m2 = S2 + w(l3 = t3[_2], _2), g2 += e3(l3, r3, o3, m2, c2); + else if ("function" == typeof (_2 = null === (h2 = t3) || "object" != typeof h2 ? null : "function" == typeof (h2 = p && h2[p] || h2["@@iterator"]) ? h2 : null)) + for (t3 = _2.call(t3), _2 = 0; !(l3 = t3.next()).done; ) + m2 = S2 + w(l3 = l3.value, _2++), g2 += e3(l3, r3, o3, m2, c2); + else if ("object" === m2) { + if ("function" == typeof t3.then) + return e3(function(e4) { + switch (e4.status) { + case "fulfilled": + return e4.value; + case "rejected": + throw e4.reason; + default: + switch ("string" == typeof e4.status ? e4.then(x, x) : (e4.status = "pending", e4.then(function(t4) { + "pending" === e4.status && (e4.status = "fulfilled", e4.value = t4); + }, function(t4) { + "pending" === e4.status && (e4.status = "rejected", e4.reason = t4); + })), e4.status) { + case "fulfilled": + return e4.value; + case "rejected": + throw e4.reason; + } + } + throw e4; + }(t3), r3, o3, l3, c2); + throw Error(n(31, "[object Object]" === (r3 = String(t3)) ? "object with keys {" + Object.keys(t3).join(", ") + "}" : r3)); + } + return g2; + }(e2, o2, "", "", function(e3) { + return t2.call(r2, e3, l2++); + }), o2; + } + function _(e2) { + if (-1 === e2._status) { + var t2 = e2._result; + (t2 = t2()).then(function(t3) { + (0 === e2._status || -1 === e2._status) && (e2._status = 1, e2._result = t3); + }, function(t3) { + (0 === e2._status || -1 === e2._status) && (e2._status = 2, e2._result = t3); + }), -1 === e2._status && (e2._status = 0, e2._result = t2); + } + if (1 === e2._status) + return e2._result.default; + throw e2._result; + } + function E() { + return /* @__PURE__ */ new WeakMap(); + } + function k() { + return { s: 0, v: void 0, o: null, p: null }; + } + t.Children = { map: S, forEach: function(e2, t2, r2) { + S(e2, function() { + t2.apply(this, arguments); + }, r2); + }, count: function(e2) { + var t2 = 0; + return S(e2, function() { + t2++; + }), t2; + }, toArray: function(e2) { + return S(e2, function(e3) { + return e3; + }) || []; + }, only: function(e2) { + if (!v(e2)) + throw Error(n(143)); + return e2; + } }, t.Fragment = o, t.Profiler = c, t.StrictMode = l, t.Suspense = d, t.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = r, t.cache = function(e2) { + return function() { + var t2 = r.A; + if (!t2) + return e2.apply(null, arguments); + var n2 = t2.getCacheForType(E); + void 0 === (t2 = n2.get(e2)) && (t2 = k(), n2.set(e2, t2)), n2 = 0; + for (var i2 = arguments.length; n2 < i2; n2++) { + var s2 = arguments[n2]; + if ("function" == typeof s2 || "object" == typeof s2 && null !== s2) { + var a2 = t2.o; + null === a2 && (t2.o = a2 = /* @__PURE__ */ new WeakMap()), void 0 === (t2 = a2.get(s2)) && (t2 = k(), a2.set(s2, t2)); + } else + null === (a2 = t2.p) && (t2.p = a2 = /* @__PURE__ */ new Map()), void 0 === (t2 = a2.get(s2)) && (t2 = k(), a2.set(s2, t2)); + } + if (1 === t2.s) + return t2.v; + if (2 === t2.s) + throw t2.v; + try { + var o2 = e2.apply(null, arguments); + return (n2 = t2).s = 1, n2.v = o2; + } catch (e3) { + throw (o2 = t2).s = 2, o2.v = e3, e3; + } + }; + }, t.cloneElement = function(e2, t2, r2) { + if (null == e2) + throw Error(n(267, e2)); + var i2 = g({}, e2.props), s2 = e2.key, a2 = void 0; + if (null != t2) + for (o2 in void 0 !== t2.ref && (a2 = void 0), void 0 !== t2.key && (s2 = "" + t2.key), t2) + m.call(t2, o2) && "key" !== o2 && "__self" !== o2 && "__source" !== o2 && ("ref" !== o2 || void 0 !== t2.ref) && (i2[o2] = t2[o2]); + var o2 = arguments.length - 2; + if (1 === o2) + i2.children = r2; + else if (1 < o2) { + for (var l2 = Array(o2), c2 = 0; c2 < o2; c2++) + l2[c2] = arguments[c2 + 2]; + i2.children = l2; + } + return y(e2.type, s2, null, void 0, void 0, a2, i2); + }, t.createElement = function(e2, t2, r2) { + var n2, i2 = {}, s2 = null; + if (null != t2) + for (n2 in void 0 !== t2.key && (s2 = "" + t2.key), t2) + m.call(t2, n2) && "key" !== n2 && "__self" !== n2 && "__source" !== n2 && (i2[n2] = t2[n2]); + var a2 = arguments.length - 2; + if (1 === a2) + i2.children = r2; + else if (1 < a2) { + for (var o2 = Array(a2), l2 = 0; l2 < a2; l2++) + o2[l2] = arguments[l2 + 2]; + i2.children = o2; + } + if (e2 && e2.defaultProps) + for (n2 in a2 = e2.defaultProps) + void 0 === i2[n2] && (i2[n2] = a2[n2]); + return y(e2, s2, null, void 0, void 0, null, i2); + }, t.createRef = function() { + return { current: null }; + }, t.forwardRef = function(e2) { + return { $$typeof: u, render: e2 }; + }, t.isValidElement = v, t.lazy = function(e2) { + return { $$typeof: f, _payload: { _status: -1, _result: e2 }, _init: _ }; + }, t.memo = function(e2, t2) { + return { $$typeof: h, type: e2, compare: void 0 === t2 ? null : t2 }; + }, t.use = function(e2) { + return r.H.use(e2); + }, t.useCallback = function(e2, t2) { + return r.H.useCallback(e2, t2); + }, t.useDebugValue = function() { + }, t.useId = function() { + return r.H.useId(); + }, t.useMemo = function(e2, t2) { + return r.H.useMemo(e2, t2); + }, t.version = "19.0.0-rc-bf7e210c-20241017"; + }; + __namedExportsObject5["__chunk_55388"] = (e, t, r) => { + "use strict"; + var n = r(23034), i = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment"); + if (!n.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) + throw Error('The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'); + function a(e2, t2, r2) { + var n2 = null; + if (void 0 !== r2 && (n2 = "" + r2), void 0 !== t2.key && (n2 = "" + t2.key), "key" in t2) + for (var s2 in r2 = {}, t2) + "key" !== s2 && (r2[s2] = t2[s2]); + else + r2 = t2; + return { $$typeof: i, type: e2, key: n2, ref: void 0 !== (t2 = r2.ref) ? t2 : null, props: r2 }; + } + t.Fragment = s, t.jsx = a, t.jsxs = a; + }; + __namedExportsObject5["__chunk_62796"] = (e, t, r) => { + "use strict"; + var n; + (n = r(75851)).prerender && (t.V = n.prerender); + }; + __namedExportsObject5["__chunk_78077"] = (e, t, r) => { + "use strict"; + var n; + (n = r(46227)).renderToReadableStream, n.decodeReply, n.decodeAction, n.decodeFormState, t.jF = n.registerServerReference, n.registerClientReference, n.createClientModuleProxy, n.createTemporaryReferenceSet; + }; + __namedExportsObject5["__chunk_74832"] = (e, t, r) => { + "use strict"; + r(63362); + }; + __namedExportsObject5["__chunk_46227"] = (e, t, r) => { + "use strict"; + var n = r(79257), i = r(70219); + function s(e10) { + ty(function() { + throw e10; + }); + } + var a = Promise, o = "function" == typeof queueMicrotask ? queueMicrotask : function(e10) { + a.resolve(null).then(e10).catch(s); + }, l = null, c = 0; + function u(e10, t2) { + if (0 !== t2.byteLength) { + if (2048 < t2.byteLength) + 0 < c && (e10.enqueue(new Uint8Array(l.buffer, 0, c)), l = new Uint8Array(2048), c = 0), e10.enqueue(t2); + else { + var r2 = l.length - c; + r2 < t2.byteLength && (0 === r2 ? e10.enqueue(l) : (l.set(t2.subarray(0, r2), c), e10.enqueue(l), t2 = t2.subarray(r2)), l = new Uint8Array(2048), c = 0), l.set(t2, c), c += t2.byteLength; + } + } + return true; + } + var d = new TextEncoder(); + function h(e10) { + return d.encode(e10); + } + function f(e10) { + return e10.byteLength; + } + function p(e10, t2) { + "function" == typeof e10.error ? e10.error(t2) : e10.close(); + } + var m = Symbol.for("react.client.reference"), g = Symbol.for("react.server.reference"); + function y(e10, t2, r2) { + return Object.defineProperties(e10, { $$typeof: { value: m }, $$id: { value: t2 }, $$async: { value: r2 } }); + } + var v = Function.prototype.bind, b = Array.prototype.slice; + function w() { + var e10 = v.apply(this, arguments); + if (this.$$typeof === g) { + var t2 = b.call(arguments, 1); + return Object.defineProperties(e10, { $$typeof: { value: g }, $$id: { value: this.$$id }, $$bound: t2 = { value: this.$$bound ? this.$$bound.concat(t2) : t2 }, bind: { value: w, configurable: true } }); + } + return e10; + } + var x = Promise.prototype, S = { get: function(e10, t2) { + switch (t2) { + case "$$typeof": + return e10.$$typeof; + case "$$id": + return e10.$$id; + case "$$async": + return e10.$$async; + case "name": + return e10.name; + case "displayName": + case "defaultProps": + case "toJSON": + return; + case Symbol.toPrimitive: + return Object.prototype[Symbol.toPrimitive]; + case Symbol.toStringTag: + return Object.prototype[Symbol.toStringTag]; + case "Provider": + throw Error("Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."); + case "then": + throw Error("Cannot await or return from a thenable. You cannot await a client module from a server component."); + } + throw Error("Cannot access " + String(e10.name) + "." + String(t2) + " on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."); + }, set: function() { + throw Error("Cannot assign to a client module from a server module."); + } }; + function _(e10, t2) { + switch (t2) { + case "$$typeof": + return e10.$$typeof; + case "$$id": + return e10.$$id; + case "$$async": + return e10.$$async; + case "name": + return e10.name; + case "defaultProps": + case "toJSON": + return; + case Symbol.toPrimitive: + return Object.prototype[Symbol.toPrimitive]; + case Symbol.toStringTag: + return Object.prototype[Symbol.toStringTag]; + case "__esModule": + var r2 = e10.$$id; + return e10.default = y(function() { + throw Error("Attempted to call the default export of " + r2 + " from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); + }, e10.$$id + "#", e10.$$async), true; + case "then": + if (e10.then) + return e10.then; + if (e10.$$async) + return; + var n2 = y({}, e10.$$id, true), i2 = new Proxy(n2, E); + return e10.status = "fulfilled", e10.value = i2, e10.then = y(function(e11) { + return Promise.resolve(e11(i2)); + }, e10.$$id + "#then", false); + } + if ("symbol" == typeof t2) + throw Error("Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."); + return (n2 = e10[t2]) || (Object.defineProperty(n2 = y(function() { + throw Error("Attempted to call " + String(t2) + "() from the server but " + String(t2) + " is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); + }, e10.$$id + "#" + t2, e10.$$async), "name", { value: t2 }), n2 = e10[t2] = new Proxy(n2, S)), n2; + } + var E = { get: function(e10, t2) { + return _(e10, t2); + }, getOwnPropertyDescriptor: function(e10, t2) { + var r2 = Object.getOwnPropertyDescriptor(e10, t2); + return r2 || (r2 = { value: _(e10, t2), writable: false, configurable: false, enumerable: false }, Object.defineProperty(e10, t2, r2)), r2; + }, getPrototypeOf: function() { + return x; + }, set: function() { + throw Error("Cannot assign to a client module from a server module."); + } }, k = n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = k.d; + function R(e10) { + if (null == e10) + return null; + var t2, r2 = false, n2 = {}; + for (t2 in e10) + null != e10[t2] && (r2 = true, n2[t2] = e10[t2]); + return r2 ? n2 : null; + } + k.d = { f: C.f, r: C.r, D: function(e10) { + if ("string" == typeof e10 && e10) { + var t2 = ev(); + if (t2) { + var r2 = t2.hints, n2 = "D|" + e10; + r2.has(n2) || (r2.add(n2), ew(t2, "D", e10)); + } else + C.D(e10); + } + }, C: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = ev(); + if (r2) { + var n2 = r2.hints, i2 = "C|" + (null == t2 ? "null" : t2) + "|" + e10; + n2.has(i2) || (n2.add(i2), "string" == typeof t2 ? ew(r2, "C", [e10, t2]) : ew(r2, "C", e10)); + } else + C.C(e10, t2); + } + }, L: function(e10, t2, r2) { + if ("string" == typeof e10) { + var n2 = ev(); + if (n2) { + var i2 = n2.hints, s2 = "L"; + if ("image" === t2 && r2) { + var a2 = r2.imageSrcSet, o2 = r2.imageSizes, l2 = ""; + "string" == typeof a2 && "" !== a2 ? (l2 += "[" + a2 + "]", "string" == typeof o2 && (l2 += "[" + o2 + "]")) : l2 += "[][]" + e10, s2 += "[image]" + l2; + } else + s2 += "[" + t2 + "]" + e10; + i2.has(s2) || (i2.add(s2), (r2 = R(r2)) ? ew(n2, "L", [e10, t2, r2]) : ew(n2, "L", [e10, t2])); + } else + C.L(e10, t2, r2); + } + }, m: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = ev(); + if (r2) { + var n2 = r2.hints, i2 = "m|" + e10; + if (n2.has(i2)) + return; + return n2.add(i2), (t2 = R(t2)) ? ew(r2, "m", [e10, t2]) : ew(r2, "m", e10); + } + C.m(e10, t2); + } + }, X: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = ev(); + if (r2) { + var n2 = r2.hints, i2 = "X|" + e10; + if (n2.has(i2)) + return; + return n2.add(i2), (t2 = R(t2)) ? ew(r2, "X", [e10, t2]) : ew(r2, "X", e10); + } + C.X(e10, t2); + } + }, S: function(e10, t2, r2) { + if ("string" == typeof e10) { + var n2 = ev(); + if (n2) { + var i2 = n2.hints, s2 = "S|" + e10; + if (i2.has(s2)) + return; + return i2.add(s2), (r2 = R(r2)) ? ew(n2, "S", [e10, "string" == typeof t2 ? t2 : 0, r2]) : "string" == typeof t2 ? ew(n2, "S", [e10, t2]) : ew(n2, "S", e10); + } + C.S(e10, t2, r2); + } + }, M: function(e10, t2) { + if ("string" == typeof e10) { + var r2 = ev(); + if (r2) { + var n2 = r2.hints, i2 = "M|" + e10; + if (n2.has(i2)) + return; + return n2.add(i2), (t2 = R(t2)) ? ew(r2, "M", [e10, t2]) : ew(r2, "M", e10); + } + C.M(e10, t2); + } + } }; + var P = "function" == typeof AsyncLocalStorage, T = P ? new AsyncLocalStorage() : null; + "object" == typeof async_hooks && async_hooks.createHook, "object" == typeof async_hooks && async_hooks.executionAsyncId; + var A = Symbol.for("react.temporary.reference"), O = { get: function(e10, t2) { + switch (t2) { + case "$$typeof": + return e10.$$typeof; + case "name": + case "displayName": + case "defaultProps": + case "toJSON": + return; + case Symbol.toPrimitive: + return Object.prototype[Symbol.toPrimitive]; + case Symbol.toStringTag: + return Object.prototype[Symbol.toStringTag]; + case "Provider": + throw Error("Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."); + } + throw Error("Cannot access " + String(t2) + " on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through to the client."); + }, set: function() { + throw Error("Cannot assign to a temporary client reference from a server module."); + } }, I = Symbol.for("react.element"), N = Symbol.for("react.transitional.element"), M = Symbol.for("react.fragment"), $ = Symbol.for("react.context"), L = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), U = Symbol.for("react.memo_cache_sentinel"); + Symbol.for("react.postpone"); + var q = Symbol.iterator; + function z(e10) { + return null === e10 || "object" != typeof e10 ? null : "function" == typeof (e10 = q && e10[q] || e10["@@iterator"]) ? e10 : null; + } + var H = Symbol.asyncIterator, W = Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"); + function Q() { + } + var V = null; + function G() { + if (null === V) + throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue."); + var e10 = V; + return V = null, e10; + } + var Z = null, K = 0, J = null; + function Y() { + var e10 = J || []; + return J = null, e10; + } + var X = { useMemo: function(e10) { + return e10(); + }, useCallback: function(e10) { + return e10; + }, useDebugValue: function() { + }, useDeferredValue: ee, useTransition: ee, readContext: er, useContext: er, useReducer: ee, useRef: ee, useState: ee, useInsertionEffect: ee, useLayoutEffect: ee, useImperativeHandle: ee, useEffect: ee, useId: function() { + if (null === Z) + throw Error("useId can only be used while React is rendering"); + var e10 = Z.identifierCount++; + return ":" + Z.identifierPrefix + "S" + e10.toString(32) + ":"; + }, useSyncExternalStore: ee, useCacheRefresh: function() { + return et; + }, useMemoCache: function(e10) { + for (var t2 = Array(e10), r2 = 0; r2 < e10; r2++) + t2[r2] = U; + return t2; + }, use: function(e10) { + if (null !== e10 && "object" == typeof e10 || "function" == typeof e10) { + if ("function" == typeof e10.then) { + var t2 = K; + return K += 1, null === J && (J = []), function(e11, t3, r2) { + switch (void 0 === (r2 = e11[r2]) ? e11.push(t3) : r2 !== t3 && (t3.then(Q, Q), t3 = r2), t3.status) { + case "fulfilled": + return t3.value; + case "rejected": + throw t3.reason; + default: + switch ("string" == typeof t3.status ? t3.then(Q, Q) : ((e11 = t3).status = "pending", e11.then(function(e12) { + if ("pending" === t3.status) { + var r3 = t3; + r3.status = "fulfilled", r3.value = e12; + } + }, function(e12) { + if ("pending" === t3.status) { + var r3 = t3; + r3.status = "rejected", r3.reason = e12; + } + })), t3.status) { + case "fulfilled": + return t3.value; + case "rejected": + throw t3.reason; + } + throw V = t3, W; + } + }(J, e10, t2); + } + e10.$$typeof === $ && er(); + } + if (e10.$$typeof === m) { + if (null != e10.value && e10.value.$$typeof === $) + throw Error("Cannot read a Client Context from a Server Component."); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error("An unsupported type was passed to use(): " + String(e10)); + } }; + function ee() { + throw Error("This Hook is not supported in Server Components."); + } + function et() { + throw Error("Refreshing the cache is not supported in Server Components."); + } + function er() { + throw Error("Cannot read a Client Context from a Server Component."); + } + var en = { getCacheForType: function(e10) { + var t2 = (t2 = ev()) ? t2.cache : /* @__PURE__ */ new Map(), r2 = t2.get(e10); + return void 0 === r2 && (r2 = e10(), t2.set(e10, r2)), r2; + } }, ei = i.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + if (!ei) + throw Error('The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'); + var es = Array.isArray, ea = Object.getPrototypeOf; + function eo(e10) { + return Object.prototype.toString.call(e10).replace(/^\[object (.*)\]$/, function(e11, t2) { + return t2; + }); + } + function el(e10) { + switch (typeof e10) { + case "string": + return JSON.stringify(10 >= e10.length ? e10 : e10.slice(0, 10) + "..."); + case "object": + if (es(e10)) + return "[...]"; + if (null !== e10 && e10.$$typeof === ec) + return "client"; + return "Object" === (e10 = eo(e10)) ? "{...}" : e10; + case "function": + return e10.$$typeof === ec ? "client" : (e10 = e10.displayName || e10.name) ? "function " + e10 : "function"; + default: + return String(e10); + } + } + var ec = Symbol.for("react.client.reference"); + function eu(e10, t2) { + var r2 = eo(e10); + if ("Object" !== r2 && "Array" !== r2) + return r2; + r2 = -1; + var n2 = 0; + if (es(e10)) { + for (var i2 = "[", s2 = 0; s2 < e10.length; s2++) { + 0 < s2 && (i2 += ", "); + var a2 = e10[s2]; + a2 = "object" == typeof a2 && null !== a2 ? eu(a2) : el(a2), "" + s2 === t2 ? (r2 = i2.length, n2 = a2.length, i2 += a2) : i2 = 10 > a2.length && 40 > i2.length + a2.length ? i2 + a2 : i2 + "..."; + } + i2 += "]"; + } else if (e10.$$typeof === N) + i2 = "<" + function e11(t3) { + if ("string" == typeof t3) + return t3; + switch (t3) { + case j: + return "Suspense"; + case D: + return "SuspenseList"; + } + if ("object" == typeof t3) + switch (t3.$$typeof) { + case L: + return e11(t3.render); + case F: + return e11(t3.type); + case B: + var r3 = t3._payload; + t3 = t3._init; + try { + return e11(t3(r3)); + } catch (e12) { + } + } + return ""; + }(e10.type) + "/>"; + else { + if (e10.$$typeof === ec) + return "client"; + for (a2 = 0, i2 = "{", s2 = Object.keys(e10); a2 < s2.length; a2++) { + 0 < a2 && (i2 += ", "); + var o2 = s2[a2], l2 = JSON.stringify(o2); + i2 += ('"' + o2 + '"' === l2 ? o2 : l2) + ": ", l2 = "object" == typeof (l2 = e10[o2]) && null !== l2 ? eu(l2) : el(l2), o2 === t2 ? (r2 = i2.length, n2 = l2.length, i2 += l2) : i2 = 10 > l2.length && 40 > i2.length + l2.length ? i2 + l2 : i2 + "..."; + } + i2 += "}"; + } + return void 0 === t2 ? i2 : -1 < r2 && 0 < n2 ? "\n " + i2 + "\n " + (e10 = " ".repeat(r2) + "^".repeat(n2)) : "\n " + i2; + } + var ed = Object.prototype, eh = JSON.stringify; + function ef(e10) { + console.error(e10); + } + function ep() { + } + function em(e10, t2, r2, n2, i2, s2, a2, o2, l2, c2, u2) { + if (null !== ei.A && ei.A !== en) + throw Error("Currently React only supports one RSC renderer at a time."); + ei.A = en, l2 = /* @__PURE__ */ new Set(), o2 = []; + var d2 = /* @__PURE__ */ new Set(); + this.type = e10, this.status = 10, this.flushScheduled = false, this.destination = this.fatalError = null, this.bundlerConfig = r2, this.cache = /* @__PURE__ */ new Map(), this.pendingChunks = this.nextChunkId = 0, this.hints = d2, this.abortListeners = /* @__PURE__ */ new Set(), this.abortableTasks = l2, this.pingedTasks = o2, this.completedImportChunks = [], this.completedHintChunks = [], this.completedRegularChunks = [], this.completedErrorChunks = [], this.writtenSymbols = /* @__PURE__ */ new Map(), this.writtenClientReferences = /* @__PURE__ */ new Map(), this.writtenServerReferences = /* @__PURE__ */ new Map(), this.writtenObjects = /* @__PURE__ */ new WeakMap(), this.temporaryReferences = a2, this.identifierPrefix = i2 || "", this.identifierCount = 1, this.taintCleanupQueue = [], this.onError = void 0 === n2 ? ef : n2, this.onPostpone = void 0 === s2 ? ep : s2, this.onAllReady = c2, this.onFatalError = u2, e10 = eC(this, t2, null, false, l2), o2.push(e10); + } + function eg() { + } + var ey = null; + function ev() { + if (ey) + return ey; + if (P) { + var e10 = T.getStore(); + if (e10) + return e10; + } + return null; + } + function eb(e10, t2, r2) { + var n2 = eC(e10, null, t2.keyPath, t2.implicitSlot, e10.abortableTasks); + switch (r2.status) { + case "fulfilled": + return n2.model = r2.value, ek(e10, n2), n2.id; + case "rejected": + return t2 = eM(e10, r2.reason, null), eL(e10, n2.id, t2), n2.status = 4, e10.abortableTasks.delete(n2), n2.id; + default: + if (12 === e10.status) + return e10.abortableTasks.delete(n2), n2.status = 3, t2 = eh(eR(e10.fatalError)), ej(e10, n2.id, t2), n2.id; + "string" != typeof r2.status && (r2.status = "pending", r2.then(function(e11) { + "pending" === r2.status && (r2.status = "fulfilled", r2.value = e11); + }, function(e11) { + "pending" === r2.status && (r2.status = "rejected", r2.reason = e11); + })); + } + return r2.then(function(t3) { + n2.model = t3, ek(e10, n2); + }, function(t3) { + 0 === n2.status && (t3 = eM(e10, t3, n2), eL(e10, n2.id, t3), n2.status = 4, e10.abortableTasks.delete(n2), eW(e10)); + }), n2.id; + } + function ew(e10, t2, r2) { + r2 = eh(r2), t2 = "H" + t2, r2 = h((t2 = (e10.nextChunkId++).toString(16) + ":" + t2) + r2 + "\n"), e10.completedHintChunks.push(r2), eW(e10); + } + function ex(e10) { + if ("fulfilled" === e10.status) + return e10.value; + if ("rejected" === e10.status) + throw e10.reason; + throw e10; + } + function eS() { + } + function e_(e10, t2, r2, n2, i2) { + var s2 = t2.thenableState; + if (t2.thenableState = null, K = 0, J = s2, n2 = n2(i2, void 0), 12 === e10.status) + throw "object" == typeof n2 && null !== n2 && "function" == typeof n2.then && n2.$$typeof !== m && n2.then(eS, eS), null; + if ("object" == typeof n2 && null !== n2 && n2.$$typeof !== m) { + if ("function" == typeof n2.then) { + if ("fulfilled" === (i2 = n2).status) + return i2.value; + n2 = function(e11) { + switch (e11.status) { + case "fulfilled": + case "rejected": + break; + default: + "string" != typeof e11.status && (e11.status = "pending", e11.then(function(t3) { + "pending" === e11.status && (e11.status = "fulfilled", e11.value = t3); + }, function(t3) { + "pending" === e11.status && (e11.status = "rejected", e11.reason = t3); + })); + } + return { $$typeof: B, _payload: e11, _init: ex }; + }(n2); + } + var a2 = z(n2); + if (a2) { + var o2 = n2; + (n2 = {})[Symbol.iterator] = function() { + return a2.call(o2); + }; + } else if (!("function" != typeof n2[H] || "function" == typeof ReadableStream && n2 instanceof ReadableStream)) { + var l2 = n2; + (n2 = {})[H] = function() { + return l2[H](); + }; + } + } + return i2 = t2.keyPath, s2 = t2.implicitSlot, null !== r2 ? t2.keyPath = null === i2 ? r2 : i2 + "," + r2 : null === i2 && (t2.implicitSlot = true), e10 = eN(e10, t2, eU, "", n2), t2.keyPath = i2, t2.implicitSlot = s2, e10; + } + function eE(e10, t2, r2) { + return null !== t2.keyPath ? (e10 = [N, M, t2.keyPath, { children: r2 }], t2.implicitSlot ? [e10] : e10) : r2; + } + function ek(e10, t2) { + var r2 = e10.pingedTasks; + r2.push(t2), 1 === r2.length && (e10.flushScheduled = null !== e10.destination, 21 === e10.type || 10 === e10.status ? o(function() { + return ez(e10); + }) : ty(function() { + return ez(e10); + }, 0)); + } + function eC(e10, t2, r2, n2, i2) { + e10.pendingChunks++; + var s2 = e10.nextChunkId++; + "object" != typeof t2 || null === t2 || null !== r2 || n2 || e10.writtenObjects.set(t2, eR(s2)); + var a2 = { id: s2, status: 0, model: t2, keyPath: r2, implicitSlot: n2, ping: function() { + return ek(e10, a2); + }, toJSON: function(t3, r3) { + var n3 = a2.keyPath, i3 = a2.implicitSlot; + try { + var s3 = eN(e10, a2, this, t3, r3); + } catch (l2) { + if (t3 = "object" == typeof (t3 = a2.model) && null !== t3 && (t3.$$typeof === N || t3.$$typeof === B), 12 === e10.status) + a2.status = 3, n3 = e10.fatalError, s3 = t3 ? "$L" + n3.toString(16) : eR(n3); + else if ("object" == typeof (r3 = l2 === W ? G() : l2) && null !== r3 && "function" == typeof r3.then) { + var o2 = (s3 = eC(e10, a2.model, a2.keyPath, a2.implicitSlot, e10.abortableTasks)).ping; + r3.then(o2, o2), s3.thenableState = Y(), a2.keyPath = n3, a2.implicitSlot = i3, s3 = t3 ? "$L" + s3.id.toString(16) : eR(s3.id); + } else + a2.keyPath = n3, a2.implicitSlot = i3, e10.pendingChunks++, n3 = e10.nextChunkId++, i3 = eM(e10, r3, a2), eL(e10, n3, i3), s3 = t3 ? "$L" + n3.toString(16) : eR(n3); + } + return s3; + }, thenableState: null }; + return i2.add(a2), a2; + } + function eR(e10) { + return "$" + e10.toString(16); + } + function eP(e10, t2, r2) { + return e10 = eh(r2), h(t2 = t2.toString(16) + ":" + e10 + "\n"); + } + function eT(e10, t2, r2, n2) { + var i2 = n2.$$async ? n2.$$id + "#async" : n2.$$id, s2 = e10.writtenClientReferences, a2 = s2.get(i2); + if (void 0 !== a2) + return t2[0] === N && "1" === r2 ? "$L" + a2.toString(16) : eR(a2); + try { + var o2 = e10.bundlerConfig, l2 = n2.$$id; + a2 = ""; + var c2 = o2[l2]; + if (c2) + a2 = c2.name; + else { + var u2 = l2.lastIndexOf("#"); + if (-1 !== u2 && (a2 = l2.slice(u2 + 1), c2 = o2[l2.slice(0, u2)]), !c2) + throw Error('Could not find the module "' + l2 + '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'); + } + if (true === c2.async && true === n2.$$async) + throw Error('The module "' + l2 + '" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'); + var d2 = true === c2.async || true === n2.$$async ? [c2.id, c2.chunks, a2, 1] : [c2.id, c2.chunks, a2]; + e10.pendingChunks++; + var f2 = e10.nextChunkId++, p2 = eh(d2), m2 = f2.toString(16) + ":I" + p2 + "\n", g2 = h(m2); + return e10.completedImportChunks.push(g2), s2.set(i2, f2), t2[0] === N && "1" === r2 ? "$L" + f2.toString(16) : eR(f2); + } catch (n3) { + return e10.pendingChunks++, t2 = e10.nextChunkId++, r2 = eM(e10, n3, null), eL(e10, t2, r2), eR(t2); + } + } + function eA(e10, t2) { + return t2 = eC(e10, t2, null, false, e10.abortableTasks), eq(e10, t2), t2.id; + } + function eO(e10, t2, r2) { + e10.pendingChunks++; + var n2 = e10.nextChunkId++; + return eD(e10, n2, t2, r2), eR(n2); + } + var eI = false; + function eN(e10, t2, r2, n2, i2) { + if (t2.model = i2, i2 === N) + return "$"; + if (null === i2) + return null; + if ("object" == typeof i2) { + switch (i2.$$typeof) { + case N: + var s2 = null, a2 = e10.writtenObjects; + if (null === t2.keyPath && !t2.implicitSlot) { + var o2 = a2.get(i2); + if (void 0 !== o2) { + if (eI !== i2) + return o2; + eI = null; + } else + -1 === n2.indexOf(":") && void 0 !== (r2 = a2.get(r2)) && (s2 = r2 + ":" + n2, a2.set(i2, s2)); + } + return r2 = (n2 = i2.props).ref, "object" == typeof (e10 = function e11(t3, r3, n3, i3, s3, a3) { + if (null != s3) + throw Error("Refs cannot be used in Server Components, nor passed to Client Components."); + if ("function" == typeof n3 && n3.$$typeof !== m && n3.$$typeof !== A) + return e_(t3, r3, i3, n3, a3); + if (n3 === M && null === i3) + return n3 = r3.implicitSlot, null === r3.keyPath && (r3.implicitSlot = true), a3 = eN(t3, r3, eU, "", a3.children), r3.implicitSlot = n3, a3; + if (null != n3 && "object" == typeof n3 && n3.$$typeof !== m) + switch (n3.$$typeof) { + case B: + if (n3 = (0, n3._init)(n3._payload), 12 === t3.status) + throw null; + return e11(t3, r3, n3, i3, s3, a3); + case L: + return e_(t3, r3, i3, n3.render, a3); + case F: + return e11(t3, r3, n3.type, i3, s3, a3); + } + return t3 = i3, i3 = r3.keyPath, null === t3 ? t3 = i3 : null !== i3 && (t3 = i3 + "," + t3), a3 = [N, n3, t3, a3], r3 = r3.implicitSlot && null !== t3 ? [a3] : a3; + }(e10, t2, i2.type, i2.key, void 0 !== r2 ? r2 : null, n2)) && null !== e10 && null !== s2 && (a2.has(e10) || a2.set(e10, s2)), e10; + case B: + if (t2.thenableState = null, i2 = (n2 = i2._init)(i2._payload), 12 === e10.status) + throw null; + return eN(e10, t2, eU, "", i2); + case I: + throw Error('A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'); + } + if (i2.$$typeof === m) + return eT(e10, r2, n2, i2); + if (void 0 !== e10.temporaryReferences && void 0 !== (s2 = e10.temporaryReferences.get(i2))) + return "$T" + s2; + if (a2 = (s2 = e10.writtenObjects).get(i2), "function" == typeof i2.then) { + if (void 0 !== a2) { + if (null !== t2.keyPath || t2.implicitSlot) + return "$@" + eb(e10, t2, i2).toString(16); + if (eI !== i2) + return a2; + eI = null; + } + return e10 = "$@" + eb(e10, t2, i2).toString(16), s2.set(i2, e10), e10; + } + if (void 0 !== a2) { + if (eI !== i2) + return a2; + eI = null; + } else if (-1 === n2.indexOf(":") && void 0 !== (a2 = s2.get(r2))) { + if (o2 = n2, es(r2) && r2[0] === N) + switch (n2) { + case "1": + o2 = "type"; + break; + case "2": + o2 = "key"; + break; + case "3": + o2 = "props"; + break; + case "4": + o2 = "_owner"; + } + s2.set(i2, a2 + ":" + o2); + } + if (es(i2)) + return eE(e10, t2, i2); + if (i2 instanceof Map) + return "$Q" + eA(e10, i2 = Array.from(i2)).toString(16); + if (i2 instanceof Set) + return "$W" + eA(e10, i2 = Array.from(i2)).toString(16); + if ("function" == typeof FormData && i2 instanceof FormData) + return "$K" + eA(e10, i2 = Array.from(i2.entries())).toString(16); + if (i2 instanceof Error) + return "$Z"; + if (i2 instanceof ArrayBuffer) + return eO(e10, "A", new Uint8Array(i2)); + if (i2 instanceof Int8Array) + return eO(e10, "O", i2); + if (i2 instanceof Uint8Array) + return eO(e10, "o", i2); + if (i2 instanceof Uint8ClampedArray) + return eO(e10, "U", i2); + if (i2 instanceof Int16Array) + return eO(e10, "S", i2); + if (i2 instanceof Uint16Array) + return eO(e10, "s", i2); + if (i2 instanceof Int32Array) + return eO(e10, "L", i2); + if (i2 instanceof Uint32Array) + return eO(e10, "l", i2); + if (i2 instanceof Float32Array) + return eO(e10, "G", i2); + if (i2 instanceof Float64Array) + return eO(e10, "g", i2); + if (i2 instanceof BigInt64Array) + return eO(e10, "M", i2); + if (i2 instanceof BigUint64Array) + return eO(e10, "m", i2); + if (i2 instanceof DataView) + return eO(e10, "V", i2); + if ("function" == typeof Blob && i2 instanceof Blob) + return function(e11, t3) { + function r3(t4) { + if (!o3) { + o3 = true, e11.abortListeners.delete(n3); + var i4 = eM(e11, t4, s3); + eL(e11, s3.id, i4), eW(e11), a3.cancel(t4).then(r3, r3); + } + } + function n3(t4) { + if (!o3) { + o3 = true, e11.abortListeners.delete(n3); + var i4 = eM(e11, t4, s3); + eL(e11, s3.id, i4), eW(e11), a3.cancel(t4).then(r3, r3); + } + } + var i3 = [t3.type], s3 = eC(e11, i3, null, false, e11.abortableTasks), a3 = t3.stream().getReader(), o3 = false; + return e11.abortListeners.add(n3), a3.read().then(function t4(l2) { + if (!o3) { + if (!l2.done) + return i3.push(l2.value), a3.read().then(t4).catch(r3); + e11.abortListeners.delete(n3), o3 = true, ek(e11, s3); + } + }).catch(r3), "$B" + s3.id.toString(16); + }(e10, i2); + if (s2 = z(i2)) + return (n2 = s2.call(i2)) === i2 ? "$i" + eA(e10, Array.from(n2)).toString(16) : eE(e10, t2, Array.from(n2)); + if ("function" == typeof ReadableStream && i2 instanceof ReadableStream) + return function(e11, t3, r3) { + function n3(t4) { + if (!l2) { + l2 = true, e11.abortListeners.delete(i3); + var r4 = eM(e11, t4, o3); + eL(e11, o3.id, r4), eW(e11), a3.cancel(t4).then(n3, n3); + } + } + function i3(t4) { + if (!l2) { + l2 = true, e11.abortListeners.delete(i3); + var r4 = eM(e11, t4, o3); + eL(e11, o3.id, r4), eW(e11), a3.cancel(t4).then(n3, n3); + } + } + var s3 = r3.supportsBYOB; + if (void 0 === s3) + try { + r3.getReader({ mode: "byob" }).releaseLock(), s3 = true; + } catch (e12) { + s3 = false; + } + var a3 = r3.getReader(), o3 = eC(e11, t3.model, t3.keyPath, t3.implicitSlot, e11.abortableTasks); + e11.abortableTasks.delete(o3), e11.pendingChunks++, t3 = o3.id.toString(16) + ":" + (s3 ? "r" : "R") + "\n", e11.completedRegularChunks.push(h(t3)); + var l2 = false; + return e11.abortListeners.add(i3), a3.read().then(function t4(r4) { + if (!l2) { + if (r4.done) + e11.abortListeners.delete(i3), r4 = o3.id.toString(16) + ":C\n", e11.completedRegularChunks.push(h(r4)), eW(e11), l2 = true; + else + try { + o3.model = r4.value, e11.pendingChunks++, eB(e11, o3, o3.model), eW(e11), a3.read().then(t4, n3); + } catch (e12) { + n3(e12); + } + } + }, n3), eR(o3.id); + }(e10, t2, i2); + if ("function" == typeof (s2 = i2[H])) + return null !== t2.keyPath ? (e10 = [N, M, t2.keyPath, { children: i2 }], e10 = t2.implicitSlot ? [e10] : e10) : (n2 = s2.call(i2), e10 = function(e11, t3, r3, n3) { + function i3(t4) { + if (!o3) { + o3 = true, e11.abortListeners.delete(s3); + var r4 = eM(e11, t4, a3); + eL(e11, a3.id, r4), eW(e11), "function" == typeof n3.throw && n3.throw(t4).then(i3, i3); + } + } + function s3(t4) { + if (!o3) { + o3 = true, e11.abortListeners.delete(s3); + var r4 = eM(e11, t4, a3); + eL(e11, a3.id, r4), eW(e11), "function" == typeof n3.throw && n3.throw(t4).then(i3, i3); + } + } + r3 = r3 === n3; + var a3 = eC(e11, t3.model, t3.keyPath, t3.implicitSlot, e11.abortableTasks); + e11.abortableTasks.delete(a3), e11.pendingChunks++, t3 = a3.id.toString(16) + ":" + (r3 ? "x" : "X") + "\n", e11.completedRegularChunks.push(h(t3)); + var o3 = false; + return e11.abortListeners.add(s3), n3.next().then(function t4(r4) { + if (!o3) { + if (r4.done) { + if (e11.abortListeners.delete(s3), void 0 === r4.value) + var l2 = a3.id.toString(16) + ":C\n"; + else + try { + var c2 = eA(e11, r4.value); + l2 = a3.id.toString(16) + ":C" + eh(eR(c2)) + "\n"; + } catch (e12) { + i3(e12); + return; + } + e11.completedRegularChunks.push(h(l2)), eW(e11), o3 = true; + } else + try { + a3.model = r4.value, e11.pendingChunks++, eB(e11, a3, a3.model), eW(e11), n3.next().then(t4, i3); + } catch (e12) { + i3(e12); + } + } + }, i3), eR(a3.id); + }(e10, t2, i2, n2)), e10; + if (i2 instanceof Date) + return "$D" + i2.toJSON(); + if ((e10 = ea(i2)) !== ed && (null === e10 || null !== ea(e10))) + throw Error("Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported." + eu(r2, n2)); + return i2; + } + if ("string" == typeof i2) + return "Z" === i2[i2.length - 1] && r2[n2] instanceof Date ? "$D" + i2 : 1024 <= i2.length && null !== f ? (e10.pendingChunks++, t2 = e10.nextChunkId++, eF(e10, t2, i2), eR(t2)) : e10 = "$" === i2[0] ? "$" + i2 : i2; + if ("boolean" == typeof i2) + return i2; + if ("number" == typeof i2) + return Number.isFinite(i2) ? 0 === i2 && -1 / 0 == 1 / i2 ? "$-0" : i2 : 1 / 0 === i2 ? "$Infinity" : -1 / 0 === i2 ? "$-Infinity" : "$NaN"; + if (void 0 === i2) + return "$undefined"; + if ("function" == typeof i2) { + if (i2.$$typeof === m) + return eT(e10, r2, n2, i2); + if (i2.$$typeof === g) + return void 0 !== (n2 = (t2 = e10.writtenServerReferences).get(i2)) ? e10 = "$F" + n2.toString(16) : (n2 = null === (n2 = i2.$$bound) ? null : Promise.resolve(n2), e10 = eA(e10, { id: i2.$$id, bound: n2 }), t2.set(i2, e10), e10 = "$F" + e10.toString(16)), e10; + if (void 0 !== e10.temporaryReferences && void 0 !== (e10 = e10.temporaryReferences.get(i2))) + return "$T" + e10; + if (i2.$$typeof === A) + throw Error("Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."); + if (/^on[A-Z]/.test(n2)) + throw Error("Event handlers cannot be passed to Client Component props." + eu(r2, n2) + "\nIf you need interactivity, consider converting part of this to a Client Component."); + throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' + eu(r2, n2)); + } + if ("symbol" == typeof i2) { + if (void 0 !== (s2 = (t2 = e10.writtenSymbols).get(i2))) + return eR(s2); + if (Symbol.for(s2 = i2.description) !== i2) + throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" + i2.description + ") cannot be found among global symbols." + eu(r2, n2)); + return e10.pendingChunks++, n2 = e10.nextChunkId++, r2 = eP(e10, n2, "$S" + s2), e10.completedImportChunks.push(r2), t2.set(i2, n2), eR(n2); + } + if ("bigint" == typeof i2) + return "$n" + i2.toString(10); + throw Error("Type " + typeof i2 + " is not supported in Client Component props." + eu(r2, n2)); + } + function eM(e10, t2) { + var r2 = ey; + ey = null; + try { + var n2 = e10.onError, i2 = P ? T.run(void 0, n2, t2) : n2(t2); + } finally { + ey = r2; + } + if (null != i2 && "string" != typeof i2) + throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + typeof i2 + '" instead'); + return i2 || ""; + } + function e$(e10, t2) { + (0, e10.onFatalError)(t2), null !== e10.destination ? (e10.status = 14, p(e10.destination, t2)) : (e10.status = 13, e10.fatalError = t2); + } + function eL(e10, t2, r2) { + r2 = { digest: r2 }, t2 = h(t2 = t2.toString(16) + ":E" + eh(r2) + "\n"), e10.completedErrorChunks.push(t2); + } + function ej(e10, t2, r2) { + t2 = h(t2 = t2.toString(16) + ":" + r2 + "\n"), e10.completedRegularChunks.push(t2); + } + function eD(e10, t2, r2, n2) { + e10.pendingChunks++; + var i2 = new Uint8Array(n2.buffer, n2.byteOffset, n2.byteLength); + i2 = (n2 = 2048 < n2.byteLength ? i2.slice() : i2).byteLength, t2 = h(t2 = t2.toString(16) + ":" + r2 + i2.toString(16) + ","), e10.completedRegularChunks.push(t2, n2); + } + function eF(e10, t2, r2) { + if (null === f) + throw Error("Existence of byteLengthOfChunk should have already been checked. This is a bug in React."); + e10.pendingChunks++; + var n2 = (r2 = h(r2)).byteLength; + t2 = h(t2 = t2.toString(16) + ":T" + n2.toString(16) + ","), e10.completedRegularChunks.push(t2, r2); + } + function eB(e10, t2, r2) { + var n2 = t2.id; + "string" == typeof r2 && null !== f ? eF(e10, n2, r2) : r2 instanceof ArrayBuffer ? eD(e10, n2, "A", new Uint8Array(r2)) : r2 instanceof Int8Array ? eD(e10, n2, "O", r2) : r2 instanceof Uint8Array ? eD(e10, n2, "o", r2) : r2 instanceof Uint8ClampedArray ? eD(e10, n2, "U", r2) : r2 instanceof Int16Array ? eD(e10, n2, "S", r2) : r2 instanceof Uint16Array ? eD(e10, n2, "s", r2) : r2 instanceof Int32Array ? eD(e10, n2, "L", r2) : r2 instanceof Uint32Array ? eD(e10, n2, "l", r2) : r2 instanceof Float32Array ? eD(e10, n2, "G", r2) : r2 instanceof Float64Array ? eD(e10, n2, "g", r2) : r2 instanceof BigInt64Array ? eD(e10, n2, "M", r2) : r2 instanceof BigUint64Array ? eD(e10, n2, "m", r2) : r2 instanceof DataView ? eD(e10, n2, "V", r2) : (r2 = eh(r2, t2.toJSON), ej(e10, t2.id, r2)); + } + var eU = {}; + function eq(e10, t2) { + if (0 === t2.status) { + t2.status = 5; + try { + eI = t2.model; + var r2 = eN(e10, t2, eU, "", t2.model); + if (eI = r2, t2.keyPath = null, t2.implicitSlot = false, "object" == typeof r2 && null !== r2) + e10.writtenObjects.set(r2, eR(t2.id)), eB(e10, t2, r2); + else { + var n2 = eh(r2); + ej(e10, t2.id, n2); + } + e10.abortableTasks.delete(t2), t2.status = 1; + } catch (r3) { + if (12 === e10.status) { + e10.abortableTasks.delete(t2), t2.status = 3; + var i2 = eh(eR(e10.fatalError)); + ej(e10, t2.id, i2); + } else { + var s2 = r3 === W ? G() : r3; + if ("object" == typeof s2 && null !== s2 && "function" == typeof s2.then) { + t2.status = 0, t2.thenableState = Y(); + var a2 = t2.ping; + s2.then(a2, a2); + } else { + e10.abortableTasks.delete(t2), t2.status = 4; + var o2 = eM(e10, s2, t2); + eL(e10, t2.id, o2); + } + } + } finally { + } + } + } + function ez(e10) { + var t2 = ei.H; + ei.H = X; + var r2 = ey; + Z = ey = e10; + var n2 = 0 < e10.abortableTasks.size; + try { + var i2 = e10.pingedTasks; + e10.pingedTasks = []; + for (var s2 = 0; s2 < i2.length; s2++) + eq(e10, i2[s2]); + null !== e10.destination && eH(e10, e10.destination), n2 && 0 === e10.abortableTasks.size && (0, e10.onAllReady)(); + } catch (t3) { + eM(e10, t3, null), e$(e10, t3); + } finally { + ei.H = t2, Z = null, ey = r2; + } + } + function eH(e10, t2) { + l = new Uint8Array(2048), c = 0; + try { + for (var r2 = e10.completedImportChunks, n2 = 0; n2 < r2.length; n2++) + e10.pendingChunks--, u(t2, r2[n2]); + r2.splice(0, n2); + var i2 = e10.completedHintChunks; + for (n2 = 0; n2 < i2.length; n2++) + u(t2, i2[n2]); + i2.splice(0, n2); + var s2 = e10.completedRegularChunks; + for (n2 = 0; n2 < s2.length; n2++) + e10.pendingChunks--, u(t2, s2[n2]); + s2.splice(0, n2); + var a2 = e10.completedErrorChunks; + for (n2 = 0; n2 < a2.length; n2++) + e10.pendingChunks--, u(t2, a2[n2]); + a2.splice(0, n2); + } finally { + e10.flushScheduled = false, l && 0 < c && (t2.enqueue(new Uint8Array(l.buffer, 0, c)), l = null, c = 0); + } + 0 === e10.pendingChunks && (e10.status = 14, t2.close(), e10.destination = null); + } + function eW(e10) { + false === e10.flushScheduled && 0 === e10.pingedTasks.length && null !== e10.destination && (e10.flushScheduled = true, ty(function() { + e10.flushScheduled = false; + var t2 = e10.destination; + t2 && eH(e10, t2); + }, 0)); + } + function eQ(e10, t2) { + try { + 11 >= e10.status && (e10.status = 12); + var r2 = e10.abortableTasks; + if (0 < r2.size) { + var n2 = void 0 === t2 ? Error("The render was aborted by the server without a reason.") : "object" == typeof t2 && null !== t2 && "function" == typeof t2.then ? Error("The render was aborted by the server with a promise.") : t2, i2 = eM(e10, n2, null), s2 = e10.nextChunkId++; + e10.fatalError = s2, e10.pendingChunks++, eL(e10, s2, i2, n2), r2.forEach(function(t3) { + if (5 !== t3.status) { + t3.status = 3; + var r3 = eR(s2); + t3 = eP(e10, t3.id, r3), e10.completedErrorChunks.push(t3); + } + }), r2.clear(), (0, e10.onAllReady)(); + } + var a2 = e10.abortListeners; + if (0 < a2.size) { + var o2 = void 0 === t2 ? Error("The render was aborted by the server without a reason.") : "object" == typeof t2 && null !== t2 && "function" == typeof t2.then ? Error("The render was aborted by the server with a promise.") : t2; + a2.forEach(function(e11) { + return e11(o2); + }), a2.clear(); + } + null !== e10.destination && eH(e10, e10.destination); + } catch (t3) { + eM(e10, t3, null), e$(e10, t3); + } + } + function eV(e10, t2) { + var r2 = "", n2 = e10[t2]; + if (n2) + r2 = n2.name; + else { + var i2 = t2.lastIndexOf("#"); + if (-1 !== i2 && (r2 = t2.slice(i2 + 1), n2 = e10[t2.slice(0, i2)]), !n2) + throw Error('Could not find the module "' + t2 + '" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'); + } + return [n2.id, n2.chunks, r2]; + } + var eG = /* @__PURE__ */ new Map(); + function eZ(e10) { + var t2 = globalThis2.__next_require__(e10); + return "function" != typeof t2.then || "fulfilled" === t2.status ? null : (t2.then(function(e11) { + t2.status = "fulfilled", t2.value = e11; + }, function(e11) { + t2.status = "rejected", t2.reason = e11; + }), t2); + } + function eK() { + } + function eJ(e10) { + for (var t2 = e10[1], n2 = [], i2 = 0; i2 < t2.length; ) { + var s2 = t2[i2++]; + t2[i2++]; + var a2 = eG.get(s2); + if (void 0 === a2) { + a2 = r.e(s2), n2.push(a2); + var o2 = eG.set.bind(eG, s2, null); + a2.then(o2, eK), eG.set(s2, a2); + } else + null !== a2 && n2.push(a2); + } + return 4 === e10.length ? 0 === n2.length ? eZ(e10[0]) : Promise.all(n2).then(function() { + return eZ(e10[0]); + }) : 0 < n2.length ? Promise.all(n2) : null; + } + function eY(e10) { + var t2 = globalThis2.__next_require__(e10[0]); + if (4 === e10.length && "function" == typeof t2.then) { + if ("fulfilled" === t2.status) + t2 = t2.value; + else + throw t2.reason; + } + return "*" === e10[2] ? t2 : "" === e10[2] ? t2.__esModule ? t2.default : t2 : t2[e10[2]]; + } + var eX = Object.prototype.hasOwnProperty; + function e0(e10, t2, r2, n2) { + this.status = e10, this.value = t2, this.reason = r2, this._response = n2; + } + function e1(e10) { + return new e0("pending", null, null, e10); + } + function e2(e10, t2) { + for (var r2 = 0; r2 < e10.length; r2++) + (0, e10[r2])(t2); + } + function e6(e10, t2) { + if ("pending" !== e10.status && "blocked" !== e10.status) + e10.reason.error(t2); + else { + var r2 = e10.reason; + e10.status = "rejected", e10.reason = t2, null !== r2 && e2(r2, t2); + } + } + function e5(e10, t2, r2) { + if ("pending" !== e10.status) + e10 = e10.reason, "C" === t2[0] ? e10.close("C" === t2 ? '"$undefined"' : t2.slice(1)) : e10.enqueueModel(t2); + else { + var n2 = e10.value, i2 = e10.reason; + if (e10.status = "resolved_model", e10.value = t2, e10.reason = r2, null !== n2) + switch (e7(e10), e10.status) { + case "fulfilled": + e2(n2, e10.value); + break; + case "pending": + case "blocked": + case "cyclic": + if (e10.value) + for (t2 = 0; t2 < n2.length; t2++) + e10.value.push(n2[t2]); + else + e10.value = n2; + if (e10.reason) { + if (i2) + for (t2 = 0; t2 < i2.length; t2++) + e10.reason.push(i2[t2]); + } else + e10.reason = i2; + break; + case "rejected": + i2 && e2(i2, e10.reason); + } + } + } + function e4(e10, t2, r2) { + return new e0("resolved_model", (r2 ? '{"done":true,"value":' : '{"done":false,"value":') + t2 + "}", -1, e10); + } + function e3(e10, t2, r2) { + e5(e10, (r2 ? '{"done":true,"value":' : '{"done":false,"value":') + t2 + "}", -1); + } + e0.prototype = Object.create(Promise.prototype), e0.prototype.then = function(e10, t2) { + switch ("resolved_model" === this.status && e7(this), this.status) { + case "fulfilled": + e10(this.value); + break; + case "pending": + case "blocked": + case "cyclic": + e10 && (null === this.value && (this.value = []), this.value.push(e10)), t2 && (null === this.reason && (this.reason = []), this.reason.push(t2)); + break; + default: + t2(this.reason); + } + }; + var e8 = null, e9 = null; + function e7(e10) { + var t2 = e8, r2 = e9; + e8 = e10, e9 = null; + var n2 = -1 === e10.reason ? void 0 : e10.reason.toString(16), i2 = e10.value; + e10.status = "cyclic", e10.value = null, e10.reason = null; + try { + var s2 = JSON.parse(i2), a2 = function e11(t3, r3, n3, i3, s3) { + if ("string" == typeof i3) + return function(e12, t4, r4, n4, i4) { + if ("$" === n4[0]) { + switch (n4[1]) { + case "$": + return n4.slice(1); + case "@": + return te(e12, t4 = parseInt(n4.slice(2), 16)); + case "F": + return n4 = tn(e12, n4 = n4.slice(2), t4, r4, to), function(e13, t5, r5, n5, i5, s5) { + var a5 = eV(e13._bundlerConfig, t5); + if (t5 = eJ(a5), r5) + r5 = Promise.all([r5, t5]).then(function(e14) { + e14 = e14[0]; + var t6 = eY(a5); + return t6.bind.apply(t6, [null].concat(e14)); + }); + else { + if (!t5) + return eY(a5); + r5 = Promise.resolve(t5).then(function() { + return eY(a5); + }); + } + return r5.then(tt(n5, i5, s5, false, e13, to, []), tr(n5)), null; + }(e12, n4.id, n4.bound, e8, t4, r4); + case "T": + var s4, a4; + if (void 0 === i4 || void 0 === e12._temporaryReferences) + throw Error("Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."); + return s4 = e12._temporaryReferences, a4 = new Proxy(a4 = Object.defineProperties(function() { + throw Error("Attempted to call a temporary Client Reference from the server but it is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); + }, { $$typeof: { value: A } }), O), s4.set(a4, i4), a4; + case "Q": + return tn(e12, n4 = n4.slice(2), t4, r4, ti); + case "W": + return tn(e12, n4 = n4.slice(2), t4, r4, ts); + case "K": + t4 = n4.slice(2); + var o3 = e12._prefix + t4 + "_", l2 = new FormData(); + return e12._formData.forEach(function(e13, t5) { + t5.startsWith(o3) && l2.append(t5.slice(o3.length), e13); + }), l2; + case "i": + return tn(e12, n4 = n4.slice(2), t4, r4, ta); + case "I": + return 1 / 0; + case "-": + return "$-0" === n4 ? -0 : -1 / 0; + case "N": + return NaN; + case "u": + return; + case "D": + return new Date(Date.parse(n4.slice(2))); + case "n": + return BigInt(n4.slice(2)); + } + switch (n4[1]) { + case "A": + return tl(e12, n4, ArrayBuffer, 1, t4, r4); + case "O": + return tl(e12, n4, Int8Array, 1, t4, r4); + case "o": + return tl(e12, n4, Uint8Array, 1, t4, r4); + case "U": + return tl(e12, n4, Uint8ClampedArray, 1, t4, r4); + case "S": + return tl(e12, n4, Int16Array, 2, t4, r4); + case "s": + return tl(e12, n4, Uint16Array, 2, t4, r4); + case "L": + return tl(e12, n4, Int32Array, 4, t4, r4); + case "l": + return tl(e12, n4, Uint32Array, 4, t4, r4); + case "G": + return tl(e12, n4, Float32Array, 4, t4, r4); + case "g": + return tl(e12, n4, Float64Array, 8, t4, r4); + case "M": + return tl(e12, n4, BigInt64Array, 8, t4, r4); + case "m": + return tl(e12, n4, BigUint64Array, 8, t4, r4); + case "V": + return tl(e12, n4, DataView, 1, t4, r4); + case "B": + return t4 = parseInt(n4.slice(2), 16), e12._formData.get(e12._prefix + t4); + } + switch (n4[1]) { + case "R": + return tu(e12, n4, void 0); + case "r": + return tu(e12, n4, "bytes"); + case "X": + return th(e12, n4, false); + case "x": + return th(e12, n4, true); + } + return tn(e12, n4 = n4.slice(1), t4, r4, to); + } + return n4; + }(t3, r3, n3, i3, s3); + if ("object" == typeof i3 && null !== i3) { + if (void 0 !== s3 && void 0 !== t3._temporaryReferences && t3._temporaryReferences.set(i3, s3), Array.isArray(i3)) + for (var a3 = 0; a3 < i3.length; a3++) + i3[a3] = e11(t3, i3, "" + a3, i3[a3], void 0 !== s3 ? s3 + ":" + a3 : void 0); + else + for (a3 in i3) + eX.call(i3, a3) && (r3 = void 0 !== s3 && -1 === a3.indexOf(":") ? s3 + ":" + a3 : void 0, void 0 !== (r3 = e11(t3, i3, a3, i3[a3], r3)) ? i3[a3] = r3 : delete i3[a3]); + } + return i3; + }(e10._response, { "": s2 }, "", s2, n2); + if (null !== e9 && 0 < e9.deps) + e9.value = a2, e10.status = "blocked"; + else { + var o2 = e10.value; + e10.status = "fulfilled", e10.value = a2, null !== o2 && e2(o2, a2); + } + } catch (t3) { + e10.status = "rejected", e10.reason = t3; + } finally { + e8 = t2, e9 = r2; + } + } + function te(e10, t2) { + var r2 = e10._chunks, n2 = r2.get(t2); + return n2 || (n2 = null != (n2 = e10._formData.get(e10._prefix + t2)) ? new e0("resolved_model", n2, t2, e10) : e1(e10), r2.set(t2, n2)), n2; + } + function tt(e10, t2, r2, n2, i2, s2, a2) { + if (e9) { + var o2 = e9; + n2 || o2.deps++; + } else + o2 = e9 = { deps: n2 ? 0 : 1, value: null }; + return function(n3) { + for (var l2 = 1; l2 < a2.length; l2++) + n3 = n3[a2[l2]]; + t2[r2] = s2(i2, n3), "" === r2 && null === o2.value && (o2.value = t2[r2]), o2.deps--, 0 === o2.deps && "blocked" === e10.status && (n3 = e10.value, e10.status = "fulfilled", e10.value = o2.value, null !== n3 && e2(n3, o2.value)); + }; + } + function tr(e10) { + return function(t2) { + return e6(e10, t2); + }; + } + function tn(e10, t2, r2, n2, i2) { + var s2 = parseInt((t2 = t2.split(":"))[0], 16); + switch ("resolved_model" === (s2 = te(e10, s2)).status && e7(s2), s2.status) { + case "fulfilled": + for (n2 = 1, r2 = s2.value; n2 < t2.length; n2++) + r2 = r2[t2[n2]]; + return i2(e10, r2); + case "pending": + case "blocked": + case "cyclic": + var a2 = e8; + return s2.then(tt(a2, r2, n2, "cyclic" === s2.status, e10, i2, t2), tr(a2)), null; + default: + throw s2.reason; + } + } + function ti(e10, t2) { + return new Map(t2); + } + function ts(e10, t2) { + return new Set(t2); + } + function ta(e10, t2) { + return t2[Symbol.iterator](); + } + function to(e10, t2) { + return t2; + } + function tl(e10, t2, r2, n2, i2, s2) { + return t2 = parseInt(t2.slice(2), 16), t2 = e10._formData.get(e10._prefix + t2), t2 = r2 === ArrayBuffer ? t2.arrayBuffer() : t2.arrayBuffer().then(function(e11) { + return new r2(e11); + }), n2 = e8, t2.then(tt(n2, i2, s2, false, e10, to, []), tr(n2)), null; + } + function tc(e10, t2, r2, n2) { + var i2 = e10._chunks; + for (r2 = new e0("fulfilled", r2, n2, e10), i2.set(t2, r2), e10 = e10._formData.getAll(e10._prefix + t2), t2 = 0; t2 < e10.length; t2++) + "C" === (i2 = e10[t2])[0] ? n2.close("C" === i2 ? '"$undefined"' : i2.slice(1)) : n2.enqueueModel(i2); + } + function tu(e10, t2, r2) { + t2 = parseInt(t2.slice(2), 16); + var n2 = null; + r2 = new ReadableStream({ type: r2, start: function(e11) { + n2 = e11; + } }); + var i2 = null; + return tc(e10, t2, r2, { enqueueModel: function(t3) { + if (null === i2) { + var r3 = new e0("resolved_model", t3, -1, e10); + e7(r3), "fulfilled" === r3.status ? n2.enqueue(r3.value) : (r3.then(function(e11) { + return n2.enqueue(e11); + }, function(e11) { + return n2.error(e11); + }), i2 = r3); + } else { + r3 = i2; + var s2 = e1(e10); + s2.then(function(e11) { + return n2.enqueue(e11); + }, function(e11) { + return n2.error(e11); + }), i2 = s2, r3.then(function() { + i2 === s2 && (i2 = null), e5(s2, t3, -1); + }); + } + }, close: function() { + if (null === i2) + n2.close(); + else { + var e11 = i2; + i2 = null, e11.then(function() { + return n2.close(); + }); + } + }, error: function(e11) { + if (null === i2) + n2.error(e11); + else { + var t3 = i2; + i2 = null, t3.then(function() { + return n2.error(e11); + }); + } + } }), r2; + } + function td() { + return this; + } + function th(e10, t2, r2) { + t2 = parseInt(t2.slice(2), 16); + var n2 = [], i2 = false, s2 = 0, a2 = {}; + return a2[H] = function() { + var t3, r3 = 0; + return (t3 = { next: t3 = function(t4) { + if (void 0 !== t4) + throw Error("Values cannot be passed to next() of AsyncIterables passed to Client Components."); + if (r3 === n2.length) { + if (i2) + return new e0("fulfilled", { done: true, value: void 0 }, null, e10); + n2[r3] = e1(e10); + } + return n2[r3++]; + } })[H] = td, t3; + }, tc(e10, t2, r2 = r2 ? a2[H]() : a2, { enqueueModel: function(t3) { + s2 === n2.length ? n2[s2] = e4(e10, t3, false) : e3(n2[s2], t3, false), s2++; + }, close: function(t3) { + for (i2 = true, s2 === n2.length ? n2[s2] = e4(e10, t3, true) : e3(n2[s2], t3, true), s2++; s2 < n2.length; ) + e3(n2[s2++], '"$undefined"', true); + }, error: function(t3) { + for (i2 = true, s2 === n2.length && (n2[s2] = e1(e10)); s2 < n2.length; ) + e6(n2[s2++], t3); + } }), r2; + } + function tf(e10, t2, r2) { + var n2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : new FormData(); + return { _bundlerConfig: e10, _prefix: t2, _formData: n2, _chunks: /* @__PURE__ */ new Map(), _temporaryReferences: r2 }; + } + function tp(e10) { + !function(e11, t2) { + e11._chunks.forEach(function(e12) { + "pending" === e12.status && e6(e12, t2); + }); + }(e10, Error("Connection closed.")); + } + function tm(e10, t2, r2) { + var n2 = eV(e10, t2); + return e10 = eJ(n2), r2 ? Promise.all([r2, e10]).then(function(e11) { + e11 = e11[0]; + var t3 = eY(n2); + return t3.bind.apply(t3, [null].concat(e11)); + }) : e10 ? Promise.resolve(e10).then(function() { + return eY(n2); + }) : Promise.resolve(eY(n2)); + } + function tg(e10, t2, r2) { + if (tp(e10 = tf(t2, r2, void 0, e10)), (e10 = te(e10, 0)).then(function() { + }), "fulfilled" !== e10.status) + throw e10.reason; + return e10.value; + } + t.createClientModuleProxy = function(e10) { + return new Proxy(e10 = y({}, e10, false), E); + }, t.createTemporaryReferenceSet = function() { + return /* @__PURE__ */ new WeakMap(); + }, t.decodeAction = function(e10, t2) { + var r2 = new FormData(), n2 = null; + return e10.forEach(function(i2, s2) { + s2.startsWith("$ACTION_") ? s2.startsWith("$ACTION_REF_") ? (i2 = tg(e10, t2, i2 = "$ACTION_" + s2.slice(12) + ":"), n2 = tm(t2, i2.id, i2.bound)) : s2.startsWith("$ACTION_ID_") && (n2 = tm(t2, i2 = s2.slice(11), null)) : r2.append(s2, i2); + }), null === n2 ? null : n2.then(function(e11) { + return e11.bind(null, r2); + }); + }, t.decodeFormState = function(e10, t2, r2) { + var n2 = t2.get("$ACTION_KEY"); + if ("string" != typeof n2) + return Promise.resolve(null); + var i2 = null; + if (t2.forEach(function(e11, n3) { + n3.startsWith("$ACTION_REF_") && (i2 = tg(t2, r2, "$ACTION_" + n3.slice(12) + ":")); + }), null === i2) + return Promise.resolve(null); + var s2 = i2.id; + return Promise.resolve(i2.bound).then(function(t3) { + return null === t3 ? null : [e10, n2, s2, t3.length - 1]; + }); + }, t.decodeReply = function(e10, t2, r2) { + if ("string" == typeof e10) { + var n2 = new FormData(); + n2.append("0", e10), e10 = n2; + } + return t2 = te(e10 = tf(t2, "", r2 ? r2.temporaryReferences : void 0, e10), 0), tp(e10), t2; + }, t.registerClientReference = function(e10, t2, r2) { + return y(e10, t2 + "#" + r2, false); + }, t.registerServerReference = function(e10, t2, r2) { + return Object.defineProperties(e10, { $$typeof: { value: g }, $$id: { value: null === r2 ? t2 : t2 + "#" + r2, configurable: true }, $$bound: { value: null, configurable: true }, bind: { value: w, configurable: true } }); + }; + let ty = "function" == typeof globalThis2.setImmediate && globalThis2.propertyIsEnumerable("setImmediate") ? globalThis2.setImmediate : setTimeout; + t.renderToReadableStream = function(e10, t2, r2) { + var n2 = new em(20, e10, t2, r2 ? r2.onError : void 0, r2 ? r2.identifierPrefix : void 0, r2 ? r2.onPostpone : void 0, r2 ? r2.temporaryReferences : void 0, void 0, void 0, eg, eg); + if (r2 && r2.signal) { + var i2 = r2.signal; + if (i2.aborted) + eQ(n2, i2.reason); + else { + var s2 = function() { + eQ(n2, i2.reason), i2.removeEventListener("abort", s2); + }; + i2.addEventListener("abort", s2); + } + } + return new ReadableStream({ type: "bytes", start: function() { + n2.flushScheduled = null !== n2.destination, P ? o(function() { + T.run(n2, ez, n2); + }) : o(function() { + return ez(n2); + }), ty(function() { + 10 === n2.status && (n2.status = 11); + }, 0); + }, pull: function(e11) { + if (13 === n2.status) + n2.status = 14, p(e11, n2.fatalError); + else if (14 !== n2.status && null === n2.destination) { + n2.destination = e11; + try { + eH(n2, e11); + } catch (e12) { + eM(n2, e12, null), e$(n2, e12); + } + } + }, cancel: function(e11) { + n2.destination = null, eQ(n2, e11); + } }, { highWaterMark: 0 }); + }; + }; + __namedExportsObject5["__chunk_63362"] = (e, t, r) => { + "use strict"; + var n = r(79257); + n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + var i = Symbol.for("react.transitional.element"), s = Symbol.for("react.lazy"), a = Symbol.iterator, o = Symbol.asyncIterator, l = Array.isArray, c = Object.getPrototypeOf, u = Object.prototype, d = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(); + function f(e2) { + var t2 = d.get(this); + if (!t2) + throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React."); + var r2 = null; + if (null !== t2.bound) { + if ((r2 = h.get(t2)) || (n2 = t2, m2 = new Promise(function(e3, t3) { + f2 = e3, p2 = t3; + }), function(e3, t3, r3, n3, h2) { + function f3(e4, t4) { + t4 = new Blob([new Uint8Array(t4.buffer, t4.byteOffset, t4.byteLength)]); + var r4 = g3++; + return null === v2 && (v2 = new FormData()), v2.append("" + r4, t4), "$" + e4 + r4.toString(16); + } + function p3(e4, x3) { + if (null === x3) + return null; + if ("object" == typeof x3) { + switch (x3.$$typeof) { + case i: + if (void 0 !== r3 && -1 === e4.indexOf(":")) { + var S2, _2, E2, k2, C2, R2 = b2.get(this); + if (void 0 !== R2) + return r3.set(R2 + ":" + e4, x3), "$T"; + } + throw Error("React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options."); + case s: + R2 = x3._payload; + var P2 = x3._init; + null === v2 && (v2 = new FormData()), y2++; + try { + var T2 = P2(R2), A2 = g3++, O2 = m3(T2, A2); + return v2.append("" + A2, O2), "$" + A2.toString(16); + } catch (e5) { + if ("object" == typeof e5 && null !== e5 && "function" == typeof e5.then) { + y2++; + var I2 = g3++; + return R2 = function() { + try { + var e6 = m3(x3, I2), r4 = v2; + r4.append(t3 + I2, e6), y2--, 0 === y2 && n3(r4); + } catch (e7) { + h2(e7); + } + }, e5.then(R2, R2), "$" + I2.toString(16); + } + return h2(e5), null; + } finally { + y2--; + } + } + if ("function" == typeof x3.then) { + null === v2 && (v2 = new FormData()), y2++; + var N2 = g3++; + return x3.then(function(e5) { + try { + var r4 = m3(e5, N2); + (e5 = v2).append(t3 + N2, r4), y2--, 0 === y2 && n3(e5); + } catch (e6) { + h2(e6); + } + }, h2), "$@" + N2.toString(16); + } + if (void 0 !== (R2 = b2.get(x3))) { + if (w2 !== x3) + return R2; + w2 = null; + } else + -1 === e4.indexOf(":") && void 0 !== (R2 = b2.get(this)) && (e4 = R2 + ":" + e4, b2.set(x3, e4), void 0 !== r3 && r3.set(e4, x3)); + if (l(x3)) + return x3; + if (x3 instanceof FormData) { + null === v2 && (v2 = new FormData()); + var M2 = v2, $2 = t3 + (e4 = g3++) + "_"; + return x3.forEach(function(e5, t4) { + M2.append($2 + t4, e5); + }), "$K" + e4.toString(16); + } + if (x3 instanceof Map) + return e4 = g3++, R2 = m3(Array.from(x3), e4), null === v2 && (v2 = new FormData()), v2.append(t3 + e4, R2), "$Q" + e4.toString(16); + if (x3 instanceof Set) + return e4 = g3++, R2 = m3(Array.from(x3), e4), null === v2 && (v2 = new FormData()), v2.append(t3 + e4, R2), "$W" + e4.toString(16); + if (x3 instanceof ArrayBuffer) + return e4 = new Blob([x3]), R2 = g3++, null === v2 && (v2 = new FormData()), v2.append(t3 + R2, e4), "$A" + R2.toString(16); + if (x3 instanceof Int8Array) + return f3("O", x3); + if (x3 instanceof Uint8Array) + return f3("o", x3); + if (x3 instanceof Uint8ClampedArray) + return f3("U", x3); + if (x3 instanceof Int16Array) + return f3("S", x3); + if (x3 instanceof Uint16Array) + return f3("s", x3); + if (x3 instanceof Int32Array) + return f3("L", x3); + if (x3 instanceof Uint32Array) + return f3("l", x3); + if (x3 instanceof Float32Array) + return f3("G", x3); + if (x3 instanceof Float64Array) + return f3("g", x3); + if (x3 instanceof BigInt64Array) + return f3("M", x3); + if (x3 instanceof BigUint64Array) + return f3("m", x3); + if (x3 instanceof DataView) + return f3("V", x3); + if ("function" == typeof Blob && x3 instanceof Blob) + return null === v2 && (v2 = new FormData()), e4 = g3++, v2.append(t3 + e4, x3), "$B" + e4.toString(16); + if (e4 = null === (S2 = x3) || "object" != typeof S2 ? null : "function" == typeof (S2 = a && S2[a] || S2["@@iterator"]) ? S2 : null) + return (R2 = e4.call(x3)) === x3 ? (e4 = g3++, R2 = m3(Array.from(R2), e4), null === v2 && (v2 = new FormData()), v2.append(t3 + e4, R2), "$i" + e4.toString(16)) : Array.from(R2); + if ("function" == typeof ReadableStream && x3 instanceof ReadableStream) + return function(e5) { + try { + var r4, i2, s2, a2, o2, l2, c2, u2 = e5.getReader({ mode: "byob" }); + } catch (a3) { + return r4 = e5.getReader(), null === v2 && (v2 = new FormData()), i2 = v2, y2++, s2 = g3++, r4.read().then(function e6(a4) { + if (a4.done) + i2.append(t3 + s2, "C"), 0 == --y2 && n3(i2); + else + try { + var o3 = JSON.stringify(a4.value, p3); + i2.append(t3 + s2, o3), r4.read().then(e6, h2); + } catch (e7) { + h2(e7); + } + }, h2), "$R" + s2.toString(16); + } + return a2 = u2, null === v2 && (v2 = new FormData()), o2 = v2, y2++, l2 = g3++, c2 = [], a2.read(new Uint8Array(1024)).then(function e6(r5) { + r5.done ? (r5 = g3++, o2.append(t3 + r5, new Blob(c2)), o2.append(t3 + l2, '"$o' + r5.toString(16) + '"'), o2.append(t3 + l2, "C"), 0 == --y2 && n3(o2)) : (c2.push(r5.value), a2.read(new Uint8Array(1024)).then(e6, h2)); + }, h2), "$r" + l2.toString(16); + }(x3); + if ("function" == typeof (e4 = x3[o])) + return _2 = x3, E2 = e4.call(x3), null === v2 && (v2 = new FormData()), k2 = v2, y2++, C2 = g3++, _2 = _2 === E2, E2.next().then(function e5(r4) { + if (r4.done) { + if (void 0 === r4.value) + k2.append(t3 + C2, "C"); + else + try { + var i2 = JSON.stringify(r4.value, p3); + k2.append(t3 + C2, "C" + i2); + } catch (e6) { + h2(e6); + return; + } + 0 == --y2 && n3(k2); + } else + try { + var s2 = JSON.stringify(r4.value, p3); + k2.append(t3 + C2, s2), E2.next().then(e5, h2); + } catch (e6) { + h2(e6); + } + }, h2), "$" + (_2 ? "x" : "X") + C2.toString(16); + if ((e4 = c(x3)) !== u && (null === e4 || null !== c(e4))) { + if (void 0 === r3) + throw Error("Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported."); + return "$T"; + } + return x3; + } + if ("string" == typeof x3) + return "Z" === x3[x3.length - 1] && this[e4] instanceof Date ? "$D" + x3 : e4 = "$" === x3[0] ? "$" + x3 : x3; + if ("boolean" == typeof x3) + return x3; + if ("number" == typeof x3) + return Number.isFinite(x3) ? 0 === x3 && -1 / 0 == 1 / x3 ? "$-0" : x3 : 1 / 0 === x3 ? "$Infinity" : -1 / 0 === x3 ? "$-Infinity" : "$NaN"; + if (void 0 === x3) + return "$undefined"; + if ("function" == typeof x3) { + if (void 0 !== (R2 = d.get(x3))) + return e4 = JSON.stringify(R2, p3), null === v2 && (v2 = new FormData()), R2 = g3++, v2.set(t3 + R2, e4), "$F" + R2.toString(16); + if (void 0 !== r3 && -1 === e4.indexOf(":") && void 0 !== (R2 = b2.get(this))) + return r3.set(R2 + ":" + e4, x3), "$T"; + throw Error("Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again."); + } + if ("symbol" == typeof x3) { + if (void 0 !== r3 && -1 === e4.indexOf(":") && void 0 !== (R2 = b2.get(this))) + return r3.set(R2 + ":" + e4, x3), "$T"; + throw Error("Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options."); + } + if ("bigint" == typeof x3) + return "$n" + x3.toString(10); + throw Error("Type " + typeof x3 + " is not supported as an argument to a Server Function."); + } + function m3(e4, t4) { + return "object" == typeof e4 && null !== e4 && (t4 = "$" + t4.toString(16), b2.set(e4, t4), void 0 !== r3 && r3.set(t4, e4)), w2 = e4, JSON.stringify(e4, p3); + } + var g3 = 1, y2 = 0, v2 = null, b2 = /* @__PURE__ */ new WeakMap(), w2 = e3, x2 = m3(e3, 0); + null === v2 ? n3(x2) : (v2.set(t3 + "0", x2), 0 === y2 && n3(v2)); + }(n2, "", void 0, function(e3) { + if ("string" == typeof e3) { + var t3 = new FormData(); + t3.append("0", e3), e3 = t3; + } + m2.status = "fulfilled", m2.value = e3, f2(e3); + }, function(e3) { + m2.status = "rejected", m2.reason = e3, p2(e3); + }), r2 = m2, h.set(t2, r2)), "rejected" === r2.status) + throw r2.reason; + if ("fulfilled" !== r2.status) + throw r2; + t2 = r2.value; + var n2, f2, p2, m2, g2 = new FormData(); + t2.forEach(function(t3, r3) { + g2.append("$ACTION_" + e2 + ":" + r3, t3); + }), r2 = g2, t2 = "$ACTION_REF_" + e2; + } else + t2 = "$ACTION_ID_" + t2.id; + return { name: t2, method: "POST", encType: "multipart/form-data", data: r2 }; + } + function p(e2, t2) { + var r2 = d.get(this); + if (!r2) + throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React."); + if (r2.id !== e2) + return false; + var n2 = r2.bound; + if (null === n2) + return 0 === t2; + switch (n2.status) { + case "fulfilled": + return n2.value.length === t2; + case "pending": + throw n2; + case "rejected": + throw n2.reason; + default: + throw "string" != typeof n2.status && (n2.status = "pending", n2.then(function(e3) { + n2.status = "fulfilled", n2.value = e3; + }, function(e3) { + n2.status = "rejected", n2.reason = e3; + })), n2; + } + } + var m = Function.prototype.bind, g = Array.prototype.slice; + function y() { + var e2 = m.apply(this, arguments), t2 = d.get(this); + if (t2) { + var r2 = g.call(arguments, 1), n2 = null; + n2 = null !== t2.bound ? Promise.resolve(t2.bound).then(function(e3) { + return e3.concat(r2); + }) : Promise.resolve(r2), Object.defineProperties(e2, { $$FORM_ACTION: { value: this.$$FORM_ACTION }, $$IS_SIGNATURE_EQUAL: { value: p }, bind: { value: y } }), d.set(e2, { id: t2.id, bound: n2 }); + } + return e2; + } + function v(e2, t2, r2, n2) { + this.status = e2, this.value = t2, this.reason = r2, this._response = n2; + } + function b(e2) { + switch (e2.status) { + case "resolved_model": + P(e2); + break; + case "resolved_module": + T(e2); + } + switch (e2.status) { + case "fulfilled": + return e2.value; + case "pending": + case "blocked": + throw e2; + default: + throw e2.reason; + } + } + function w(e2) { + return new v("pending", null, null, e2); + } + function x(e2, t2) { + for (var r2 = 0; r2 < e2.length; r2++) + (0, e2[r2])(t2); + } + function S(e2, t2, r2) { + switch (e2.status) { + case "fulfilled": + x(t2, e2.value); + break; + case "pending": + case "blocked": + if (e2.value) + for (var n2 = 0; n2 < t2.length; n2++) + e2.value.push(t2[n2]); + else + e2.value = t2; + if (e2.reason) { + if (r2) + for (t2 = 0; t2 < r2.length; t2++) + e2.reason.push(r2[t2]); + } else + e2.reason = r2; + break; + case "rejected": + r2 && x(r2, e2.reason); + } + } + function _(e2, t2) { + if ("pending" !== e2.status && "blocked" !== e2.status) + e2.reason.error(t2); + else { + var r2 = e2.reason; + e2.status = "rejected", e2.reason = t2, null !== r2 && x(r2, t2); + } + } + function E(e2, t2, r2) { + return new v("resolved_model", (r2 ? '{"done":true,"value":' : '{"done":false,"value":') + t2 + "}", null, e2); + } + function k(e2, t2, r2) { + C(e2, (r2 ? '{"done":true,"value":' : '{"done":false,"value":') + t2 + "}"); + } + function C(e2, t2) { + if ("pending" !== e2.status) + e2.reason.enqueueModel(t2); + else { + var r2 = e2.value, n2 = e2.reason; + e2.status = "resolved_model", e2.value = t2, null !== r2 && (P(e2), S(e2, r2, n2)); + } + } + v.prototype = Object.create(Promise.prototype), v.prototype.then = function(e2, t2) { + switch (this.status) { + case "resolved_model": + P(this); + break; + case "resolved_module": + T(this); + } + switch (this.status) { + case "fulfilled": + e2(this.value); + break; + case "pending": + case "blocked": + e2 && (null === this.value && (this.value = []), this.value.push(e2)), t2 && (null === this.reason && (this.reason = []), this.reason.push(t2)); + break; + default: + t2 && t2(this.reason); + } + }; + var R = null; + function P(e2) { + var t2 = R; + R = null; + var r2 = e2.value; + e2.status = "blocked", e2.value = null, e2.reason = null; + try { + var n2 = JSON.parse(r2, e2._response._fromJSON), i2 = e2.value; + if (null !== i2 && (e2.value = null, e2.reason = null, x(i2, n2)), null !== R) { + if (R.errored) + throw R.value; + if (0 < R.deps) { + R.value = n2, R.chunk = e2; + return; + } + } + e2.status = "fulfilled", e2.value = n2; + } catch (t3) { + e2.status = "rejected", e2.reason = t3; + } finally { + R = t2; + } + } + function T(e2) { + try { + var t2 = e2.value, r2 = globalThis2.__next_require__(t2[0]); + if (4 === t2.length && "function" == typeof r2.then) { + if ("fulfilled" === r2.status) + r2 = r2.value; + else + throw r2.reason; + } + var n2 = "*" === t2[2] ? r2 : "" === t2[2] ? r2.__esModule ? r2.default : r2 : r2[t2[2]]; + e2.status = "fulfilled", e2.value = n2; + } catch (t3) { + e2.status = "rejected", e2.reason = t3; + } + } + function A(e2) { + return { $$typeof: s, _payload: e2, _init: b }; + } + function O(e2, t2) { + var r2 = e2._chunks, n2 = r2.get(t2); + return n2 || (n2 = w(e2), r2.set(t2, n2)), n2; + } + function I(e2, t2, r2, n2, a2, o2) { + function l2(e3) { + if (!c2.errored) { + c2.errored = true, c2.value = e3; + var t3 = c2.chunk; + null !== t3 && "blocked" === t3.status && _(t3, e3); + } + } + if (R) { + var c2 = R; + c2.deps++; + } else + c2 = R = { parent: null, chunk: null, value: null, deps: 1, errored: false }; + return e2.then(function e3(u2) { + for (var d2 = 1; d2 < o2.length; d2++) { + for (; u2.$$typeof === s; ) + if ((u2 = u2._payload) === c2.chunk) + u2 = c2.value; + else if ("fulfilled" === u2.status) + u2 = u2.value; + else { + o2.splice(0, d2 - 1), u2.then(e3, l2); + return; + } + u2 = u2[o2[d2]]; + } + d2 = a2(n2, u2), t2[r2] = d2, "" === r2 && null === c2.value && (c2.value = d2), t2[0] === i && "object" == typeof c2.value && null !== c2.value && c2.value.$$typeof === i && (u2 = c2.value, "3" === r2) && (u2.props = d2), c2.deps--, 0 === c2.deps && null !== (d2 = c2.chunk) && "blocked" === d2.status && (u2 = d2.value, d2.status = "fulfilled", d2.value = c2.value, null !== u2 && x(u2, c2.value)); + }, l2), null; + } + function N(e2, t2) { + return function(e3, t3, r2) { + function n2() { + var e4 = Array.prototype.slice.call(arguments); + return a2 ? "fulfilled" === a2.status ? t3(s2, a2.value.concat(e4)) : Promise.resolve(a2).then(function(r3) { + return t3(s2, r3.concat(e4)); + }) : t3(s2, e4); + } + var i2, s2 = e3.id, a2 = e3.bound; + return i2 = { id: s2, bound: a2 }, Object.defineProperties(n2, { $$FORM_ACTION: { value: void 0 === r2 ? f : function() { + var e4 = d.get(this); + if (!e4) + throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React."); + var t4 = e4.bound; + return null === t4 && (t4 = Promise.resolve([])), r2(e4.id, t4); + } }, $$IS_SIGNATURE_EQUAL: { value: p }, bind: { value: y } }), d.set(n2, i2), n2; + }(t2, e2._callServer, e2._encodeFormAction); + } + function M(e2, t2, r2, n2, i2) { + var a2 = parseInt((t2 = t2.split(":"))[0], 16); + switch ((a2 = O(e2, a2)).status) { + case "resolved_model": + P(a2); + break; + case "resolved_module": + T(a2); + } + switch (a2.status) { + case "fulfilled": + var o2 = a2.value; + for (a2 = 1; a2 < t2.length; a2++) { + for (; o2.$$typeof === s; ) + if ("fulfilled" !== (o2 = o2._payload).status) + return I(o2, r2, n2, e2, i2, t2.slice(a2 - 1)); + else + o2 = o2.value; + o2 = o2[t2[a2]]; + } + return i2(e2, o2); + case "pending": + case "blocked": + return I(a2, r2, n2, e2, i2, t2); + default: + return R ? (R.errored = true, R.value = a2.reason) : R = { parent: null, chunk: null, value: a2.reason, deps: 0, errored: true }, null; + } + } + function $(e2, t2) { + return new Map(t2); + } + function L(e2, t2) { + return new Set(t2); + } + function j(e2, t2) { + return new Blob(t2.slice(1), { type: t2[0] }); + } + function D(e2, t2) { + e2 = new FormData(); + for (var r2 = 0; r2 < t2.length; r2++) + e2.append(t2[r2][0], t2[r2][1]); + return e2; + } + function F(e2, t2) { + return t2[Symbol.iterator](); + } + function B(e2, t2) { + return t2; + } + function U() { + throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.'); + } + function q(e2, t2, r2, n2) { + var i2 = e2._chunks, s2 = i2.get(t2); + s2 ? "pending" === s2.status && (e2 = s2.value, s2.status = "fulfilled", s2.value = r2, s2.reason = n2, null !== e2 && x(e2, s2.value)) : i2.set(t2, new v("fulfilled", r2, n2, e2)); + } + function z() { + return this; + } + }; + __namedExportsObject5["__chunk_79257"] = (e, t, r) => { + "use strict"; + e.exports = r(44288); + }; + __namedExportsObject5["__chunk_44288"] = (e, t, r) => { + "use strict"; + var n = r(70219); + function i() { + } + var s = { d: { f: i, r: function() { + throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React."); + }, D: i, C: i, L: i, m: i, X: i, S: i, M: i }, p: 0, findDOMNode: null }; + if (!n.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) + throw Error('The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'); + function a(e2, t2) { + return "font" === e2 ? "" : "string" == typeof t2 ? "use-credentials" === t2 ? t2 : "" : void 0; + } + t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = s, t.preconnect = function(e2, t2) { + "string" == typeof e2 && (t2 = t2 ? "string" == typeof (t2 = t2.crossOrigin) ? "use-credentials" === t2 ? t2 : "" : void 0 : null, s.d.C(e2, t2)); + }, t.prefetchDNS = function(e2) { + "string" == typeof e2 && s.d.D(e2); + }, t.preinit = function(e2, t2) { + if ("string" == typeof e2 && t2 && "string" == typeof t2.as) { + var r2 = t2.as, n2 = a(r2, t2.crossOrigin), i2 = "string" == typeof t2.integrity ? t2.integrity : void 0, o = "string" == typeof t2.fetchPriority ? t2.fetchPriority : void 0; + "style" === r2 ? s.d.S(e2, "string" == typeof t2.precedence ? t2.precedence : void 0, { crossOrigin: n2, integrity: i2, fetchPriority: o }) : "script" === r2 && s.d.X(e2, { crossOrigin: n2, integrity: i2, fetchPriority: o, nonce: "string" == typeof t2.nonce ? t2.nonce : void 0 }); + } + }, t.preinitModule = function(e2, t2) { + if ("string" == typeof e2) { + if ("object" == typeof t2 && null !== t2) { + if (null == t2.as || "script" === t2.as) { + var r2 = a(t2.as, t2.crossOrigin); + s.d.M(e2, { crossOrigin: r2, integrity: "string" == typeof t2.integrity ? t2.integrity : void 0, nonce: "string" == typeof t2.nonce ? t2.nonce : void 0 }); + } + } else + null == t2 && s.d.M(e2); + } + }, t.preload = function(e2, t2) { + if ("string" == typeof e2 && "object" == typeof t2 && null !== t2 && "string" == typeof t2.as) { + var r2 = t2.as, n2 = a(r2, t2.crossOrigin); + s.d.L(e2, r2, { crossOrigin: n2, integrity: "string" == typeof t2.integrity ? t2.integrity : void 0, nonce: "string" == typeof t2.nonce ? t2.nonce : void 0, type: "string" == typeof t2.type ? t2.type : void 0, fetchPriority: "string" == typeof t2.fetchPriority ? t2.fetchPriority : void 0, referrerPolicy: "string" == typeof t2.referrerPolicy ? t2.referrerPolicy : void 0, imageSrcSet: "string" == typeof t2.imageSrcSet ? t2.imageSrcSet : void 0, imageSizes: "string" == typeof t2.imageSizes ? t2.imageSizes : void 0, media: "string" == typeof t2.media ? t2.media : void 0 }); + } + }, t.preloadModule = function(e2, t2) { + if ("string" == typeof e2) { + if (t2) { + var r2 = a(t2.as, t2.crossOrigin); + s.d.m(e2, { as: "string" == typeof t2.as && "script" !== t2.as ? t2.as : void 0, crossOrigin: r2, integrity: "string" == typeof t2.integrity ? t2.integrity : void 0 }); + } else + s.d.m(e2); + } + }, t.version = "19.0.0-rc-bf7e210c-20241017"; + }; + __namedExportsObject5["__chunk_92969"] = (e) => { + "use strict"; + var t = Object.defineProperty, r = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, i = Object.prototype.hasOwnProperty, s = {}; + function a(e2) { + var t2; + let r2 = ["path" in e2 && e2.path && `Path=${e2.path}`, "expires" in e2 && (e2.expires || 0 === e2.expires) && `Expires=${("number" == typeof e2.expires ? new Date(e2.expires) : e2.expires).toUTCString()}`, "maxAge" in e2 && "number" == typeof e2.maxAge && `Max-Age=${e2.maxAge}`, "domain" in e2 && e2.domain && `Domain=${e2.domain}`, "secure" in e2 && e2.secure && "Secure", "httpOnly" in e2 && e2.httpOnly && "HttpOnly", "sameSite" in e2 && e2.sameSite && `SameSite=${e2.sameSite}`, "partitioned" in e2 && e2.partitioned && "Partitioned", "priority" in e2 && e2.priority && `Priority=${e2.priority}`].filter(Boolean), n2 = `${e2.name}=${encodeURIComponent(null != (t2 = e2.value) ? t2 : "")}`; + return 0 === r2.length ? n2 : `${n2}; ${r2.join("; ")}`; + } + function o(e2) { + let t2 = /* @__PURE__ */ new Map(); + for (let r2 of e2.split(/; */)) { + if (!r2) + continue; + let e3 = r2.indexOf("="); + if (-1 === e3) { + t2.set(r2, "true"); + continue; + } + let [n2, i2] = [r2.slice(0, e3), r2.slice(e3 + 1)]; + try { + t2.set(n2, decodeURIComponent(null != i2 ? i2 : "true")); + } catch { + } + } + return t2; + } + function l(e2) { + var t2, r2; + if (!e2) + return; + let [[n2, i2], ...s2] = o(e2), { domain: a2, expires: l2, httponly: d2, maxage: h2, path: f, samesite: p, secure: m, partitioned: g, priority: y } = Object.fromEntries(s2.map(([e3, t3]) => [e3.toLowerCase(), t3])); + return function(e3) { + let t3 = {}; + for (let r3 in e3) + e3[r3] && (t3[r3] = e3[r3]); + return t3; + }({ name: n2, value: decodeURIComponent(i2), domain: a2, ...l2 && { expires: new Date(l2) }, ...d2 && { httpOnly: true }, ..."string" == typeof h2 && { maxAge: Number(h2) }, path: f, ...p && { sameSite: c.includes(t2 = (t2 = p).toLowerCase()) ? t2 : void 0 }, ...m && { secure: true }, ...y && { priority: u.includes(r2 = (r2 = y).toLowerCase()) ? r2 : void 0 }, ...g && { partitioned: true } }); + } + ((e2, r2) => { + for (var n2 in r2) + t(e2, n2, { get: r2[n2], enumerable: true }); + })(s, { RequestCookies: () => d, ResponseCookies: () => h, parseCookie: () => o, parseSetCookie: () => l, stringifyCookie: () => a }), e.exports = ((e2, s2, a2, o2) => { + if (s2 && "object" == typeof s2 || "function" == typeof s2) + for (let l2 of n(s2)) + i.call(e2, l2) || l2 === a2 || t(e2, l2, { get: () => s2[l2], enumerable: !(o2 = r(s2, l2)) || o2.enumerable }); + return e2; + })(t({}, "__esModule", { value: true }), s); + var c = ["strict", "lax", "none"], u = ["low", "medium", "high"], d = class { + constructor(e2) { + this._parsed = /* @__PURE__ */ new Map(), this._headers = e2; + let t2 = e2.get("cookie"); + if (t2) + for (let [e3, r2] of o(t2)) + this._parsed.set(e3, { name: e3, value: r2 }); + } + [Symbol.iterator]() { + return this._parsed[Symbol.iterator](); + } + get size() { + return this._parsed.size; + } + get(...e2) { + let t2 = "string" == typeof e2[0] ? e2[0] : e2[0].name; + return this._parsed.get(t2); + } + getAll(...e2) { + var t2; + let r2 = Array.from(this._parsed); + if (!e2.length) + return r2.map(([e3, t3]) => t3); + let n2 = "string" == typeof e2[0] ? e2[0] : null == (t2 = e2[0]) ? void 0 : t2.name; + return r2.filter(([e3]) => e3 === n2).map(([e3, t3]) => t3); + } + has(e2) { + return this._parsed.has(e2); + } + set(...e2) { + let [t2, r2] = 1 === e2.length ? [e2[0].name, e2[0].value] : e2, n2 = this._parsed; + return n2.set(t2, { name: t2, value: r2 }), this._headers.set("cookie", Array.from(n2).map(([e3, t3]) => a(t3)).join("; ")), this; + } + delete(e2) { + let t2 = this._parsed, r2 = Array.isArray(e2) ? e2.map((e3) => t2.delete(e3)) : t2.delete(e2); + return this._headers.set("cookie", Array.from(t2).map(([e3, t3]) => a(t3)).join("; ")), r2; + } + clear() { + return this.delete(Array.from(this._parsed.keys())), this; + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`; + } + toString() { + return [...this._parsed.values()].map((e2) => `${e2.name}=${encodeURIComponent(e2.value)}`).join("; "); + } + }, h = class { + constructor(e2) { + var t2, r2, n2; + this._parsed = /* @__PURE__ */ new Map(), this._headers = e2; + let i2 = null != (n2 = null != (r2 = null == (t2 = e2.getSetCookie) ? void 0 : t2.call(e2)) ? r2 : e2.get("set-cookie")) ? n2 : []; + for (let e3 of Array.isArray(i2) ? i2 : function(e4) { + if (!e4) + return []; + var t3, r3, n3, i3, s2, a2 = [], o2 = 0; + function l2() { + for (; o2 < e4.length && /\s/.test(e4.charAt(o2)); ) + o2 += 1; + return o2 < e4.length; + } + for (; o2 < e4.length; ) { + for (t3 = o2, s2 = false; l2(); ) + if ("," === (r3 = e4.charAt(o2))) { + for (n3 = o2, o2 += 1, l2(), i3 = o2; o2 < e4.length && "=" !== (r3 = e4.charAt(o2)) && ";" !== r3 && "," !== r3; ) + o2 += 1; + o2 < e4.length && "=" === e4.charAt(o2) ? (s2 = true, o2 = i3, a2.push(e4.substring(t3, n3)), t3 = o2) : o2 = n3 + 1; + } else + o2 += 1; + (!s2 || o2 >= e4.length) && a2.push(e4.substring(t3, e4.length)); + } + return a2; + }(i2)) { + let t3 = l(e3); + t3 && this._parsed.set(t3.name, t3); + } + } + get(...e2) { + let t2 = "string" == typeof e2[0] ? e2[0] : e2[0].name; + return this._parsed.get(t2); + } + getAll(...e2) { + var t2; + let r2 = Array.from(this._parsed.values()); + if (!e2.length) + return r2; + let n2 = "string" == typeof e2[0] ? e2[0] : null == (t2 = e2[0]) ? void 0 : t2.name; + return r2.filter((e3) => e3.name === n2); + } + has(e2) { + return this._parsed.has(e2); + } + set(...e2) { + let [t2, r2, n2] = 1 === e2.length ? [e2[0].name, e2[0].value, e2[0]] : e2, i2 = this._parsed; + return i2.set(t2, function(e3 = { name: "", value: "" }) { + return "number" == typeof e3.expires && (e3.expires = new Date(e3.expires)), e3.maxAge && (e3.expires = new Date(Date.now() + 1e3 * e3.maxAge)), (null === e3.path || void 0 === e3.path) && (e3.path = "/"), e3; + }({ name: t2, value: r2, ...n2 })), function(e3, t3) { + for (let [, r3] of (t3.delete("set-cookie"), e3)) { + let e4 = a(r3); + t3.append("set-cookie", e4); + } + }(i2, this._headers), this; + } + delete(...e2) { + let [t2, r2, n2] = "string" == typeof e2[0] ? [e2[0]] : [e2[0].name, e2[0].path, e2[0].domain]; + return this.set({ name: t2, path: r2, domain: n2, value: "", expires: /* @__PURE__ */ new Date(0) }); + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`; + } + toString() { + return [...this._parsed.values()].map(a).join("; "); + } + }; + }; + __namedExportsObject5["__chunk_55535"] = (e, t, r) => { + "use strict"; + r.d(t, { Z: () => n }); + let n = (0, r(7264).Z)("Menu", [["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }], ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }], ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]]); + }; + __namedExportsObject5["__chunk_7264"] = (e, t, r) => { + "use strict"; + r.d(t, { Z: () => l }); + var n = r(23034); + let i = (e2) => e2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), s = (...e2) => e2.filter((e3, t2, r2) => !!e3 && r2.indexOf(e3) === t2).join(" "); + var a = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }; + let o = (0, n.forwardRef)(({ color: e2 = "currentColor", size: t2 = 24, strokeWidth: r2 = 2, absoluteStrokeWidth: i2, className: o2 = "", children: l2, iconNode: c, ...u }, d) => (0, n.createElement)("svg", { ref: d, ...a, width: t2, height: t2, stroke: e2, strokeWidth: i2 ? 24 * Number(r2) / Number(t2) : r2, className: s("lucide", o2), ...u }, [...c.map(([e3, t3]) => (0, n.createElement)(e3, t3)), ...Array.isArray(l2) ? l2 : [l2]])), l = (e2, t2) => { + let r2 = (0, n.forwardRef)(({ className: r3, ...a2 }, l2) => (0, n.createElement)(o, { ref: l2, iconNode: t2, className: s(`lucide-${i(e2)}`, r3), ...a2 })); + return r2.displayName = `${e2}`, r2; + }; + }; + __namedExportsObject5["__chunk_66913"] = (e, t, r) => { + "use strict"; + var n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e2, t2) => { + for (var r2 in t2) + n(e2, r2, { get: t2[r2], enumerable: true }); + }, l = {}; + o(l, { Analytics: () => u, IpDenyList: () => w, MultiRegionRatelimit: () => M, Ratelimit: () => $ }), e.exports = ((e2, t2, r2, o2) => { + if (t2 && "object" == typeof t2 || "function" == typeof t2) + for (let l2 of s(t2)) + a.call(e2, l2) || l2 === r2 || n(e2, l2, { get: () => t2[l2], enumerable: !(o2 = i(t2, l2)) || o2.enumerable }); + return e2; + })(n({}, "__esModule", { value: true }), l); + var c = r(98316), u = class { + analytics; + table = "events"; + constructor(e2) { + this.analytics = new c.Analytics({ redis: e2.redis, window: "1h", prefix: e2.prefix ?? "@upstash/ratelimit", retention: "90d" }); + } + extractGeo(e2) { + return void 0 !== e2.geo ? e2.geo : void 0 !== e2.cf ? e2.cf : {}; + } + async record(e2) { + await this.analytics.ingest(this.table, e2); + } + async series(e2, t2) { + let r2 = Math.min((this.analytics.getBucket(Date.now()) - this.analytics.getBucket(t2)) / 36e5, 256); + return this.analytics.aggregateBucketsWithPipeline(this.table, e2, r2); + } + async getUsage(e2 = 0) { + let t2 = Math.min((this.analytics.getBucket(Date.now()) - this.analytics.getBucket(e2)) / 36e5, 256); + return await this.analytics.getAllowedBlocked(this.table, t2); + } + async getUsageOverTime(e2, t2) { + return await this.analytics.aggregateBucketsWithPipeline(this.table, t2, e2); + } + async getMostAllowedBlocked(e2, t2, r2) { + return t2 = t2 ?? 5, this.analytics.getMostAllowedBlocked(this.table, e2, t2, void 0, r2); + } + }, d = class { + cache; + constructor(e2) { + this.cache = e2; + } + isBlocked(e2) { + if (!this.cache.has(e2)) + return { blocked: false, reset: 0 }; + let t2 = this.cache.get(e2); + return t2 < Date.now() ? (this.cache.delete(e2), { blocked: false, reset: 0 }) : { blocked: true, reset: t2 }; + } + blockUntil(e2, t2) { + this.cache.set(e2, t2); + } + set(e2, t2) { + this.cache.set(e2, t2); + } + get(e2) { + return this.cache.get(e2) || null; + } + incr(e2) { + let t2 = this.cache.get(e2) ?? 0; + return t2 += 1, this.cache.set(e2, t2), t2; + } + pop(e2) { + this.cache.delete(e2); + } + empty() { + this.cache.clear(); + } + size() { + return this.cache.size; + } + }; + function h(e2) { + let t2 = e2.match(/^(\d+)\s?(ms|s|m|h|d)$/); + if (!t2) + throw Error(`Unable to parse window size: ${e2}`); + let r2 = Number.parseInt(t2[1]); + switch (t2[2]) { + case "ms": + return r2; + case "s": + return 1e3 * r2; + case "m": + return 6e4 * r2; + case "h": + return 36e5 * r2; + case "d": + return 864e5 * r2; + default: + throw Error(`Unable to parse window size: ${e2}`); + } + } + var f = async (e2, t2, r2, n2) => { + try { + return await e2.redis.evalsha(t2.hash, r2, n2); + } catch (i2) { + if (`${i2}`.includes("NOSCRIPT")) { + let i3 = await e2.redis.scriptLoad(t2.script); + return i3 !== t2.hash && console.warn("Upstash Ratelimit: Expected hash and the hash received from Redis are different. Ratelimit will work as usual but performance will be reduced."), await e2.redis.evalsha(i3, r2, n2); + } + throw i2; + } + }, p = { singleRegion: { fixedWindow: { limit: { script: ` + local key = KEYS[1] + local window = ARGV[1] + local incrementBy = ARGV[2] -- increment rate per request at a given value, default is 1 + + local r = redis.call("INCRBY", key, incrementBy) + if r == tonumber(incrementBy) then + -- The first time this key is set, the value will be equal to incrementBy. + -- So we only need the expire command once + redis.call("PEXPIRE", key, window) + end + + return r +`, hash: "b13943e359636db027ad280f1def143f02158c13" }, getRemaining: { script: ` + local key = KEYS[1] + local tokens = 0 + + local value = redis.call('GET', key) + if value then + tokens = value + end + return tokens + `, hash: "8c4c341934502aee132643ffbe58ead3450e5208" } }, slidingWindow: { limit: { script: ` + local currentKey = KEYS[1] -- identifier including prefixes + local previousKey = KEYS[2] -- key of the previous bucket + local tokens = tonumber(ARGV[1]) -- tokens per window + local now = ARGV[2] -- current timestamp in milliseconds + local window = ARGV[3] -- interval in milliseconds + local incrementBy = ARGV[4] -- increment rate per request at a given value, default is 1 + + local requestsInCurrentWindow = redis.call("GET", currentKey) + if requestsInCurrentWindow == false then + requestsInCurrentWindow = 0 + end + + local requestsInPreviousWindow = redis.call("GET", previousKey) + if requestsInPreviousWindow == false then + requestsInPreviousWindow = 0 + end + local percentageInCurrent = ( now % window ) / window + -- weighted requests to consider from the previous window + requestsInPreviousWindow = math.floor(( 1 - percentageInCurrent ) * requestsInPreviousWindow) + if requestsInPreviousWindow + requestsInCurrentWindow >= tokens then + return -1 + end + + local newValue = redis.call("INCRBY", currentKey, incrementBy) + if newValue == tonumber(incrementBy) then + -- The first time this key is set, the value will be equal to incrementBy. + -- So we only need the expire command once + redis.call("PEXPIRE", currentKey, window * 2 + 1000) -- Enough time to overlap with a new window + 1 second + end + return tokens - ( newValue + requestsInPreviousWindow ) +`, hash: "e1391e429b699c780eb0480350cd5b7280fd9213" }, getRemaining: { script: ` + local currentKey = KEYS[1] -- identifier including prefixes + local previousKey = KEYS[2] -- key of the previous bucket + local now = ARGV[1] -- current timestamp in milliseconds + local window = ARGV[2] -- interval in milliseconds + + local requestsInCurrentWindow = redis.call("GET", currentKey) + if requestsInCurrentWindow == false then + requestsInCurrentWindow = 0 + end + + local requestsInPreviousWindow = redis.call("GET", previousKey) + if requestsInPreviousWindow == false then + requestsInPreviousWindow = 0 + end + + local percentageInCurrent = ( now % window ) / window + -- weighted requests to consider from the previous window + requestsInPreviousWindow = math.floor(( 1 - percentageInCurrent ) * requestsInPreviousWindow) + + return requestsInPreviousWindow + requestsInCurrentWindow +`, hash: "65a73ac5a05bf9712903bc304b77268980c1c417" } }, tokenBucket: { limit: { script: ` + local key = KEYS[1] -- identifier including prefixes + local maxTokens = tonumber(ARGV[1]) -- maximum number of tokens + local interval = tonumber(ARGV[2]) -- size of the window in milliseconds + local refillRate = tonumber(ARGV[3]) -- how many tokens are refilled after each interval + local now = tonumber(ARGV[4]) -- current timestamp in milliseconds + local incrementBy = tonumber(ARGV[5]) -- how many tokens to consume, default is 1 + + local bucket = redis.call("HMGET", key, "refilledAt", "tokens") + + local refilledAt + local tokens + + if bucket[1] == false then + refilledAt = now + tokens = maxTokens + else + refilledAt = tonumber(bucket[1]) + tokens = tonumber(bucket[2]) + end + + if now >= refilledAt + interval then + local numRefills = math.floor((now - refilledAt) / interval) + tokens = math.min(maxTokens, tokens + numRefills * refillRate) + + refilledAt = refilledAt + numRefills * interval + end + + if tokens == 0 then + return {-1, refilledAt + interval} + end + + local remaining = tokens - incrementBy + local expireAt = math.ceil(((maxTokens - remaining) / refillRate)) * interval + + redis.call("HSET", key, "refilledAt", refilledAt, "tokens", remaining) + redis.call("PEXPIRE", key, expireAt) + return {remaining, refilledAt + interval} +`, hash: "5bece90aeef8189a8cfd28995b479529e270b3c6" }, getRemaining: { script: ` + local key = KEYS[1] + local maxTokens = tonumber(ARGV[1]) + + local bucket = redis.call("HMGET", key, "refilledAt", "tokens") + + if bucket[1] == false then + return {maxTokens, -1} + end + + return {tonumber(bucket[2]), tonumber(bucket[1])} +`, hash: "a15be2bb1db2a15f7c82db06146f9d08983900d0" } }, cachedFixedWindow: { limit: { script: ` + local key = KEYS[1] + local window = ARGV[1] + local incrementBy = ARGV[2] -- increment rate per request at a given value, default is 1 + + local r = redis.call("INCRBY", key, incrementBy) + if r == incrementBy then + -- The first time this key is set, the value will be equal to incrementBy. + -- So we only need the expire command once + redis.call("PEXPIRE", key, window) + end + + return r +`, hash: "c26b12703dd137939b9a69a3a9b18e906a2d940f" }, getRemaining: { script: ` + local key = KEYS[1] + local tokens = 0 + + local value = redis.call('GET', key) + if value then + tokens = value + end + return tokens +`, hash: "8e8f222ccae68b595ee6e3f3bf2199629a62b91a" } } }, multiRegion: { fixedWindow: { limit: { script: ` + local key = KEYS[1] + local id = ARGV[1] + local window = ARGV[2] + local incrementBy = tonumber(ARGV[3]) + + redis.call("HSET", key, id, incrementBy) + local fields = redis.call("HGETALL", key) + if #fields == 2 and tonumber(fields[2])==incrementBy then + -- The first time this key is set, and the value will be equal to incrementBy. + -- So we only need the expire command once + redis.call("PEXPIRE", key, window) + end + + return fields +`, hash: "a8c14f3835aa87bd70e5e2116081b81664abcf5c" }, getRemaining: { script: ` + local key = KEYS[1] + local tokens = 0 + + local fields = redis.call("HGETALL", key) + + return fields + `, hash: "8ab8322d0ed5fe5ac8eb08f0c2e4557f1b4816fd" } }, slidingWindow: { limit: { script: ` + local currentKey = KEYS[1] -- identifier including prefixes + local previousKey = KEYS[2] -- key of the previous bucket + local tokens = tonumber(ARGV[1]) -- tokens per window + local now = ARGV[2] -- current timestamp in milliseconds + local window = ARGV[3] -- interval in milliseconds + local requestId = ARGV[4] -- uuid for this request + local incrementBy = tonumber(ARGV[5]) -- custom rate, default is 1 + + local currentFields = redis.call("HGETALL", currentKey) + local requestsInCurrentWindow = 0 + for i = 2, #currentFields, 2 do + requestsInCurrentWindow = requestsInCurrentWindow + tonumber(currentFields[i]) + end + + local previousFields = redis.call("HGETALL", previousKey) + local requestsInPreviousWindow = 0 + for i = 2, #previousFields, 2 do + requestsInPreviousWindow = requestsInPreviousWindow + tonumber(previousFields[i]) + end + + local percentageInCurrent = ( now % window) / window + if requestsInPreviousWindow * (1 - percentageInCurrent ) + requestsInCurrentWindow >= tokens then + return {currentFields, previousFields, false} + end + + redis.call("HSET", currentKey, requestId, incrementBy) + + if requestsInCurrentWindow == 0 then + -- The first time this key is set, the value will be equal to incrementBy. + -- So we only need the expire command once + redis.call("PEXPIRE", currentKey, window * 2 + 1000) -- Enough time to overlap with a new window + 1 second + end + return {currentFields, previousFields, true} +`, hash: "cb4fdc2575056df7c6d422764df0de3a08d6753b" }, getRemaining: { script: ` + local currentKey = KEYS[1] -- identifier including prefixes + local previousKey = KEYS[2] -- key of the previous bucket + local now = ARGV[1] -- current timestamp in milliseconds + local window = ARGV[2] -- interval in milliseconds + + local currentFields = redis.call("HGETALL", currentKey) + local requestsInCurrentWindow = 0 + for i = 2, #currentFields, 2 do + requestsInCurrentWindow = requestsInCurrentWindow + tonumber(currentFields[i]) + end + + local previousFields = redis.call("HGETALL", previousKey) + local requestsInPreviousWindow = 0 + for i = 2, #previousFields, 2 do + requestsInPreviousWindow = requestsInPreviousWindow + tonumber(previousFields[i]) + end + + local percentageInCurrent = ( now % window) / window + requestsInPreviousWindow = math.floor(( 1 - percentageInCurrent ) * requestsInPreviousWindow) + + return requestsInCurrentWindow + requestsInPreviousWindow +`, hash: "558c9306b7ec54abb50747fe0b17e5d44bd24868" } } } }, m = { script: ` + local pattern = KEYS[1] + + -- Initialize cursor to start from 0 + local cursor = "0" + + repeat + -- Scan for keys matching the pattern + local scan_result = redis.call('SCAN', cursor, 'MATCH', pattern) + + -- Extract cursor for the next iteration + cursor = scan_result[1] + + -- Extract keys from the scan result + local keys = scan_result[2] + + for i=1, #keys do + redis.call('DEL', keys[i]) + end + + -- Continue scanning until cursor is 0 (end of keyspace) + until cursor == "0" + `, hash: "54bd274ddc59fb3be0f42deee2f64322a10e2b50" }, g = "denyList", y = "ipDenyList", v = "ipDenyListStatus", b = ` + -- Checks if values provideed in ARGV are present in the deny lists. + -- This is done using the allDenyListsKey below. + + -- Additionally, checks the status of the ip deny list using the + -- ipDenyListStatusKey below. Here are the possible states of the + -- ipDenyListStatusKey key: + -- * status == -1: set to "disabled" with no TTL + -- * status == -2: not set, meaning that is was set before but expired + -- * status > 0: set to "valid", with a TTL + -- + -- In the case of status == -2, we set the status to "pending" with + -- 30 second ttl. During this time, the process which got status == -2 + -- will update the ip deny list. + + local allDenyListsKey = KEYS[1] + local ipDenyListStatusKey = KEYS[2] + + local results = redis.call('SMISMEMBER', allDenyListsKey, unpack(ARGV)) + local status = redis.call('TTL', ipDenyListStatusKey) + if status == -2 then + redis.call('SETEX', ipDenyListStatusKey, 30, "pending") + end + + return { results, status } +`, w = {}; + o(w, { ThresholdError: () => S, disableIpDenyList: () => k, updateIpDenyList: () => E }); + var x = (e2) => 864e5 - ((e2 || Date.now()) - 72e5) % 864e5, S = class extends Error { + constructor(e2) { + super(`Allowed threshold values are from 1 to 8, 1 and 8 included. Received: ${e2}`), this.name = "ThresholdError"; + } + }, _ = async (e2) => { + if ("number" != typeof e2 || e2 < 1 || e2 > 8) + throw new S(e2); + try { + let t2 = await fetch(`https://raw.githubusercontent.com/stamparm/ipsum/master/levels/${e2}.txt`); + if (!t2.ok) + throw Error(`Error fetching data: ${t2.statusText}`); + return (await t2.text()).split("\n").filter((e3) => e3.length > 0); + } catch (e3) { + throw Error(`Failed to fetch ip deny list: ${e3}`); + } + }, E = async (e2, t2, r2, n2) => { + let i2 = await _(r2), s2 = [t2, g, "all"].join(":"), a2 = [t2, g, y].join(":"), o2 = [t2, v].join(":"), l2 = e2.multi(); + return l2.sdiffstore(s2, s2, a2), l2.del(a2), l2.sadd(a2, i2.at(0), ...i2.slice(1)), l2.sdiffstore(a2, a2, s2), l2.sunionstore(s2, s2, a2), l2.set(o2, "valid", { px: n2 ?? x() }), await l2.exec(); + }, k = async (e2, t2) => { + let r2 = [t2, g, "all"].join(":"), n2 = [t2, g, y].join(":"), i2 = [t2, v].join(":"), s2 = e2.multi(); + return s2.sdiffstore(r2, r2, n2), s2.del(n2), s2.set(i2, "disabled"), await s2.exec(); + }, C = new d(/* @__PURE__ */ new Map()), R = (e2) => e2.find((e3) => C.isBlocked(e3).blocked), P = (e2) => { + C.size() > 1e3 && C.empty(), C.blockUntil(e2, Date.now() + 6e4); + }, T = async (e2, t2, r2) => { + let n2; + let [i2, s2] = await e2.eval(b, [[t2, g, "all"].join(":"), [t2, v].join(":")], r2); + return i2.map((e3, t3) => { + e3 && (P(r2[t3]), n2 = r2[t3]); + }), { deniedValue: n2, invalidIpDenyList: -2 === s2 }; + }, A = (e2, t2, [r2, n2], i2) => { + if (n2.deniedValue && (r2.success = false, r2.remaining = 0, r2.reason = "denyList", r2.deniedValue = n2.deniedValue), n2.invalidIpDenyList) { + let n3 = E(e2, t2, i2); + r2.pending = Promise.all([r2.pending, n3]); + } + return r2; + }, O = (e2) => ({ success: false, limit: 0, remaining: 0, reset: 0, pending: Promise.resolve(), reason: "denyList", deniedValue: e2 }), I = class { + limiter; + ctx; + prefix; + timeout; + primaryRedis; + analytics; + enableProtection; + denyListThreshold; + constructor(e2) { + this.ctx = e2.ctx, this.limiter = e2.limiter, this.timeout = e2.timeout ?? 5e3, this.prefix = e2.prefix ?? "@upstash/ratelimit", this.enableProtection = e2.enableProtection ?? false, this.denyListThreshold = e2.denyListThreshold ?? 6, this.primaryRedis = "redis" in this.ctx ? this.ctx.redis : this.ctx.regionContexts[0].redis, this.analytics = e2.analytics ? new u({ redis: this.primaryRedis, prefix: this.prefix }) : void 0, e2.ephemeralCache instanceof Map ? this.ctx.cache = new d(e2.ephemeralCache) : void 0 === e2.ephemeralCache && (this.ctx.cache = new d(/* @__PURE__ */ new Map())); + } + limit = async (e2, t2) => { + let r2 = null; + try { + let n2 = this.getRatelimitResponse(e2, t2), { responseArray: i2, newTimeoutId: s2 } = this.applyTimeout(n2); + r2 = s2; + let a2 = await Promise.race(i2); + return this.submitAnalytics(a2, e2, t2); + } finally { + r2 && clearTimeout(r2); + } + }; + blockUntilReady = async (e2, t2) => { + let r2; + if (t2 <= 0) + throw Error("timeout must be positive"); + let n2 = Date.now() + t2; + for (; !(r2 = await this.limit(e2)).success; ) { + if (0 === r2.reset) + throw Error("This should not happen"); + let e3 = Math.min(r2.reset, n2) - Date.now(); + if (await new Promise((t3) => setTimeout(t3, e3)), Date.now() > n2) + break; + } + return r2; + }; + resetUsedTokens = async (e2) => { + let t2 = [this.prefix, e2].join(":"); + await this.limiter().resetTokens(this.ctx, t2); + }; + getRemaining = async (e2) => { + let t2 = [this.prefix, e2].join(":"); + return await this.limiter().getRemaining(this.ctx, t2); + }; + getRatelimitResponse = async (e2, t2) => { + let r2 = this.getKey(e2), n2 = this.getDefinedMembers(e2, t2), i2 = R(n2), s2 = i2 ? [O(i2), { deniedValue: i2, invalidIpDenyList: false }] : await Promise.all([this.limiter().limit(this.ctx, r2, t2?.rate), this.enableProtection ? T(this.primaryRedis, this.prefix, n2) : { deniedValue: void 0, invalidIpDenyList: false }]); + return A(this.primaryRedis, this.prefix, s2, this.denyListThreshold); + }; + applyTimeout = (e2) => { + let t2 = null, r2 = [e2]; + if (this.timeout > 0) { + let e3 = new Promise((e4) => { + t2 = setTimeout(() => { + e4({ success: true, limit: 0, remaining: 0, reset: 0, pending: Promise.resolve(), reason: "timeout" }); + }, this.timeout); + }); + r2.push(e3); + } + return { responseArray: r2, newTimeoutId: t2 }; + }; + submitAnalytics = (e2, t2, r2) => { + if (this.analytics) + try { + let n2 = r2 ? this.analytics.extractGeo(r2) : void 0, i2 = this.analytics.record({ identifier: "denyList" === e2.reason ? e2.deniedValue : t2, time: Date.now(), success: "denyList" === e2.reason ? "denied" : e2.success, ...n2 }).catch((e3) => { + let t3 = "Failed to record analytics"; + `${e3}`.includes("WRONGTYPE") && (t3 = ` + Failed to record analytics. See the information below: + + This can occur when you uprade to Ratelimit version 1.1.2 + or later from an earlier version. + + This occurs simply because the way we store analytics data + has changed. To avoid getting this error, disable analytics + for *an hour*, then simply enable it back. + + `), console.warn(t3, e3); + }); + e2.pending = Promise.all([e2.pending, i2]); + } catch (e3) { + console.warn("Failed to record analytics", e3); + } + return e2; + }; + getKey = (e2) => [this.prefix, e2].join(":"); + getDefinedMembers = (e2, t2) => [e2, t2?.ip, t2?.userAgent, t2?.country].filter((e3) => !!e3); + }; + function N() { + let e2 = "", t2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", r2 = t2.length; + for (let n2 = 0; n2 < 16; n2++) + e2 += t2.charAt(Math.floor(Math.random() * r2)); + return e2; + } + var M = class extends I { + constructor(e2) { + super({ prefix: e2.prefix, limiter: e2.limiter, timeout: e2.timeout, analytics: e2.analytics, ctx: { regionContexts: e2.redis.map((e3) => ({ redis: e3 })), cache: e2.ephemeralCache ? new d(e2.ephemeralCache) : void 0 } }); + } + static fixedWindow(e2, t2) { + let r2 = h(t2); + return () => ({ async limit(t3, n2, i2) { + if (t3.cache) { + let { blocked: r3, reset: i3 } = t3.cache.isBlocked(n2); + if (r3) + return { success: false, limit: e2, remaining: 0, reset: i3, pending: Promise.resolve(), reason: "cacheBlock" }; + } + let s2 = N(), a2 = Math.floor(Date.now() / r2), o2 = [n2, a2].join(":"), l2 = i2 ? Math.max(1, i2) : 1, c2 = t3.regionContexts.map((e3) => ({ redis: e3.redis, request: f(e3, p.multiRegion.fixedWindow.limit, [o2], [s2, r2, l2]) })), u2 = e2 - (await Promise.any(c2.map((e3) => e3.request))).reduce((e3, t4, r3) => { + let n3 = 0; + return r3 % 2 && (n3 = Number.parseInt(t4)), e3 + n3; + }, 0); + async function d2() { + let t4 = [...new Set((await Promise.all(c2.map((e3) => e3.request))).flat().reduce((e3, t5, r3) => (r3 % 2 == 0 && e3.push(t5), e3), [])).values()]; + for (let r3 of c2) { + let n3 = (await r3.request).reduce((e3, t5, r4) => { + let n4 = 0; + return r4 % 2 && (n4 = Number.parseInt(t5)), e3 + n4; + }, 0), i3 = (await r3.request).reduce((e3, t5, r4) => (r4 % 2 == 0 && e3.push(t5), e3), []); + if (n3 >= e2) + continue; + let s3 = t4.filter((e3) => !i3.includes(e3)); + if (0 !== s3.length) + for (let e3 of s3) + await r3.redis.hset(o2, { [e3]: l2 }); + } + } + let h2 = u2 > 0, m2 = (a2 + 1) * r2; + return t3.cache && !h2 && t3.cache.blockUntil(n2, m2), { success: h2, limit: e2, remaining: u2, reset: m2, pending: d2() }; + }, async getRemaining(t3, n2) { + let i2 = Math.floor(Date.now() / r2), s2 = [n2, i2].join(":"), a2 = t3.regionContexts.map((e3) => ({ redis: e3.redis, request: f(e3, p.multiRegion.fixedWindow.getRemaining, [s2], [null]) })); + return { remaining: Math.max(0, e2 - (await Promise.any(a2.map((e3) => e3.request))).reduce((e3, t4, r3) => { + let n3 = 0; + return r3 % 2 && (n3 = Number.parseInt(t4)), e3 + n3; + }, 0)), reset: (i2 + 1) * r2 }; + }, async resetTokens(e3, t3) { + let r3 = [t3, "*"].join(":"); + e3.cache && e3.cache.pop(t3), await Promise.all(e3.regionContexts.map((e4) => { + f(e4, m, [r3], [null]); + })); + } }); + } + static slidingWindow(e2, t2) { + let r2 = h(t2), n2 = h(t2); + return () => ({ async limit(t3, i2, s2) { + if (t3.cache) { + let { blocked: r3, reset: n3 } = t3.cache.isBlocked(i2); + if (r3) + return { success: false, limit: e2, remaining: 0, reset: n3, pending: Promise.resolve(), reason: "cacheBlock" }; + } + let a2 = N(), o2 = Date.now(), l2 = Math.floor(o2 / r2), c2 = [i2, l2].join(":"), u2 = [i2, l2 - 1].join(":"), d2 = s2 ? Math.max(1, s2) : 1, h2 = t3.regionContexts.map((t4) => ({ redis: t4.redis, request: f(t4, p.multiRegion.slidingWindow.limit, [c2, u2], [e2, o2, n2, a2, d2]) })), m2 = o2 % n2 / n2, [g2, y2, v2] = await Promise.any(h2.map((e3) => e3.request)); + v2 && g2.push(a2, d2.toString()); + let b2 = y2.reduce((e3, t4, r3) => { + let n3 = 0; + return r3 % 2 && (n3 = Number.parseInt(t4)), e3 + n3; + }, 0), w2 = e2 - (Math.ceil(b2 * (1 - m2)) + g2.reduce((e3, t4, r3) => { + let n3 = 0; + return r3 % 2 && (n3 = Number.parseInt(t4)), e3 + n3; + }, 0)); + async function x2() { + let t4 = [...new Set((await Promise.all(h2.map((e3) => e3.request))).flatMap(([e3]) => e3).reduce((e3, t5, r3) => (r3 % 2 == 0 && e3.push(t5), e3), [])).values()]; + for (let r3 of h2) { + let [n3, i3, s3] = await r3.request, a3 = n3.reduce((e3, t5, r4) => (r4 % 2 == 0 && e3.push(t5), e3), []); + if (n3.reduce((e3, t5, r4) => { + let n4 = 0; + return r4 % 2 && (n4 = Number.parseInt(t5)), e3 + n4; + }, 0) >= e2) + continue; + let o3 = t4.filter((e3) => !a3.includes(e3)); + if (0 !== o3.length) + for (let e3 of o3) + await r3.redis.hset(c2, { [e3]: d2 }); + } + } + let S2 = (l2 + 1) * n2; + return t3.cache && !v2 && t3.cache.blockUntil(i2, S2), { success: !!v2, limit: e2, remaining: Math.max(0, w2), reset: S2, pending: x2() }; + }, async getRemaining(t3, n3) { + let i2 = Date.now(), s2 = Math.floor(i2 / r2), a2 = [n3, s2].join(":"), o2 = [n3, s2 - 1].join(":"), l2 = t3.regionContexts.map((e3) => ({ redis: e3.redis, request: f(e3, p.multiRegion.slidingWindow.getRemaining, [a2, o2], [i2, r2]) })); + return { remaining: Math.max(0, e2 - await Promise.any(l2.map((e3) => e3.request))), reset: (s2 + 1) * r2 }; + }, async resetTokens(e3, t3) { + let r3 = [t3, "*"].join(":"); + e3.cache && e3.cache.pop(t3), await Promise.all(e3.regionContexts.map((e4) => { + f(e4, m, [r3], [null]); + })); + } }); + } + }, $ = class extends I { + constructor(e2) { + super({ prefix: e2.prefix, limiter: e2.limiter, timeout: e2.timeout, analytics: e2.analytics, ctx: { redis: e2.redis }, ephemeralCache: e2.ephemeralCache, enableProtection: e2.enableProtection, denyListThreshold: e2.denyListThreshold }); + } + static fixedWindow(e2, t2) { + let r2 = h(t2); + return () => ({ async limit(t3, n2, i2) { + let s2 = Math.floor(Date.now() / r2), a2 = [n2, s2].join(":"); + if (t3.cache) { + let { blocked: r3, reset: i3 } = t3.cache.isBlocked(n2); + if (r3) + return { success: false, limit: e2, remaining: 0, reset: i3, pending: Promise.resolve(), reason: "cacheBlock" }; + } + let o2 = i2 ? Math.max(1, i2) : 1, l2 = await f(t3, p.singleRegion.fixedWindow.limit, [a2], [r2, o2]), c2 = l2 <= e2, u2 = Math.max(0, e2 - l2), d2 = (s2 + 1) * r2; + return t3.cache && !c2 && t3.cache.blockUntil(n2, d2), { success: c2, limit: e2, remaining: u2, reset: d2, pending: Promise.resolve() }; + }, async getRemaining(t3, n2) { + let i2 = Math.floor(Date.now() / r2), s2 = [n2, i2].join(":"); + return { remaining: Math.max(0, e2 - await f(t3, p.singleRegion.fixedWindow.getRemaining, [s2], [null])), reset: (i2 + 1) * r2 }; + }, async resetTokens(e3, t3) { + let r3 = [t3, "*"].join(":"); + e3.cache && e3.cache.pop(t3), await f(e3, m, [r3], [null]); + } }); + } + static slidingWindow(e2, t2) { + let r2 = h(t2); + return () => ({ async limit(t3, n2, i2) { + let s2 = Date.now(), a2 = Math.floor(s2 / r2), o2 = [n2, a2].join(":"), l2 = [n2, a2 - 1].join(":"); + if (t3.cache) { + let { blocked: r3, reset: i3 } = t3.cache.isBlocked(n2); + if (r3) + return { success: false, limit: e2, remaining: 0, reset: i3, pending: Promise.resolve(), reason: "cacheBlock" }; + } + let c2 = i2 ? Math.max(1, i2) : 1, u2 = await f(t3, p.singleRegion.slidingWindow.limit, [o2, l2], [e2, s2, r2, c2]), d2 = u2 >= 0, h2 = (a2 + 1) * r2; + return t3.cache && !d2 && t3.cache.blockUntil(n2, h2), { success: d2, limit: e2, remaining: Math.max(0, u2), reset: h2, pending: Promise.resolve() }; + }, async getRemaining(t3, n2) { + let i2 = Date.now(), s2 = Math.floor(i2 / r2), a2 = [n2, s2].join(":"), o2 = [n2, s2 - 1].join(":"); + return { remaining: Math.max(0, e2 - await f(t3, p.singleRegion.slidingWindow.getRemaining, [a2, o2], [i2, r2])), reset: (s2 + 1) * r2 }; + }, async resetTokens(e3, t3) { + let r3 = [t3, "*"].join(":"); + e3.cache && e3.cache.pop(t3), await f(e3, m, [r3], [null]); + } }); + } + static tokenBucket(e2, t2, r2) { + let n2 = h(t2); + return () => ({ async limit(t3, i2, s2) { + if (t3.cache) { + let { blocked: e3, reset: n3 } = t3.cache.isBlocked(i2); + if (e3) + return { success: false, limit: r2, remaining: 0, reset: n3, pending: Promise.resolve(), reason: "cacheBlock" }; + } + let a2 = Date.now(), o2 = s2 ? Math.max(1, s2) : 1, [l2, c2] = await f(t3, p.singleRegion.tokenBucket.limit, [i2], [r2, n2, e2, a2, o2]), u2 = l2 >= 0; + return t3.cache && !u2 && t3.cache.blockUntil(i2, c2), { success: u2, limit: r2, remaining: l2, reset: c2, pending: Promise.resolve() }; + }, async getRemaining(e3, t3) { + let [i2, s2] = await f(e3, p.singleRegion.tokenBucket.getRemaining, [t3], [r2]), a2 = Date.now() + n2, o2 = s2 + n2; + return { remaining: i2, reset: -1 === s2 ? a2 : o2 }; + }, async resetTokens(e3, t3) { + e3.cache && e3.cache.pop(t3), await f(e3, m, [t3], [null]); + } }); + } + static cachedFixedWindow(e2, t2) { + let r2 = h(t2); + return () => ({ async limit(t3, n2, i2) { + if (!t3.cache) + throw Error("This algorithm requires a cache"); + let s2 = Math.floor(Date.now() / r2), a2 = [n2, s2].join(":"), o2 = (s2 + 1) * r2, l2 = i2 ? Math.max(1, i2) : 1; + if ("number" == typeof t3.cache.get(a2)) { + let n3 = t3.cache.incr(a2), i3 = n3 < e2, s3 = i3 ? f(t3, p.singleRegion.cachedFixedWindow.limit, [a2], [r2, l2]) : Promise.resolve(); + return { success: i3, limit: e2, remaining: e2 - n3, reset: o2, pending: s3 }; + } + let c2 = await f(t3, p.singleRegion.cachedFixedWindow.limit, [a2], [r2, l2]); + t3.cache.set(a2, c2); + let u2 = e2 - c2; + return { success: u2 >= 0, limit: e2, remaining: u2, reset: o2, pending: Promise.resolve() }; + }, async getRemaining(t3, n2) { + if (!t3.cache) + throw Error("This algorithm requires a cache"); + let i2 = Math.floor(Date.now() / r2), s2 = [n2, i2].join(":"); + return "number" == typeof t3.cache.get(s2) ? { remaining: Math.max(0, e2 - (t3.cache.get(s2) ?? 0)), reset: (i2 + 1) * r2 } : { remaining: Math.max(0, e2 - await f(t3, p.singleRegion.cachedFixedWindow.getRemaining, [s2], [null])), reset: (i2 + 1) * r2 }; + }, async resetTokens(e3, t3) { + if (!e3.cache) + throw Error("This algorithm requires a cache"); + let n2 = [t3, Math.floor(Date.now() / r2)].join(":"); + e3.cache.pop(n2); + let i2 = [t3, "*"].join(":"); + await f(e3, m, [i2], [null]); + } }); + } + }; + }; + __namedExportsObject5["__chunk_98316"] = (e) => { + "use strict"; + var t = Object.defineProperty, r = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, i = Object.prototype.hasOwnProperty, s = {}; + ((e2, r2) => { + for (var n2 in r2) + t(e2, n2, { get: r2[n2], enumerable: true }); + })(s, { Analytics: () => c }), e.exports = ((e2, s2, a2, o2) => { + if (s2 && "object" == typeof s2 || "function" == typeof s2) + for (let l2 of n(s2)) + i.call(e2, l2) || l2 === a2 || t(e2, l2, { get: () => s2[l2], enumerable: !(o2 = r(s2, l2)) || o2.enumerable }); + return e2; + })(t({}, "__esModule", { value: true }), s); + var a = ` +local key = KEYS[1] +local field = ARGV[1] + +local data = redis.call("ZRANGE", key, 0, -1, "WITHSCORES") +local count = {} + +for i = 1, #data, 2 do + local json_str = data[i] + local score = tonumber(data[i + 1]) + local obj = cjson.decode(json_str) + + local fieldValue = obj[field] + + if count[fieldValue] == nil then + count[fieldValue] = score + else + count[fieldValue] = count[fieldValue] + score + end +end + +local result = {} +for k, v in pairs(count) do + table.insert(result, {k, v}) +end + +return result +`, o = ` +local prefix = KEYS[1] +local first_timestamp = tonumber(ARGV[1]) -- First timestamp to check +local increment = tonumber(ARGV[2]) -- Increment between each timestamp +local num_timestamps = tonumber(ARGV[3]) -- Number of timestampts to check (24 for a day and 24 * 7 for a week) +local num_elements = tonumber(ARGV[4]) -- Number of elements to fetch in each category +local check_at_most = tonumber(ARGV[5]) -- Number of elements to check at most. + +local keys = {} +for i = 1, num_timestamps do + local timestamp = first_timestamp - (i - 1) * increment + table.insert(keys, prefix .. ":" .. timestamp) +end + +-- get the union of the groups +local zunion_params = {"ZUNION", num_timestamps, unpack(keys)} +table.insert(zunion_params, "WITHSCORES") +local result = redis.call(unpack(zunion_params)) + +-- select num_elements many items +local true_group = {} +local false_group = {} +local denied_group = {} +local true_count = 0 +local false_count = 0 +local denied_count = 0 +local i = #result - 1 + +-- index to stop at after going through "checkAtMost" many items: +local cutoff_index = #result - 2 * check_at_most + +-- iterate over the results +while (true_count + false_count + denied_count) < (num_elements * 3) and 1 <= i and i >= cutoff_index do + local score = tonumber(result[i + 1]) + if score > 0 then + local element = result[i] + if string.find(element, "success\\":true") and true_count < num_elements then + table.insert(true_group, {score, element}) + true_count = true_count + 1 + elseif string.find(element, "success\\":false") and false_count < num_elements then + table.insert(false_group, {score, element}) + false_count = false_count + 1 + elseif string.find(element, "success\\":\\"denied") and denied_count < num_elements then + table.insert(denied_group, {score, element}) + denied_count = denied_count + 1 + end + end + i = i - 2 +end + +return {true_group, false_group, denied_group} +`, l = ` +local prefix = KEYS[1] +local first_timestamp = tonumber(ARGV[1]) +local increment = tonumber(ARGV[2]) +local num_timestamps = tonumber(ARGV[3]) + +local keys = {} +for i = 1, num_timestamps do + local timestamp = first_timestamp - (i - 1) * increment + table.insert(keys, prefix .. ":" .. timestamp) +end + +-- get the union of the groups +local zunion_params = {"ZUNION", num_timestamps, unpack(keys)} +table.insert(zunion_params, "WITHSCORES") +local result = redis.call(unpack(zunion_params)) + +return result +`, c = class { + redis; + prefix; + bucketSize; + constructor(e2) { + this.redis = e2.redis, this.prefix = e2.prefix ?? "@upstash/analytics", this.bucketSize = this.parseWindow(e2.window); + } + validateTableName(e2) { + if (!/^[a-zA-Z0-9_-]+$/.test(e2)) + throw Error(`Invalid table name: ${e2}. Table names can only contain letters, numbers, dashes and underscores.`); + } + parseWindow(e2) { + if ("number" == typeof e2) { + if (e2 <= 0) + throw Error(`Invalid window: ${e2}`); + return e2; + } + let t2 = /^(\d+)([smhd])$/; + if (!t2.test(e2)) + throw Error(`Invalid window: ${e2}`); + let [, r2, n2] = e2.match(t2), i2 = parseInt(r2); + switch (n2) { + case "s": + return 1e3 * i2; + case "m": + return 6e4 * i2; + case "h": + return 36e5 * i2; + case "d": + return 864e5 * i2; + default: + throw Error(`Invalid window unit: ${n2}`); + } + } + getBucket(e2) { + return Math.floor((e2 ?? Date.now()) / this.bucketSize) * this.bucketSize; + } + async ingest(e2, ...t2) { + this.validateTableName(e2), await Promise.all(t2.map(async (t3) => { + let r2 = this.getBucket(t3.time), n2 = [this.prefix, e2, r2].join(":"); + await this.redis.zincrby(n2, 1, JSON.stringify({ ...t3, time: void 0 })); + })); + } + formatBucketAggregate(e2, t2, r2) { + let n2 = {}; + return e2.forEach(([e3, r3]) => { + "success" == t2 && (e3 = 1 === e3 ? "true" : null === e3 ? "false" : e3), n2[t2] = n2[t2] || {}, n2[t2][(e3 ?? "null").toString()] = r3; + }), { time: r2, ...n2 }; + } + async aggregateBucket(e2, t2, r2) { + this.validateTableName(e2); + let n2 = this.getBucket(r2), i2 = [this.prefix, e2, n2].join(":"), s2 = await this.redis.eval(a, [i2], [t2]); + return this.formatBucketAggregate(s2, t2, n2); + } + async aggregateBuckets(e2, t2, r2, n2) { + this.validateTableName(e2); + let i2 = this.getBucket(n2), s2 = []; + for (let n3 = 0; n3 < r2; n3 += 1) + s2.push(this.aggregateBucket(e2, t2, i2)), i2 -= this.bucketSize; + return Promise.all(s2); + } + async aggregateBucketsWithPipeline(e2, t2, r2, n2, i2) { + this.validateTableName(e2), i2 = i2 ?? 48; + let s2 = this.getBucket(n2), o2 = [], l2 = this.redis.pipeline(), c2 = []; + for (let n3 = 1; n3 <= r2; n3 += 1) { + let u = [this.prefix, e2, s2].join(":"); + l2.eval(a, [u], [t2]), o2.push(s2), s2 -= this.bucketSize, (n3 % i2 == 0 || n3 == r2) && (c2.push(l2.exec()), l2 = this.redis.pipeline()); + } + return (await Promise.all(c2)).flat().map((e3, r3) => this.formatBucketAggregate(e3, t2, o2[r3])); + } + async getAllowedBlocked(e2, t2, r2) { + this.validateTableName(e2); + let n2 = [this.prefix, e2].join(":"), i2 = this.getBucket(r2), s2 = await this.redis.eval(l, [n2], [i2, this.bucketSize, t2]), a2 = {}; + for (let e3 = 0; e3 < s2.length; e3 += 2) { + let t3 = s2[e3], r3 = t3.identifier, n3 = +s2[e3 + 1]; + a2[r3] || (a2[r3] = { success: 0, blocked: 0 }), a2[r3][t3.success ? "success" : "blocked"] = n3; + } + return a2; + } + async getMostAllowedBlocked(e2, t2, r2, n2, i2) { + this.validateTableName(e2); + let s2 = [this.prefix, e2].join(":"), a2 = this.getBucket(n2), [l2, c2, u] = await this.redis.eval(o, [s2], [a2, this.bucketSize, t2, r2, i2 ?? 5 * r2]); + return { allowed: this.toDicts(l2), ratelimited: this.toDicts(c2), denied: this.toDicts(u) }; + } + toDicts(e2) { + let t2 = []; + for (let r2 = 0; r2 < e2.length; r2 += 1) { + let n2 = +e2[r2][0], i2 = e2[r2][1]; + t2.push({ identifier: i2.identifier, count: n2 }); + } + return t2; + } + }; + }; + __namedExportsObject5["__chunk_42803"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { DiagConsoleLogger: () => M, DiagLogLevel: () => n, INVALID_SPANID: () => ed, INVALID_SPAN_CONTEXT: () => ef, INVALID_TRACEID: () => eh, ProxyTracer: () => eO, ProxyTracerProvider: () => eN, ROOT_CONTEXT: () => I, SamplingDecision: () => a, SpanKind: () => o, SpanStatusCode: () => l, TraceFlags: () => s, ValueType: () => i, baggageEntryMetadataFromString: () => A, context: () => eB, createContextKey: () => O, createNoopMeter: () => ee, createTraceState: () => eF, default: () => e2, defaultTextMapGetter: () => et, defaultTextMapSetter: () => er, diag: () => eU, isSpanContextValid: () => eC, isValidSpanId: () => ek, isValidTraceId: () => eE, metrics: () => eH, propagation: () => eX, trace: () => e1 }); + var n, i, s, a, o, l, c = "object" == typeof globalThis2 ? globalThis2 : "object" == typeof self ? self : "object" == typeof window ? window : "object" == typeof r.g ? r.g : {}, u = "1.9.0", d = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/, h = function(e3) { + var t2 = /* @__PURE__ */ new Set([e3]), r2 = /* @__PURE__ */ new Set(), n2 = e3.match(d); + if (!n2) + return function() { + return false; + }; + var i2 = { major: +n2[1], minor: +n2[2], patch: +n2[3], prerelease: n2[4] }; + if (null != i2.prerelease) + return function(t3) { + return t3 === e3; + }; + function s2(e4) { + return r2.add(e4), false; + } + return function(e4) { + if (t2.has(e4)) + return true; + if (r2.has(e4)) + return false; + var n3 = e4.match(d); + if (!n3) + return s2(e4); + var a2 = { major: +n3[1], minor: +n3[2], patch: +n3[3], prerelease: n3[4] }; + return null != a2.prerelease || i2.major !== a2.major ? s2(e4) : 0 === i2.major ? i2.minor === a2.minor && i2.patch <= a2.patch ? (t2.add(e4), true) : s2(e4) : i2.minor <= a2.minor ? (t2.add(e4), true) : s2(e4); + }; + }(u), f = Symbol.for("opentelemetry.js.api." + u.split(".")[0]); + function p(e3, t2, r2, n2) { + void 0 === n2 && (n2 = false); + var i2, s2 = c[f] = null !== (i2 = c[f]) && void 0 !== i2 ? i2 : { version: u }; + if (!n2 && s2[e3]) { + var a2 = Error("@opentelemetry/api: Attempted duplicate registration of API: " + e3); + return r2.error(a2.stack || a2.message), false; + } + if (s2.version !== u) { + var a2 = Error("@opentelemetry/api: Registration of version v" + s2.version + " for " + e3 + " does not match previously registered API v" + u); + return r2.error(a2.stack || a2.message), false; + } + return s2[e3] = t2, r2.debug("@opentelemetry/api: Registered a global for " + e3 + " v" + u + "."), true; + } + function m(e3) { + var t2, r2, n2 = null === (t2 = c[f]) || void 0 === t2 ? void 0 : t2.version; + if (n2 && h(n2)) + return null === (r2 = c[f]) || void 0 === r2 ? void 0 : r2[e3]; + } + function g(e3, t2) { + t2.debug("@opentelemetry/api: Unregistering a global for " + e3 + " v" + u + "."); + var r2 = c[f]; + r2 && delete r2[e3]; + } + var y = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, i2, s2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = s2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + i2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = s2.return) && r2.call(s2); + } finally { + if (i2) + throw i2.error; + } + } + return a2; + }, v = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, i2 = 0, s2 = t2.length; i2 < s2; i2++) + !n2 && i2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, i2)), n2[i2] = t2[i2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, b = function() { + function e3(e4) { + this._namespace = e4.namespace || "DiagComponentLogger"; + } + return e3.prototype.debug = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return w("debug", this._namespace, e4); + }, e3.prototype.error = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return w("error", this._namespace, e4); + }, e3.prototype.info = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return w("info", this._namespace, e4); + }, e3.prototype.warn = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return w("warn", this._namespace, e4); + }, e3.prototype.verbose = function() { + for (var e4 = [], t2 = 0; t2 < arguments.length; t2++) + e4[t2] = arguments[t2]; + return w("verbose", this._namespace, e4); + }, e3; + }(); + function w(e3, t2, r2) { + var n2 = m("diag"); + if (n2) + return r2.unshift(t2), n2[e3].apply(n2, v([], y(r2), false)); + } + !function(e3) { + e3[e3.NONE = 0] = "NONE", e3[e3.ERROR = 30] = "ERROR", e3[e3.WARN = 50] = "WARN", e3[e3.INFO = 60] = "INFO", e3[e3.DEBUG = 70] = "DEBUG", e3[e3.VERBOSE = 80] = "VERBOSE", e3[e3.ALL = 9999] = "ALL"; + }(n || (n = {})); + var x = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, i2, s2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = s2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + i2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = s2.return) && r2.call(s2); + } finally { + if (i2) + throw i2.error; + } + } + return a2; + }, S = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, i2 = 0, s2 = t2.length; i2 < s2; i2++) + !n2 && i2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, i2)), n2[i2] = t2[i2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, _ = function() { + function e3() { + function e4(e5) { + return function() { + for (var t3 = [], r2 = 0; r2 < arguments.length; r2++) + t3[r2] = arguments[r2]; + var n2 = m("diag"); + if (n2) + return n2[e5].apply(n2, S([], x(t3), false)); + }; + } + var t2 = this; + t2.setLogger = function(e5, r2) { + if (void 0 === r2 && (r2 = { logLevel: n.INFO }), e5 === t2) { + var i2, s2, a2, o2 = Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); + return t2.error(null !== (i2 = o2.stack) && void 0 !== i2 ? i2 : o2.message), false; + } + "number" == typeof r2 && (r2 = { logLevel: r2 }); + var l2 = m("diag"), c2 = function(e6, t3) { + function r3(r4, n2) { + var i3 = t3[r4]; + return "function" == typeof i3 && e6 >= n2 ? i3.bind(t3) : function() { + }; + } + return e6 < n.NONE ? e6 = n.NONE : e6 > n.ALL && (e6 = n.ALL), t3 = t3 || {}, { error: r3("error", n.ERROR), warn: r3("warn", n.WARN), info: r3("info", n.INFO), debug: r3("debug", n.DEBUG), verbose: r3("verbose", n.VERBOSE) }; + }(null !== (s2 = r2.logLevel) && void 0 !== s2 ? s2 : n.INFO, e5); + if (l2 && !r2.suppressOverrideMessage) { + var u2 = null !== (a2 = Error().stack) && void 0 !== a2 ? a2 : ""; + l2.warn("Current logger will be overwritten from " + u2), c2.warn("Current logger will overwrite one already registered from " + u2); + } + return p("diag", c2, t2, true); + }, t2.disable = function() { + g("diag", t2); + }, t2.createComponentLogger = function(e5) { + return new b(e5); + }, t2.verbose = e4("verbose"), t2.debug = e4("debug"), t2.info = e4("info"), t2.warn = e4("warn"), t2.error = e4("error"); + } + return e3.instance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3; + }(), E = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, i2, s2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = s2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + i2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = s2.return) && r2.call(s2); + } finally { + if (i2) + throw i2.error; + } + } + return a2; + }, k = function(e3) { + var t2 = "function" == typeof Symbol && Symbol.iterator, r2 = t2 && e3[t2], n2 = 0; + if (r2) + return r2.call(e3); + if (e3 && "number" == typeof e3.length) + return { next: function() { + return e3 && n2 >= e3.length && (e3 = void 0), { value: e3 && e3[n2++], done: !e3 }; + } }; + throw TypeError(t2 ? "Object is not iterable." : "Symbol.iterator is not defined."); + }, C = function() { + function e3(e4) { + this._entries = e4 ? new Map(e4) : /* @__PURE__ */ new Map(); + } + return e3.prototype.getEntry = function(e4) { + var t2 = this._entries.get(e4); + if (t2) + return Object.assign({}, t2); + }, e3.prototype.getAllEntries = function() { + return Array.from(this._entries.entries()).map(function(e4) { + var t2 = E(e4, 2); + return [t2[0], t2[1]]; + }); + }, e3.prototype.setEntry = function(t2, r2) { + var n2 = new e3(this._entries); + return n2._entries.set(t2, r2), n2; + }, e3.prototype.removeEntry = function(t2) { + var r2 = new e3(this._entries); + return r2._entries.delete(t2), r2; + }, e3.prototype.removeEntries = function() { + for (var t2, r2, n2 = [], i2 = 0; i2 < arguments.length; i2++) + n2[i2] = arguments[i2]; + var s2 = new e3(this._entries); + try { + for (var a2 = k(n2), o2 = a2.next(); !o2.done; o2 = a2.next()) { + var l2 = o2.value; + s2._entries.delete(l2); + } + } catch (e4) { + t2 = { error: e4 }; + } finally { + try { + o2 && !o2.done && (r2 = a2.return) && r2.call(a2); + } finally { + if (t2) + throw t2.error; + } + } + return s2; + }, e3.prototype.clear = function() { + return new e3(); + }, e3; + }(), R = Symbol("BaggageEntryMetadata"), P = _.instance(); + function T(e3) { + return void 0 === e3 && (e3 = {}), new C(new Map(Object.entries(e3))); + } + function A(e3) { + return "string" != typeof e3 && (P.error("Cannot create baggage metadata from unknown type: " + typeof e3), e3 = ""), { __TYPE__: R, toString: function() { + return e3; + } }; + } + function O(e3) { + return Symbol.for(e3); + } + var I = new function e3(t2) { + var r2 = this; + r2._currentContext = t2 ? new Map(t2) : /* @__PURE__ */ new Map(), r2.getValue = function(e4) { + return r2._currentContext.get(e4); + }, r2.setValue = function(t3, n2) { + var i2 = new e3(r2._currentContext); + return i2._currentContext.set(t3, n2), i2; + }, r2.deleteValue = function(t3) { + var n2 = new e3(r2._currentContext); + return n2._currentContext.delete(t3), n2; + }; + }(), N = [{ n: "error", c: "error" }, { n: "warn", c: "warn" }, { n: "info", c: "info" }, { n: "debug", c: "debug" }, { n: "verbose", c: "trace" }], M = function() { + for (var e3 = 0; e3 < N.length; e3++) + this[N[e3].n] = /* @__PURE__ */ function(e4) { + return function() { + for (var t2 = [], r2 = 0; r2 < arguments.length; r2++) + t2[r2] = arguments[r2]; + if (console) { + var n2 = console[e4]; + if ("function" != typeof n2 && (n2 = console.log), "function" == typeof n2) + return n2.apply(console, t2); + } + }; + }(N[e3].c); + }, $ = /* @__PURE__ */ function() { + var e3 = function(t2, r2) { + return (e3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e4, t3) { + e4.__proto__ = t3; + } || function(e4, t3) { + for (var r3 in t3) + Object.prototype.hasOwnProperty.call(t3, r3) && (e4[r3] = t3[r3]); + })(t2, r2); + }; + return function(t2, r2) { + if ("function" != typeof r2 && null !== r2) + throw TypeError("Class extends value " + String(r2) + " is not a constructor or null"); + function n2() { + this.constructor = t2; + } + e3(t2, r2), t2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); + }; + }(), L = function() { + function e3() { + } + return e3.prototype.createGauge = function(e4, t2) { + return G; + }, e3.prototype.createHistogram = function(e4, t2) { + return Z; + }, e3.prototype.createCounter = function(e4, t2) { + return V; + }, e3.prototype.createUpDownCounter = function(e4, t2) { + return K; + }, e3.prototype.createObservableGauge = function(e4, t2) { + return Y; + }, e3.prototype.createObservableCounter = function(e4, t2) { + return J; + }, e3.prototype.createObservableUpDownCounter = function(e4, t2) { + return X; + }, e3.prototype.addBatchObservableCallback = function(e4, t2) { + }, e3.prototype.removeBatchObservableCallback = function(e4) { + }, e3; + }(), j = function() { + }, D = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return $(t2, e3), t2.prototype.add = function(e4, t3) { + }, t2; + }(j), F = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return $(t2, e3), t2.prototype.add = function(e4, t3) { + }, t2; + }(j), B = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return $(t2, e3), t2.prototype.record = function(e4, t3) { + }, t2; + }(j), U = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return $(t2, e3), t2.prototype.record = function(e4, t3) { + }, t2; + }(j), q = function() { + function e3() { + } + return e3.prototype.addCallback = function(e4) { + }, e3.prototype.removeCallback = function(e4) { + }, e3; + }(), z = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return $(t2, e3), t2; + }(q), H = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return $(t2, e3), t2; + }(q), W = function(e3) { + function t2() { + return null !== e3 && e3.apply(this, arguments) || this; + } + return $(t2, e3), t2; + }(q), Q = new L(), V = new D(), G = new B(), Z = new U(), K = new F(), J = new z(), Y = new H(), X = new W(); + function ee() { + return Q; + } + !function(e3) { + e3[e3.INT = 0] = "INT", e3[e3.DOUBLE = 1] = "DOUBLE"; + }(i || (i = {})); + var et = { get: function(e3, t2) { + if (null != e3) + return e3[t2]; + }, keys: function(e3) { + return null == e3 ? [] : Object.keys(e3); + } }, er = { set: function(e3, t2, r2) { + null != e3 && (e3[t2] = r2); + } }, en = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, i2, s2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = s2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + i2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = s2.return) && r2.call(s2); + } finally { + if (i2) + throw i2.error; + } + } + return a2; + }, ei = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, i2 = 0, s2 = t2.length; i2 < s2; i2++) + !n2 && i2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, i2)), n2[i2] = t2[i2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, es = function() { + function e3() { + } + return e3.prototype.active = function() { + return I; + }, e3.prototype.with = function(e4, t2, r2) { + for (var n2 = [], i2 = 3; i2 < arguments.length; i2++) + n2[i2 - 3] = arguments[i2]; + return t2.call.apply(t2, ei([r2], en(n2), false)); + }, e3.prototype.bind = function(e4, t2) { + return t2; + }, e3.prototype.enable = function() { + return this; + }, e3.prototype.disable = function() { + return this; + }, e3; + }(), ea = function(e3, t2) { + var r2 = "function" == typeof Symbol && e3[Symbol.iterator]; + if (!r2) + return e3; + var n2, i2, s2 = r2.call(e3), a2 = []; + try { + for (; (void 0 === t2 || t2-- > 0) && !(n2 = s2.next()).done; ) + a2.push(n2.value); + } catch (e4) { + i2 = { error: e4 }; + } finally { + try { + n2 && !n2.done && (r2 = s2.return) && r2.call(s2); + } finally { + if (i2) + throw i2.error; + } + } + return a2; + }, eo = function(e3, t2, r2) { + if (r2 || 2 == arguments.length) + for (var n2, i2 = 0, s2 = t2.length; i2 < s2; i2++) + !n2 && i2 in t2 || (n2 || (n2 = Array.prototype.slice.call(t2, 0, i2)), n2[i2] = t2[i2]); + return e3.concat(n2 || Array.prototype.slice.call(t2)); + }, el = "context", ec = new es(), eu = function() { + function e3() { + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalContextManager = function(e4) { + return p(el, e4, _.instance()); + }, e3.prototype.active = function() { + return this._getContextManager().active(); + }, e3.prototype.with = function(e4, t2, r2) { + for (var n2, i2 = [], s2 = 3; s2 < arguments.length; s2++) + i2[s2 - 3] = arguments[s2]; + return (n2 = this._getContextManager()).with.apply(n2, eo([e4, t2, r2], ea(i2), false)); + }, e3.prototype.bind = function(e4, t2) { + return this._getContextManager().bind(e4, t2); + }, e3.prototype._getContextManager = function() { + return m(el) || ec; + }, e3.prototype.disable = function() { + this._getContextManager().disable(), g(el, _.instance()); + }, e3; + }(); + !function(e3) { + e3[e3.NONE = 0] = "NONE", e3[e3.SAMPLED = 1] = "SAMPLED"; + }(s || (s = {})); + var ed = "0000000000000000", eh = "00000000000000000000000000000000", ef = { traceId: eh, spanId: ed, traceFlags: s.NONE }, ep = function() { + function e3(e4) { + void 0 === e4 && (e4 = ef), this._spanContext = e4; + } + return e3.prototype.spanContext = function() { + return this._spanContext; + }, e3.prototype.setAttribute = function(e4, t2) { + return this; + }, e3.prototype.setAttributes = function(e4) { + return this; + }, e3.prototype.addEvent = function(e4, t2) { + return this; + }, e3.prototype.addLink = function(e4) { + return this; + }, e3.prototype.addLinks = function(e4) { + return this; + }, e3.prototype.setStatus = function(e4) { + return this; + }, e3.prototype.updateName = function(e4) { + return this; + }, e3.prototype.end = function(e4) { + }, e3.prototype.isRecording = function() { + return false; + }, e3.prototype.recordException = function(e4, t2) { + }, e3; + }(), em = O("OpenTelemetry Context Key SPAN"); + function eg(e3) { + return e3.getValue(em) || void 0; + } + function ey() { + return eg(eu.getInstance().active()); + } + function ev(e3, t2) { + return e3.setValue(em, t2); + } + function eb(e3) { + return e3.deleteValue(em); + } + function ew(e3, t2) { + return ev(e3, new ep(t2)); + } + function ex(e3) { + var t2; + return null === (t2 = eg(e3)) || void 0 === t2 ? void 0 : t2.spanContext(); + } + var eS = /^([0-9a-f]{32})$/i, e_ = /^[0-9a-f]{16}$/i; + function eE(e3) { + return eS.test(e3) && e3 !== eh; + } + function ek(e3) { + return e_.test(e3) && e3 !== ed; + } + function eC(e3) { + return eE(e3.traceId) && ek(e3.spanId); + } + function eR(e3) { + return new ep(e3); + } + var eP = eu.getInstance(), eT = function() { + function e3() { + } + return e3.prototype.startSpan = function(e4, t2, r2) { + if (void 0 === r2 && (r2 = eP.active()), null == t2 ? void 0 : t2.root) + return new ep(); + var n2 = r2 && ex(r2); + return "object" == typeof n2 && "string" == typeof n2.spanId && "string" == typeof n2.traceId && "number" == typeof n2.traceFlags && eC(n2) ? new ep(n2) : new ep(); + }, e3.prototype.startActiveSpan = function(e4, t2, r2, n2) { + if (!(arguments.length < 2)) { + 2 == arguments.length ? a2 = t2 : 3 == arguments.length ? (i2 = t2, a2 = r2) : (i2 = t2, s2 = r2, a2 = n2); + var i2, s2, a2, o2 = null != s2 ? s2 : eP.active(), l2 = this.startSpan(e4, i2, o2), c2 = ev(o2, l2); + return eP.with(c2, a2, void 0, l2); + } + }, e3; + }(), eA = new eT(), eO = function() { + function e3(e4, t2, r2, n2) { + this._provider = e4, this.name = t2, this.version = r2, this.options = n2; + } + return e3.prototype.startSpan = function(e4, t2, r2) { + return this._getTracer().startSpan(e4, t2, r2); + }, e3.prototype.startActiveSpan = function(e4, t2, r2, n2) { + var i2 = this._getTracer(); + return Reflect.apply(i2.startActiveSpan, i2, arguments); + }, e3.prototype._getTracer = function() { + if (this._delegate) + return this._delegate; + var e4 = this._provider.getDelegateTracer(this.name, this.version, this.options); + return e4 ? (this._delegate = e4, this._delegate) : eA; + }, e3; + }(), eI = new (function() { + function e3() { + } + return e3.prototype.getTracer = function(e4, t2, r2) { + return new eT(); + }, e3; + }())(), eN = function() { + function e3() { + } + return e3.prototype.getTracer = function(e4, t2, r2) { + var n2; + return null !== (n2 = this.getDelegateTracer(e4, t2, r2)) && void 0 !== n2 ? n2 : new eO(this, e4, t2, r2); + }, e3.prototype.getDelegate = function() { + var e4; + return null !== (e4 = this._delegate) && void 0 !== e4 ? e4 : eI; + }, e3.prototype.setDelegate = function(e4) { + this._delegate = e4; + }, e3.prototype.getDelegateTracer = function(e4, t2, r2) { + var n2; + return null === (n2 = this._delegate) || void 0 === n2 ? void 0 : n2.getTracer(e4, t2, r2); + }, e3; + }(); + !function(e3) { + e3[e3.NOT_RECORD = 0] = "NOT_RECORD", e3[e3.RECORD = 1] = "RECORD", e3[e3.RECORD_AND_SAMPLED = 2] = "RECORD_AND_SAMPLED"; + }(a || (a = {})), function(e3) { + e3[e3.INTERNAL = 0] = "INTERNAL", e3[e3.SERVER = 1] = "SERVER", e3[e3.CLIENT = 2] = "CLIENT", e3[e3.PRODUCER = 3] = "PRODUCER", e3[e3.CONSUMER = 4] = "CONSUMER"; + }(o || (o = {})), function(e3) { + e3[e3.UNSET = 0] = "UNSET", e3[e3.OK = 1] = "OK", e3[e3.ERROR = 2] = "ERROR"; + }(l || (l = {})); + var eM = "[_0-9a-z-*/]", e$ = RegExp("^(?:[a-z]" + eM + "{0,255}|" + ("[a-z0-9]" + eM) + "{0,240}@[a-z]" + eM + "{0,13})$"), eL = /^[ -~]{0,255}[!-~]$/, ej = /,|=/, eD = function() { + function e3(e4) { + this._internalState = /* @__PURE__ */ new Map(), e4 && this._parse(e4); + } + return e3.prototype.set = function(e4, t2) { + var r2 = this._clone(); + return r2._internalState.has(e4) && r2._internalState.delete(e4), r2._internalState.set(e4, t2), r2; + }, e3.prototype.unset = function(e4) { + var t2 = this._clone(); + return t2._internalState.delete(e4), t2; + }, e3.prototype.get = function(e4) { + return this._internalState.get(e4); + }, e3.prototype.serialize = function() { + var e4 = this; + return this._keys().reduce(function(t2, r2) { + return t2.push(r2 + "=" + e4.get(r2)), t2; + }, []).join(","); + }, e3.prototype._parse = function(e4) { + !(e4.length > 512) && (this._internalState = e4.split(",").reverse().reduce(function(e5, t2) { + var r2 = t2.trim(), n2 = r2.indexOf("="); + if (-1 !== n2) { + var i2 = r2.slice(0, n2), s2 = r2.slice(n2 + 1, t2.length); + e$.test(i2) && eL.test(s2) && !ej.test(s2) && e5.set(i2, s2); + } + return e5; + }, /* @__PURE__ */ new Map()), this._internalState.size > 32 && (this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, 32)))); + }, e3.prototype._keys = function() { + return Array.from(this._internalState.keys()).reverse(); + }, e3.prototype._clone = function() { + var t2 = new e3(); + return t2._internalState = new Map(this._internalState), t2; + }, e3; + }(); + function eF(e3) { + return new eD(e3); + } + var eB = eu.getInstance(), eU = _.instance(), eq = new (function() { + function e3() { + } + return e3.prototype.getMeter = function(e4, t2, r2) { + return Q; + }, e3; + }())(), ez = "metrics", eH = function() { + function e3() { + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalMeterProvider = function(e4) { + return p(ez, e4, _.instance()); + }, e3.prototype.getMeterProvider = function() { + return m(ez) || eq; + }, e3.prototype.getMeter = function(e4, t2, r2) { + return this.getMeterProvider().getMeter(e4, t2, r2); + }, e3.prototype.disable = function() { + g(ez, _.instance()); + }, e3; + }().getInstance(), eW = function() { + function e3() { + } + return e3.prototype.inject = function(e4, t2) { + }, e3.prototype.extract = function(e4, t2) { + return e4; + }, e3.prototype.fields = function() { + return []; + }, e3; + }(), eQ = O("OpenTelemetry Baggage Key"); + function eV(e3) { + return e3.getValue(eQ) || void 0; + } + function eG() { + return eV(eu.getInstance().active()); + } + function eZ(e3, t2) { + return e3.setValue(eQ, t2); + } + function eK(e3) { + return e3.deleteValue(eQ); + } + var eJ = "propagation", eY = new eW(), eX = function() { + function e3() { + this.createBaggage = T, this.getBaggage = eV, this.getActiveBaggage = eG, this.setBaggage = eZ, this.deleteBaggage = eK; + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalPropagator = function(e4) { + return p(eJ, e4, _.instance()); + }, e3.prototype.inject = function(e4, t2, r2) { + return void 0 === r2 && (r2 = er), this._getGlobalPropagator().inject(e4, t2, r2); + }, e3.prototype.extract = function(e4, t2, r2) { + return void 0 === r2 && (r2 = et), this._getGlobalPropagator().extract(e4, t2, r2); + }, e3.prototype.fields = function() { + return this._getGlobalPropagator().fields(); + }, e3.prototype.disable = function() { + g(eJ, _.instance()); + }, e3.prototype._getGlobalPropagator = function() { + return m(eJ) || eY; + }, e3; + }().getInstance(), e0 = "trace", e1 = function() { + function e3() { + this._proxyTracerProvider = new eN(), this.wrapSpanContext = eR, this.isSpanContextValid = eC, this.deleteSpan = eb, this.getSpan = eg, this.getActiveSpan = ey, this.getSpanContext = ex, this.setSpan = ev, this.setSpanContext = ew; + } + return e3.getInstance = function() { + return this._instance || (this._instance = new e3()), this._instance; + }, e3.prototype.setGlobalTracerProvider = function(e4) { + var t2 = p(e0, this._proxyTracerProvider, _.instance()); + return t2 && this._proxyTracerProvider.setDelegate(e4), t2; + }, e3.prototype.getTracerProvider = function() { + return m(e0) || this._proxyTracerProvider; + }, e3.prototype.getTracer = function(e4, t2) { + return this.getTracerProvider().getTracer(e4, t2); + }, e3.prototype.disable = function() { + g(e0, _.instance()), this._proxyTracerProvider = new eN(); + }, e3; + }().getInstance(); + let e2 = { context: eB, diag: eU, metrics: eH, propagation: eX, trace: e1 }; + }; + __namedExportsObject5["__chunk_7718"] = (e, t, r) => { + "use strict"; + Object.defineProperty(t, "__esModule", { value: true }), function(e2, t2) { + for (var r2 in t2) + Object.defineProperty(e2, r2, { enumerable: true, get: t2[r2] }); + }(t, { interceptTestApis: function() { + return s; + }, wrapRequestHandler: function() { + return a; + } }); + let n = r(28081), i = r(90348); + function s() { + return (0, i.interceptFetch)(r.g.fetch); + } + function a(e2) { + return (t2, r2) => (0, n.withRequest)(t2, i.reader, () => e2(t2, r2)); + } + }; + __namedExportsObject5["__chunk_90348"] = (e, t, r) => { + "use strict"; + var n = r(26195).Buffer; + Object.defineProperty(t, "__esModule", { value: true }), function(e2, t2) { + for (var r2 in t2) + Object.defineProperty(e2, r2, { enumerable: true, get: t2[r2] }); + }(t, { handleFetch: function() { + return o; + }, interceptFetch: function() { + return l; + }, reader: function() { + return s; + } }); + let i = r(28081), s = { url: (e2) => e2.url, header: (e2, t2) => e2.headers.get(t2) }; + async function a(e2, t2) { + let { url: r2, method: i2, headers: s2, body: a2, cache: o2, credentials: l2, integrity: c, mode: u, redirect: d, referrer: h, referrerPolicy: f } = t2; + return { testData: e2, api: "fetch", request: { url: r2, method: i2, headers: [...Array.from(s2), ["next-test-stack", function() { + let e3 = (Error().stack ?? "").split("\n"); + for (let t3 = 1; t3 < e3.length; t3++) + if (e3[t3].length > 0) { + e3 = e3.slice(t3); + break; + } + return (e3 = (e3 = (e3 = e3.filter((e4) => !e4.includes("/next/dist/"))).slice(0, 5)).map((e4) => e4.replace("webpack-internal:///(rsc)/", "").trim())).join(" "); + }()]], body: a2 ? n.from(await t2.arrayBuffer()).toString("base64") : null, cache: o2, credentials: l2, integrity: c, mode: u, redirect: d, referrer: h, referrerPolicy: f } }; + } + async function o(e2, t2) { + let r2 = (0, i.getTestReqInfo)(t2, s); + if (!r2) + return e2(t2); + let { testData: o2, proxyPort: l2 } = r2, c = await a(o2, t2), u = await e2(`http://localhost:${l2}`, { method: "POST", body: JSON.stringify(c), next: { internal: true } }); + if (!u.ok) + throw Error(`Proxy request failed: ${u.status}`); + let d = await u.json(), { api: h } = d; + switch (h) { + case "continue": + return e2(t2); + case "abort": + case "unhandled": + throw Error(`Proxy request aborted [${t2.method} ${t2.url}]`); + } + return function(e3) { + let { status: t3, headers: r3, body: i2 } = e3.response; + return new Response(i2 ? n.from(i2, "base64") : null, { status: t3, headers: new Headers(r3) }); + }(d); + } + function l(e2) { + return r.g.fetch = function(t2, r2) { + var n2; + return (null == r2 ? void 0 : null == (n2 = r2.next) ? void 0 : n2.internal) ? e2(t2, r2) : o(e2, new Request(t2, r2)); + }, () => { + r.g.fetch = e2; + }; + } + }; + __namedExportsObject5["__chunk_28081"] = (e, t, r) => { + "use strict"; + Object.defineProperty(t, "__esModule", { value: true }), function(e2, t2) { + for (var r2 in t2) + Object.defineProperty(e2, r2, { enumerable: true, get: t2[r2] }); + }(t, { getTestReqInfo: function() { + return a; + }, withRequest: function() { + return s; + } }); + let n = new (r(2067)).AsyncLocalStorage(); + function i(e2, t2) { + let r2 = t2.header(e2, "next-test-proxy-port"); + if (r2) + return { url: t2.url(e2), proxyPort: Number(r2), testData: t2.header(e2, "next-test-data") || "" }; + } + function s(e2, t2, r2) { + let s2 = i(e2, t2); + return s2 ? n.run(s2, r2) : r2(); + } + function a(e2, t2) { + return n.getStore() || (e2 && t2 ? i(e2, t2) : void 0); + } + }; + __namedExportsObject5["__chunk_82078"] = (e, t, r) => { + "use strict"; + function n(e2) { + let t2, r2 = false; + return function() { + for (var n2 = arguments.length, i2 = Array(n2), s2 = 0; s2 < n2; s2++) + i2[s2] = arguments[s2]; + return r2 || (r2 = true, t2 = e2(...i2)), t2; + }; + } + r.d(t, { At: () => u, Dp: () => a, KM: () => c, U3: () => o, _9: () => l, gf: () => n, sD: () => s }); + let i = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/, s = (e2) => i.test(e2); + function a() { + let { protocol: e2, hostname: t2, port: r2 } = window.location; + return e2 + "//" + t2 + (r2 ? ":" + r2 : ""); + } + function o(e2) { + let t2 = e2.split("?"); + return t2[0].replace(/\\/g, "/").replace(/\/\/+/g, "/") + (t2[1] ? "?" + t2.slice(1).join("?") : ""); + } + "undefined" != typeof performance && ["mark", "measure", "getEntriesByName"].every((e2) => "function" == typeof performance[e2]); + class l extends Error { + } + class c extends Error { + } + class u extends Error { + constructor(e2, t2) { + super(), this.message = "Failed to load static file for page: " + e2 + " " + t2; + } + } + }; + __namedExportsObject5["__chunk_5565"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { ServerInsertedHTMLContext: () => i, useServerInsertedHTML: () => s }); + var n = r(49398); + let i = n.createContext(null); + function s(e2) { + let t2 = (0, n.useContext)(i); + t2 && t2(e2); + } + }; + __namedExportsObject5["__chunk_12419"] = (e, t, r) => { + "use strict"; + function n(e2) { + return "(" === e2[0] && e2.endsWith(")"); + } + function i(e2, t2) { + if (e2.includes(s)) { + let e3 = JSON.stringify(t2); + return "{}" !== e3 ? s + "?" + e3 : s; + } + return e2; + } + r.d(t, { GC: () => s, Zl: () => i, av: () => a, lv: () => n }); + let s = "__PAGE__", a = "__DEFAULT__"; + }; + __namedExportsObject5["__chunk_57268"] = (e, t, r) => { + "use strict"; + r.d(t, { JV: () => h, b8: () => l, vG: () => u }); + var n = r(67117), i = r(42278), s = r(86575), a = r(13573); + let o = /\[((?:\[.*\])|.+)\]/; + function l(e2) { + let t2 = e2.match(o); + return t2 ? c(t2[1]) : c(e2); + } + function c(e2) { + let t2 = e2.startsWith("[") && e2.endsWith("]"); + t2 && (e2 = e2.slice(1, -1)); + let r2 = e2.startsWith("..."); + return r2 && (e2 = e2.slice(3)), { key: e2, repeat: r2, optional: t2 }; + } + function u(e2) { + let { parameterizedRoute: t2, groups: r2 } = function(e3) { + let t3 = (0, a.Q)(e3).slice(1).split("/"), r3 = {}, n2 = 1; + return { parameterizedRoute: t3.map((e4) => { + let t4 = i.Wz.find((t5) => e4.startsWith(t5)), a2 = e4.match(o); + if (t4 && a2) { + let { key: e5, optional: i2, repeat: o2 } = c(a2[1]); + return r3[e5] = { pos: n2++, repeat: o2, optional: i2 }, "/" + (0, s.f)(t4) + "([^/]+?)"; + } + if (!a2) + return "/" + (0, s.f)(e4); + { + let { key: e5, repeat: t5, optional: i2 } = c(a2[1]); + return r3[e5] = { pos: n2++, repeat: t5, optional: i2 }, t5 ? i2 ? "(?:/(.+?))?" : "/(.+?)" : "/([^/]+?)"; + } + }).join(""), groups: r3 }; + }(e2); + return { re: RegExp("^" + t2 + "(?:/)?$"), groups: r2 }; + } + function d(e2) { + let { interceptionMarker: t2, getSafeRouteKey: r2, segment: n2, routeKeys: i2, keyPrefix: a2 } = e2, { key: o2, optional: l2, repeat: u2 } = c(n2), d2 = o2.replace(/\W/g, ""); + a2 && (d2 = "" + a2 + d2); + let h2 = false; + (0 === d2.length || d2.length > 30) && (h2 = true), isNaN(parseInt(d2.slice(0, 1))) || (h2 = true), h2 && (d2 = r2()), a2 ? i2[d2] = "" + a2 + o2 : i2[d2] = o2; + let f = t2 ? (0, s.f)(t2) : ""; + return u2 ? l2 ? "(?:/" + f + "(?<" + d2 + ">.+?))?" : "/" + f + "(?<" + d2 + ">.+?)" : "/" + f + "(?<" + d2 + ">[^/]+?)"; + } + function h(e2, t2) { + let r2 = function(e3, t3) { + let r3; + let o2 = (0, a.Q)(e3).slice(1).split("/"), l2 = (r3 = 0, () => { + let e4 = "", t4 = ++r3; + for (; t4 > 0; ) + e4 += String.fromCharCode(97 + (t4 - 1) % 26), t4 = Math.floor((t4 - 1) / 26); + return e4; + }), c2 = {}; + return { namedParameterizedRoute: o2.map((e4) => { + let r4 = i.Wz.some((t4) => e4.startsWith(t4)), a2 = e4.match(/\[((?:\[.*\])|.+)\]/); + if (r4 && a2) { + let [r5] = e4.split(a2[0]); + return d({ getSafeRouteKey: l2, interceptionMarker: r5, segment: a2[1], routeKeys: c2, keyPrefix: t3 ? n.u7 : void 0 }); + } + return a2 ? d({ getSafeRouteKey: l2, segment: a2[1], routeKeys: c2, keyPrefix: t3 ? n.dN : void 0 }) : "/" + (0, s.f)(e4); + }).join(""), routeKeys: c2 }; + }(e2, t2); + return { ...u(e2), namedRegex: "^" + r2.namedParameterizedRoute + "(?:/)?$", routeKeys: r2.routeKeys }; + } + }; + __namedExportsObject5["__chunk_89513"] = (e, t, r) => { + "use strict"; + r.d(t, { t: () => i }); + var n = r(82078); + function i(e2) { + let { re: t2, groups: r2 } = e2; + return (e3) => { + let i2 = t2.exec(e3); + if (!i2) + return false; + let s = (e4) => { + try { + return decodeURIComponent(e4); + } catch (e5) { + throw new n._9("failed to decode param"); + } + }, a = {}; + return Object.keys(r2).forEach((e4) => { + let t3 = r2[e4], n2 = i2[t3.pos]; + void 0 !== n2 && (a[e4] = ~n2.indexOf("/") ? n2.split("/").map((e5) => s(e5)) : t3.repeat ? [s(n2)] : s(n2)); + }), a; + }; + } + }; + __namedExportsObject5["__chunk_13573"] = (e, t, r) => { + "use strict"; + function n(e2) { + return e2.replace(/\/$/, "") || "/"; + } + r.d(t, { Q: () => n }); + }; + __namedExportsObject5["__chunk_2381"] = (e, t, r) => { + "use strict"; + r.d(t, { n: () => i }); + var n = r(64599); + function i(e2, t2) { + if (!(0, n.Y)(e2, t2)) + return e2; + let r2 = e2.slice(t2.length); + return r2.startsWith("/") ? r2 : "/" + r2; + } + }; + __namedExportsObject5["__chunk_11126"] = (e, t, r) => { + "use strict"; + function n(e2) { + let t2 = {}; + return e2.forEach((e3, r2) => { + void 0 === t2[r2] ? t2[r2] = e3 : Array.isArray(t2[r2]) ? t2[r2].push(e3) : t2[r2] = [t2[r2], e3]; + }), t2; + } + function i(e2) { + return "string" != typeof e2 && ("number" != typeof e2 || isNaN(e2)) && "boolean" != typeof e2 ? "" : String(e2); + } + function s(e2) { + let t2 = new URLSearchParams(); + return Object.entries(e2).forEach((e3) => { + let [r2, n2] = e3; + Array.isArray(n2) ? n2.forEach((e4) => t2.append(r2, i(e4))) : t2.set(r2, i(n2)); + }), t2; + } + r.d(t, { Nn: () => s, u5: () => n }); + }; + __namedExportsObject5["__chunk_64599"] = (e, t, r) => { + "use strict"; + r.d(t, { Y: () => i }); + var n = r(68132); + function i(e2, t2) { + if ("string" != typeof e2) + return false; + let { pathname: r2 } = (0, n.c)(e2); + return r2 === t2 || r2.startsWith(t2 + "/"); + } + }; + __namedExportsObject5["__chunk_61772"] = (e, t, r) => { + "use strict"; + r.d(t, { u: () => i }), r(82078); + var n = r(11126); + function i(e2, t2, r2) { + void 0 === r2 && (r2 = true); + let i2 = new URL("http://n"), s = t2 ? new URL(t2, i2) : e2.startsWith(".") ? new URL("http://n") : i2, { pathname: a, searchParams: o, search: l, hash: c, href: u, origin: d } = new URL(e2, s); + if (d !== i2.origin) + throw Error("invariant: invalid relative URL, router received " + e2); + return { pathname: a, query: r2 ? (0, n.u5)(o) : void 0, search: l, hash: c, href: u.slice(d.length) }; + } + }; + __namedExportsObject5["__chunk_68132"] = (e, t, r) => { + "use strict"; + function n(e2) { + let t2 = e2.indexOf("#"), r2 = e2.indexOf("?"), n2 = r2 > -1 && (t2 < 0 || r2 < t2); + return n2 || t2 > -1 ? { pathname: e2.substring(0, n2 ? r2 : t2), query: n2 ? e2.substring(r2, t2 > -1 ? t2 : void 0) : "", hash: t2 > -1 ? e2.slice(t2) : "" } : { pathname: e2, query: "", hash: "" }; + } + r.d(t, { c: () => n }); + }; + __namedExportsObject5["__chunk_6094"] = (e, t, r) => { + "use strict"; + r.d(t, { $: () => s }); + var n = r(42278); + let i = /\/\[[^/]+?\](?=\/|$)/; + function s(e2) { + return (0, n.Ag)(e2) && (e2 = (0, n.CK)(e2).interceptedRoute), i.test(e2); + } + }; + __namedExportsObject5["__chunk_14953"] = (e, t, r) => { + "use strict"; + r.d(t, { Q: () => i }); + let n = /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i; + function i(e2) { + return n.test(e2); + } + }; + __namedExportsObject5["__chunk_49112"] = (e, t, r) => { + "use strict"; + r.d(t, { a: () => a }); + var n = r(43793), i = r(2381), s = r(64599); + function a(e2, t2) { + var r2, a2; + let { basePath: o, i18n: l, trailingSlash: c } = null != (r2 = t2.nextConfig) ? r2 : {}, u = { pathname: e2, trailingSlash: "/" !== e2 ? e2.endsWith("/") : c }; + o && (0, s.Y)(u.pathname, o) && (u.pathname = (0, i.n)(u.pathname, o), u.basePath = o); + let d = u.pathname; + if (u.pathname.startsWith("/_next/data/") && u.pathname.endsWith(".json")) { + let e3 = u.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/"), r3 = e3[0]; + u.buildId = r3, d = "index" !== e3[1] ? "/" + e3.slice(1).join("/") : "/", true === t2.parseData && (u.pathname = d); + } + if (l) { + let e3 = t2.i18nProvider ? t2.i18nProvider.analyze(u.pathname) : (0, n.h)(u.pathname, l.locales); + u.locale = e3.detectedLocale, u.pathname = null != (a2 = e3.pathname) ? a2 : u.pathname, !e3.detectedLocale && u.buildId && (e3 = t2.i18nProvider ? t2.i18nProvider.analyze(d) : (0, n.h)(d, l.locales)).detectedLocale && (u.locale = e3.detectedLocale); + } + return u; + } + }; + __namedExportsObject5["__chunk_46112"] = (e, t, r) => { + "use strict"; + r.d(t, { b: () => a, w: () => s }); + var n = r(63544), i = r(12419); + function s(e2) { + return (0, n.e)(e2.split("/").reduce((e3, t2, r2, n2) => !t2 || (0, i.lv)(t2) || "@" === t2[0] || ("page" === t2 || "route" === t2) && r2 === n2.length - 1 ? e3 : e3 + "/" + t2, "")); + } + function a(e2) { + return e2.replace(/\.rsc($|\?)/, "$1"); + } + }; + __namedExportsObject5["__chunk_21326"] = (e, t, r) => { + "use strict"; + r.d(t, { V: () => i }); + var n = r(68132); + function i(e2, t2) { + if (!e2.startsWith("/") || !t2) + return e2; + let { pathname: r2, query: i2, hash: s } = (0, n.c)(e2); + return "" + t2 + r2 + i2 + s; + } + }; + __namedExportsObject5["__chunk_97521"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { RouterContext: () => n }); + let n = r(49398).createContext(null); + }; + __namedExportsObject5["__chunk_46703"] = (e, t, r) => { + "use strict"; + r.d(t, { y: () => s }); + var n = r(63544), i = r(6094); + function s(e2) { + return /^\/index(\/|$)/.test(e2) && !(0, i.$)(e2) ? "/index" + e2 : "/" === e2 ? "/index" : (0, n.e)(e2); + } + r(82078); + }; + __namedExportsObject5["__chunk_63544"] = (e, t, r) => { + "use strict"; + function n(e2) { + return e2.startsWith("/") ? e2 : "/" + e2; + } + r.d(t, { e: () => n }); + }; + __namedExportsObject5["__chunk_86581"] = (e) => { + "use strict"; + e.exports = ["chrome 64", "edge 79", "firefox 67", "opera 51", "safari 12"]; + }; + __namedExportsObject5["__chunk_60608"] = (e, t, r) => { + "use strict"; + r.d(t, { D: () => s, Z: () => i }); + let n = "BAILOUT_TO_CLIENT_SIDE_RENDERING"; + class i extends Error { + constructor(e2) { + super("Bail out to client-side rendering: " + e2), this.reason = e2, this.digest = n; + } + } + function s(e2) { + return "object" == typeof e2 && null !== e2 && "digest" in e2 && e2.digest === n; + } + }; + __namedExportsObject5["__chunk_95131"] = (e, t, r) => { + "use strict"; + let n; + n = r(77475), e.exports = n; + }; + __namedExportsObject5["__chunk_77052"] = (e, t, r) => { + "use strict"; + function n(e2) { + return null !== e2 && "object" == typeof e2 && "then" in e2 && "function" == typeof e2.then; + } + r.d(t, { J: () => n }); + }; + __namedExportsObject5["__chunk_32874"] = (e, t, r) => { + "use strict"; + r.d(t, { e: () => n }); + class n extends Error { + constructor(e2, t2) { + super("Invariant: " + (e2.endsWith(".") ? e2 : e2 + ".") + " This is a bug in Next.js.", t2), this.name = "InvariantError"; + } + } + }; + __namedExportsObject5["__chunk_87709"] = (e, t, r) => { + "use strict"; + function n(e2) { + let { config: t2, src: r2, width: n2, quality: i2 } = e2; + return t2.path + "?url=" + encodeURIComponent(r2) + "&w=" + n2 + "&q=" + (i2 || 75); + } + r.d(t, { Z: () => i }), n.__next_img_default = true; + let i = n; + }; + __namedExportsObject5["__chunk_47937"] = (e, t, r) => { + "use strict"; + r.d(t, { z: () => n }); + let n = { deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], path: "/_next/image", loader: "default", loaderFile: "", domains: [], disableStaticImages: false, minimumCacheTTL: 60, formats: ["image/webp"], dangerouslyAllowSVG: false, contentSecurityPolicy: "script-src 'none'; frame-src 'none'; sandbox;", contentDispositionType: "attachment", localPatterns: void 0, remotePatterns: [], unoptimized: false }; + }; + __namedExportsObject5["__chunk_56555"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { ImageConfigContext: () => s }); + var n = r(49398), i = r(47937); + let s = n.createContext(i.z); + }; + __namedExportsObject5["__chunk_43793"] = (e, t, r) => { + "use strict"; + function n(e2, t2) { + let r2; + let n2 = e2.split("/"); + return (t2 || []).some((t3) => !!n2[1] && n2[1].toLowerCase() === t3.toLowerCase() && (r2 = t3, n2.splice(1, 1), e2 = n2.join("/") || "/", true)), { pathname: e2, detectedLocale: r2 }; + } + r.d(t, { h: () => n }); + }; + __namedExportsObject5["__chunk_75040"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { PathParamsContext: () => a, PathnameContext: () => s, SearchParamsContext: () => i }); + var n = r(49398); + let i = (0, n.createContext)(null), s = (0, n.createContext)(null), a = (0, n.createContext)(null); + }; + __namedExportsObject5["__chunk_27033"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { HeadManagerContext: () => n }); + let n = r(49398).createContext({}); + }; + __namedExportsObject5["__chunk_55639"] = (e, t, r) => { + "use strict"; + function n(e2) { + let t2 = 5381; + for (let r2 = 0; r2 < e2.length; r2++) + t2 = (t2 << 5) + t2 + e2.charCodeAt(r2) & 4294967295; + return t2 >>> 0; + } + function i(e2) { + return n(e2).toString(36).slice(0, 5); + } + r.d(t, { a: () => i, p: () => n }); + }; + __namedExportsObject5["__chunk_60370"] = (e, t, r) => { + "use strict"; + r.d(t, { s: () => a }); + var n = r(47937); + function i(e2) { + return void 0 !== e2.default; + } + function s(e2) { + return void 0 === e2 ? e2 : "number" == typeof e2 ? Number.isFinite(e2) ? e2 : NaN : "string" == typeof e2 && /^[0-9]+$/.test(e2) ? parseInt(e2, 10) : NaN; + } + function a(e2, t2) { + var r2; + let a2, o, l, { src: c, sizes: u, unoptimized: d = false, priority: h = false, loading: f, className: p, quality: m, width: g, height: y, fill: v = false, style: b, overrideSrc: w, onLoad: x, onLoadingComplete: S, placeholder: _ = "empty", blurDataURL: E, fetchPriority: k, decoding: C = "async", layout: R, objectFit: P, objectPosition: T, lazyBoundary: A, lazyRoot: O, ...I } = e2, { imgConf: N, showAltText: M, blurComplete: $, defaultLoader: L } = t2, j = N || n.z; + if ("allSizes" in j) + a2 = j; + else { + let e3 = [...j.deviceSizes, ...j.imageSizes].sort((e4, t4) => e4 - t4), t3 = j.deviceSizes.sort((e4, t4) => e4 - t4); + a2 = { ...j, allSizes: e3, deviceSizes: t3 }; + } + if (void 0 === L) + throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"); + let D = I.loader || L; + delete I.loader, delete I.srcSet; + let F = "__next_img_default" in D; + if (F) { + if ("custom" === a2.loader) + throw Error('Image with src "' + c + '" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader'); + } else { + let e3 = D; + D = (t3) => { + let { config: r3, ...n2 } = t3; + return e3(n2); + }; + } + if (R) { + "fill" === R && (v = true); + let e3 = { intrinsic: { maxWidth: "100%", height: "auto" }, responsive: { width: "100%", height: "auto" } }[R]; + e3 && (b = { ...b, ...e3 }); + let t3 = { responsive: "100vw", fill: "100vw" }[R]; + t3 && !u && (u = t3); + } + let B = "", U = s(g), q = s(y); + if ((r2 = c) && "object" == typeof r2 && (i(r2) || void 0 !== r2.src)) { + let e3 = i(c) ? c.default : c; + if (!e3.src) + throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " + JSON.stringify(e3)); + if (!e3.height || !e3.width) + throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " + JSON.stringify(e3)); + if (o = e3.blurWidth, l = e3.blurHeight, E = E || e3.blurDataURL, B = e3.src, !v) { + if (U || q) { + if (U && !q) { + let t3 = U / e3.width; + q = Math.round(e3.height * t3); + } else if (!U && q) { + let t3 = q / e3.height; + U = Math.round(e3.width * t3); + } + } else + U = e3.width, q = e3.height; + } + } + let z = !h && ("lazy" === f || void 0 === f); + (!(c = "string" == typeof c ? c : B) || c.startsWith("data:") || c.startsWith("blob:")) && (d = true, z = false), a2.unoptimized && (d = true), F && c.endsWith(".svg") && !a2.dangerouslyAllowSVG && (d = true); + let H = s(m), W = Object.assign(v ? { position: "absolute", height: "100%", width: "100%", left: 0, top: 0, right: 0, bottom: 0, objectFit: P, objectPosition: T } : {}, M ? {} : { color: "transparent" }, b), Q = $ || "empty" === _ ? null : "blur" === _ ? 'url("data:image/svg+xml;charset=utf-8,' + function(e3) { + let { widthInt: t3, heightInt: r3, blurWidth: n2, blurHeight: i2, blurDataURL: s2, objectFit: a3 } = e3, o2 = n2 ? 40 * n2 : t3, l2 = i2 ? 40 * i2 : r3, c2 = o2 && l2 ? "viewBox='0 0 " + o2 + " " + l2 + "'" : ""; + return "%3Csvg xmlns='http://www.w3.org/2000/svg' " + c2 + "%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='" + (c2 ? "none" : "contain" === a3 ? "xMidYMid" : "cover" === a3 ? "xMidYMid slice" : "none") + "' style='filter: url(%23b);' href='" + s2 + "'/%3E%3C/svg%3E"; + }({ widthInt: U, heightInt: q, blurWidth: o, blurHeight: l, blurDataURL: E || "", objectFit: W.objectFit }) + '")' : 'url("' + _ + '")', V = Q ? { backgroundSize: W.objectFit || "cover", backgroundPosition: W.objectPosition || "50% 50%", backgroundRepeat: "no-repeat", backgroundImage: Q } : {}, G = function(e3) { + let { config: t3, src: r3, unoptimized: n2, width: i2, quality: s2, sizes: a3, loader: o2 } = e3; + if (n2) + return { src: r3, srcSet: void 0, sizes: void 0 }; + let { widths: l2, kind: c2 } = function(e4, t4, r4) { + let { deviceSizes: n3, allSizes: i3 } = e4; + if (r4) { + let e5 = /(^|\s)(1?\d?\d)vw/g, t5 = []; + for (let n4; n4 = e5.exec(r4); n4) + t5.push(parseInt(n4[2])); + if (t5.length) { + let e6 = 0.01 * Math.min(...t5); + return { widths: i3.filter((t6) => t6 >= n3[0] * e6), kind: "w" }; + } + return { widths: i3, kind: "w" }; + } + return "number" != typeof t4 ? { widths: n3, kind: "w" } : { widths: [...new Set([t4, 2 * t4].map((e5) => i3.find((t5) => t5 >= e5) || i3[i3.length - 1]))], kind: "x" }; + }(t3, i2, a3), u2 = l2.length - 1; + return { sizes: a3 || "w" !== c2 ? a3 : "100vw", srcSet: l2.map((e4, n3) => o2({ config: t3, src: r3, quality: s2, width: e4 }) + " " + ("w" === c2 ? e4 : n3 + 1) + c2).join(", "), src: o2({ config: t3, src: r3, quality: s2, width: l2[u2] }) }; + }({ config: a2, src: c, unoptimized: d, width: U, quality: H, sizes: u, loader: D }); + return { props: { ...I, loading: z ? "lazy" : f, fetchPriority: k, width: U, height: q, decoding: C, className: p, style: { ...W, ...V }, sizes: G.sizes, srcSet: G.srcSet, src: w || G.src }, meta: { unoptimized: d, priority: h, placeholder: _, fill: v } }; + } + }; + __namedExportsObject5["__chunk_4769"] = (e, t, r) => { + "use strict"; + function n(e2, t2) { + let r2; + if ((null == t2 ? void 0 : t2.host) && !Array.isArray(t2.host)) + r2 = t2.host.toString().split(":", 1)[0]; + else { + if (!e2.hostname) + return; + r2 = e2.hostname; + } + return r2.toLowerCase(); + } + r.d(t, { F: () => n }); + }; + __namedExportsObject5["__chunk_86575"] = (e, t, r) => { + "use strict"; + r.d(t, { f: () => s }); + let n = /[|\\{}()[\]^$+*?.-]/, i = /[|\\{}()[\]^$+*?.-]/g; + function s(e2) { + return n.test(e2) ? e2.replace(i, "\\$&") : e2; + } + }; + __namedExportsObject5["__chunk_46587"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { AppRouterContext: () => i, GlobalLayoutRouterContext: () => a, LayoutRouterContext: () => s, MissingSlotContext: () => l, TemplateContext: () => o }); + var n = r(49398); + let i = n.createContext(null), s = n.createContext(null), a = n.createContext(null), o = n.createContext(null), l = n.createContext(/* @__PURE__ */ new Set()); + }; + __namedExportsObject5["__chunk_16037"] = (e, t, r) => { + "use strict"; + r.r(t), r.d(t, { AmpStateContext: () => n }); + let n = r(49398).createContext({}); + }; + __namedExportsObject5["__chunk_61420"] = (e, t, r) => { + "use strict"; + function n(e2, t2) { + return "string" == typeof e2 ? async function* () { + let r2 = new TextEncoder(); + yield r2.encode(e2), t2(); + }() : function(e3, t3) { + let r2 = new TransformStream({ flush: () => t3() }); + return e3.pipeThrough(r2); + }(e2, t2); + } + r.d(t, { Yh: () => n, xt: () => i }); + class i { + onClose(e2) { + if (this.isClosed) + throw Error("Cannot subscribe to a closed CloseController"); + this.target.addEventListener("close", e2), this.listeners++; + } + dispatchClose() { + if (this.isClosed) + throw Error("Cannot close a CloseController multiple times"); + this.listeners > 0 && this.target.dispatchEvent(new Event("close")), this.isClosed = true; + } + constructor() { + this.target = new EventTarget(), this.listeners = 0, this.isClosed = false; + } + } + }; + __namedExportsObject5["__chunk_25725"] = (e, t, r) => { + "use strict"; + r.d(t, { EK: () => i, LI: () => l, l$: () => s, lb: () => a, r4: () => o }); + var n = r(67117); + function i(e2) { + let t2 = new Headers(); + for (let [r2, n2] of Object.entries(e2)) + for (let e3 of Array.isArray(n2) ? n2 : [n2]) + void 0 !== e3 && ("number" == typeof e3 && (e3 = e3.toString()), t2.append(r2, e3)); + return t2; + } + function s(e2) { + var t2, r2, n2, i2, s2, a2 = [], o2 = 0; + function l2() { + for (; o2 < e2.length && /\s/.test(e2.charAt(o2)); ) + o2 += 1; + return o2 < e2.length; + } + for (; o2 < e2.length; ) { + for (t2 = o2, s2 = false; l2(); ) + if ("," === (r2 = e2.charAt(o2))) { + for (n2 = o2, o2 += 1, l2(), i2 = o2; o2 < e2.length && "=" !== (r2 = e2.charAt(o2)) && ";" !== r2 && "," !== r2; ) + o2 += 1; + o2 < e2.length && "=" === e2.charAt(o2) ? (s2 = true, o2 = i2, a2.push(e2.substring(t2, n2)), t2 = o2) : o2 = n2 + 1; + } else + o2 += 1; + (!s2 || o2 >= e2.length) && a2.push(e2.substring(t2, e2.length)); + } + return a2; + } + function a(e2) { + let t2 = {}, r2 = []; + if (e2) + for (let [n2, i2] of e2.entries()) + "set-cookie" === n2.toLowerCase() ? (r2.push(...s(i2)), t2[n2] = 1 === r2.length ? r2[0] : r2) : t2[n2] = i2; + return t2; + } + function o(e2) { + try { + return String(new URL(String(e2))); + } catch (t2) { + throw Error(`URL is malformed "${String(e2)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, { cause: t2 }); + } + } + function l(e2, t2) { + for (let r2 of [n.dN, n.u7]) + e2 !== r2 && e2.startsWith(r2) && t2(e2.substring(r2.length)); + } + }; + __namedExportsObject5["__chunk_94134"] = (e, t, r) => { + "use strict"; + r.d(t, { I: () => l }); + var n = r(72053), i = r(25725), s = r(3298), a = r(7873); + let o = Symbol("internal request"); + class l extends Request { + constructor(e2, t2 = {}) { + let r2 = "string" != typeof e2 && "url" in e2 ? e2.url : String(e2); + (0, i.r4)(r2), e2 instanceof Request ? super(e2, t2) : super(r2, t2); + let s2 = new n.c(r2, { headers: (0, i.lb)(this.headers), nextConfig: t2.nextConfig }); + this[o] = { cookies: new a.qC(this.headers), nextUrl: s2, url: s2.toString() }; + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return { cookies: this.cookies, nextUrl: this.nextUrl, url: this.url, bodyUsed: this.bodyUsed, cache: this.cache, credentials: this.credentials, destination: this.destination, headers: Object.fromEntries(this.headers), integrity: this.integrity, keepalive: this.keepalive, method: this.method, mode: this.mode, redirect: this.redirect, referrer: this.referrer, referrerPolicy: this.referrerPolicy, signal: this.signal }; + } + get cookies() { + return this[o].cookies; + } + get nextUrl() { + return this[o].nextUrl; + } + get page() { + throw new s.cR(); + } + get ua() { + throw new s.Y5(); + } + get url() { + return this[o].url; + } + } + }; + __namedExportsObject5["__chunk_7873"] = (e, t, r) => { + "use strict"; + r.d(t, { Q7: () => n.stringifyCookie, nV: () => n.ResponseCookies, qC: () => n.RequestCookies }); + var n = r(4055); + }; + __namedExportsObject5["__chunk_51008"] = (e, t, r) => { + "use strict"; + r.d(t, { Qb: () => l, Xv: () => f, _5: () => d, e5: () => m, fB: () => u, vr: () => h }); + var n = r(7873), i = r(95469), s = r(57418), a = r(49216); + class o extends Error { + constructor() { + super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options"); + } + static callable() { + throw new o(); + } + } + class l { + static seal(e2) { + return new Proxy(e2, { get(e3, t2, r2) { + switch (t2) { + case "clear": + case "delete": + case "set": + return o.callable; + default: + return i.g.get(e3, t2, r2); + } + } }); + } + } + let c = Symbol.for("next.mutated.cookies"); + function u(e2) { + let t2 = e2[c]; + return t2 && Array.isArray(t2) && 0 !== t2.length ? t2 : []; + } + function d(e2, t2) { + let r2 = u(t2); + if (0 === r2.length) + return false; + let i2 = new n.nV(e2), s2 = i2.getAll(); + for (let e3 of r2) + i2.set(e3); + for (let e3 of s2) + i2.set(e3); + return true; + } + class h { + static wrap(e2, t2) { + let r2 = new n.nV(new Headers()); + for (let t3 of e2.getAll()) + r2.set(t3); + let a2 = [], o2 = /* @__PURE__ */ new Set(), l2 = () => { + let e3 = s.workAsyncStorage.getStore(); + if (e3 && (e3.pathWasRevalidated = true), a2 = r2.getAll().filter((e4) => o2.has(e4.name)), t2) { + let e4 = []; + for (let t3 of a2) { + let r3 = new n.nV(new Headers()); + r3.set(t3), e4.push(r3.toString()); + } + t2(e4); + } + }, u2 = new Proxy(r2, { get(e3, t3, r3) { + switch (t3) { + case c: + return a2; + case "delete": + return function(...t4) { + o2.add("string" == typeof t4[0] ? t4[0] : t4[0].name); + try { + return e3.delete(...t4), u2; + } finally { + l2(); + } + }; + case "set": + return function(...t4) { + o2.add("string" == typeof t4[0] ? t4[0] : t4[0].name); + try { + return e3.set(...t4), u2; + } finally { + l2(); + } + }; + default: + return i.g.get(e3, t3, r3); + } + } }); + return u2; + } + } + function f(e2) { + let t2 = new Proxy(e2, { get(e3, r2, n2) { + switch (r2) { + case "delete": + return function(...r3) { + return p("cookies().delete"), e3.delete(...r3), t2; + }; + case "set": + return function(...r3) { + return p("cookies().set"), e3.set(...r3), t2; + }; + default: + return i.g.get(e3, r2, n2); + } + } }); + return t2; + } + function p(e2) { + if ("action" !== (0, a.F)(e2).phase) + throw new o(); + } + function m(e2) { + let t2 = new n.qC(new Headers()); + for (let r2 of e2.getAll()) + t2.set(r2); + return t2; + } + }; + __namedExportsObject5["__chunk_95469"] = (e, t, r) => { + "use strict"; + r.d(t, { g: () => n }); + class n { + static get(e2, t2, r2) { + let n2 = Reflect.get(e2, t2, r2); + return "function" == typeof n2 ? n2.bind(e2) : n2; + } + static set(e2, t2, r2, n2) { + return Reflect.set(e2, t2, r2, n2); + } + static has(e2, t2) { + return Reflect.has(e2, t2); + } + static deleteProperty(e2, t2) { + return Reflect.deleteProperty(e2, t2); + } + } + }; + __namedExportsObject5["__chunk_69150"] = (e, t, r) => { + "use strict"; + r.d(t, { Og: () => d, Ub: () => u, WK: () => o, yi: () => c }); + var n = r(57081), i = r(25725), s = r(94134), a = r(66818); + let o = "ResponseAborted"; + class l extends Error { + constructor(...e2) { + super(...e2), this.name = o; + } + } + function c(e2) { + let t2 = new AbortController(); + return e2.once("close", () => { + e2.writableFinished || t2.abort(new l()); + }), t2; + } + function u(e2) { + let { errored: t2, destroyed: r2 } = e2; + if (t2 || r2) + return AbortSignal.abort(t2 ?? new l()); + let { signal: n2 } = c(e2); + return n2; + } + class d { + static fromBaseNextRequest(e2, t2) { + if ((0, a.hf)(e2)) + return d.fromWebNextRequest(e2); + throw Error("Invariant: Unsupported NextRequest type"); + } + static fromNodeNextRequest(e2, t2) { + let r2, a2 = null; + if ("GET" !== e2.method && "HEAD" !== e2.method && e2.body && (a2 = e2.body), e2.url.startsWith("http")) + r2 = new URL(e2.url); + else { + let t3 = (0, n.OX)(e2, "initURL"); + r2 = t3 && t3.startsWith("http") ? new URL(e2.url, t3) : new URL(e2.url, "http://n"); + } + return new s.I(r2, { method: e2.method, headers: (0, i.EK)(e2.headers), duplex: "half", signal: t2, ...t2.aborted ? {} : { body: a2 } }); + } + static fromWebNextRequest(e2) { + let t2 = null; + return "GET" !== e2.method && "HEAD" !== e2.method && (t2 = e2.body), new s.I(e2.url, { method: e2.method, headers: (0, i.EK)(e2.headers), duplex: "half", signal: e2.request.signal, ...e2.request.signal.aborted ? {} : { body: t2 } }); + } + } + }; + __namedExportsObject5["__chunk_28229"] = (e, t, r) => { + "use strict"; + r.d(t, { h: () => s }); + var n = r(95469); + class i extends Error { + constructor() { + super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers"); + } + static callable() { + throw new i(); + } + } + class s extends Headers { + constructor(e2) { + super(), this.headers = new Proxy(e2, { get(t2, r2, i2) { + if ("symbol" == typeof r2) + return n.g.get(t2, r2, i2); + let s2 = r2.toLowerCase(), a = Object.keys(e2).find((e3) => e3.toLowerCase() === s2); + if (void 0 !== a) + return n.g.get(t2, a, i2); + }, set(t2, r2, i2, s2) { + if ("symbol" == typeof r2) + return n.g.set(t2, r2, i2, s2); + let a = r2.toLowerCase(), o = Object.keys(e2).find((e3) => e3.toLowerCase() === a); + return n.g.set(t2, o ?? r2, i2, s2); + }, has(t2, r2) { + if ("symbol" == typeof r2) + return n.g.has(t2, r2); + let i2 = r2.toLowerCase(), s2 = Object.keys(e2).find((e3) => e3.toLowerCase() === i2); + return void 0 !== s2 && n.g.has(t2, s2); + }, deleteProperty(t2, r2) { + if ("symbol" == typeof r2) + return n.g.deleteProperty(t2, r2); + let i2 = r2.toLowerCase(), s2 = Object.keys(e2).find((e3) => e3.toLowerCase() === i2); + return void 0 === s2 || n.g.deleteProperty(t2, s2); + } }); + } + static seal(e2) { + return new Proxy(e2, { get(e3, t2, r2) { + switch (t2) { + case "append": + case "delete": + case "set": + return i.callable; + default: + return n.g.get(e3, t2, r2); + } + } }); + } + merge(e2) { + return Array.isArray(e2) ? e2.join(", ") : e2; + } + static from(e2) { + return e2 instanceof Headers ? e2 : new s(e2); + } + append(e2, t2) { + let r2 = this.headers[e2]; + "string" == typeof r2 ? this.headers[e2] = [r2, t2] : Array.isArray(r2) ? r2.push(t2) : this.headers[e2] = t2; + } + delete(e2) { + delete this.headers[e2]; + } + get(e2) { + let t2 = this.headers[e2]; + return void 0 !== t2 ? this.merge(t2) : null; + } + has(e2) { + return void 0 !== this.headers[e2]; + } + set(e2, t2) { + this.headers[e2] = t2; + } + forEach(e2, t2) { + for (let [r2, n2] of this.entries()) + e2.call(t2, n2, r2, this); + } + *entries() { + for (let e2 of Object.keys(this.headers)) { + let t2 = e2.toLowerCase(), r2 = this.get(t2); + yield [t2, r2]; + } + } + *keys() { + for (let e2 of Object.keys(this.headers)) { + let t2 = e2.toLowerCase(); + yield t2; + } + } + *values() { + for (let e2 of Object.keys(this.headers)) { + let t2 = this.get(e2); + yield t2; + } + } + [Symbol.iterator]() { + return this.entries(); + } + } + }; + __namedExportsObject5["__chunk_72053"] = (e, t, r) => { + "use strict"; + r.d(t, { c: () => f }); + var n = r(13573), i = r(21326), s = r(68132); + function a(e2, t2) { + if (!e2.startsWith("/") || !t2) + return e2; + let { pathname: r2, query: n2, hash: i2 } = (0, s.c)(e2); + return "" + r2 + t2 + n2 + i2; + } + var o = r(64599), l = r(4769), c = r(49112); + let u = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/; + function d(e2, t2) { + return new URL(String(e2).replace(u, "localhost"), t2 && String(t2).replace(u, "localhost")); + } + let h = Symbol("NextURLInternal"); + class f { + constructor(e2, t2, r2) { + let n2, i2; + "object" == typeof t2 && "pathname" in t2 || "string" == typeof t2 ? (n2 = t2, i2 = r2 || {}) : i2 = r2 || t2 || {}, this[h] = { url: d(e2, n2 ?? i2.base), options: i2, basePath: "" }, this.analyze(); + } + analyze() { + var e2, t2, r2, n2, i2; + let s2 = (0, c.a)(this[h].url.pathname, { nextConfig: this[h].options.nextConfig, parseData: true, i18nProvider: this[h].options.i18nProvider }), a2 = (0, l.F)(this[h].url, this[h].options.headers); + this[h].domainLocale = this[h].options.i18nProvider ? this[h].options.i18nProvider.detectDomainLocale(a2) : function(e3, t3, r3) { + if (e3) + for (let s3 of (r3 && (r3 = r3.toLowerCase()), e3)) { + var n3, i3; + if (t3 === (null == (n3 = s3.domain) ? void 0 : n3.split(":", 1)[0].toLowerCase()) || r3 === s3.defaultLocale.toLowerCase() || (null == (i3 = s3.locales) ? void 0 : i3.some((e4) => e4.toLowerCase() === r3))) + return s3; + } + }(null == (t2 = this[h].options.nextConfig) ? void 0 : null == (e2 = t2.i18n) ? void 0 : e2.domains, a2); + let o2 = (null == (r2 = this[h].domainLocale) ? void 0 : r2.defaultLocale) || (null == (i2 = this[h].options.nextConfig) ? void 0 : null == (n2 = i2.i18n) ? void 0 : n2.defaultLocale); + this[h].url.pathname = s2.pathname, this[h].defaultLocale = o2, this[h].basePath = s2.basePath ?? "", this[h].buildId = s2.buildId, this[h].locale = s2.locale ?? o2, this[h].trailingSlash = s2.trailingSlash; + } + formatPathname() { + var e2; + let t2; + return t2 = function(e3, t3, r2, n2) { + if (!t3 || t3 === r2) + return e3; + let s2 = e3.toLowerCase(); + return !n2 && ((0, o.Y)(s2, "/api") || (0, o.Y)(s2, "/" + t3.toLowerCase())) ? e3 : (0, i.V)(e3, "/" + t3); + }((e2 = { basePath: this[h].basePath, buildId: this[h].buildId, defaultLocale: this[h].options.forceLocale ? void 0 : this[h].defaultLocale, locale: this[h].locale, pathname: this[h].url.pathname, trailingSlash: this[h].trailingSlash }).pathname, e2.locale, e2.buildId ? void 0 : e2.defaultLocale, e2.ignorePrefix), (e2.buildId || !e2.trailingSlash) && (t2 = (0, n.Q)(t2)), e2.buildId && (t2 = a((0, i.V)(t2, "/_next/data/" + e2.buildId), "/" === e2.pathname ? "index.json" : ".json")), t2 = (0, i.V)(t2, e2.basePath), !e2.buildId && e2.trailingSlash ? t2.endsWith("/") ? t2 : a(t2, "/") : (0, n.Q)(t2); + } + formatSearch() { + return this[h].url.search; + } + get buildId() { + return this[h].buildId; + } + set buildId(e2) { + this[h].buildId = e2; + } + get locale() { + return this[h].locale ?? ""; + } + set locale(e2) { + var t2, r2; + if (!this[h].locale || !(null == (r2 = this[h].options.nextConfig) ? void 0 : null == (t2 = r2.i18n) ? void 0 : t2.locales.includes(e2))) + throw TypeError(`The NextURL configuration includes no locale "${e2}"`); + this[h].locale = e2; + } + get defaultLocale() { + return this[h].defaultLocale; + } + get domainLocale() { + return this[h].domainLocale; + } + get searchParams() { + return this[h].url.searchParams; + } + get host() { + return this[h].url.host; + } + set host(e2) { + this[h].url.host = e2; + } + get hostname() { + return this[h].url.hostname; + } + set hostname(e2) { + this[h].url.hostname = e2; + } + get port() { + return this[h].url.port; + } + set port(e2) { + this[h].url.port = e2; + } + get protocol() { + return this[h].url.protocol; + } + set protocol(e2) { + this[h].url.protocol = e2; + } + get href() { + let e2 = this.formatPathname(), t2 = this.formatSearch(); + return `${this.protocol}//${this.host}${e2}${t2}${this.hash}`; + } + set href(e2) { + this[h].url = d(e2), this.analyze(); + } + get origin() { + return this[h].url.origin; + } + get pathname() { + return this[h].url.pathname; + } + set pathname(e2) { + this[h].url.pathname = e2; + } + get hash() { + return this[h].url.hash; + } + set hash(e2) { + this[h].url.hash = e2; + } + get search() { + return this[h].url.search; + } + set search(e2) { + this[h].url.search = e2; + } + get password() { + return this[h].url.password; + } + set password(e2) { + this[h].url.password = e2; + } + get username() { + return this[h].url.username; + } + set username(e2) { + this[h].url.username = e2; + } + get basePath() { + return this[h].basePath; + } + set basePath(e2) { + this[h].basePath = e2.startsWith("/") ? e2 : `/${e2}`; + } + toString() { + return this.href; + } + toJSON() { + return this.href; + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return { href: this.href, origin: this.origin, protocol: this.protocol, username: this.username, password: this.password, host: this.host, hostname: this.hostname, port: this.port, pathname: this.pathname, search: this.search, searchParams: this.searchParams, hash: this.hash }; + } + clone() { + return new f(String(this), this[h].options); + } + } + }; + __namedExportsObject5["__chunk_88325"] = (e, t, r) => { + "use strict"; + async function n() { + return "_ENTRIES" in globalThis2 && _ENTRIES.middleware_instrumentation && await _ENTRIES.middleware_instrumentation; + } + r.d(t, { Hr: () => o, Le: () => n }); + let i = null; + async function s() { + if (false) + return; + i || (i = n()); + let e2 = await i; + if (null == e2 ? void 0 : e2.register) + try { + await e2.register(); + } catch (e3) { + throw e3.message = `An error occurred while loading instrumentation hook: ${e3.message}`, e3; + } + } + let a = null; + function o() { + return a || (a = s()), a; + } + function l(e2) { + return `The edge runtime does not support Node.js '${e2}' module. +Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`; + } + process !== r.g.process && (process.env = r.g.process.env, r.g.process = process), Object.defineProperty(globalThis2, "__import_unsupported", { value: function(e2) { + let t2 = new Proxy(function() { + }, { get(t3, r2) { + if ("then" === r2) + return {}; + throw Error(l(e2)); + }, construct() { + throw Error(l(e2)); + }, apply(r2, n2, i2) { + if ("function" == typeof i2[0]) + return i2[0](t2); + throw Error(l(e2)); + } }); + return new Proxy({}, { get: () => t2 }); + }, enumerable: false, configurable: true }), o(); + }; + __namedExportsObject5["__chunk_81533"] = (e, t, r) => { + "use strict"; + function n() { + return { previewModeId: "", previewModeSigningKey: "", previewModeEncryptionKey: "" }; + } + r.d(t, { X: () => n }); + }; + __namedExportsObject5["__chunk_3298"] = (e, t, r) => { + "use strict"; + r.d(t, { Y5: () => s, cR: () => i, qJ: () => n }); + class n extends Error { + constructor({ page: e2 }) { + super(`The middleware "${e2}" accepts an async API directly with the form: + + export function middleware(request, event) { + return NextResponse.redirect('/new-location') + } + + Read more: https://nextjs.org/docs/messages/middleware-new-signature + `); + } + } + class i extends Error { + constructor() { + super(`The request.page has been deprecated in favour of \`URLPattern\`. + Read more: https://nextjs.org/docs/messages/middleware-request-page + `); + } + } + class s extends Error { + constructor() { + super(`The request.ua has been removed in favour of \`userAgent\` function. + Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent + `); + } + } + }; + __namedExportsObject5["__chunk_87503"] = (e, t, r) => { + "use strict"; + r.d(t, { V: () => I, C: () => L }); + var n = r(3298), i = r(25725); + let s = Symbol("response"), a = Symbol("passThrough"), o = Symbol("waitUntil"); + class l { + constructor(e2, t2) { + this[a] = false, this[o] = t2 ? { kind: "external", function: t2 } : { kind: "internal", promises: [] }; + } + respondWith(e2) { + this[s] || (this[s] = Promise.resolve(e2)); + } + passThroughOnException() { + this[a] = true; + } + waitUntil(e2) { + if ("external" === this[o].kind) + return (0, this[o].function)(e2); + this[o].promises.push(e2); + } + } + class c extends l { + constructor(e2) { + var t2; + super(e2.request, null == (t2 = e2.context) ? void 0 : t2.waitUntil), this.sourcePage = e2.page; + } + get request() { + throw new n.qJ({ page: this.sourcePage }); + } + respondWith() { + throw new n.qJ({ page: this.sourcePage }); + } + } + var u = r(94134), d = r(7873), h = r(72053), f = r(95469); + let p = Symbol("internal response"), m = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]); + function g(e2, t2) { + var r2; + if (null == e2 ? void 0 : null == (r2 = e2.request) ? void 0 : r2.headers) { + if (!(e2.request.headers instanceof Headers)) + throw Error("request.headers must be an instance of Headers"); + let r3 = []; + for (let [n2, i2] of e2.request.headers) + t2.set("x-middleware-request-" + n2, i2), r3.push(n2); + t2.set("x-middleware-override-headers", r3.join(",")); + } + } + class y extends Response { + constructor(e2, t2 = {}) { + super(e2, t2); + let r2 = this.headers, n2 = new Proxy(new d.nV(r2), { get(e3, n3, i2) { + switch (n3) { + case "delete": + case "set": + return (...i3) => { + let s2 = Reflect.apply(e3[n3], e3, i3), a2 = new Headers(r2); + return s2 instanceof d.nV && r2.set("x-middleware-set-cookie", s2.getAll().map((e4) => (0, d.Q7)(e4)).join(",")), g(t2, a2), s2; + }; + default: + return f.g.get(e3, n3, i2); + } + } }); + this[p] = { cookies: n2, url: t2.url ? new h.c(t2.url, { headers: (0, i.lb)(r2), nextConfig: t2.nextConfig }) : void 0 }; + } + [Symbol.for("edge-runtime.inspect.custom")]() { + return { cookies: this.cookies, url: this.url, body: this.body, bodyUsed: this.bodyUsed, headers: Object.fromEntries(this.headers), ok: this.ok, redirected: this.redirected, status: this.status, statusText: this.statusText, type: this.type }; + } + get cookies() { + return this[p].cookies; + } + static json(e2, t2) { + let r2 = Response.json(e2, t2); + return new y(r2.body, r2); + } + static redirect(e2, t2) { + let r2 = "number" == typeof t2 ? t2 : (null == t2 ? void 0 : t2.status) ?? 307; + if (!m.has(r2)) + throw RangeError('Failed to execute "redirect" on "response": Invalid status code'); + let n2 = "object" == typeof t2 ? t2 : {}, s2 = new Headers(null == n2 ? void 0 : n2.headers); + return s2.set("Location", (0, i.r4)(e2)), new y(null, { ...n2, headers: s2, status: r2 }); + } + static rewrite(e2, t2) { + let r2 = new Headers(null == t2 ? void 0 : t2.headers); + return r2.set("x-middleware-rewrite", (0, i.r4)(e2)), g(t2, r2), new y(null, { ...t2, headers: r2 }); + } + static next(e2) { + let t2 = new Headers(null == e2 ? void 0 : e2.headers); + return t2.set("x-middleware-next", "1"), g(e2, t2), new y(null, { ...e2, headers: t2 }); + } + } + function v(e2, t2) { + let r2 = "string" == typeof t2 ? new URL(t2) : t2, n2 = new URL(e2, t2), i2 = r2.protocol + "//" + r2.host; + return n2.protocol + "//" + n2.host === i2 ? n2.toString().replace(i2, "") : n2.toString(); + } + var b = r(32659), w = r(46112), x = r(65785), S = r(88325), _ = r(69873), E = r(49216), k = r(5997), C = r(57418), R = r(86952), P = r(79721), T = r(61420), A = r(81533), O = r(55940); + class I extends u.I { + constructor(e2) { + super(e2.input, e2.init), this.sourcePage = e2.page; + } + get request() { + throw new n.qJ({ page: this.sourcePage }); + } + respondWith() { + throw new n.qJ({ page: this.sourcePage }); + } + waitUntil() { + throw new n.qJ({ page: this.sourcePage }); + } + } + let N = { keys: (e2) => Array.from(e2.keys()), get: (e2, t2) => e2.get(t2) ?? void 0 }, M = (e2, t2) => (0, R.Yz)().withPropagatedContext(e2.headers, t2, N), $ = false; + async function L(e2) { + var t2; + let n2, s2; + !function() { + if (!$ && ($ = true, false)) { + let { interceptTestApis: e3, wrapRequestHandler: t3 } = r(7718); + e3(), M = t3(M); + } + }(), await (0, S.Hr)(); + let a2 = void 0 !== self.__BUILD_MANIFEST; + e2.request.url = (0, w.b)(e2.request.url); + let l2 = new h.c(e2.request.url, { headers: e2.request.headers, nextConfig: e2.request.nextConfig }); + for (let e3 of [...l2.searchParams.keys()]) { + let t3 = l2.searchParams.getAll(e3); + (0, i.LI)(e3, (r2) => { + for (let e4 of (l2.searchParams.delete(r2), t3)) + l2.searchParams.append(r2, e4); + l2.searchParams.delete(e3); + }); + } + let u2 = l2.buildId; + l2.buildId = ""; + let d2 = e2.request.headers["x-nextjs-data"]; + d2 && "/index" === l2.pathname && (l2.pathname = "/"); + let f2 = (0, i.EK)(e2.request.headers), p2 = /* @__PURE__ */ new Map(); + if (!a2) + for (let e3 of x.Dl) { + let t3 = e3.toLowerCase(), r2 = f2.get(t3); + r2 && (p2.set(t3, r2), f2.delete(t3)); + } + let m2 = new I({ page: e2.page, input: (0, b.T)(l2, true).toString(), init: { body: e2.request.body, headers: f2, method: e2.request.method, nextConfig: e2.request.nextConfig, signal: e2.request.signal } }); + d2 && Object.defineProperty(m2, "__isData", { enumerable: false, value: true }), !globalThis2.__incrementalCache && e2.IncrementalCache && (globalThis2.__incrementalCache = new e2.IncrementalCache({ appDir: true, fetchCache: true, minimalMode: true, fetchCacheKeyPrefix: "", dev: false, requestHeaders: e2.request.headers, requestProtocol: "https", getPrerenderManifest: () => ({ version: -1, routes: {}, dynamicRoutes: {}, notFoundRoutes: [], preview: (0, A.X)() }) })); + let g2 = e2.request.waitUntil ?? (null == (t2 = (0, O.j)()) ? void 0 : t2.waitUntil), N2 = new c({ request: m2, page: e2.page, context: g2 ? { waitUntil: g2 } : void 0 }); + if ((n2 = await M(m2, () => { + if ("/middleware" === e2.page || "/src/middleware" === e2.page) { + var t3, r2; + let n3, i2; + let a3 = (null == (r2 = e2.request.nextConfig) ? void 0 : null == (t3 = r2.experimental) ? void 0 : t3.after) ?? false; + return a3 && (n3 = N2.waitUntil.bind(N2), i2 = new T.xt()), (0, R.Yz)().trace(P.dI.execute, { spanName: `middleware ${m2.method} ${m2.nextUrl.pathname}`, attributes: { "http.target": m2.nextUrl.pathname, "http.method": m2.method } }, async () => { + try { + var t4, r3; + let o2 = (0, A.X)(), l3 = (0, _.iM)(m2, m2.nextUrl, void 0, (e3) => { + s2 = e3; + }, o2); + return await (0, k.i)(C.workAsyncStorage, { page: "/", fallbackRouteParams: null, renderOpts: { cacheLifeProfiles: null == (r3 = e2.request.nextConfig) ? void 0 : null == (t4 = r3.experimental) ? void 0 : t4.cacheLife, experimental: { after: a3, isRoutePPREnabled: false, dynamicIO: false }, buildId: u2 ?? "", supportsDynamicResponse: true, waitUntil: n3, onClose: i2 ? i2.onClose.bind(i2) : void 0 }, requestEndedState: { ended: false }, isPrefetchRequest: m2.headers.has(x.qw) }, () => E.S.run(l3, e2.handler, m2, N2)); + } finally { + i2 && setTimeout(() => { + i2.dispatchClose(); + }, 0); + } + }); + } + return e2.handler(m2, N2); + })) && !(n2 instanceof Response)) + throw TypeError("Expected an instance of Response to be returned"); + n2 && s2 && n2.headers.set("set-cookie", s2); + let L2 = null == n2 ? void 0 : n2.headers.get("x-middleware-rewrite"); + if (n2 && L2 && !a2) { + let t3 = new h.c(L2, { forceLocale: true, headers: e2.request.headers, nextConfig: e2.request.nextConfig }); + t3.host === m2.nextUrl.host && (t3.buildId = u2 || t3.buildId, n2.headers.set("x-middleware-rewrite", String(t3))); + let r2 = v(String(t3), String(l2)); + d2 && n2.headers.set("x-nextjs-rewrite", r2); + } + let j = null == n2 ? void 0 : n2.headers.get("Location"); + if (n2 && j && !a2) { + let t3 = new h.c(j, { forceLocale: false, headers: e2.request.headers, nextConfig: e2.request.nextConfig }); + n2 = new Response(n2.body, n2), t3.host === m2.nextUrl.host && (t3.buildId = u2 || t3.buildId, n2.headers.set("Location", String(t3))), d2 && (n2.headers.delete("Location"), n2.headers.set("x-nextjs-redirect", v(String(t3), String(l2)))); + } + let D = n2 || y.next(), F = D.headers.get("x-middleware-override-headers"), B = []; + if (F) { + for (let [e3, t3] of p2) + D.headers.set(`x-middleware-request-${e3}`, t3), B.push(e3); + B.length > 0 && D.headers.set("x-middleware-override-headers", F + "," + B.join(",")); + } + return { response: D, waitUntil: ("internal" === N2[o].kind ? Promise.all(N2[o].promises).then(() => { + }) : void 0) ?? Promise.resolve(), fetchMetrics: m2.fetchMetrics }; + } + }; + __namedExportsObject5["__chunk_35716"] = (e, t, r) => { + "use strict"; + r.d(t, { QW: () => p, Bb: () => P, _W: () => C, eN: () => k, Jm: () => R, VJ: () => T, MY: () => w, mo: () => g, lU: () => m, Mv: () => y, PN: () => v }); + var n = r(86952), i = r(79721), s = r(26253), a = r(86481), o = r(73464); + function l(e2, t2) { + if (0 === t2.length) + return 0; + if (0 === e2.length || t2.length > e2.length) + return -1; + for (let r2 = 0; r2 <= e2.length - t2.length; r2++) { + let n2 = true; + for (let i2 = 0; i2 < t2.length; i2++) + if (e2[r2 + i2] !== t2[i2]) { + n2 = false; + break; + } + if (n2) + return r2; + } + return -1; + } + function c(e2, t2) { + if (e2.length !== t2.length) + return false; + for (let r2 = 0; r2 < e2.length; r2++) + if (e2[r2] !== t2[r2]) + return false; + return true; + } + function u(e2, t2) { + let r2 = l(e2, t2); + if (0 === r2) + return e2.subarray(t2.length); + if (!(r2 > -1)) + return e2; + { + let n2 = new Uint8Array(e2.length - t2.length); + return n2.set(e2.slice(0, r2)), n2.set(e2.slice(r2 + t2.length), r2), n2; + } + } + var d = r(26195).Buffer; + function h() { + } + let f = new TextEncoder(); + function p(...e2) { + if (0 === e2.length) + throw Error("Invariant: chainStreams requires at least one stream"); + if (1 === e2.length) + return e2[0]; + let { readable: t2, writable: r2 } = new TransformStream(), n2 = e2[0].pipeTo(r2, { preventClose: true }), i2 = 1; + for (; i2 < e2.length - 1; i2++) { + let t3 = e2[i2]; + n2 = n2.then(() => t3.pipeTo(r2, { preventClose: true })); + } + let s2 = e2[i2]; + return (n2 = n2.then(() => s2.pipeTo(r2))).catch(h), t2; + } + function m(e2) { + return new ReadableStream({ start(t2) { + t2.enqueue(f.encode(e2)), t2.close(); + } }); + } + function g(e2) { + return new ReadableStream({ start(t2) { + t2.enqueue(e2), t2.close(); + } }); + } + async function y(e2) { + let t2 = e2.getReader(), r2 = []; + for (; ; ) { + let { done: e3, value: n2 } = await t2.read(); + if (e3) + break; + r2.push(n2); + } + return d.concat(r2); + } + async function v(e2) { + let t2 = new TextDecoder("utf-8", { fatal: true }), r2 = ""; + for await (let n2 of e2) + r2 += t2.decode(n2, { stream: true }); + return r2 + t2.decode(); + } + function b() { + let e2, t2 = [], r2 = 0, n2 = (n3) => { + if (e2) + return; + let i2 = new s.Y(); + e2 = i2, (0, a.Rk)(() => { + try { + let e3 = new Uint8Array(r2), i3 = 0; + for (let r3 = 0; r3 < t2.length; r3++) { + let n4 = t2[r3]; + e3.set(n4, i3), i3 += n4.byteLength; + } + t2.length = 0, r2 = 0, n3.enqueue(e3); + } catch { + } finally { + e2 = void 0, i2.resolve(); + } + }); + }; + return new TransformStream({ transform(e3, i2) { + t2.push(e3), r2 += e3.byteLength, n2(i2); + }, flush() { + if (e2) + return e2.promise; + } }); + } + function w({ ReactDOMServer: e2, element: t2, streamOptions: r2 }) { + return (0, n.Yz)().trace(i.k0.renderToReadableStream, async () => e2.renderToReadableStream(t2, r2)); + } + function x(e2) { + let t2 = false, r2 = false, n2 = false; + return new TransformStream({ async transform(i2, s2) { + if (n2 = true, r2) { + s2.enqueue(i2); + return; + } + let c2 = await e2(); + if (t2) { + if (c2) { + let e3 = f.encode(c2); + s2.enqueue(e3); + } + s2.enqueue(i2), r2 = true; + } else { + let e3 = l(i2, o.A.CLOSED.HEAD); + if (-1 !== e3) { + if (c2) { + let t3 = f.encode(c2), r3 = new Uint8Array(i2.length + t3.length); + r3.set(i2.slice(0, e3)), r3.set(t3, e3), r3.set(i2.slice(e3), e3 + t3.length), s2.enqueue(r3); + } else + s2.enqueue(i2); + r2 = true, t2 = true; + } + } + t2 ? (0, a.Rk)(() => { + r2 = false; + }) : s2.enqueue(i2); + }, async flush(t3) { + if (n2) { + let r3 = await e2(); + r3 && t3.enqueue(f.encode(r3)); + } + } }); + } + function S(e2) { + let t2 = null, r2 = false; + async function n2(n3) { + if (t2) + return; + let i2 = e2.getReader(); + await (0, a.ui)(); + try { + for (; ; ) { + let { done: e3, value: t3 } = await i2.read(); + if (e3) { + r2 = true; + return; + } + n3.enqueue(t3); + } + } catch (e3) { + n3.error(e3); + } + } + return new TransformStream({ transform(e3, r3) { + r3.enqueue(e3), t2 || (t2 = n2(r3)); + }, flush(e3) { + if (!r2) + return t2 || n2(e3); + } }); + } + let _ = ""; + function E() { + let e2 = false; + return new TransformStream({ transform(t2, r2) { + if (e2) + return r2.enqueue(t2); + let n2 = l(t2, o.A.CLOSED.BODY_AND_HTML); + if (n2 > -1) { + if (e2 = true, t2.length === o.A.CLOSED.BODY_AND_HTML.length) + return; + let i2 = t2.slice(0, n2); + if (r2.enqueue(i2), t2.length > o.A.CLOSED.BODY_AND_HTML.length + n2) { + let e3 = t2.slice(n2 + o.A.CLOSED.BODY_AND_HTML.length); + r2.enqueue(e3); + } + } else + r2.enqueue(t2); + }, flush(e3) { + e3.enqueue(o.A.CLOSED.BODY_AND_HTML); + } }); + } + async function k(e2, { suffix: t2, inlinedDataStream: r2, isStaticGeneration: n2, getServerInsertedHTML: i2, serverInsertedHTMLToHead: c2, validateRootLayout: u2 }) { + let d2, h2; + let p2 = t2 ? t2.split(_, 1)[0] : null; + return n2 && "allReady" in e2 && await e2.allReady, function(e3, t3) { + let r3 = e3; + for (let e4 of t3) + e4 && (r3 = r3.pipeThrough(e4)); + return r3; + }(e2, [b(), i2 && !c2 ? new TransformStream({ transform: async (e3, t3) => { + let r3 = await i2(); + r3 && t3.enqueue(f.encode(r3)), t3.enqueue(e3); + } }) : null, null != p2 && p2.length > 0 ? function(e3) { + let t3, r3 = false, n3 = (r4) => { + let n4 = new s.Y(); + t3 = n4, (0, a.Rk)(() => { + try { + r4.enqueue(f.encode(e3)); + } catch { + } finally { + t3 = void 0, n4.resolve(); + } + }); + }; + return new TransformStream({ transform(e4, t4) { + t4.enqueue(e4), r3 || (r3 = true, n3(t4)); + }, flush(n4) { + if (t3) + return t3.promise; + r3 || n4.enqueue(f.encode(e3)); + } }); + }(p2) : null, r2 ? S(r2) : null, u2 ? (d2 = false, h2 = false, new TransformStream({ async transform(e3, t3) { + !d2 && l(e3, o.A.OPENING.HTML) > -1 && (d2 = true), !h2 && l(e3, o.A.OPENING.BODY) > -1 && (h2 = true), t3.enqueue(e3); + }, flush(e3) { + let t3 = []; + d2 || t3.push("html"), h2 || t3.push("body"), t3.length && e3.enqueue(f.encode(`