var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb2, mod) => function __require() { return mod || (0, cb2[__getOwnPropNames(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all3) => { for (var name in all3) __defProp(target, name, { get: all3[name], enumerable: true }); }; var __copyProps = (to, from, except2, desc2) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except2) __defProp(to, key, { get: () => from[key], enumerable: !(desc2 = __getOwnPropDesc(from, key)) || desc2.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; // .wrangler/tmp/bundle-GYbPT2/strip-cf-connecting-ip-header.js function stripCfConnectingIPHeader(input, init) { const request = new Request(input, init); request.headers.delete("CF-Connecting-IP"); return request; } var init_strip_cf_connecting_ip_header = __esm({ ".wrangler/tmp/bundle-GYbPT2/strip-cf-connecting-ip-header.js"() { "use strict"; __name(stripCfConnectingIPHeader, "stripCfConnectingIPHeader"); globalThis.fetch = new Proxy(globalThis.fetch, { apply(target, thisArg, argArray) { return Reflect.apply(target, thisArg, [ stripCfConnectingIPHeader.apply(null, argArray) ]); } }); } }); // ../../node_modules/unenv/dist/runtime/_internal/utils.mjs function createNotImplementedError(name) { return new Error(`[unenv] ${name} is not implemented yet!`); } function notImplemented(name) { const fn = /* @__PURE__ */ __name(() => { throw createNotImplementedError(name); }, "fn"); return Object.assign(fn, { __unenv__: true }); } function notImplementedClass(name) { return class { __unenv__ = true; constructor() { throw new Error(`[unenv] ${name} is not implemented yet!`); } }; } var init_utils = __esm({ "../../node_modules/unenv/dist/runtime/_internal/utils.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(createNotImplementedError, "createNotImplementedError"); __name(notImplemented, "notImplemented"); __name(notImplementedClass, "notImplementedClass"); } }); // ../../node_modules/unenv/dist/runtime/node/internal/perf_hooks/performance.mjs var _timeOrigin, _performanceNow, nodeTiming, PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceResourceTiming, PerformanceObserverEntryList, Performance, PerformanceObserver, performance; var init_performance = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/perf_hooks/performance.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils(); _timeOrigin = globalThis.performance?.timeOrigin ?? Date.now(); _performanceNow = globalThis.performance?.now ? globalThis.performance.now.bind(globalThis.performance) : () => Date.now() - _timeOrigin; nodeTiming = { name: "node", entryType: "node", startTime: 0, duration: 0, nodeStart: 0, v8Start: 0, bootstrapComplete: 0, environment: 0, loopStart: 0, loopExit: 0, idleTime: 0, uvMetricsInfo: { loopCount: 0, events: 0, eventsWaiting: 0 }, detail: void 0, toJSON() { return this; } }; PerformanceEntry = class { __unenv__ = true; detail; entryType = "event"; name; startTime; constructor(name, options) { this.name = name; this.startTime = options?.startTime || _performanceNow(); this.detail = options?.detail; } get duration() { return _performanceNow() - this.startTime; } toJSON() { return { name: this.name, entryType: this.entryType, startTime: this.startTime, duration: this.duration, detail: this.detail }; } }; __name(PerformanceEntry, "PerformanceEntry"); PerformanceMark = /* @__PURE__ */ __name(class PerformanceMark2 extends PerformanceEntry { entryType = "mark"; constructor() { super(...arguments); } get duration() { return 0; } }, "PerformanceMark"); PerformanceMeasure = class extends PerformanceEntry { entryType = "measure"; }; __name(PerformanceMeasure, "PerformanceMeasure"); PerformanceResourceTiming = class extends PerformanceEntry { entryType = "resource"; serverTiming = []; connectEnd = 0; connectStart = 0; decodedBodySize = 0; domainLookupEnd = 0; domainLookupStart = 0; encodedBodySize = 0; fetchStart = 0; initiatorType = ""; name = ""; nextHopProtocol = ""; redirectEnd = 0; redirectStart = 0; requestStart = 0; responseEnd = 0; responseStart = 0; secureConnectionStart = 0; startTime = 0; transferSize = 0; workerStart = 0; responseStatus = 0; }; __name(PerformanceResourceTiming, "PerformanceResourceTiming"); PerformanceObserverEntryList = class { __unenv__ = true; getEntries() { return []; } getEntriesByName(_name, _type) { return []; } getEntriesByType(type) { return []; } }; __name(PerformanceObserverEntryList, "PerformanceObserverEntryList"); Performance = class { __unenv__ = true; timeOrigin = _timeOrigin; eventCounts = /* @__PURE__ */ new Map(); _entries = []; _resourceTimingBufferSize = 0; navigation = void 0; timing = void 0; timerify(_fn, _options) { throw createNotImplementedError("Performance.timerify"); } get nodeTiming() { return nodeTiming; } eventLoopUtilization() { return {}; } markResourceTiming() { return new PerformanceResourceTiming(""); } onresourcetimingbufferfull = null; now() { if (this.timeOrigin === _timeOrigin) { return _performanceNow(); } return Date.now() - this.timeOrigin; } clearMarks(markName) { this._entries = markName ? this._entries.filter((e2) => e2.name !== markName) : this._entries.filter((e2) => e2.entryType !== "mark"); } clearMeasures(measureName) { this._entries = measureName ? this._entries.filter((e2) => e2.name !== measureName) : this._entries.filter((e2) => e2.entryType !== "measure"); } clearResourceTimings() { this._entries = this._entries.filter((e2) => e2.entryType !== "resource" || e2.entryType !== "navigation"); } getEntries() { return this._entries; } getEntriesByName(name, type) { return this._entries.filter((e2) => e2.name === name && (!type || e2.entryType === type)); } getEntriesByType(type) { return this._entries.filter((e2) => e2.entryType === type); } mark(name, options) { const entry = new PerformanceMark(name, options); this._entries.push(entry); return entry; } measure(measureName, startOrMeasureOptions, endMark) { let start; let end; if (typeof startOrMeasureOptions === "string") { start = this.getEntriesByName(startOrMeasureOptions, "mark")[0]?.startTime; end = this.getEntriesByName(endMark, "mark")[0]?.startTime; } else { start = Number.parseFloat(startOrMeasureOptions?.start) || this.now(); end = Number.parseFloat(startOrMeasureOptions?.end) || this.now(); } const entry = new PerformanceMeasure(measureName, { startTime: start, detail: { start, end } }); this._entries.push(entry); return entry; } setResourceTimingBufferSize(maxSize) { this._resourceTimingBufferSize = maxSize; } addEventListener(type, listener, options) { throw createNotImplementedError("Performance.addEventListener"); } removeEventListener(type, listener, options) { throw createNotImplementedError("Performance.removeEventListener"); } dispatchEvent(event) { throw createNotImplementedError("Performance.dispatchEvent"); } toJSON() { return this; } }; __name(Performance, "Performance"); PerformanceObserver = class { __unenv__ = true; _callback = null; constructor(callback) { this._callback = callback; } takeRecords() { return []; } disconnect() { throw createNotImplementedError("PerformanceObserver.disconnect"); } observe(options) { throw createNotImplementedError("PerformanceObserver.observe"); } bind(fn) { return fn; } runInAsyncScope(fn, thisArg, ...args) { return fn.call(thisArg, ...args); } asyncId() { return 0; } triggerAsyncId() { return 0; } emitDestroy() { return this; } }; __name(PerformanceObserver, "PerformanceObserver"); __publicField(PerformanceObserver, "supportedEntryTypes", []); performance = globalThis.performance && "addEventListener" in globalThis.performance ? globalThis.performance : new Performance(); } }); // ../../node_modules/unenv/dist/runtime/node/perf_hooks.mjs var init_perf_hooks = __esm({ "../../node_modules/unenv/dist/runtime/node/perf_hooks.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_performance(); } }); // ../../node_modules/@cloudflare/unenv-preset/dist/runtime/polyfill/performance.mjs var init_performance2 = __esm({ "../../node_modules/@cloudflare/unenv-preset/dist/runtime/polyfill/performance.mjs"() { init_perf_hooks(); globalThis.performance = performance; globalThis.Performance = Performance; globalThis.PerformanceEntry = PerformanceEntry; globalThis.PerformanceMark = PerformanceMark; globalThis.PerformanceMeasure = PerformanceMeasure; globalThis.PerformanceObserver = PerformanceObserver; globalThis.PerformanceObserverEntryList = PerformanceObserverEntryList; globalThis.PerformanceResourceTiming = PerformanceResourceTiming; } }); // ../../node_modules/unenv/dist/runtime/mock/noop.mjs var noop_default; var init_noop = __esm({ "../../node_modules/unenv/dist/runtime/mock/noop.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); noop_default = Object.assign(() => { }, { __unenv__: true }); } }); // ../../node_modules/unenv/dist/runtime/node/console.mjs import { Writable } from "node:stream"; var _console, _ignoreErrors, _stderr, _stdout, log, info, trace, debug, table, error, warn, createTask, clear, count, countReset, dir, dirxml, group, groupEnd, groupCollapsed, profile, profileEnd, time, timeEnd, timeLog, timeStamp, Console, _times, _stdoutErrorHandler, _stderrErrorHandler; var init_console = __esm({ "../../node_modules/unenv/dist/runtime/node/console.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_noop(); init_utils(); _console = globalThis.console; _ignoreErrors = true; _stderr = new Writable(); _stdout = new Writable(); log = _console?.log ?? noop_default; info = _console?.info ?? log; trace = _console?.trace ?? info; debug = _console?.debug ?? log; table = _console?.table ?? log; error = _console?.error ?? log; warn = _console?.warn ?? error; createTask = _console?.createTask ?? /* @__PURE__ */ notImplemented("console.createTask"); clear = _console?.clear ?? noop_default; count = _console?.count ?? noop_default; countReset = _console?.countReset ?? noop_default; dir = _console?.dir ?? noop_default; dirxml = _console?.dirxml ?? noop_default; group = _console?.group ?? noop_default; groupEnd = _console?.groupEnd ?? noop_default; groupCollapsed = _console?.groupCollapsed ?? noop_default; profile = _console?.profile ?? noop_default; profileEnd = _console?.profileEnd ?? noop_default; time = _console?.time ?? noop_default; timeEnd = _console?.timeEnd ?? noop_default; timeLog = _console?.timeLog ?? noop_default; timeStamp = _console?.timeStamp ?? noop_default; Console = _console?.Console ?? /* @__PURE__ */ notImplementedClass("console.Console"); _times = /* @__PURE__ */ new Map(); _stdoutErrorHandler = noop_default; _stderrErrorHandler = noop_default; } }); // ../../node_modules/@cloudflare/unenv-preset/dist/runtime/node/console.mjs var workerdConsole, assert, clear2, context, count2, countReset2, createTask2, debug2, dir2, dirxml2, error2, group2, groupCollapsed2, groupEnd2, info2, log2, profile2, profileEnd2, table2, time2, timeEnd2, timeLog2, timeStamp2, trace2, warn2, console_default; var init_console2 = __esm({ "../../node_modules/@cloudflare/unenv-preset/dist/runtime/node/console.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_console(); workerdConsole = globalThis["console"]; ({ assert, clear: clear2, context: ( // @ts-expect-error undocumented public API context ), count: count2, countReset: countReset2, createTask: ( // @ts-expect-error undocumented public API createTask2 ), debug: debug2, dir: dir2, dirxml: dirxml2, error: error2, group: group2, groupCollapsed: groupCollapsed2, groupEnd: groupEnd2, info: info2, log: log2, profile: profile2, profileEnd: profileEnd2, table: table2, time: time2, timeEnd: timeEnd2, timeLog: timeLog2, timeStamp: timeStamp2, trace: trace2, warn: warn2 } = workerdConsole); Object.assign(workerdConsole, { Console, _ignoreErrors, _stderr, _stderrErrorHandler, _stdout, _stdoutErrorHandler, _times }); console_default = workerdConsole; } }); // ../../node_modules/wrangler/_virtual_unenv_global_polyfill-@cloudflare-unenv-preset-node-console var init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console = __esm({ "../../node_modules/wrangler/_virtual_unenv_global_polyfill-@cloudflare-unenv-preset-node-console"() { init_console2(); globalThis.console = console_default; } }); // ../../node_modules/unenv/dist/runtime/node/internal/process/hrtime.mjs var hrtime; var init_hrtime = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/process/hrtime.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); hrtime = /* @__PURE__ */ Object.assign(/* @__PURE__ */ __name(function hrtime2(startTime) { const now = Date.now(); const seconds = Math.trunc(now / 1e3); const nanos = now % 1e3 * 1e6; if (startTime) { let diffSeconds = seconds - startTime[0]; let diffNanos = nanos - startTime[0]; if (diffNanos < 0) { diffSeconds = diffSeconds - 1; diffNanos = 1e9 + diffNanos; } return [diffSeconds, diffNanos]; } return [seconds, nanos]; }, "hrtime"), { bigint: /* @__PURE__ */ __name(function bigint() { return BigInt(Date.now() * 1e6); }, "bigint") }); } }); // ../../node_modules/unenv/dist/runtime/node/internal/tty/read-stream.mjs import { Socket } from "node:net"; var ReadStream; var init_read_stream = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/tty/read-stream.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ReadStream = class extends Socket { fd; constructor(fd) { super(); this.fd = fd; } isRaw = false; setRawMode(mode) { this.isRaw = mode; return this; } isTTY = false; }; __name(ReadStream, "ReadStream"); } }); // ../../node_modules/unenv/dist/runtime/node/internal/tty/write-stream.mjs import { Socket as Socket2 } from "node:net"; var WriteStream; var init_write_stream = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/tty/write-stream.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); WriteStream = class extends Socket2 { fd; constructor(fd) { super(); this.fd = fd; } clearLine(dir3, callback) { callback && callback(); return false; } clearScreenDown(callback) { callback && callback(); return false; } cursorTo(x2, y2, callback) { callback && typeof callback === "function" && callback(); return false; } moveCursor(dx, dy, callback) { callback && callback(); return false; } getColorDepth(env2) { return 1; } hasColors(count4, env2) { return false; } getWindowSize() { return [this.columns, this.rows]; } columns = 80; rows = 24; isTTY = false; }; __name(WriteStream, "WriteStream"); } }); // ../../node_modules/unenv/dist/runtime/node/tty.mjs var init_tty = __esm({ "../../node_modules/unenv/dist/runtime/node/tty.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_read_stream(); init_write_stream(); } }); // ../../node_modules/unenv/dist/runtime/node/internal/process/process.mjs import { EventEmitter } from "node:events"; var Process; var init_process = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/process/process.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tty(); init_utils(); Process = class extends EventEmitter { env; hrtime; nextTick; constructor(impl) { super(); this.env = impl.env; this.hrtime = impl.hrtime; this.nextTick = impl.nextTick; for (const prop of [...Object.getOwnPropertyNames(Process.prototype), ...Object.getOwnPropertyNames(EventEmitter.prototype)]) { const value = this[prop]; if (typeof value === "function") { this[prop] = value.bind(this); } } } emitWarning(warning, type, code) { console.warn(`${code ? `[${code}] ` : ""}${type ? `${type}: ` : ""}${warning}`); } emit(...args) { return super.emit(...args); } listeners(eventName) { return super.listeners(eventName); } #stdin; #stdout; #stderr; get stdin() { return this.#stdin ??= new ReadStream(0); } get stdout() { return this.#stdout ??= new WriteStream(1); } get stderr() { return this.#stderr ??= new WriteStream(2); } #cwd = "/"; chdir(cwd2) { this.#cwd = cwd2; } cwd() { return this.#cwd; } arch = ""; platform = ""; argv = []; argv0 = ""; execArgv = []; execPath = ""; title = ""; pid = 200; ppid = 100; get version() { return ""; } get versions() { return {}; } get allowedNodeEnvironmentFlags() { return /* @__PURE__ */ new Set(); } get sourceMapsEnabled() { return false; } get debugPort() { return 0; } get throwDeprecation() { return false; } get traceDeprecation() { return false; } get features() { return {}; } get release() { return {}; } get connected() { return false; } get config() { return {}; } get moduleLoadList() { return []; } constrainedMemory() { return 0; } availableMemory() { return 0; } uptime() { return 0; } resourceUsage() { return {}; } ref() { } unref() { } umask() { throw createNotImplementedError("process.umask"); } getBuiltinModule() { return void 0; } getActiveResourcesInfo() { throw createNotImplementedError("process.getActiveResourcesInfo"); } exit() { throw createNotImplementedError("process.exit"); } reallyExit() { throw createNotImplementedError("process.reallyExit"); } kill() { throw createNotImplementedError("process.kill"); } abort() { throw createNotImplementedError("process.abort"); } dlopen() { throw createNotImplementedError("process.dlopen"); } setSourceMapsEnabled() { throw createNotImplementedError("process.setSourceMapsEnabled"); } loadEnvFile() { throw createNotImplementedError("process.loadEnvFile"); } disconnect() { throw createNotImplementedError("process.disconnect"); } cpuUsage() { throw createNotImplementedError("process.cpuUsage"); } setUncaughtExceptionCaptureCallback() { throw createNotImplementedError("process.setUncaughtExceptionCaptureCallback"); } hasUncaughtExceptionCaptureCallback() { throw createNotImplementedError("process.hasUncaughtExceptionCaptureCallback"); } initgroups() { throw createNotImplementedError("process.initgroups"); } openStdin() { throw createNotImplementedError("process.openStdin"); } assert() { throw createNotImplementedError("process.assert"); } binding() { throw createNotImplementedError("process.binding"); } permission = { has: /* @__PURE__ */ notImplemented("process.permission.has") }; report = { directory: "", filename: "", signal: "SIGUSR2", compact: false, reportOnFatalError: false, reportOnSignal: false, reportOnUncaughtException: false, getReport: /* @__PURE__ */ notImplemented("process.report.getReport"), writeReport: /* @__PURE__ */ notImplemented("process.report.writeReport") }; finalization = { register: /* @__PURE__ */ notImplemented("process.finalization.register"), unregister: /* @__PURE__ */ notImplemented("process.finalization.unregister"), registerBeforeExit: /* @__PURE__ */ notImplemented("process.finalization.registerBeforeExit") }; memoryUsage = Object.assign(() => ({ arrayBuffers: 0, rss: 0, external: 0, heapTotal: 0, heapUsed: 0 }), { rss: () => 0 }); mainModule = void 0; domain = void 0; send = void 0; exitCode = void 0; channel = void 0; getegid = void 0; geteuid = void 0; getgid = void 0; getgroups = void 0; getuid = void 0; setegid = void 0; seteuid = void 0; setgid = void 0; setgroups = void 0; setuid = void 0; _events = void 0; _eventsCount = void 0; _exiting = void 0; _maxListeners = void 0; _debugEnd = void 0; _debugProcess = void 0; _fatalException = void 0; _getActiveHandles = void 0; _getActiveRequests = void 0; _kill = void 0; _preload_modules = void 0; _rawDebug = void 0; _startProfilerIdleNotifier = void 0; _stopProfilerIdleNotifier = void 0; _tickCallback = void 0; _disconnect = void 0; _handleQueue = void 0; _pendingMessage = void 0; _channel = void 0; _send = void 0; _linkedBinding = void 0; }; __name(Process, "Process"); } }); // ../../node_modules/@cloudflare/unenv-preset/dist/runtime/node/process.mjs var globalProcess, getBuiltinModule, exit, platform, nextTick, unenvProcess, abort, addListener, allowedNodeEnvironmentFlags, hasUncaughtExceptionCaptureCallback, setUncaughtExceptionCaptureCallback, loadEnvFile, sourceMapsEnabled, arch, argv, argv0, chdir, config, connected, constrainedMemory, availableMemory, cpuUsage, cwd, debugPort, dlopen, disconnect, emit, emitWarning, env, eventNames, execArgv, execPath, finalization, features, getActiveResourcesInfo, getMaxListeners, hrtime3, kill, listeners, listenerCount, memoryUsage, on, off, once, pid, ppid, prependListener, prependOnceListener, rawListeners, release, removeAllListeners, removeListener, report, resourceUsage, setMaxListeners, setSourceMapsEnabled, stderr, stdin, stdout, title, throwDeprecation, traceDeprecation, umask, uptime, version, versions, domain, initgroups, moduleLoadList, reallyExit, openStdin, assert2, binding, send, exitCode, channel, getegid, geteuid, getgid, getgroups, getuid, setegid, seteuid, setgid, setgroups, setuid, permission, mainModule, _events, _eventsCount, _exiting, _maxListeners, _debugEnd, _debugProcess, _fatalException, _getActiveHandles, _getActiveRequests, _kill, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, _disconnect, _handleQueue, _pendingMessage, _channel, _send, _linkedBinding, _process, process_default; var init_process2 = __esm({ "../../node_modules/@cloudflare/unenv-preset/dist/runtime/node/process.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_hrtime(); init_process(); globalProcess = globalThis["process"]; getBuiltinModule = globalProcess.getBuiltinModule; ({ exit, platform, nextTick } = getBuiltinModule( "node:process" )); unenvProcess = new Process({ env: globalProcess.env, hrtime, nextTick }); ({ abort, addListener, allowedNodeEnvironmentFlags, hasUncaughtExceptionCaptureCallback, setUncaughtExceptionCaptureCallback, loadEnvFile, sourceMapsEnabled, arch, argv, argv0, chdir, config, connected, constrainedMemory, availableMemory, cpuUsage, cwd, debugPort, dlopen, disconnect, emit, emitWarning, env, eventNames, execArgv, execPath, finalization, features, getActiveResourcesInfo, getMaxListeners, hrtime: hrtime3, kill, listeners, listenerCount, memoryUsage, on, off, once, pid, ppid, prependListener, prependOnceListener, rawListeners, release, removeAllListeners, removeListener, report, resourceUsage, setMaxListeners, setSourceMapsEnabled, stderr, stdin, stdout, title, throwDeprecation, traceDeprecation, umask, uptime, version, versions, domain, initgroups, moduleLoadList, reallyExit, openStdin, assert: assert2, binding, send, exitCode, channel, getegid, geteuid, getgid, getgroups, getuid, setegid, seteuid, setgid, setgroups, setuid, permission, mainModule, _events, _eventsCount, _exiting, _maxListeners, _debugEnd, _debugProcess, _fatalException, _getActiveHandles, _getActiveRequests, _kill, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, _disconnect, _handleQueue, _pendingMessage, _channel, _send, _linkedBinding } = unenvProcess); _process = { abort, addListener, allowedNodeEnvironmentFlags, hasUncaughtExceptionCaptureCallback, setUncaughtExceptionCaptureCallback, loadEnvFile, sourceMapsEnabled, arch, argv, argv0, chdir, config, connected, constrainedMemory, availableMemory, cpuUsage, cwd, debugPort, dlopen, disconnect, emit, emitWarning, env, eventNames, execArgv, execPath, exit, finalization, features, getBuiltinModule, getActiveResourcesInfo, getMaxListeners, hrtime: hrtime3, kill, listeners, listenerCount, memoryUsage, nextTick, on, off, once, pid, platform, ppid, prependListener, prependOnceListener, rawListeners, release, removeAllListeners, removeListener, report, resourceUsage, setMaxListeners, setSourceMapsEnabled, stderr, stdin, stdout, title, throwDeprecation, traceDeprecation, umask, uptime, version, versions, // @ts-expect-error old API domain, initgroups, moduleLoadList, reallyExit, openStdin, assert: assert2, binding, send, exitCode, channel, getegid, geteuid, getgid, getgroups, getuid, setegid, seteuid, setgid, setgroups, setuid, permission, mainModule, _events, _eventsCount, _exiting, _maxListeners, _debugEnd, _debugProcess, _fatalException, _getActiveHandles, _getActiveRequests, _kill, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, _disconnect, _handleQueue, _pendingMessage, _channel, _send, _linkedBinding }; process_default = _process; } }); // ../../node_modules/wrangler/_virtual_unenv_global_polyfill-@cloudflare-unenv-preset-node-process var init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process = __esm({ "../../node_modules/wrangler/_virtual_unenv_global_polyfill-@cloudflare-unenv-preset-node-process"() { init_process2(); globalThis.process = process_default; } }); // wrangler-modules-watch:wrangler:modules-watch var init_wrangler_modules_watch = __esm({ "wrangler-modules-watch:wrangler:modules-watch"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/wrangler/templates/modules-watch-stub.js var init_modules_watch_stub = __esm({ "../../node_modules/wrangler/templates/modules-watch-stub.js"() { init_wrangler_modules_watch(); } }); // ../../node_modules/hono/dist/compose.js var compose; var init_compose = __esm({ "../../node_modules/hono/dist/compose.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); compose = /* @__PURE__ */ __name((middleware2, onError, onNotFound) => { return (context2, next) => { let index = -1; return dispatch(0); async function dispatch(i2) { if (i2 <= index) { throw new Error("next() called multiple times"); } index = i2; let res; let isError = false; let handler; if (middleware2[i2]) { handler = middleware2[i2][0][0]; context2.req.routeIndex = i2; } else { handler = i2 === middleware2.length && next || void 0; } if (handler) { try { res = await handler(context2, () => dispatch(i2 + 1)); } catch (err) { if (err instanceof Error && onError) { context2.error = err; res = await onError(err, context2); isError = true; } else { throw err; } } } else { if (context2.finalized === false && onNotFound) { res = await onNotFound(context2); } } if (res && (context2.finalized === false || isError)) { context2.res = res; } return context2; } __name(dispatch, "dispatch"); }; }, "compose"); } }); // ../../node_modules/hono/dist/http-exception.js var init_http_exception = __esm({ "../../node_modules/hono/dist/http-exception.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/hono/dist/request/constants.js var GET_MATCH_RESULT; var init_constants = __esm({ "../../node_modules/hono/dist/request/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); } }); // ../../node_modules/hono/dist/utils/body.js async function parseFormData(request, options) { const formData = await request.formData(); if (formData) { return convertFormDataToBodyData(formData, options); } return {}; } function convertFormDataToBodyData(formData, options) { const form = /* @__PURE__ */ Object.create(null); formData.forEach((value, key) => { const shouldParseAllValues = options.all || key.endsWith("[]"); if (!shouldParseAllValues) { form[key] = value; } else { handleParsingAllValues(form, key, value); } }); if (options.dot) { Object.entries(form).forEach(([key, value]) => { const shouldParseDotValues = key.includes("."); if (shouldParseDotValues) { handleParsingNestedValues(form, key, value); delete form[key]; } }); } return form; } var parseBody, handleParsingAllValues, handleParsingNestedValues; var init_body = __esm({ "../../node_modules/hono/dist/utils/body.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_request(); parseBody = /* @__PURE__ */ __name(async (request, options = /* @__PURE__ */ Object.create(null)) => { const { all: all3 = false, dot = false } = options; const headers = request instanceof HonoRequest ? request.raw.headers : request.headers; const contentType = headers.get("Content-Type"); if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) { return parseFormData(request, { all: all3, dot }); } return {}; }, "parseBody"); __name(parseFormData, "parseFormData"); __name(convertFormDataToBodyData, "convertFormDataToBodyData"); handleParsingAllValues = /* @__PURE__ */ __name((form, key, value) => { if (form[key] !== void 0) { if (Array.isArray(form[key])) { ; form[key].push(value); } else { form[key] = [form[key], value]; } } else { if (!key.endsWith("[]")) { form[key] = value; } else { form[key] = [value]; } } }, "handleParsingAllValues"); handleParsingNestedValues = /* @__PURE__ */ __name((form, key, value) => { if (/(?:^|\.)__proto__\./.test(key)) { return; } let nestedForm = form; const keys = key.split("."); keys.forEach((key2, index) => { if (index === keys.length - 1) { nestedForm[key2] = value; } else { if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) { nestedForm[key2] = /* @__PURE__ */ Object.create(null); } nestedForm = nestedForm[key2]; } }); }, "handleParsingNestedValues"); } }); // ../../node_modules/hono/dist/utils/url.js var splitPath, splitRoutingPath, extractGroupsFromPath, replaceGroupMarks, patternCache, getPattern, tryDecode, tryDecodeURI, getPath, getPathNoStrict, mergePath, checkOptionalParameter, _decodeURI, _getQueryParam, getQueryParam, getQueryParams, decodeURIComponent_; var init_url = __esm({ "../../node_modules/hono/dist/utils/url.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); splitPath = /* @__PURE__ */ __name((path) => { const paths = path.split("/"); if (paths[0] === "") { paths.shift(); } return paths; }, "splitPath"); splitRoutingPath = /* @__PURE__ */ __name((routePath2) => { const { groups, path } = extractGroupsFromPath(routePath2); const paths = splitPath(path); return replaceGroupMarks(paths, groups); }, "splitRoutingPath"); extractGroupsFromPath = /* @__PURE__ */ __name((path) => { const groups = []; path = path.replace(/\{[^}]+\}/g, (match2, index) => { const mark = `@${index}`; groups.push([mark, match2]); return mark; }); return { groups, path }; }, "extractGroupsFromPath"); replaceGroupMarks = /* @__PURE__ */ __name((paths, groups) => { for (let i2 = groups.length - 1; i2 >= 0; i2--) { const [mark] = groups[i2]; for (let j2 = paths.length - 1; j2 >= 0; j2--) { if (paths[j2].includes(mark)) { paths[j2] = paths[j2].replace(mark, groups[i2][1]); break; } } } return paths; }, "replaceGroupMarks"); patternCache = {}; getPattern = /* @__PURE__ */ __name((label, next) => { if (label === "*") { return "*"; } const match2 = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); if (match2) { const cacheKey = `${label}#${next}`; if (!patternCache[cacheKey]) { if (match2[2]) { patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match2[1], new RegExp(`^${match2[2]}(?=/${next})`)] : [label, match2[1], new RegExp(`^${match2[2]}$`)]; } else { patternCache[cacheKey] = [label, match2[1], true]; } } return patternCache[cacheKey]; } return null; }, "getPattern"); tryDecode = /* @__PURE__ */ __name((str, decoder2) => { try { return decoder2(str); } catch { return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match2) => { try { return decoder2(match2); } catch { return match2; } }); } }, "tryDecode"); tryDecodeURI = /* @__PURE__ */ __name((str) => tryDecode(str, decodeURI), "tryDecodeURI"); getPath = /* @__PURE__ */ __name((request) => { const url2 = request.url; const start = url2.indexOf("/", url2.indexOf(":") + 4); let i2 = start; for (; i2 < url2.length; i2++) { const charCode = url2.charCodeAt(i2); if (charCode === 37) { const queryIndex = url2.indexOf("?", i2); const hashIndex = url2.indexOf("#", i2); const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex); const path = url2.slice(start, end); return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path); } else if (charCode === 63 || charCode === 35) { break; } } return url2.slice(start, i2); }, "getPath"); getPathNoStrict = /* @__PURE__ */ __name((request) => { const result = getPath(request); return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result; }, "getPathNoStrict"); mergePath = /* @__PURE__ */ __name((base, sub, ...rest) => { if (rest.length) { sub = mergePath(sub, ...rest); } return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`; }, "mergePath"); checkOptionalParameter = /* @__PURE__ */ __name((path) => { if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) { return null; } const segments = path.split("/"); const results = []; let basePath = ""; segments.forEach((segment) => { if (segment !== "" && !/\:/.test(segment)) { basePath += "/" + segment; } else if (/\:/.test(segment)) { if (/\?/.test(segment)) { if (results.length === 0 && basePath === "") { results.push("/"); } else { results.push(basePath); } const optionalSegment = segment.replace("?", ""); basePath += "/" + optionalSegment; results.push(basePath); } else { basePath += "/" + segment; } } }); return results.filter((v3, i2, a2) => a2.indexOf(v3) === i2); }, "checkOptionalParameter"); _decodeURI = /* @__PURE__ */ __name((value) => { if (!/[%+]/.test(value)) { return value; } if (value.indexOf("+") !== -1) { value = value.replace(/\+/g, " "); } return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value; }, "_decodeURI"); _getQueryParam = /* @__PURE__ */ __name((url2, key, multiple) => { let encoded; if (!multiple && key && !/[%+]/.test(key)) { let keyIndex2 = url2.indexOf("?", 8); if (keyIndex2 === -1) { return void 0; } if (!url2.startsWith(key, keyIndex2 + 1)) { keyIndex2 = url2.indexOf(`&${key}`, keyIndex2 + 1); } while (keyIndex2 !== -1) { const trailingKeyCode = url2.charCodeAt(keyIndex2 + key.length + 1); if (trailingKeyCode === 61) { const valueIndex = keyIndex2 + key.length + 2; const endIndex = url2.indexOf("&", valueIndex); return _decodeURI(url2.slice(valueIndex, endIndex === -1 ? void 0 : endIndex)); } else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) { return ""; } keyIndex2 = url2.indexOf(`&${key}`, keyIndex2 + 1); } encoded = /[%+]/.test(url2); if (!encoded) { return void 0; } } const results = {}; encoded ??= /[%+]/.test(url2); let keyIndex = url2.indexOf("?", 8); while (keyIndex !== -1) { const nextKeyIndex = url2.indexOf("&", keyIndex + 1); let valueIndex = url2.indexOf("=", keyIndex); if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) { valueIndex = -1; } let name = url2.slice( keyIndex + 1, valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex ); if (encoded) { name = _decodeURI(name); } keyIndex = nextKeyIndex; if (name === "") { continue; } let value; if (valueIndex === -1) { value = ""; } else { value = url2.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex); if (encoded) { value = _decodeURI(value); } } if (multiple) { if (!(results[name] && Array.isArray(results[name]))) { results[name] = []; } ; results[name].push(value); } else { results[name] ??= value; } } return key ? results[key] : results; }, "_getQueryParam"); getQueryParam = _getQueryParam; getQueryParams = /* @__PURE__ */ __name((url2, key) => { return _getQueryParam(url2, key, true); }, "getQueryParams"); decodeURIComponent_ = decodeURIComponent; } }); // ../../node_modules/hono/dist/request.js var tryDecodeURIComponent, HonoRequest; var init_request = __esm({ "../../node_modules/hono/dist/request.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_http_exception(); init_constants(); init_body(); init_url(); tryDecodeURIComponent = /* @__PURE__ */ __name((str) => tryDecode(str, decodeURIComponent_), "tryDecodeURIComponent"); HonoRequest = /* @__PURE__ */ __name(class { /** * `.raw` can get the raw Request object. * * @see {@link https://hono.dev/docs/api/request#raw} * * @example * ```ts * // For Cloudflare Workers * app.post('/', async (c) => { * const metadata = c.req.raw.cf?.hostMetadata? * ... * }) * ``` */ raw; #validatedData; // Short name of validatedData #matchResult; routeIndex = 0; /** * `.path` can get the pathname of the request. * * @see {@link https://hono.dev/docs/api/request#path} * * @example * ```ts * app.get('/about/me', (c) => { * const pathname = c.req.path // `/about/me` * }) * ``` */ path; bodyCache = {}; constructor(request, path = "/", matchResult = [[]]) { this.raw = request; this.path = path; this.#matchResult = matchResult; this.#validatedData = {}; } param(key) { return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams(); } #getDecodedParam(key) { const paramKey = this.#matchResult[0][this.routeIndex][1][key]; const param = this.#getParamValue(paramKey); return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param; } #getAllDecodedParams() { const decoded = {}; const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]); for (const key of keys) { const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]); if (value !== void 0) { decoded[key] = /\%/.test(value) ? tryDecodeURIComponent(value) : value; } } return decoded; } #getParamValue(paramKey) { return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey; } query(key) { return getQueryParam(this.url, key); } queries(key) { return getQueryParams(this.url, key); } header(name) { if (name) { return this.raw.headers.get(name) ?? void 0; } const headerData = {}; this.raw.headers.forEach((value, key) => { headerData[key] = value; }); return headerData; } async parseBody(options) { return parseBody(this, options); } #cachedBody = (key) => { const { bodyCache, raw: raw2 } = this; const cachedBody = bodyCache[key]; if (cachedBody) { return cachedBody; } const anyCachedKey = Object.keys(bodyCache)[0]; if (anyCachedKey) { return bodyCache[anyCachedKey].then((body) => { if (anyCachedKey === "json") { body = JSON.stringify(body); } return new Response(body)[key](); }); } return bodyCache[key] = raw2[key](); }; /** * `.json()` can parse Request body of type `application/json` * * @see {@link https://hono.dev/docs/api/request#json} * * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.json() * }) * ``` */ json() { return this.#cachedBody("text").then((text2) => JSON.parse(text2)); } /** * `.text()` can parse Request body of type `text/plain` * * @see {@link https://hono.dev/docs/api/request#text} * * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.text() * }) * ``` */ text() { return this.#cachedBody("text"); } /** * `.arrayBuffer()` parse Request body as an `ArrayBuffer` * * @see {@link https://hono.dev/docs/api/request#arraybuffer} * * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.arrayBuffer() * }) * ``` */ arrayBuffer() { return this.#cachedBody("arrayBuffer"); } /** * Parses the request body as a `Blob`. * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.blob(); * }); * ``` * @see https://hono.dev/docs/api/request#blob */ blob() { return this.#cachedBody("blob"); } /** * Parses the request body as `FormData`. * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.formData(); * }); * ``` * @see https://hono.dev/docs/api/request#formdata */ formData() { return this.#cachedBody("formData"); } /** * Adds validated data to the request. * * @param target - The target of the validation. * @param data - The validated data to add. */ addValidatedData(target, data) { this.#validatedData[target] = data; } valid(target) { return this.#validatedData[target]; } /** * `.url()` can get the request url strings. * * @see {@link https://hono.dev/docs/api/request#url} * * @example * ```ts * app.get('/about/me', (c) => { * const url = c.req.url // `http://localhost:8787/about/me` * ... * }) * ``` */ get url() { return this.raw.url; } /** * `.method()` can get the method name of the request. * * @see {@link https://hono.dev/docs/api/request#method} * * @example * ```ts * app.get('/about/me', (c) => { * const method = c.req.method // `GET` * }) * ``` */ get method() { return this.raw.method; } get [GET_MATCH_RESULT]() { return this.#matchResult; } /** * `.matchedRoutes()` can return a matched route in the handler * * @deprecated * * Use matchedRoutes helper defined in "hono/route" instead. * * @see {@link https://hono.dev/docs/api/request#matchedroutes} * * @example * ```ts * app.use('*', async function logger(c, next) { * await next() * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') * console.log( * method, * ' ', * path, * ' '.repeat(Math.max(10 - path.length, 0)), * name, * i === c.req.routeIndex ? '<- respond from here' : '' * ) * }) * }) * ``` */ get matchedRoutes() { return this.#matchResult[0].map(([[, route]]) => route); } /** * `routePath()` can retrieve the path registered within the handler * * @deprecated * * Use routePath helper defined in "hono/route" instead. * * @see {@link https://hono.dev/docs/api/request#routepath} * * @example * ```ts * app.get('/posts/:id', (c) => { * return c.json({ path: c.req.routePath }) * }) * ``` */ get routePath() { return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path; } }, "HonoRequest"); } }); // ../../node_modules/hono/dist/utils/html.js var HtmlEscapedCallbackPhase, raw, resolveCallback; var init_html = __esm({ "../../node_modules/hono/dist/utils/html.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); HtmlEscapedCallbackPhase = { Stringify: 1, BeforeStream: 2, Stream: 3 }; raw = /* @__PURE__ */ __name((value, callbacks) => { const escapedString = new String(value); escapedString.isEscaped = true; escapedString.callbacks = callbacks; return escapedString; }, "raw"); resolveCallback = /* @__PURE__ */ __name(async (str, phase, preserveCallbacks, context2, buffer) => { if (typeof str === "object" && !(str instanceof String)) { if (!(str instanceof Promise)) { str = str.toString(); } if (str instanceof Promise) { str = await str; } } const callbacks = str.callbacks; if (!callbacks?.length) { return Promise.resolve(str); } if (buffer) { buffer[0] += str; } else { buffer = [str]; } const resStr = Promise.all(callbacks.map((c2) => c2({ phase, buffer, context: context2 }))).then( (res) => Promise.all( res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context2, buffer)) ).then(() => buffer[0]) ); if (preserveCallbacks) { return raw(await resStr, callbacks); } else { return resStr; } }, "resolveCallback"); } }); // ../../node_modules/hono/dist/context.js var TEXT_PLAIN, setDefaultContentType, createResponseInstance, Context; var init_context = __esm({ "../../node_modules/hono/dist/context.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_request(); init_html(); TEXT_PLAIN = "text/plain; charset=UTF-8"; setDefaultContentType = /* @__PURE__ */ __name((contentType, headers) => { return { "Content-Type": contentType, ...headers }; }, "setDefaultContentType"); createResponseInstance = /* @__PURE__ */ __name((body, init) => new Response(body, init), "createResponseInstance"); Context = /* @__PURE__ */ __name(class { #rawRequest; #req; /** * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers. * * @see {@link https://hono.dev/docs/api/context#env} * * @example * ```ts * // Environment object for Cloudflare Workers * app.get('*', async c => { * const counter = c.env.COUNTER * }) * ``` */ env = {}; #var; finalized = false; /** * `.error` can get the error object from the middleware if the Handler throws an error. * * @see {@link https://hono.dev/docs/api/context#error} * * @example * ```ts * app.use('*', async (c, next) => { * await next() * if (c.error) { * // do something... * } * }) * ``` */ error; #status; #executionCtx; #res; #layout; #renderer; #notFoundHandler; #preparedHeaders; #matchResult; #path; /** * Creates an instance of the Context class. * * @param req - The Request object. * @param options - Optional configuration options for the context. */ constructor(req, options) { this.#rawRequest = req; if (options) { this.#executionCtx = options.executionCtx; this.env = options.env; this.#notFoundHandler = options.notFoundHandler; this.#path = options.path; this.#matchResult = options.matchResult; } } /** * `.req` is the instance of {@link HonoRequest}. */ get req() { this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult); return this.#req; } /** * @see {@link https://hono.dev/docs/api/context#event} * The FetchEvent associated with the current request. * * @throws Will throw an error if the context does not have a FetchEvent. */ get event() { if (this.#executionCtx && "respondWith" in this.#executionCtx) { return this.#executionCtx; } else { throw Error("This context has no FetchEvent"); } } /** * @see {@link https://hono.dev/docs/api/context#executionctx} * The ExecutionContext associated with the current request. * * @throws Will throw an error if the context does not have an ExecutionContext. */ get executionCtx() { if (this.#executionCtx) { return this.#executionCtx; } else { throw Error("This context has no ExecutionContext"); } } /** * @see {@link https://hono.dev/docs/api/context#res} * The Response object for the current request. */ get res() { return this.#res ||= createResponseInstance(null, { headers: this.#preparedHeaders ??= new Headers() }); } /** * Sets the Response object for the current request. * * @param _res - The Response object to set. */ set res(_res) { if (this.#res && _res) { _res = createResponseInstance(_res.body, _res); for (const [k2, v3] of this.#res.headers.entries()) { if (k2 === "content-type") { continue; } if (k2 === "set-cookie") { const cookies = this.#res.headers.getSetCookie(); _res.headers.delete("set-cookie"); for (const cookie of cookies) { _res.headers.append("set-cookie", cookie); } } else { _res.headers.set(k2, v3); } } } this.#res = _res; this.finalized = true; } /** * `.render()` can create a response within a layout. * * @see {@link https://hono.dev/docs/api/context#render-setrenderer} * * @example * ```ts * app.get('/', (c) => { * return c.render('Hello!') * }) * ``` */ render = (...args) => { this.#renderer ??= (content) => this.html(content); return this.#renderer(...args); }; /** * Sets the layout for the response. * * @param layout - The layout to set. * @returns The layout function. */ setLayout = (layout) => this.#layout = layout; /** * Gets the current layout for the response. * * @returns The current layout function. */ getLayout = () => this.#layout; /** * `.setRenderer()` can set the layout in the custom middleware. * * @see {@link https://hono.dev/docs/api/context#render-setrenderer} * * @example * ```tsx * app.use('*', async (c, next) => { * c.setRenderer((content) => { * return c.html( * * *

{content}

* * * ) * }) * await next() * }) * ``` */ setRenderer = (renderer) => { this.#renderer = renderer; }; /** * `.header()` can set headers. * * @see {@link https://hono.dev/docs/api/context#header} * * @example * ```ts * app.get('/welcome', (c) => { * // Set headers * c.header('X-Message', 'Hello!') * c.header('Content-Type', 'text/plain') * * return c.body('Thank you for coming') * }) * ``` */ header = (name, value, options) => { if (this.finalized) { this.#res = createResponseInstance(this.#res.body, this.#res); } const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers(); if (value === void 0) { headers.delete(name); } else if (options?.append) { headers.append(name, value); } else { headers.set(name, value); } }; status = (status) => { this.#status = status; }; /** * `.set()` can set the value specified by the key. * * @see {@link https://hono.dev/docs/api/context#set-get} * * @example * ```ts * app.use('*', async (c, next) => { * c.set('message', 'Hono is hot!!') * await next() * }) * ``` */ set = (key, value) => { this.#var ??= /* @__PURE__ */ new Map(); this.#var.set(key, value); }; /** * `.get()` can use the value specified by the key. * * @see {@link https://hono.dev/docs/api/context#set-get} * * @example * ```ts * app.get('/', (c) => { * const message = c.get('message') * return c.text(`The message is "${message}"`) * }) * ``` */ get = (key) => { return this.#var ? this.#var.get(key) : void 0; }; /** * `.var` can access the value of a variable. * * @see {@link https://hono.dev/docs/api/context#var} * * @example * ```ts * const result = c.var.client.oneMethod() * ``` */ // c.var.propName is a read-only get var() { if (!this.#var) { return {}; } return Object.fromEntries(this.#var); } #newResponse(data, arg, headers) { const responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders ?? new Headers(); if (typeof arg === "object" && "headers" in arg) { const argHeaders = arg.headers instanceof Headers ? arg.headers : new Headers(arg.headers); for (const [key, value] of argHeaders) { if (key.toLowerCase() === "set-cookie") { responseHeaders.append(key, value); } else { responseHeaders.set(key, value); } } } if (headers) { for (const [k2, v3] of Object.entries(headers)) { if (typeof v3 === "string") { responseHeaders.set(k2, v3); } else { responseHeaders.delete(k2); for (const v22 of v3) { responseHeaders.append(k2, v22); } } } } const status = typeof arg === "number" ? arg : arg?.status ?? this.#status; return createResponseInstance(data, { status, headers: responseHeaders }); } newResponse = (...args) => this.#newResponse(...args); /** * `.body()` can return the HTTP response. * You can set headers with `.header()` and set HTTP status code with `.status`. * This can also be set in `.text()`, `.json()` and so on. * * @see {@link https://hono.dev/docs/api/context#body} * * @example * ```ts * app.get('/welcome', (c) => { * // Set headers * c.header('X-Message', 'Hello!') * c.header('Content-Type', 'text/plain') * // Set HTTP status code * c.status(201) * * // Return the response body * return c.body('Thank you for coming') * }) * ``` */ body = (data, arg, headers) => this.#newResponse(data, arg, headers); /** * `.text()` can render text as `Content-Type:text/plain`. * * @see {@link https://hono.dev/docs/api/context#text} * * @example * ```ts * app.get('/say', (c) => { * return c.text('Hello!') * }) * ``` */ text = (text2, arg, headers) => { return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text2) : this.#newResponse( text2, arg, setDefaultContentType(TEXT_PLAIN, headers) ); }; /** * `.json()` can render JSON as `Content-Type:application/json`. * * @see {@link https://hono.dev/docs/api/context#json} * * @example * ```ts * app.get('/api', (c) => { * return c.json({ message: 'Hello!' }) * }) * ``` */ json = (object2, arg, headers) => { return this.#newResponse( JSON.stringify(object2), arg, setDefaultContentType("application/json", headers) ); }; html = (html, arg, headers) => { const res = /* @__PURE__ */ __name((html2) => this.#newResponse(html2, arg, setDefaultContentType("text/html; charset=UTF-8", headers)), "res"); return typeof html === "object" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html); }; /** * `.redirect()` can Redirect, default status code is 302. * * @see {@link https://hono.dev/docs/api/context#redirect} * * @example * ```ts * app.get('/redirect', (c) => { * return c.redirect('/') * }) * app.get('/redirect-permanently', (c) => { * return c.redirect('/', 301) * }) * ``` */ redirect = (location, status) => { const locationString = String(location); this.header( "Location", // Multibyes should be encoded // eslint-disable-next-line no-control-regex !/[^\x00-\xFF]/.test(locationString) ? locationString : encodeURI(locationString) ); return this.newResponse(null, status ?? 302); }; /** * `.notFound()` can return the Not Found Response. * * @see {@link https://hono.dev/docs/api/context#notfound} * * @example * ```ts * app.get('/notfound', (c) => { * return c.notFound() * }) * ``` */ notFound = () => { this.#notFoundHandler ??= () => createResponseInstance(); return this.#notFoundHandler(this); }; }, "Context"); } }); // ../../node_modules/hono/dist/router.js var METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE, METHODS, MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError; var init_router = __esm({ "../../node_modules/hono/dist/router.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); METHOD_NAME_ALL = "ALL"; METHOD_NAME_ALL_LOWERCASE = "all"; METHODS = ["get", "post", "put", "delete", "options", "patch"]; MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; UnsupportedPathError = /* @__PURE__ */ __name(class extends Error { }, "UnsupportedPathError"); } }); // ../../node_modules/hono/dist/utils/constants.js var COMPOSED_HANDLER; var init_constants2 = __esm({ "../../node_modules/hono/dist/utils/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); COMPOSED_HANDLER = "__COMPOSED_HANDLER"; } }); // ../../node_modules/hono/dist/hono-base.js var notFoundHandler, errorHandler, Hono; var init_hono_base = __esm({ "../../node_modules/hono/dist/hono-base.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_compose(); init_context(); init_router(); init_constants2(); init_url(); notFoundHandler = /* @__PURE__ */ __name((c2) => { return c2.text("404 Not Found", 404); }, "notFoundHandler"); errorHandler = /* @__PURE__ */ __name((err, c2) => { if ("getResponse" in err) { const res = err.getResponse(); return c2.newResponse(res.body, res); } console.error(err); return c2.text("Internal Server Error", 500); }, "errorHandler"); Hono = /* @__PURE__ */ __name(class _Hono { get; post; put; delete; options; patch; all; on; use; /* This class is like an abstract class and does not have a router. To use it, inherit the class and implement router in the constructor. */ router; getPath; // Cannot use `#` because it requires visibility at JavaScript runtime. _basePath = "/"; #path = "/"; routes = []; constructor(options = {}) { const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE]; allMethods.forEach((method) => { this[method] = (args1, ...args) => { if (typeof args1 === "string") { this.#path = args1; } else { this.#addRoute(method, this.#path, args1); } args.forEach((handler) => { this.#addRoute(method, this.#path, handler); }); return this; }; }); this.on = (method, path, ...handlers2) => { for (const p2 of [path].flat()) { this.#path = p2; for (const m2 of [method].flat()) { handlers2.map((handler) => { this.#addRoute(m2.toUpperCase(), this.#path, handler); }); } } return this; }; this.use = (arg1, ...handlers2) => { if (typeof arg1 === "string") { this.#path = arg1; } else { this.#path = "*"; handlers2.unshift(arg1); } handlers2.forEach((handler) => { this.#addRoute(METHOD_NAME_ALL, this.#path, handler); }); return this; }; const { strict, ...optionsWithoutStrict } = options; Object.assign(this, optionsWithoutStrict); this.getPath = strict ?? true ? options.getPath ?? getPath : getPathNoStrict; } #clone() { const clone2 = new _Hono({ router: this.router, getPath: this.getPath }); clone2.errorHandler = this.errorHandler; clone2.#notFoundHandler = this.#notFoundHandler; clone2.routes = this.routes; return clone2; } #notFoundHandler = notFoundHandler; // Cannot use `#` because it requires visibility at JavaScript runtime. errorHandler = errorHandler; /** * `.route()` allows grouping other Hono instance in routes. * * @see {@link https://hono.dev/docs/api/routing#grouping} * * @param {string} path - base Path * @param {Hono} app - other Hono instance * @returns {Hono} routed Hono instance * * @example * ```ts * const app = new Hono() * const app2 = new Hono() * * app2.get("/user", (c) => c.text("user")) * app.route("/api", app2) // GET /api/user * ``` */ route(path, app) { const subApp = this.basePath(path); app.routes.map((r2) => { let handler; if (app.errorHandler === errorHandler) { handler = r2.handler; } else { handler = /* @__PURE__ */ __name(async (c2, next) => (await compose([], app.errorHandler)(c2, () => r2.handler(c2, next))).res, "handler"); handler[COMPOSED_HANDLER] = r2.handler; } subApp.#addRoute(r2.method, r2.path, handler); }); return this; } /** * `.basePath()` allows base paths to be specified. * * @see {@link https://hono.dev/docs/api/routing#base-path} * * @param {string} path - base Path * @returns {Hono} changed Hono instance * * @example * ```ts * const api = new Hono().basePath('/api') * ``` */ basePath(path) { const subApp = this.#clone(); subApp._basePath = mergePath(this._basePath, path); return subApp; } /** * `.onError()` handles an error and returns a customized Response. * * @see {@link https://hono.dev/docs/api/hono#error-handling} * * @param {ErrorHandler} handler - request Handler for error * @returns {Hono} changed Hono instance * * @example * ```ts * app.onError((err, c) => { * console.error(`${err}`) * return c.text('Custom Error Message', 500) * }) * ``` */ onError = (handler) => { this.errorHandler = handler; return this; }; /** * `.notFound()` allows you to customize a Not Found Response. * * @see {@link https://hono.dev/docs/api/hono#not-found} * * @param {NotFoundHandler} handler - request handler for not-found * @returns {Hono} changed Hono instance * * @example * ```ts * app.notFound((c) => { * return c.text('Custom 404 Message', 404) * }) * ``` */ notFound = (handler) => { this.#notFoundHandler = handler; return this; }; /** * `.mount()` allows you to mount applications built with other frameworks into your Hono application. * * @see {@link https://hono.dev/docs/api/hono#mount} * * @param {string} path - base Path * @param {Function} applicationHandler - other Request Handler * @param {MountOptions} [options] - options of `.mount()` * @returns {Hono} mounted Hono instance * * @example * ```ts * import { Router as IttyRouter } from 'itty-router' * import { Hono } from 'hono' * // Create itty-router application * const ittyRouter = IttyRouter() * // GET /itty-router/hello * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) * * const app = new Hono() * app.mount('/itty-router', ittyRouter.handle) * ``` * * @example * ```ts * const app = new Hono() * // Send the request to another application without modification. * app.mount('/app', anotherApp, { * replaceRequest: (req) => req, * }) * ``` */ mount(path, applicationHandler, options) { let replaceRequest; let optionHandler; if (options) { if (typeof options === "function") { optionHandler = options; } else { optionHandler = options.optionHandler; if (options.replaceRequest === false) { replaceRequest = /* @__PURE__ */ __name((request) => request, "replaceRequest"); } else { replaceRequest = options.replaceRequest; } } } const getOptions = optionHandler ? (c2) => { const options2 = optionHandler(c2); return Array.isArray(options2) ? options2 : [options2]; } : (c2) => { let executionContext = void 0; try { executionContext = c2.executionCtx; } catch { } return [c2.env, executionContext]; }; replaceRequest ||= (() => { const mergedPath = mergePath(this._basePath, path); const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; return (request) => { const url2 = new URL(request.url); url2.pathname = url2.pathname.slice(pathPrefixLength) || "/"; return new Request(url2, request); }; })(); const handler = /* @__PURE__ */ __name(async (c2, next) => { const res = await applicationHandler(replaceRequest(c2.req.raw), ...getOptions(c2)); if (res) { return res; } await next(); }, "handler"); this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler); return this; } #addRoute(method, path, handler) { method = method.toUpperCase(); path = mergePath(this._basePath, path); const r2 = { basePath: this._basePath, path, method, handler }; this.router.add(method, path, [handler, r2]); this.routes.push(r2); } #handleError(err, c2) { if (err instanceof Error) { return this.errorHandler(err, c2); } throw err; } #dispatch(request, executionCtx, env2, method) { if (method === "HEAD") { return (async () => new Response(null, await this.#dispatch(request, executionCtx, env2, "GET")))(); } const path = this.getPath(request, { env: env2 }); const matchResult = this.router.match(method, path); const c2 = new Context(request, { path, matchResult, env: env2, executionCtx, notFoundHandler: this.#notFoundHandler }); if (matchResult[0].length === 1) { let res; try { res = matchResult[0][0][0][0](c2, async () => { c2.res = await this.#notFoundHandler(c2); }); } catch (err) { return this.#handleError(err, c2); } return res instanceof Promise ? res.then( (resolved) => resolved || (c2.finalized ? c2.res : this.#notFoundHandler(c2)) ).catch((err) => this.#handleError(err, c2)) : res ?? this.#notFoundHandler(c2); } const composed = compose(matchResult[0], this.errorHandler, this.#notFoundHandler); return (async () => { try { const context2 = await composed(c2); if (!context2.finalized) { throw new Error( "Context is not finalized. Did you forget to return a Response object or `await next()`?" ); } return context2.res; } catch (err) { return this.#handleError(err, c2); } })(); } /** * `.fetch()` will be entry point of your app. * * @see {@link https://hono.dev/docs/api/hono#fetch} * * @param {Request} request - request Object of request * @param {Env} Env - env Object * @param {ExecutionContext} - context of execution * @returns {Response | Promise} response of request * */ fetch = (request, ...rest) => { return this.#dispatch(request, rest[1], rest[0], request.method); }; /** * `.request()` is a useful method for testing. * You can pass a URL or pathname to send a GET request. * app will return a Response object. * ```ts * test('GET /hello is ok', async () => { * const res = await app.request('/hello') * expect(res.status).toBe(200) * }) * ``` * @see https://hono.dev/docs/api/hono#request */ request = (input, requestInit, Env, executionCtx) => { if (input instanceof Request) { return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx); } input = input.toString(); return this.fetch( new Request( /^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`, requestInit ), Env, executionCtx ); }; /** * `.fire()` automatically adds a global fetch event listener. * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. * @deprecated * Use `fire` from `hono/service-worker` instead. * ```ts * import { Hono } from 'hono' * import { fire } from 'hono/service-worker' * * const app = new Hono() * // ... * fire(app) * ``` * @see https://hono.dev/docs/api/hono#fire * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ */ fire = () => { addEventListener("fetch", (event) => { event.respondWith(this.#dispatch(event.request, event, void 0, event.request.method)); }); }; }, "_Hono"); } }); // ../../node_modules/hono/dist/router/reg-exp-router/matcher.js function match(method, path) { const matchers = this.buildAllMatchers(); const match2 = /* @__PURE__ */ __name((method2, path2) => { const matcher = matchers[method2] || matchers[METHOD_NAME_ALL]; const staticMatch = matcher[2][path2]; if (staticMatch) { return staticMatch; } const match3 = path2.match(matcher[0]); if (!match3) { return [[], emptyParam]; } const index = match3.indexOf("", 1); return [matcher[1][index], match3]; }, "match2"); this.match = match2; return match2(method, path); } var emptyParam; var init_matcher = __esm({ "../../node_modules/hono/dist/router/reg-exp-router/matcher.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router(); emptyParam = []; __name(match, "match"); } }); // ../../node_modules/hono/dist/router/reg-exp-router/node.js function compareKey(a2, b2) { if (a2.length === 1) { return b2.length === 1 ? a2 < b2 ? -1 : 1 : -1; } if (b2.length === 1) { return 1; } if (a2 === ONLY_WILDCARD_REG_EXP_STR || a2 === TAIL_WILDCARD_REG_EXP_STR) { return 1; } else if (b2 === ONLY_WILDCARD_REG_EXP_STR || b2 === TAIL_WILDCARD_REG_EXP_STR) { return -1; } if (a2 === LABEL_REG_EXP_STR) { return 1; } else if (b2 === LABEL_REG_EXP_STR) { return -1; } return a2.length === b2.length ? a2 < b2 ? -1 : 1 : b2.length - a2.length; } var LABEL_REG_EXP_STR, ONLY_WILDCARD_REG_EXP_STR, TAIL_WILDCARD_REG_EXP_STR, PATH_ERROR, regExpMetaChars, Node2; var init_node = __esm({ "../../node_modules/hono/dist/router/reg-exp-router/node.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); LABEL_REG_EXP_STR = "[^/]+"; ONLY_WILDCARD_REG_EXP_STR = ".*"; TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; PATH_ERROR = /* @__PURE__ */ Symbol(); regExpMetaChars = new Set(".\\+*[^]$()"); __name(compareKey, "compareKey"); Node2 = /* @__PURE__ */ __name(class _Node { #index; #varIndex; #children = /* @__PURE__ */ Object.create(null); insert(tokens, index, paramMap, context2, pathErrorCheckOnly) { if (tokens.length === 0) { if (this.#index !== void 0) { throw PATH_ERROR; } if (pathErrorCheckOnly) { return; } this.#index = index; return; } const [token, ...restTokens] = tokens; const pattern = token === "*" ? restTokens.length === 0 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); let node; if (pattern) { const name = pattern[1]; let regexpStr = pattern[2] || LABEL_REG_EXP_STR; if (name && pattern[2]) { if (regexpStr === ".*") { throw PATH_ERROR; } regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); if (/\((?!\?:)/.test(regexpStr)) { throw PATH_ERROR; } } node = this.#children[regexpStr]; if (!node) { if (Object.keys(this.#children).some( (k2) => k2 !== ONLY_WILDCARD_REG_EXP_STR && k2 !== TAIL_WILDCARD_REG_EXP_STR )) { throw PATH_ERROR; } if (pathErrorCheckOnly) { return; } node = this.#children[regexpStr] = new _Node(); if (name !== "") { node.#varIndex = context2.varIndex++; } } if (!pathErrorCheckOnly && name !== "") { paramMap.push([name, node.#varIndex]); } } else { node = this.#children[token]; if (!node) { if (Object.keys(this.#children).some( (k2) => k2.length > 1 && k2 !== ONLY_WILDCARD_REG_EXP_STR && k2 !== TAIL_WILDCARD_REG_EXP_STR )) { throw PATH_ERROR; } if (pathErrorCheckOnly) { return; } node = this.#children[token] = new _Node(); } } node.insert(restTokens, index, paramMap, context2, pathErrorCheckOnly); } buildRegExpStr() { const childKeys = Object.keys(this.#children).sort(compareKey); const strList = childKeys.map((k2) => { const c2 = this.#children[k2]; return (typeof c2.#varIndex === "number" ? `(${k2})@${c2.#varIndex}` : regExpMetaChars.has(k2) ? `\\${k2}` : k2) + c2.buildRegExpStr(); }); if (typeof this.#index === "number") { strList.unshift(`#${this.#index}`); } if (strList.length === 0) { return ""; } if (strList.length === 1) { return strList[0]; } return "(?:" + strList.join("|") + ")"; } }, "_Node"); } }); // ../../node_modules/hono/dist/router/reg-exp-router/trie.js var Trie; var init_trie = __esm({ "../../node_modules/hono/dist/router/reg-exp-router/trie.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_node(); Trie = /* @__PURE__ */ __name(class { #context = { varIndex: 0 }; #root = new Node2(); insert(path, index, pathErrorCheckOnly) { const paramAssoc = []; const groups = []; for (let i2 = 0; ; ) { let replaced = false; path = path.replace(/\{[^}]+\}/g, (m2) => { const mark = `@\\${i2}`; groups[i2] = [mark, m2]; i2++; replaced = true; return mark; }); if (!replaced) { break; } } const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; for (let i2 = groups.length - 1; i2 >= 0; i2--) { const [mark] = groups[i2]; for (let j2 = tokens.length - 1; j2 >= 0; j2--) { if (tokens[j2].indexOf(mark) !== -1) { tokens[j2] = tokens[j2].replace(mark, groups[i2][1]); break; } } } this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly); return paramAssoc; } buildRegExp() { let regexp = this.#root.buildRegExpStr(); if (regexp === "") { return [/^$/, [], []]; } let captureIndex = 0; const indexReplacementMap = []; const paramReplacementMap = []; regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => { if (handlerIndex !== void 0) { indexReplacementMap[++captureIndex] = Number(handlerIndex); return "$()"; } if (paramIndex !== void 0) { paramReplacementMap[Number(paramIndex)] = ++captureIndex; return ""; } return ""; }); return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap]; } }, "Trie"); } }); // ../../node_modules/hono/dist/router/reg-exp-router/router.js function buildWildcardRegExp(path) { return wildcardRegExpCache[path] ??= new RegExp( path === "*" ? "" : `^${path.replace( /\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)" )}$` ); } function clearWildcardRegExpCache() { wildcardRegExpCache = /* @__PURE__ */ Object.create(null); } function buildMatcherFromPreprocessedRoutes(routes) { const trie = new Trie(); const handlerData = []; if (routes.length === 0) { return nullMatcher; } const routesWithStaticPathFlag = routes.map( (route) => [!/\*|\/:/.test(route[0]), ...route] ).sort( ([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length ); const staticMap = /* @__PURE__ */ Object.create(null); for (let i2 = 0, j2 = -1, len = routesWithStaticPathFlag.length; i2 < len; i2++) { const [pathErrorCheckOnly, path, handlers2] = routesWithStaticPathFlag[i2]; if (pathErrorCheckOnly) { staticMap[path] = [handlers2.map(([h2]) => [h2, /* @__PURE__ */ Object.create(null)]), emptyParam]; } else { j2++; } let paramAssoc; try { paramAssoc = trie.insert(path, j2, pathErrorCheckOnly); } catch (e2) { throw e2 === PATH_ERROR ? new UnsupportedPathError(path) : e2; } if (pathErrorCheckOnly) { continue; } handlerData[j2] = handlers2.map(([h2, paramCount]) => { const paramIndexMap = /* @__PURE__ */ Object.create(null); paramCount -= 1; for (; paramCount >= 0; paramCount--) { const [key, value] = paramAssoc[paramCount]; paramIndexMap[key] = value; } return [h2, paramIndexMap]; }); } const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); for (let i2 = 0, len = handlerData.length; i2 < len; i2++) { for (let j2 = 0, len2 = handlerData[i2].length; j2 < len2; j2++) { const map2 = handlerData[i2][j2]?.[1]; if (!map2) { continue; } const keys = Object.keys(map2); for (let k2 = 0, len3 = keys.length; k2 < len3; k2++) { map2[keys[k2]] = paramReplacementMap[map2[keys[k2]]]; } } } const handlerMap = []; for (const i2 in indexReplacementMap) { handlerMap[i2] = handlerData[indexReplacementMap[i2]]; } return [regexp, handlerMap, staticMap]; } function findMiddleware(middleware2, path) { if (!middleware2) { return void 0; } for (const k2 of Object.keys(middleware2).sort((a2, b2) => b2.length - a2.length)) { if (buildWildcardRegExp(k2).test(path)) { return [...middleware2[k2]]; } } return void 0; } var nullMatcher, wildcardRegExpCache, RegExpRouter; var init_router2 = __esm({ "../../node_modules/hono/dist/router/reg-exp-router/router.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router(); init_url(); init_matcher(); init_node(); init_trie(); nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)]; wildcardRegExpCache = /* @__PURE__ */ Object.create(null); __name(buildWildcardRegExp, "buildWildcardRegExp"); __name(clearWildcardRegExpCache, "clearWildcardRegExpCache"); __name(buildMatcherFromPreprocessedRoutes, "buildMatcherFromPreprocessedRoutes"); __name(findMiddleware, "findMiddleware"); RegExpRouter = /* @__PURE__ */ __name(class { name = "RegExpRouter"; #middleware; #routes; constructor() { this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; } add(method, path, handler) { const middleware2 = this.#middleware; const routes = this.#routes; if (!middleware2 || !routes) { throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); } if (!middleware2[method]) { ; [middleware2, routes].forEach((handlerMap) => { handlerMap[method] = /* @__PURE__ */ Object.create(null); Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p2) => { handlerMap[method][p2] = [...handlerMap[METHOD_NAME_ALL][p2]]; }); }); } if (path === "/*") { path = "*"; } const paramCount = (path.match(/\/:/g) || []).length; if (/\*$/.test(path)) { const re = buildWildcardRegExp(path); if (method === METHOD_NAME_ALL) { Object.keys(middleware2).forEach((m2) => { middleware2[m2][path] ||= findMiddleware(middleware2[m2], path) || findMiddleware(middleware2[METHOD_NAME_ALL], path) || []; }); } else { middleware2[method][path] ||= findMiddleware(middleware2[method], path) || findMiddleware(middleware2[METHOD_NAME_ALL], path) || []; } Object.keys(middleware2).forEach((m2) => { if (method === METHOD_NAME_ALL || method === m2) { Object.keys(middleware2[m2]).forEach((p2) => { re.test(p2) && middleware2[m2][p2].push([handler, paramCount]); }); } }); Object.keys(routes).forEach((m2) => { if (method === METHOD_NAME_ALL || method === m2) { Object.keys(routes[m2]).forEach( (p2) => re.test(p2) && routes[m2][p2].push([handler, paramCount]) ); } }); return; } const paths = checkOptionalParameter(path) || [path]; for (let i2 = 0, len = paths.length; i2 < len; i2++) { const path2 = paths[i2]; Object.keys(routes).forEach((m2) => { if (method === METHOD_NAME_ALL || method === m2) { routes[m2][path2] ||= [ ...findMiddleware(middleware2[m2], path2) || findMiddleware(middleware2[METHOD_NAME_ALL], path2) || [] ]; routes[m2][path2].push([handler, paramCount - len + i2 + 1]); } }); } } match = match; buildAllMatchers() { const matchers = /* @__PURE__ */ Object.create(null); Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => { matchers[method] ||= this.#buildMatcher(method); }); this.#middleware = this.#routes = void 0; clearWildcardRegExpCache(); return matchers; } #buildMatcher(method) { const routes = []; let hasOwnRoute = method === METHOD_NAME_ALL; [this.#middleware, this.#routes].forEach((r2) => { const ownRoute = r2[method] ? Object.keys(r2[method]).map((path) => [path, r2[method][path]]) : []; if (ownRoute.length !== 0) { hasOwnRoute ||= true; routes.push(...ownRoute); } else if (method !== METHOD_NAME_ALL) { routes.push( ...Object.keys(r2[METHOD_NAME_ALL]).map((path) => [path, r2[METHOD_NAME_ALL][path]]) ); } }); if (!hasOwnRoute) { return null; } else { return buildMatcherFromPreprocessedRoutes(routes); } } }, "RegExpRouter"); } }); // ../../node_modules/hono/dist/router/reg-exp-router/prepared-router.js var init_prepared_router = __esm({ "../../node_modules/hono/dist/router/reg-exp-router/prepared-router.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router(); init_matcher(); init_router2(); } }); // ../../node_modules/hono/dist/router/reg-exp-router/index.js var init_reg_exp_router = __esm({ "../../node_modules/hono/dist/router/reg-exp-router/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router2(); init_prepared_router(); } }); // ../../node_modules/hono/dist/router/smart-router/router.js var SmartRouter; var init_router3 = __esm({ "../../node_modules/hono/dist/router/smart-router/router.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router(); SmartRouter = /* @__PURE__ */ __name(class { name = "SmartRouter"; #routers = []; #routes = []; constructor(init) { this.#routers = init.routers; } add(method, path, handler) { if (!this.#routes) { throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); } this.#routes.push([method, path, handler]); } match(method, path) { if (!this.#routes) { throw new Error("Fatal error"); } const routers = this.#routers; const routes = this.#routes; const len = routers.length; let i2 = 0; let res; for (; i2 < len; i2++) { const router8 = routers[i2]; try { for (let i22 = 0, len2 = routes.length; i22 < len2; i22++) { router8.add(...routes[i22]); } res = router8.match(method, path); } catch (e2) { if (e2 instanceof UnsupportedPathError) { continue; } throw e2; } this.match = router8.match.bind(router8); this.#routers = [router8]; this.#routes = void 0; break; } if (i2 === len) { throw new Error("Fatal error"); } this.name = `SmartRouter + ${this.activeRouter.name}`; return res; } get activeRouter() { if (this.#routes || this.#routers.length !== 1) { throw new Error("No active router has been determined yet."); } return this.#routers[0]; } }, "SmartRouter"); } }); // ../../node_modules/hono/dist/router/smart-router/index.js var init_smart_router = __esm({ "../../node_modules/hono/dist/router/smart-router/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router3(); } }); // ../../node_modules/hono/dist/router/trie-router/node.js var emptyParams, hasChildren, Node3; var init_node2 = __esm({ "../../node_modules/hono/dist/router/trie-router/node.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router(); init_url(); emptyParams = /* @__PURE__ */ Object.create(null); hasChildren = /* @__PURE__ */ __name((children) => { for (const _ in children) { return true; } return false; }, "hasChildren"); Node3 = /* @__PURE__ */ __name(class _Node2 { #methods; #children; #patterns; #order = 0; #params = emptyParams; constructor(method, handler, children) { this.#children = children || /* @__PURE__ */ Object.create(null); this.#methods = []; if (method && handler) { const m2 = /* @__PURE__ */ Object.create(null); m2[method] = { handler, possibleKeys: [], score: 0 }; this.#methods = [m2]; } this.#patterns = []; } insert(method, path, handler) { this.#order = ++this.#order; let curNode = this; const parts = splitRoutingPath(path); const possibleKeys = []; for (let i2 = 0, len = parts.length; i2 < len; i2++) { const p2 = parts[i2]; const nextP = parts[i2 + 1]; const pattern = getPattern(p2, nextP); const key = Array.isArray(pattern) ? pattern[0] : p2; if (key in curNode.#children) { curNode = curNode.#children[key]; if (pattern) { possibleKeys.push(pattern[1]); } continue; } curNode.#children[key] = new _Node2(); if (pattern) { curNode.#patterns.push(pattern); possibleKeys.push(pattern[1]); } curNode = curNode.#children[key]; } curNode.#methods.push({ [method]: { handler, possibleKeys: possibleKeys.filter((v3, i2, a2) => a2.indexOf(v3) === i2), score: this.#order } }); return curNode; } #pushHandlerSets(handlerSets, node, method, nodeParams, params) { for (let i2 = 0, len = node.#methods.length; i2 < len; i2++) { const m2 = node.#methods[i2]; const handlerSet = m2[method] || m2[METHOD_NAME_ALL]; const processedSet = {}; if (handlerSet !== void 0) { handlerSet.params = /* @__PURE__ */ Object.create(null); handlerSets.push(handlerSet); if (nodeParams !== emptyParams || params && params !== emptyParams) { for (let i22 = 0, len2 = handlerSet.possibleKeys.length; i22 < len2; i22++) { const key = handlerSet.possibleKeys[i22]; const processed = processedSet[handlerSet.score]; handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key]; processedSet[handlerSet.score] = true; } } } } } search(method, path) { const handlerSets = []; this.#params = emptyParams; const curNode = this; let curNodes = [curNode]; const parts = splitPath(path); const curNodesQueue = []; const len = parts.length; let partOffsets = null; for (let i2 = 0; i2 < len; i2++) { const part = parts[i2]; const isLast = i2 === len - 1; const tempNodes = []; for (let j2 = 0, len2 = curNodes.length; j2 < len2; j2++) { const node = curNodes[j2]; const nextNode = node.#children[part]; if (nextNode) { nextNode.#params = node.#params; if (isLast) { if (nextNode.#children["*"]) { this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params); } this.#pushHandlerSets(handlerSets, nextNode, method, node.#params); } else { tempNodes.push(nextNode); } } for (let k2 = 0, len3 = node.#patterns.length; k2 < len3; k2++) { const pattern = node.#patterns[k2]; const params = node.#params === emptyParams ? {} : { ...node.#params }; if (pattern === "*") { const astNode = node.#children["*"]; if (astNode) { this.#pushHandlerSets(handlerSets, astNode, method, node.#params); astNode.#params = params; tempNodes.push(astNode); } continue; } const [key, name, matcher] = pattern; if (!part && !(matcher instanceof RegExp)) { continue; } const child = node.#children[key]; if (matcher instanceof RegExp) { if (partOffsets === null) { partOffsets = new Array(len); let offset = path[0] === "/" ? 1 : 0; for (let p2 = 0; p2 < len; p2++) { partOffsets[p2] = offset; offset += parts[p2].length + 1; } } const restPathString = path.substring(partOffsets[i2]); const m2 = matcher.exec(restPathString); if (m2) { params[name] = m2[0]; this.#pushHandlerSets(handlerSets, child, method, node.#params, params); if (hasChildren(child.#children)) { child.#params = params; const componentCount = m2[0].match(/\//)?.length ?? 0; const targetCurNodes = curNodesQueue[componentCount] ||= []; targetCurNodes.push(child); } continue; } } if (matcher === true || matcher.test(part)) { params[name] = part; if (isLast) { this.#pushHandlerSets(handlerSets, child, method, params, node.#params); if (child.#children["*"]) { this.#pushHandlerSets( handlerSets, child.#children["*"], method, params, node.#params ); } } else { child.#params = params; tempNodes.push(child); } } } } const shifted = curNodesQueue.shift(); curNodes = shifted ? tempNodes.concat(shifted) : tempNodes; } if (handlerSets.length > 1) { handlerSets.sort((a2, b2) => { return a2.score - b2.score; }); } return [handlerSets.map(({ handler, params }) => [handler, params])]; } }, "_Node"); } }); // ../../node_modules/hono/dist/router/trie-router/router.js var TrieRouter; var init_router4 = __esm({ "../../node_modules/hono/dist/router/trie-router/router.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_url(); init_node2(); TrieRouter = /* @__PURE__ */ __name(class { name = "TrieRouter"; #node; constructor() { this.#node = new Node3(); } add(method, path, handler) { const results = checkOptionalParameter(path); if (results) { for (let i2 = 0, len = results.length; i2 < len; i2++) { this.#node.insert(method, results[i2], handler); } return; } this.#node.insert(method, path, handler); } match(method, path) { return this.#node.search(method, path); } }, "TrieRouter"); } }); // ../../node_modules/hono/dist/router/trie-router/index.js var init_trie_router = __esm({ "../../node_modules/hono/dist/router/trie-router/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_router4(); } }); // ../../node_modules/hono/dist/hono.js var Hono2; var init_hono = __esm({ "../../node_modules/hono/dist/hono.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_hono_base(); init_reg_exp_router(); init_smart_router(); init_trie_router(); Hono2 = /* @__PURE__ */ __name(class extends Hono { /** * Creates an instance of the Hono class. * * @param options - Optional configuration options for the Hono instance. */ constructor(options = {}) { super(options); this.router = options.router ?? new SmartRouter({ routers: [new RegExpRouter(), new TrieRouter()] }); } }, "Hono"); } }); // ../../node_modules/hono/dist/index.js var init_dist = __esm({ "../../node_modules/hono/dist/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_hono(); } }); // ../../node_modules/hono/dist/middleware/cors/index.js var cors; var init_cors = __esm({ "../../node_modules/hono/dist/middleware/cors/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); cors = /* @__PURE__ */ __name((options) => { const defaults2 = { origin: "*", allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"], allowHeaders: [], exposeHeaders: [] }; const opts = { ...defaults2, ...options }; const findAllowOrigin = ((optsOrigin) => { if (typeof optsOrigin === "string") { if (optsOrigin === "*") { if (opts.credentials) { return (origin2) => origin2 || null; } return () => optsOrigin; } else { return (origin2) => optsOrigin === origin2 ? origin2 : null; } } else if (typeof optsOrigin === "function") { return optsOrigin; } else { return (origin2) => optsOrigin.includes(origin2) ? origin2 : null; } })(opts.origin); const findAllowMethods = ((optsAllowMethods) => { if (typeof optsAllowMethods === "function") { return optsAllowMethods; } else if (Array.isArray(optsAllowMethods)) { return () => optsAllowMethods; } else { return () => []; } })(opts.allowMethods); return /* @__PURE__ */ __name(async function cors2(c2, next) { function set2(key, value) { c2.res.headers.set(key, value); } __name(set2, "set"); const allowOrigin = await findAllowOrigin(c2.req.header("origin") || "", c2); if (allowOrigin) { set2("Access-Control-Allow-Origin", allowOrigin); } if (opts.credentials) { set2("Access-Control-Allow-Credentials", "true"); } if (opts.exposeHeaders?.length) { set2("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); } if (c2.req.method === "OPTIONS") { if (opts.origin !== "*" || opts.credentials) { set2("Vary", "Origin"); } if (opts.maxAge != null) { set2("Access-Control-Max-Age", opts.maxAge.toString()); } const allowMethods = await findAllowMethods(c2.req.header("origin") || "", c2); if (allowMethods.length) { set2("Access-Control-Allow-Methods", allowMethods.join(",")); } let headers = opts.allowHeaders; if (!headers?.length) { const requestHeaders = c2.req.header("Access-Control-Request-Headers"); if (requestHeaders) { headers = requestHeaders.split(/\s*,\s*/); } } if (headers?.length) { set2("Access-Control-Allow-Headers", headers.join(",")); c2.res.headers.append("Vary", "Access-Control-Request-Headers"); } c2.res.headers.delete("Content-Length"); c2.res.headers.delete("Content-Type"); return new Response(null, { headers: c2.res.headers, status: 204, statusText: "No Content" }); } await next(); if (opts.origin !== "*" || opts.credentials) { c2.header("Vary", "Origin", { append: true }); } }, "cors2"); }, "cors"); } }); // ../../node_modules/hono/dist/utils/color.js function getColorEnabled() { const { process: process3, Deno } = globalThis; const isNoColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : process3 !== void 0 ? ( // eslint-disable-next-line no-unsafe-optional-chaining "NO_COLOR" in process3?.env ) : false; return !isNoColor; } async function getColorEnabledAsync() { const { navigator: navigator2 } = globalThis; const cfWorkers = "cloudflare:workers"; const isNoColor = navigator2 !== void 0 && navigator2.userAgent === "Cloudflare-Workers" ? await (async () => { try { return "NO_COLOR" in ((await import(cfWorkers)).env ?? {}); } catch { return false; } })() : !getColorEnabled(); return !isNoColor; } var init_color = __esm({ "../../node_modules/hono/dist/utils/color.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(getColorEnabled, "getColorEnabled"); __name(getColorEnabledAsync, "getColorEnabledAsync"); } }); // ../../node_modules/hono/dist/middleware/logger/index.js async function log3(fn, prefix, method, path, status = 0, elapsed) { const out = prefix === "<--" ? `${prefix} ${method} ${path}` : `${prefix} ${method} ${path} ${await colorStatus(status)} ${elapsed}`; fn(out); } var humanize, time3, colorStatus, logger; var init_logger = __esm({ "../../node_modules/hono/dist/middleware/logger/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_color(); humanize = /* @__PURE__ */ __name((times) => { const [delimiter, separator] = [",", "."]; const orderTimes = times.map((v3) => v3.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter)); return orderTimes.join(separator); }, "humanize"); time3 = /* @__PURE__ */ __name((start) => { const delta = Date.now() - start; return humanize([delta < 1e3 ? delta + "ms" : Math.round(delta / 1e3) + "s"]); }, "time"); colorStatus = /* @__PURE__ */ __name(async (status) => { const colorEnabled = await getColorEnabledAsync(); if (colorEnabled) { switch (status / 100 | 0) { case 5: return `\x1B[31m${status}\x1B[0m`; case 4: return `\x1B[33m${status}\x1B[0m`; case 3: return `\x1B[36m${status}\x1B[0m`; case 2: return `\x1B[32m${status}\x1B[0m`; } } return `${status}`; }, "colorStatus"); __name(log3, "log"); logger = /* @__PURE__ */ __name((fn = console.log) => { return /* @__PURE__ */ __name(async function logger22(c2, next) { const { method, url: url2 } = c2.req; const path = url2.slice(url2.indexOf("/", 8)); await log3(fn, "<--", method, path); const start = Date.now(); await next(); await log3(fn, "-->", method, path, c2.res.status, time3(start)); }, "logger2"); }, "logger"); } }); // ../../node_modules/@trpc/server/dist/codes-DagpWZLc.mjs function mergeWithoutOverrides(obj1, ...objs) { const newObj = Object.assign(emptyObject(), obj1); for (const overrides of objs) for (const key in overrides) { if (key in newObj && newObj[key] !== overrides[key]) throw new Error(`Duplicate key ${key}`); newObj[key] = overrides[key]; } return newObj; } function isObject(value) { return !!value && !Array.isArray(value) && typeof value === "object"; } function isFunction(fn) { return typeof fn === "function"; } function emptyObject() { return /* @__PURE__ */ Object.create(null); } function isAsyncIterable(value) { return asyncIteratorsSupported && isObject(value) && Symbol.asyncIterator in value; } function identity(it) { return it; } function abortSignalsAnyPonyfill(signals) { if (typeof AbortSignal.any === "function") return AbortSignal.any(signals); const ac3 = new AbortController(); for (const signal of signals) { if (signal.aborted) { trigger(); break; } signal.addEventListener("abort", trigger, { once: true }); } return ac3.signal; function trigger() { ac3.abort(); for (const signal of signals) signal.removeEventListener("abort", trigger); } __name(trigger, "trigger"); } var asyncIteratorsSupported, run, TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER, retryableRpcCodes; var init_codes_DagpWZLc = __esm({ "../../node_modules/@trpc/server/dist/codes-DagpWZLc.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(mergeWithoutOverrides, "mergeWithoutOverrides"); __name(isObject, "isObject"); __name(isFunction, "isFunction"); __name(emptyObject, "emptyObject"); asyncIteratorsSupported = typeof Symbol === "function" && !!Symbol.asyncIterator; __name(isAsyncIterable, "isAsyncIterable"); run = /* @__PURE__ */ __name((fn) => fn(), "run"); __name(identity, "identity"); __name(abortSignalsAnyPonyfill, "abortSignalsAnyPonyfill"); TRPC_ERROR_CODES_BY_KEY = { PARSE_ERROR: -32700, BAD_REQUEST: -32600, INTERNAL_SERVER_ERROR: -32603, NOT_IMPLEMENTED: -32603, BAD_GATEWAY: -32603, SERVICE_UNAVAILABLE: -32603, GATEWAY_TIMEOUT: -32603, UNAUTHORIZED: -32001, PAYMENT_REQUIRED: -32002, FORBIDDEN: -32003, NOT_FOUND: -32004, METHOD_NOT_SUPPORTED: -32005, TIMEOUT: -32008, CONFLICT: -32009, PRECONDITION_FAILED: -32012, PAYLOAD_TOO_LARGE: -32013, UNSUPPORTED_MEDIA_TYPE: -32015, UNPROCESSABLE_CONTENT: -32022, PRECONDITION_REQUIRED: -32028, TOO_MANY_REQUESTS: -32029, CLIENT_CLOSED_REQUEST: -32099 }; TRPC_ERROR_CODES_BY_NUMBER = { [-32700]: "PARSE_ERROR", [-32600]: "BAD_REQUEST", [-32603]: "INTERNAL_SERVER_ERROR", [-32001]: "UNAUTHORIZED", [-32002]: "PAYMENT_REQUIRED", [-32003]: "FORBIDDEN", [-32004]: "NOT_FOUND", [-32005]: "METHOD_NOT_SUPPORTED", [-32008]: "TIMEOUT", [-32009]: "CONFLICT", [-32012]: "PRECONDITION_FAILED", [-32013]: "PAYLOAD_TOO_LARGE", [-32015]: "UNSUPPORTED_MEDIA_TYPE", [-32022]: "UNPROCESSABLE_CONTENT", [-32028]: "PRECONDITION_REQUIRED", [-32029]: "TOO_MANY_REQUESTS", [-32099]: "CLIENT_CLOSED_REQUEST" }; retryableRpcCodes = [ TRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY, TRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE, TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT, TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR ]; } }); // ../../node_modules/@trpc/server/dist/getErrorShape-vC8mUXJD.mjs function createInnerProxy(callback, path, memo2) { var _memo$cacheKey; const cacheKey = path.join("."); (_memo$cacheKey = memo2[cacheKey]) !== null && _memo$cacheKey !== void 0 || (memo2[cacheKey] = new Proxy(noop, { get(_obj, key) { if (typeof key !== "string" || key === "then") return void 0; return createInnerProxy(callback, [...path, key], memo2); }, apply(_1, _2, args) { const lastOfPath = path[path.length - 1]; let opts = { args, path }; if (lastOfPath === "call") opts = { args: args.length >= 2 ? [args[1]] : [], path: path.slice(0, -1) }; else if (lastOfPath === "apply") opts = { args: args.length >= 2 ? args[1] : [], path: path.slice(0, -1) }; freezeIfAvailable(opts.args); freezeIfAvailable(opts.path); return callback(opts); } })); return memo2[cacheKey]; } function getStatusCodeFromKey(code) { var _JSONRPC2_TO_HTTP_COD; return (_JSONRPC2_TO_HTTP_COD = JSONRPC2_TO_HTTP_CODE[code]) !== null && _JSONRPC2_TO_HTTP_COD !== void 0 ? _JSONRPC2_TO_HTTP_COD : 500; } function getHTTPStatusCode(json2) { const arr = Array.isArray(json2) ? json2 : [json2]; const httpStatuses = new Set(arr.map((res) => { if ("error" in res && isObject(res.error.data)) { var _res$error$data; if (typeof ((_res$error$data = res.error.data) === null || _res$error$data === void 0 ? void 0 : _res$error$data["httpStatus"]) === "number") return res.error.data["httpStatus"]; const code = TRPC_ERROR_CODES_BY_NUMBER[res.error.code]; return getStatusCodeFromKey(code); } return 200; })); if (httpStatuses.size !== 1) return 207; const httpStatus = httpStatuses.values().next().value; return httpStatus; } function getHTTPStatusCodeFromError(error50) { return getStatusCodeFromKey(error50.code); } function getErrorShape(opts) { const { path, error: error50, config: config3 } = opts; const { code } = opts.error; const shape = { message: error50.message, code: TRPC_ERROR_CODES_BY_KEY[code], data: { code, httpStatus: getHTTPStatusCodeFromError(error50) } }; if (config3.isDev && typeof opts.error.stack === "string") shape.data.stack = opts.error.stack; if (typeof path === "string") shape.data.path = path; return config3.errorFormatter((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { shape })); } var __create2, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __commonJS2, __copyProps2, __toESM2, noop, freezeIfAvailable, createRecursiveProxy, JSONRPC2_TO_HTTP_CODE, require_typeof, require_toPrimitive, require_toPropertyKey, require_defineProperty, require_objectSpread2, import_objectSpread2; var init_getErrorShape_vC8mUXJD = __esm({ "../../node_modules/@trpc/server/dist/getErrorShape-vC8mUXJD.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_codes_DagpWZLc(); __create2 = Object.create; __defProp2 = Object.defineProperty; __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; __getOwnPropNames2 = Object.getOwnPropertyNames; __getProtoOf2 = Object.getPrototypeOf; __hasOwnProp2 = Object.prototype.hasOwnProperty; __commonJS2 = /* @__PURE__ */ __name((cb2, mod) => function() { return mod || (0, cb2[__getOwnPropNames2(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }, "__commonJS"); __copyProps2 = /* @__PURE__ */ __name((to, from, except2, desc2) => { if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames2(from), i2 = 0, n2 = keys.length, key; i2 < n2; i2++) { key = keys[i2]; if (!__hasOwnProp2.call(to, key) && key !== except2) __defProp2(to, key, { get: ((k2) => from[k2]).bind(null, key), enumerable: !(desc2 = __getOwnPropDesc2(from, key)) || desc2.enumerable }); } return to; }, "__copyProps"); __toESM2 = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), "__toESM"); noop = /* @__PURE__ */ __name(() => { }, "noop"); freezeIfAvailable = /* @__PURE__ */ __name((obj) => { if (Object.freeze) Object.freeze(obj); }, "freezeIfAvailable"); __name(createInnerProxy, "createInnerProxy"); createRecursiveProxy = /* @__PURE__ */ __name((callback) => createInnerProxy(callback, [], emptyObject()), "createRecursiveProxy"); JSONRPC2_TO_HTTP_CODE = { PARSE_ERROR: 400, BAD_REQUEST: 400, UNAUTHORIZED: 401, PAYMENT_REQUIRED: 402, FORBIDDEN: 403, NOT_FOUND: 404, METHOD_NOT_SUPPORTED: 405, TIMEOUT: 408, CONFLICT: 409, PRECONDITION_FAILED: 412, PAYLOAD_TOO_LARGE: 413, UNSUPPORTED_MEDIA_TYPE: 415, UNPROCESSABLE_CONTENT: 422, PRECONDITION_REQUIRED: 428, TOO_MANY_REQUESTS: 429, CLIENT_CLOSED_REQUEST: 499, INTERNAL_SERVER_ERROR: 500, NOT_IMPLEMENTED: 501, BAD_GATEWAY: 502, SERVICE_UNAVAILABLE: 503, GATEWAY_TIMEOUT: 504 }; __name(getStatusCodeFromKey, "getStatusCodeFromKey"); __name(getHTTPStatusCode, "getHTTPStatusCode"); __name(getHTTPStatusCodeFromError, "getHTTPStatusCodeFromError"); require_typeof = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) { function _typeof$2(o2) { "@babel/helpers - typeof"; return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) { return typeof o$1; } : function(o$1) { return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1; }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o2); } __name(_typeof$2, "_typeof$2"); module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_toPrimitive = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) { var _typeof$1 = require_typeof()["default"]; function toPrimitive$1(t9, r2) { if ("object" != _typeof$1(t9) || !t9) return t9; var e2 = t9[Symbol.toPrimitive]; if (void 0 !== e2) { var i2 = e2.call(t9, r2 || "default"); if ("object" != _typeof$1(i2)) return i2; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t9); } __name(toPrimitive$1, "toPrimitive$1"); module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_toPropertyKey = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) { var _typeof = require_typeof()["default"]; var toPrimitive = require_toPrimitive(); function toPropertyKey$1(t9) { var i2 = toPrimitive(t9, "string"); return "symbol" == _typeof(i2) ? i2 : i2 + ""; } __name(toPropertyKey$1, "toPropertyKey$1"); module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_defineProperty = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) { var toPropertyKey = require_toPropertyKey(); function _defineProperty(e2, r2, t9) { return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t9, enumerable: true, configurable: true, writable: true }) : e2[r2] = t9, e2; } __name(_defineProperty, "_defineProperty"); module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_objectSpread2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) { var defineProperty = require_defineProperty(); function ownKeys(e2, r2) { var t9 = Object.keys(e2); if (Object.getOwnPropertySymbols) { var o2 = Object.getOwnPropertySymbols(e2); r2 && (o2 = o2.filter(function(r$1) { return Object.getOwnPropertyDescriptor(e2, r$1).enumerable; })), t9.push.apply(t9, o2); } return t9; } __name(ownKeys, "ownKeys"); function _objectSpread2(e2) { for (var r2 = 1; r2 < arguments.length; r2++) { var t9 = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys(Object(t9), true).forEach(function(r$1) { defineProperty(e2, r$1, t9[r$1]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t9)) : ownKeys(Object(t9)).forEach(function(r$1) { Object.defineProperty(e2, r$1, Object.getOwnPropertyDescriptor(t9, r$1)); }); } return e2; } __name(_objectSpread2, "_objectSpread2"); module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); import_objectSpread2 = __toESM2(require_objectSpread2(), 1); __name(getErrorShape, "getErrorShape"); } }); // ../../node_modules/@trpc/server/dist/tracked-Bjtgv3wJ.mjs function getCauseFromUnknown(cause) { if (cause instanceof Error) return cause; const type = typeof cause; if (type === "undefined" || type === "function" || cause === null) return void 0; if (type !== "object") return new Error(String(cause)); if (isObject(cause)) return Object.assign(new UnknownCauseError(), cause); return void 0; } function getTRPCErrorFromUnknown(cause) { if (cause instanceof TRPCError) return cause; if (cause instanceof Error && cause.name === "TRPCError") return cause; const trpcError = new TRPCError({ code: "INTERNAL_SERVER_ERROR", cause }); if (cause instanceof Error && cause.stack) trpcError.stack = cause.stack; return trpcError; } function getDataTransformer(transformer) { if ("input" in transformer) return transformer; return { input: transformer, output: transformer }; } function transformTRPCResponseItem(config3, item) { if ("error" in item) return (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item), {}, { error: config3.transformer.output.serialize(item.error) }); if ("data" in item.result) return (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item), {}, { result: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item.result), {}, { data: config3.transformer.output.serialize(item.result.data) }) }); return item; } function transformTRPCResponse(config3, itemOrItems) { return Array.isArray(itemOrItems) ? itemOrItems.map((item) => transformTRPCResponseItem(config3, item)) : transformTRPCResponseItem(config3, itemOrItems); } function once2(fn) { const uncalled = Symbol(); let result = uncalled; return () => { if (result === uncalled) result = fn(); return result; }; } function isLazy(input) { return typeof input === "function" && lazyMarker in input; } function isRouter(value) { return isObject(value) && isObject(value["_def"]) && "router" in value["_def"]; } function createRouterFactory(config3) { function createRouterInner(input) { const reservedWordsUsed = new Set(Object.keys(input).filter((v3) => reservedWords.includes(v3))); if (reservedWordsUsed.size > 0) throw new Error("Reserved words used in `router({})` call: " + Array.from(reservedWordsUsed).join(", ")); const procedures = emptyObject(); const lazy$1 = emptyObject(); function createLazyLoader(opts) { return { ref: opts.ref, load: once2(async () => { const router$1 = await opts.ref(); const lazyPath = [...opts.path, opts.key]; const lazyKey = lazyPath.join("."); opts.aggregate[opts.key] = step(router$1._def.record, lazyPath); delete lazy$1[lazyKey]; for (const [nestedKey, nestedItem] of Object.entries(router$1._def.lazy)) { const nestedRouterKey = [...lazyPath, nestedKey].join("."); lazy$1[nestedRouterKey] = createLazyLoader({ ref: nestedItem.ref, path: lazyPath, key: nestedKey, aggregate: opts.aggregate[opts.key] }); } }) }; } __name(createLazyLoader, "createLazyLoader"); function step(from, path = []) { const aggregate = emptyObject(); for (const [key, item] of Object.entries(from !== null && from !== void 0 ? from : {})) { if (isLazy(item)) { lazy$1[[...path, key].join(".")] = createLazyLoader({ path, ref: item, key, aggregate }); continue; } if (isRouter(item)) { aggregate[key] = step(item._def.record, [...path, key]); continue; } if (!isProcedure(item)) { aggregate[key] = step(item, [...path, key]); continue; } const newPath = [...path, key].join("."); if (procedures[newPath]) throw new Error(`Duplicate key: ${newPath}`); procedures[newPath] = item; aggregate[key] = item; } return aggregate; } __name(step, "step"); const record2 = step(input); const _def = (0, import_objectSpread22.default)((0, import_objectSpread22.default)({ _config: config3, router: true, procedures, lazy: lazy$1 }, emptyRouter), {}, { record: record2 }); const router8 = (0, import_objectSpread22.default)((0, import_objectSpread22.default)({}, record2), {}, { _def, createCaller: createCallerFactory()({ _def }) }); return router8; } __name(createRouterInner, "createRouterInner"); return createRouterInner; } function isProcedure(procedureOrRouter) { return typeof procedureOrRouter === "function"; } async function getProcedureAtPath(router8, path) { const { _def } = router8; let procedure = _def.procedures[path]; while (!procedure) { const key = Object.keys(_def.lazy).find((key$1) => path.startsWith(key$1)); if (!key) return null; const lazyRouter = _def.lazy[key]; await lazyRouter.load(); procedure = _def.procedures[path]; } return procedure; } function createCallerFactory() { return /* @__PURE__ */ __name(function createCallerInner(router8) { const { _def } = router8; return /* @__PURE__ */ __name(function createCaller(ctxOrCallback, opts) { return createRecursiveProxy(async (innerOpts) => { const { path, args } = innerOpts; const fullPath = path.join("."); if (path.length === 1 && path[0] === "_def") return _def; const procedure = await getProcedureAtPath(router8, fullPath); let ctx = void 0; try { if (!procedure) throw new TRPCError({ code: "NOT_FOUND", message: `No procedure found on path "${path}"` }); ctx = isFunction(ctxOrCallback) ? await Promise.resolve(ctxOrCallback()) : ctxOrCallback; return await procedure({ path: fullPath, getRawInput: async () => args[0], ctx, type: procedure._def.type, signal: opts === null || opts === void 0 ? void 0 : opts.signal, batchIndex: 0 }); } catch (cause) { var _opts$onError, _procedure$_def$type; opts === null || opts === void 0 || (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, { ctx, error: getTRPCErrorFromUnknown(cause), input: args[0], path: fullPath, type: (_procedure$_def$type = procedure === null || procedure === void 0 ? void 0 : procedure._def.type) !== null && _procedure$_def$type !== void 0 ? _procedure$_def$type : "unknown" }); throw cause; } }); }, "createCaller"); }, "createCallerInner"); } function mergeRouters(...routerList) { var _routerList$, _routerList$2; const record2 = mergeWithoutOverrides({}, ...routerList.map((r2) => r2._def.record)); const errorFormatter = routerList.reduce((currentErrorFormatter, nextRouter) => { if (nextRouter._def._config.errorFormatter && nextRouter._def._config.errorFormatter !== defaultFormatter) { if (currentErrorFormatter !== defaultFormatter && currentErrorFormatter !== nextRouter._def._config.errorFormatter) throw new Error("You seem to have several error formatters"); return nextRouter._def._config.errorFormatter; } return currentErrorFormatter; }, defaultFormatter); const transformer = routerList.reduce((prev, current) => { if (current._def._config.transformer && current._def._config.transformer !== defaultTransformer) { if (prev !== defaultTransformer && prev !== current._def._config.transformer) throw new Error("You seem to have several transformers"); return current._def._config.transformer; } return prev; }, defaultTransformer); const router8 = createRouterFactory({ errorFormatter, transformer, isDev: routerList.every((r2) => r2._def._config.isDev), allowOutsideOfServer: routerList.every((r2) => r2._def._config.allowOutsideOfServer), isServer: routerList.every((r2) => r2._def._config.isServer), $types: (_routerList$ = routerList[0]) === null || _routerList$ === void 0 ? void 0 : _routerList$._def._config.$types, sse: (_routerList$2 = routerList[0]) === null || _routerList$2 === void 0 ? void 0 : _routerList$2._def._config.sse })(record2); return router8; } function isTrackedEnvelope(value) { return Array.isArray(value) && value[2] === trackedSymbol; } var defaultFormatter, import_defineProperty, UnknownCauseError, TRPCError, import_objectSpread2$1, defaultTransformer, import_objectSpread22, lazyMarker, emptyRouter, reservedWords, trackedSymbol; var init_tracked_Bjtgv3wJ = __esm({ "../../node_modules/@trpc/server/dist/tracked-Bjtgv3wJ.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getErrorShape_vC8mUXJD(); init_codes_DagpWZLc(); defaultFormatter = /* @__PURE__ */ __name(({ shape }) => { return shape; }, "defaultFormatter"); import_defineProperty = __toESM2(require_defineProperty(), 1); UnknownCauseError = /* @__PURE__ */ __name(class extends Error { }, "UnknownCauseError"); __name(getCauseFromUnknown, "getCauseFromUnknown"); __name(getTRPCErrorFromUnknown, "getTRPCErrorFromUnknown"); TRPCError = /* @__PURE__ */ __name(class extends Error { constructor(opts) { var _ref, _opts$message, _this$cause; const cause = getCauseFromUnknown(opts.cause); const message2 = (_ref = (_opts$message = opts.message) !== null && _opts$message !== void 0 ? _opts$message : cause === null || cause === void 0 ? void 0 : cause.message) !== null && _ref !== void 0 ? _ref : opts.code; super(message2, { cause }); (0, import_defineProperty.default)(this, "cause", void 0); (0, import_defineProperty.default)(this, "code", void 0); this.code = opts.code; this.name = "TRPCError"; (_this$cause = this.cause) !== null && _this$cause !== void 0 || (this.cause = cause); } }, "TRPCError"); import_objectSpread2$1 = __toESM2(require_objectSpread2(), 1); __name(getDataTransformer, "getDataTransformer"); defaultTransformer = { input: { serialize: (obj) => obj, deserialize: (obj) => obj }, output: { serialize: (obj) => obj, deserialize: (obj) => obj } }; __name(transformTRPCResponseItem, "transformTRPCResponseItem"); __name(transformTRPCResponse, "transformTRPCResponse"); import_objectSpread22 = __toESM2(require_objectSpread2(), 1); lazyMarker = "lazyMarker"; __name(once2, "once"); __name(isLazy, "isLazy"); __name(isRouter, "isRouter"); emptyRouter = { _ctx: null, _errorShape: null, _meta: null, queries: {}, mutations: {}, subscriptions: {}, errorFormatter: defaultFormatter, transformer: defaultTransformer }; reservedWords = [ "then", "call", "apply" ]; __name(createRouterFactory, "createRouterFactory"); __name(isProcedure, "isProcedure"); __name(getProcedureAtPath, "getProcedureAtPath"); __name(createCallerFactory, "createCallerFactory"); __name(mergeRouters, "mergeRouters"); trackedSymbol = Symbol(); __name(isTrackedEnvelope, "isTrackedEnvelope"); } }); // ../../node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs function isObservable(x2) { return typeof x2 === "object" && x2 !== null && "subscribe" in x2; } function observableToReadableStream(observable$1, signal) { let unsub = null; const onAbort = /* @__PURE__ */ __name(() => { unsub === null || unsub === void 0 || unsub.unsubscribe(); unsub = null; signal.removeEventListener("abort", onAbort); }, "onAbort"); return new ReadableStream({ start(controller) { unsub = observable$1.subscribe({ next(data) { controller.enqueue({ ok: true, value: data }); }, error(error50) { controller.enqueue({ ok: false, error: error50 }); controller.close(); }, complete() { controller.close(); } }); if (signal.aborted) onAbort(); else signal.addEventListener("abort", onAbort, { once: true }); }, cancel() { onAbort(); } }); } function observableToAsyncIterable(observable$1, signal) { const stream = observableToReadableStream(observable$1, signal); const reader = stream.getReader(); const iterator2 = { async next() { const value = await reader.read(); if (value.done) return { value: void 0, done: true }; const { value: result } = value; if (!result.ok) throw result.error; return { value: result.value, done: false }; }, async return() { await reader.cancel(); return { value: void 0, done: true }; } }; return { [Symbol.asyncIterator]() { return iterator2; } }; } var init_observable_UMO3vUa = __esm({ "../../node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(isObservable, "isObservable"); __name(observableToReadableStream, "observableToReadableStream"); __name(observableToAsyncIterable, "observableToAsyncIterable"); } }); // ../../node_modules/@trpc/server/dist/resolveResponse-CHqBlAgR.mjs function parseConnectionParamsFromUnknown(parsed) { try { if (parsed === null) return null; if (!isObject(parsed)) throw new Error("Expected object"); const nonStringValues = Object.entries(parsed).filter(([_key2, value]) => typeof value !== "string"); if (nonStringValues.length > 0) throw new Error(`Expected connectionParams to be string values. Got ${nonStringValues.map(([key, value]) => `${key}: ${typeof value}`).join(", ")}`); return parsed; } catch (cause) { throw new TRPCError({ code: "PARSE_ERROR", message: "Invalid connection params shape", cause }); } } function parseConnectionParamsFromString(str) { let parsed; try { parsed = JSON.parse(str); } catch (cause) { throw new TRPCError({ code: "PARSE_ERROR", message: "Not JSON-parsable query params", cause }); } return parseConnectionParamsFromUnknown(parsed); } function getAcceptHeader(headers) { var _ref, _headers$get; return (_ref = headers.get("trpc-accept")) !== null && _ref !== void 0 ? _ref : ((_headers$get = headers.get("accept")) === null || _headers$get === void 0 ? void 0 : _headers$get.split(",").some((t9) => t9.trim() === "application/jsonl")) ? "application/jsonl" : null; } function memo(fn) { let promise2 = null; const sym = Symbol.for("@trpc/server/http/memo"); let value = sym; return { read: async () => { var _promise2; if (value !== sym) return value; (_promise2 = promise2) !== null && _promise2 !== void 0 || (promise2 = fn().catch((cause) => { if (cause instanceof TRPCError) throw cause; throw new TRPCError({ code: "BAD_REQUEST", message: cause instanceof Error ? cause.message : "Invalid input", cause }); })); value = await promise2; promise2 = null; return value; }, result: () => { return value !== sym ? value : void 0; } }; } function getContentTypeHandler(req) { const handler = handlers.find((handler$1) => handler$1.isMatch(req)); if (handler) return handler; if (!handler && req.method === "GET") return jsonContentTypeHandler; throw new TRPCError({ code: "UNSUPPORTED_MEDIA_TYPE", message: req.headers.has("content-type") ? `Unsupported content-type "${req.headers.get("content-type")}` : "Missing content-type header" }); } async function getRequestInfo(opts) { const handler = getContentTypeHandler(opts.req); return await handler.parse(opts); } function isAbortError(error50) { return isObject(error50) && error50["name"] === "AbortError"; } function throwAbortError(message2 = "AbortError") { throw new DOMException(message2, "AbortError"); } function isObject$1(o2) { return Object.prototype.toString.call(o2) === "[object Object]"; } function isPlainObject(o2) { var ctor, prot; if (isObject$1(o2) === false) return false; ctor = o2.constructor; if (ctor === void 0) return true; prot = ctor.prototype; if (isObject$1(prot) === false) return false; if (prot.hasOwnProperty("isPrototypeOf") === false) return false; return true; } function resolveSelfTuple(promise2) { return Unpromise.proxy(promise2).then(() => [promise2]); } function withResolvers() { let resolve; let reject; const promise2 = new Promise((_resolve, _reject) => { resolve = _resolve; reject = _reject; }); return { promise: promise2, resolve, reject }; } function listWithMember(arr, member2) { return [...arr, member2]; } function listWithoutIndex(arr, index) { return [...arr.slice(0, index), ...arr.slice(index + 1)]; } function listWithoutMember(arr, member2) { const index = arr.indexOf(member2); if (index !== -1) return listWithoutIndex(arr, index); return arr; } function makeResource(thing, dispose) { const it = thing; const existing = it[Symbol.dispose]; it[Symbol.dispose] = () => { dispose(); existing === null || existing === void 0 || existing(); }; return it; } function makeAsyncResource(thing, dispose) { const it = thing; const existing = it[Symbol.asyncDispose]; it[Symbol.asyncDispose] = async () => { await dispose(); await (existing === null || existing === void 0 ? void 0 : existing()); }; return it; } function timerResource(ms) { let timer = null; return makeResource({ start() { if (timer) throw new Error("Timer already started"); const promise2 = new Promise((resolve) => { timer = setTimeout(() => resolve(disposablePromiseTimerResult), ms); }); return promise2; } }, () => { if (timer) clearTimeout(timer); }); } function iteratorResource(iterable) { const iterator2 = iterable[Symbol.asyncIterator](); if (iterator2[Symbol.asyncDispose]) return iterator2; return makeAsyncResource(iterator2, async () => { var _iterator$return; await ((_iterator$return = iterator2.return) === null || _iterator$return === void 0 ? void 0 : _iterator$return.call(iterator2)); }); } function takeWithGrace(_x2, _x22) { return _takeWithGrace.apply(this, arguments); } function _takeWithGrace() { _takeWithGrace = (0, import_wrapAsyncGenerator$5.default)(function* (iterable, opts) { try { var _usingCtx$1 = (0, import_usingCtx$4.default)(); const iterator2 = _usingCtx$1.a(iteratorResource(iterable)); let result; const timer = _usingCtx$1.u(timerResource(opts.gracePeriodMs)); let count4 = opts.count; let timerPromise = new Promise(() => { }); while (true) { result = yield (0, import_awaitAsyncGenerator$4.default)(Unpromise.race([iterator2.next(), timerPromise])); if (result === disposablePromiseTimerResult) throwAbortError(); if (result.done) return result.value; yield result.value; if (--count4 === 0) timerPromise = timer.start(); result = null; } } catch (_) { _usingCtx$1.e = _; } finally { yield (0, import_awaitAsyncGenerator$4.default)(_usingCtx$1.d()); } }); return _takeWithGrace.apply(this, arguments); } function createDeferred() { let resolve; let reject; const promise2 = new Promise((res, rej) => { resolve = res; reject = rej; }); return { promise: promise2, resolve, reject }; } function createManagedIterator(iterable, onResult) { const iterator2 = iterable[Symbol.asyncIterator](); let state = "idle"; function cleanup() { state = "done"; onResult = /* @__PURE__ */ __name(() => { }, "onResult"); } __name(cleanup, "cleanup"); function pull() { if (state !== "idle") return; state = "pending"; const next = iterator2.next(); next.then((result) => { if (result.done) { state = "done"; onResult({ status: "return", value: result.value }); cleanup(); return; } state = "idle"; onResult({ status: "yield", value: result.value }); }).catch((cause) => { onResult({ status: "error", error: cause }); cleanup(); }); } __name(pull, "pull"); return { pull, destroy: async () => { var _iterator$return; cleanup(); await ((_iterator$return = iterator2.return) === null || _iterator$return === void 0 ? void 0 : _iterator$return.call(iterator2)); } }; } function mergeAsyncIterables() { let state = "idle"; let flushSignal = createDeferred(); const iterables = []; const iterators = /* @__PURE__ */ new Set(); const buffer = []; function initIterable(iterable) { if (state !== "pending") return; const iterator2 = createManagedIterator(iterable, (result) => { if (state !== "pending") return; switch (result.status) { case "yield": buffer.push([iterator2, result]); break; case "return": iterators.delete(iterator2); break; case "error": buffer.push([iterator2, result]); iterators.delete(iterator2); break; } flushSignal.resolve(); }); iterators.add(iterator2); iterator2.pull(); } __name(initIterable, "initIterable"); return { add(iterable) { switch (state) { case "idle": iterables.push(iterable); break; case "pending": initIterable(iterable); break; case "done": break; } }, [Symbol.asyncIterator]() { return (0, import_wrapAsyncGenerator$4.default)(function* () { try { var _usingCtx$1 = (0, import_usingCtx$3.default)(); if (state !== "idle") throw new Error("Cannot iterate twice"); state = "pending"; const _finally = _usingCtx$1.a(makeAsyncResource({}, async () => { state = "done"; const errors = []; await Promise.all(Array.from(iterators.values()).map(async (it) => { try { await it.destroy(); } catch (cause) { errors.push(cause); } })); buffer.length = 0; iterators.clear(); flushSignal.resolve(); if (errors.length > 0) throw new AggregateError(errors); })); while (iterables.length > 0) initIterable(iterables.shift()); while (iterators.size > 0) { yield (0, import_awaitAsyncGenerator$3.default)(flushSignal.promise); while (buffer.length > 0) { const [iterator2, result] = buffer.shift(); switch (result.status) { case "yield": yield result.value; iterator2.pull(); break; case "error": throw result.error; } } flushSignal = createDeferred(); } } catch (_) { _usingCtx$1.e = _; } finally { yield (0, import_awaitAsyncGenerator$3.default)(_usingCtx$1.d()); } })(); } }; } function readableStreamFrom(iterable) { const iterator2 = iterable[Symbol.asyncIterator](); return new ReadableStream({ async cancel() { var _iterator$return; await ((_iterator$return = iterator2.return) === null || _iterator$return === void 0 ? void 0 : _iterator$return.call(iterator2)); }, async pull(controller) { const result = await iterator2.next(); if (result.done) { controller.close(); return; } controller.enqueue(result.value); } }); } function withPing(_x2, _x22) { return _withPing.apply(this, arguments); } function _withPing() { _withPing = (0, import_wrapAsyncGenerator$3.default)(function* (iterable, pingIntervalMs) { try { var _usingCtx$1 = (0, import_usingCtx$2.default)(); const iterator2 = _usingCtx$1.a(iteratorResource(iterable)); let result; let nextPromise = iterator2.next(); while (true) try { var _usingCtx3 = (0, import_usingCtx$2.default)(); const pingPromise = _usingCtx3.u(timerResource(pingIntervalMs)); result = yield (0, import_awaitAsyncGenerator$2.default)(Unpromise.race([nextPromise, pingPromise.start()])); if (result === disposablePromiseTimerResult) { yield PING_SYM; continue; } if (result.done) return result.value; nextPromise = iterator2.next(); yield result.value; result = null; } catch (_) { _usingCtx3.e = _; } finally { _usingCtx3.d(); } } catch (_) { _usingCtx$1.e = _; } finally { yield (0, import_awaitAsyncGenerator$2.default)(_usingCtx$1.d()); } }); return _withPing.apply(this, arguments); } function isPromise(value) { return (isObject(value) || isFunction(value)) && typeof (value === null || value === void 0 ? void 0 : value["then"]) === "function" && typeof (value === null || value === void 0 ? void 0 : value["catch"]) === "function"; } function createBatchStreamProducer(_x3) { return _createBatchStreamProducer.apply(this, arguments); } function _createBatchStreamProducer() { _createBatchStreamProducer = (0, import_wrapAsyncGenerator$2.default)(function* (opts) { const { data } = opts; let counter = 0; const placeholder = 0; const mergedIterables = mergeAsyncIterables(); function registerAsync(callback) { const idx = counter++; const iterable$1 = callback(idx); mergedIterables.add(iterable$1); return idx; } __name(registerAsync, "registerAsync"); function encodePromise(promise2, path) { return registerAsync(/* @__PURE__ */ function() { var _ref = (0, import_wrapAsyncGenerator$2.default)(function* (idx) { const error50 = checkMaxDepth(path); if (error50) { promise2.catch((cause) => { var _opts$onError; (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, { error: cause, path }); }); promise2 = Promise.reject(error50); } try { const next = yield (0, import_awaitAsyncGenerator$1.default)(promise2); yield [ idx, PROMISE_STATUS_FULFILLED, encode7(next, path) ]; } catch (cause) { var _opts$onError2, _opts$formatError; (_opts$onError2 = opts.onError) === null || _opts$onError2 === void 0 || _opts$onError2.call(opts, { error: cause, path }); yield [ idx, PROMISE_STATUS_REJECTED, (_opts$formatError = opts.formatError) === null || _opts$formatError === void 0 ? void 0 : _opts$formatError.call(opts, { error: cause, path }) ]; } }); return function(_x2) { return _ref.apply(this, arguments); }; }()); } __name(encodePromise, "encodePromise"); function encodeAsyncIterable(iterable$1, path) { return registerAsync(/* @__PURE__ */ function() { var _ref2 = (0, import_wrapAsyncGenerator$2.default)(function* (idx) { try { var _usingCtx$1 = (0, import_usingCtx$1.default)(); const error50 = checkMaxDepth(path); if (error50) throw error50; const iterator2 = _usingCtx$1.a(iteratorResource(iterable$1)); try { while (true) { const next = yield (0, import_awaitAsyncGenerator$1.default)(iterator2.next()); if (next.done) { yield [ idx, ASYNC_ITERABLE_STATUS_RETURN, encode7(next.value, path) ]; break; } yield [ idx, ASYNC_ITERABLE_STATUS_YIELD, encode7(next.value, path) ]; } } catch (cause) { var _opts$onError3, _opts$formatError2; (_opts$onError3 = opts.onError) === null || _opts$onError3 === void 0 || _opts$onError3.call(opts, { error: cause, path }); yield [ idx, ASYNC_ITERABLE_STATUS_ERROR, (_opts$formatError2 = opts.formatError) === null || _opts$formatError2 === void 0 ? void 0 : _opts$formatError2.call(opts, { error: cause, path }) ]; } } catch (_) { _usingCtx$1.e = _; } finally { yield (0, import_awaitAsyncGenerator$1.default)(_usingCtx$1.d()); } }); return function(_x2) { return _ref2.apply(this, arguments); }; }()); } __name(encodeAsyncIterable, "encodeAsyncIterable"); function checkMaxDepth(path) { if (opts.maxDepth && path.length > opts.maxDepth) return new MaxDepthError(path); return null; } __name(checkMaxDepth, "checkMaxDepth"); function encodeAsync3(value, path) { if (isPromise(value)) return [CHUNK_VALUE_TYPE_PROMISE, encodePromise(value, path)]; if (isAsyncIterable(value)) { if (opts.maxDepth && path.length >= opts.maxDepth) throw new Error("Max depth reached"); return [CHUNK_VALUE_TYPE_ASYNC_ITERABLE, encodeAsyncIterable(value, path)]; } return null; } __name(encodeAsync3, "encodeAsync"); function encode7(value, path) { if (value === void 0) return [[]]; const reg = encodeAsync3(value, path); if (reg) return [[placeholder], [null, ...reg]]; if (!isPlainObject(value)) return [[value]]; const newObj = emptyObject(); const asyncValues = []; for (const [key, item] of Object.entries(value)) { const transformed = encodeAsync3(item, [...path, key]); if (!transformed) { newObj[key] = item; continue; } newObj[key] = placeholder; asyncValues.push([key, ...transformed]); } return [[newObj], ...asyncValues]; } __name(encode7, "encode"); const newHead = emptyObject(); for (const [key, item] of Object.entries(data)) newHead[key] = encode7(item, [key]); yield newHead; let iterable = mergedIterables; if (opts.pingMs) iterable = withPing(mergedIterables, opts.pingMs); var _iteratorAbruptCompletion = false; var _didIteratorError = false; var _iteratorError; try { for (var _iterator = (0, import_asyncIterator$1.default)(iterable), _step; _iteratorAbruptCompletion = !(_step = yield (0, import_awaitAsyncGenerator$1.default)(_iterator.next())).done; _iteratorAbruptCompletion = false) { const value = _step.value; yield value; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (_iteratorAbruptCompletion && _iterator.return != null) yield (0, import_awaitAsyncGenerator$1.default)(_iterator.return()); } finally { if (_didIteratorError) throw _iteratorError; } } }); return _createBatchStreamProducer.apply(this, arguments); } function jsonlStreamProducer(opts) { let stream = readableStreamFrom(createBatchStreamProducer(opts)); const { serialize } = opts; if (serialize) stream = stream.pipeThrough(new TransformStream({ transform(chunk, controller) { if (chunk === PING_SYM) controller.enqueue(PING_SYM); else controller.enqueue(serialize(chunk)); } })); return stream.pipeThrough(new TransformStream({ transform(chunk, controller) { if (chunk === PING_SYM) controller.enqueue(" "); else controller.enqueue(JSON.stringify(chunk) + "\n"); } })).pipeThrough(new TextEncoderStream()); } function sseStreamProducer(opts) { var _opts$ping$enabled, _opts$ping, _opts$ping$intervalMs, _opts$ping2, _opts$client; const { serialize = identity } = opts; const ping = { enabled: (_opts$ping$enabled = (_opts$ping = opts.ping) === null || _opts$ping === void 0 ? void 0 : _opts$ping.enabled) !== null && _opts$ping$enabled !== void 0 ? _opts$ping$enabled : false, intervalMs: (_opts$ping$intervalMs = (_opts$ping2 = opts.ping) === null || _opts$ping2 === void 0 ? void 0 : _opts$ping2.intervalMs) !== null && _opts$ping$intervalMs !== void 0 ? _opts$ping$intervalMs : 1e3 }; const client = (_opts$client = opts.client) !== null && _opts$client !== void 0 ? _opts$client : {}; if (ping.enabled && client.reconnectAfterInactivityMs && ping.intervalMs > client.reconnectAfterInactivityMs) throw new Error(`Ping interval must be less than client reconnect interval to prevent unnecessary reconnection - ping.intervalMs: ${ping.intervalMs} client.reconnectAfterInactivityMs: ${client.reconnectAfterInactivityMs}`); function generator() { return _generator.apply(this, arguments); } __name(generator, "generator"); function _generator() { _generator = (0, import_wrapAsyncGenerator$1.default)(function* () { yield { event: CONNECTED_EVENT, data: JSON.stringify(client) }; let iterable = opts.data; if (opts.emitAndEndImmediately) iterable = takeWithGrace(iterable, { count: 1, gracePeriodMs: 1 }); if (ping.enabled && ping.intervalMs !== Infinity && ping.intervalMs > 0) iterable = withPing(iterable, ping.intervalMs); let value; let chunk; var _iteratorAbruptCompletion = false; var _didIteratorError = false; var _iteratorError; try { for (var _iterator = (0, import_asyncIterator.default)(iterable), _step; _iteratorAbruptCompletion = !(_step = yield (0, import_awaitAsyncGenerator.default)(_iterator.next())).done; _iteratorAbruptCompletion = false) { value = _step.value; { if (value === PING_SYM) { yield { event: PING_EVENT, data: "" }; continue; } chunk = isTrackedEnvelope(value) ? { id: value[0], data: value[1] } : { data: value }; chunk.data = JSON.stringify(serialize(chunk.data)); yield chunk; value = null; chunk = null; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (_iteratorAbruptCompletion && _iterator.return != null) yield (0, import_awaitAsyncGenerator.default)(_iterator.return()); } finally { if (_didIteratorError) throw _iteratorError; } } }); return _generator.apply(this, arguments); } __name(_generator, "_generator"); function generatorWithErrorHandling() { return _generatorWithErrorHandling.apply(this, arguments); } __name(generatorWithErrorHandling, "generatorWithErrorHandling"); function _generatorWithErrorHandling() { _generatorWithErrorHandling = (0, import_wrapAsyncGenerator$1.default)(function* () { try { yield* (0, import_asyncGeneratorDelegate.default)((0, import_asyncIterator.default)(generator())); yield { event: RETURN_EVENT, data: "" }; } catch (cause) { var _opts$formatError, _opts$formatError2; if (isAbortError(cause)) return; const error50 = getTRPCErrorFromUnknown(cause); const data = (_opts$formatError = (_opts$formatError2 = opts.formatError) === null || _opts$formatError2 === void 0 ? void 0 : _opts$formatError2.call(opts, { error: error50 })) !== null && _opts$formatError !== void 0 ? _opts$formatError : null; yield { event: SERIALIZED_ERROR_EVENT, data: JSON.stringify(serialize(data)) }; } }); return _generatorWithErrorHandling.apply(this, arguments); } __name(_generatorWithErrorHandling, "_generatorWithErrorHandling"); const stream = readableStreamFrom(generatorWithErrorHandling()); return stream.pipeThrough(new TransformStream({ transform(chunk, controller) { if ("event" in chunk) controller.enqueue(`event: ${chunk.event} `); if ("data" in chunk) controller.enqueue(`data: ${chunk.data} `); if ("id" in chunk) controller.enqueue(`id: ${chunk.id} `); if ("comment" in chunk) controller.enqueue(`: ${chunk.comment} `); controller.enqueue("\n\n"); } })).pipeThrough(new TextEncoderStream()); } function errorToAsyncIterable(err) { return run((0, import_wrapAsyncGenerator.default)(function* () { throw err; })); } function combinedAbortController(signal) { const controller = new AbortController(); const combinedSignal = abortSignalsAnyPonyfill([signal, controller.signal]); return { signal: combinedSignal, controller }; } function initResponse(initOpts) { var _responseMeta, _info$calls$find$proc, _info$calls$find; const { ctx, info: info3, responseMeta, untransformedJSON, errors = [], headers } = initOpts; let status = untransformedJSON ? getHTTPStatusCode(untransformedJSON) : 200; const eagerGeneration = !untransformedJSON; const data = eagerGeneration ? [] : Array.isArray(untransformedJSON) ? untransformedJSON : [untransformedJSON]; const meta3 = (_responseMeta = responseMeta === null || responseMeta === void 0 ? void 0 : responseMeta({ ctx, info: info3, paths: info3 === null || info3 === void 0 ? void 0 : info3.calls.map((call) => call.path), data, errors, eagerGeneration, type: (_info$calls$find$proc = info3 === null || info3 === void 0 || (_info$calls$find = info3.calls.find((call) => { var _call$procedure; return (_call$procedure = call.procedure) === null || _call$procedure === void 0 ? void 0 : _call$procedure._def.type; })) === null || _info$calls$find === void 0 || (_info$calls$find = _info$calls$find.procedure) === null || _info$calls$find === void 0 ? void 0 : _info$calls$find._def.type) !== null && _info$calls$find$proc !== void 0 ? _info$calls$find$proc : "unknown" })) !== null && _responseMeta !== void 0 ? _responseMeta : {}; if (meta3.headers) { if (meta3.headers instanceof Headers) for (const [key, value] of meta3.headers.entries()) headers.append(key, value); else for (const [key, value] of Object.entries(meta3.headers)) if (Array.isArray(value)) for (const v3 of value) headers.append(key, v3); else if (typeof value === "string") headers.set(key, value); } if (meta3.status) status = meta3.status; return { status }; } function caughtErrorToData(cause, errorOpts) { const { router: router8, req, onError } = errorOpts.opts; const error50 = getTRPCErrorFromUnknown(cause); onError === null || onError === void 0 || onError({ error: error50, path: errorOpts.path, input: errorOpts.input, ctx: errorOpts.ctx, type: errorOpts.type, req }); const untransformedJSON = { error: getErrorShape({ config: router8._def._config, error: error50, type: errorOpts.type, path: errorOpts.path, input: errorOpts.input, ctx: errorOpts.ctx }) }; const transformedJSON = transformTRPCResponse(router8._def._config, untransformedJSON); const body = JSON.stringify(transformedJSON); return { error: error50, untransformedJSON, body }; } function isDataStream(v3) { if (!isObject(v3)) return false; if (isAsyncIterable(v3)) return true; return Object.values(v3).some(isPromise) || Object.values(v3).some(isAsyncIterable); } async function resolveResponse(opts) { var _ref, _opts$allowBatching, _opts$batching, _opts$allowMethodOver, _config$sse$enabled, _config$sse; const { router: router8, req } = opts; const headers = new Headers([["vary", "trpc-accept, accept"]]); const config3 = router8._def._config; const url2 = new URL(req.url); if (req.method === "HEAD") return new Response(null, { status: 204 }); const allowBatching = (_ref = (_opts$allowBatching = opts.allowBatching) !== null && _opts$allowBatching !== void 0 ? _opts$allowBatching : (_opts$batching = opts.batching) === null || _opts$batching === void 0 ? void 0 : _opts$batching.enabled) !== null && _ref !== void 0 ? _ref : true; const allowMethodOverride = ((_opts$allowMethodOver = opts.allowMethodOverride) !== null && _opts$allowMethodOver !== void 0 ? _opts$allowMethodOver : false) && req.method === "POST"; const infoTuple = await run(async () => { try { return [void 0, await getRequestInfo({ req, path: decodeURIComponent(opts.path), router: router8, searchParams: url2.searchParams, headers: opts.req.headers, url: url2 })]; } catch (cause) { return [getTRPCErrorFromUnknown(cause), void 0]; } }); const ctxManager = run(() => { let result = void 0; return { valueOrUndefined: () => { if (!result) return void 0; return result[1]; }, value: () => { const [err, ctx] = result; if (err) throw err; return ctx; }, create: async (info3) => { if (result) throw new Error("This should only be called once - report a bug in tRPC"); try { const ctx = await opts.createContext({ info: info3 }); result = [void 0, ctx]; } catch (cause) { result = [getTRPCErrorFromUnknown(cause), void 0]; } } }; }); const methodMapper = allowMethodOverride ? TYPE_ACCEPTED_METHOD_MAP_WITH_METHOD_OVERRIDE : TYPE_ACCEPTED_METHOD_MAP; const isStreamCall = getAcceptHeader(req.headers) === "application/jsonl"; const experimentalSSE = (_config$sse$enabled = (_config$sse = config3.sse) === null || _config$sse === void 0 ? void 0 : _config$sse.enabled) !== null && _config$sse$enabled !== void 0 ? _config$sse$enabled : true; try { const [infoError, info3] = infoTuple; if (infoError) throw infoError; if (info3.isBatchCall && !allowBatching) throw new TRPCError({ code: "BAD_REQUEST", message: `Batching is not enabled on the server` }); if (isStreamCall && !info3.isBatchCall) throw new TRPCError({ message: `Streaming requests must be batched (you can do a batch of 1)`, code: "BAD_REQUEST" }); await ctxManager.create(info3); const rpcCalls = info3.calls.map(async (call) => { const proc = call.procedure; const combinedAbort = combinedAbortController(opts.req.signal); try { if (opts.error) throw opts.error; if (!proc) throw new TRPCError({ code: "NOT_FOUND", message: `No procedure found on path "${call.path}"` }); if (!methodMapper[proc._def.type].includes(req.method)) throw new TRPCError({ code: "METHOD_NOT_SUPPORTED", message: `Unsupported ${req.method}-request to ${proc._def.type} procedure at path "${call.path}"` }); if (proc._def.type === "subscription") { var _config$sse2; if (info3.isBatchCall) throw new TRPCError({ code: "BAD_REQUEST", message: `Cannot batch subscription calls` }); if ((_config$sse2 = config3.sse) === null || _config$sse2 === void 0 ? void 0 : _config$sse2.maxDurationMs) { let cleanup = function() { clearTimeout(timer); combinedAbort.signal.removeEventListener("abort", cleanup); combinedAbort.controller.abort(); }; __name(cleanup, "cleanup"); const timer = setTimeout(cleanup, config3.sse.maxDurationMs); combinedAbort.signal.addEventListener("abort", cleanup); } } const data = await proc({ path: call.path, getRawInput: call.getRawInput, ctx: ctxManager.value(), type: proc._def.type, signal: combinedAbort.signal, batchIndex: call.batchIndex }); return [void 0, { data, signal: proc._def.type === "subscription" ? combinedAbort.signal : void 0 }]; } catch (cause) { var _opts$onError, _call$procedure$_def$, _call$procedure2; const error50 = getTRPCErrorFromUnknown(cause); const input = call.result(); (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, { error: error50, path: call.path, input, ctx: ctxManager.valueOrUndefined(), type: (_call$procedure$_def$ = (_call$procedure2 = call.procedure) === null || _call$procedure2 === void 0 ? void 0 : _call$procedure2._def.type) !== null && _call$procedure$_def$ !== void 0 ? _call$procedure$_def$ : "unknown", req: opts.req }); return [error50, void 0]; } }); if (!info3.isBatchCall) { const [call] = info3.calls; const [error50, result] = await rpcCalls[0]; switch (info3.type) { case "unknown": case "mutation": case "query": { headers.set("content-type", "application/json"); if (isDataStream(result === null || result === void 0 ? void 0 : result.data)) throw new TRPCError({ code: "UNSUPPORTED_MEDIA_TYPE", message: "Cannot use stream-like response in non-streaming request - use httpBatchStreamLink" }); const res = error50 ? { error: getErrorShape({ config: config3, ctx: ctxManager.valueOrUndefined(), error: error50, input: call.result(), path: call.path, type: info3.type }) } : { result: { data: result.data } }; const headResponse$1 = initResponse({ ctx: ctxManager.valueOrUndefined(), info: info3, responseMeta: opts.responseMeta, errors: error50 ? [error50] : [], headers, untransformedJSON: [res] }); return new Response(JSON.stringify(transformTRPCResponse(config3, res)), { status: headResponse$1.status, headers }); } case "subscription": { const iterable = run(() => { if (error50) return errorToAsyncIterable(error50); if (!experimentalSSE) return errorToAsyncIterable(new TRPCError({ code: "METHOD_NOT_SUPPORTED", message: 'Missing experimental flag "sseSubscriptions"' })); if (!isObservable(result.data) && !isAsyncIterable(result.data)) return errorToAsyncIterable(new TRPCError({ message: `Subscription ${call.path} did not return an observable or a AsyncGenerator`, code: "INTERNAL_SERVER_ERROR" })); const dataAsIterable = isObservable(result.data) ? observableToAsyncIterable(result.data, opts.req.signal) : result.data; return dataAsIterable; }); const stream = sseStreamProducer((0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, config3.sse), {}, { data: iterable, serialize: (v3) => config3.transformer.output.serialize(v3), formatError(errorOpts) { var _call$procedure$_def$2, _call$procedure3, _opts$onError2; const error$1 = getTRPCErrorFromUnknown(errorOpts.error); const input = call === null || call === void 0 ? void 0 : call.result(); const path = call === null || call === void 0 ? void 0 : call.path; const type = (_call$procedure$_def$2 = call === null || call === void 0 || (_call$procedure3 = call.procedure) === null || _call$procedure3 === void 0 ? void 0 : _call$procedure3._def.type) !== null && _call$procedure$_def$2 !== void 0 ? _call$procedure$_def$2 : "unknown"; (_opts$onError2 = opts.onError) === null || _opts$onError2 === void 0 || _opts$onError2.call(opts, { error: error$1, path, input, ctx: ctxManager.valueOrUndefined(), req: opts.req, type }); const shape = getErrorShape({ config: config3, ctx: ctxManager.valueOrUndefined(), error: error$1, input, path, type }); return shape; } })); for (const [key, value] of Object.entries(sseHeaders)) headers.set(key, value); const headResponse$1 = initResponse({ ctx: ctxManager.valueOrUndefined(), info: info3, responseMeta: opts.responseMeta, errors: [], headers, untransformedJSON: null }); const abortSignal = result === null || result === void 0 ? void 0 : result.signal; let responseBody = stream; if (abortSignal) { const reader = stream.getReader(); const onAbort = /* @__PURE__ */ __name(() => void reader.cancel(), "onAbort"); if (abortSignal.aborted) onAbort(); else abortSignal.addEventListener("abort", onAbort, { once: true }); responseBody = new ReadableStream({ async pull(controller) { const chunk = await reader.read(); if (chunk.done) { abortSignal.removeEventListener("abort", onAbort); controller.close(); } else controller.enqueue(chunk.value); }, cancel() { abortSignal.removeEventListener("abort", onAbort); return reader.cancel(); } }); } return new Response(responseBody, { headers, status: headResponse$1.status }); } } } if (info3.accept === "application/jsonl") { headers.set("content-type", "application/json"); headers.set("transfer-encoding", "chunked"); const headResponse$1 = initResponse({ ctx: ctxManager.valueOrUndefined(), info: info3, responseMeta: opts.responseMeta, errors: [], headers, untransformedJSON: null }); const stream = jsonlStreamProducer((0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, config3.jsonl), {}, { maxDepth: Infinity, data: rpcCalls.map(async (res) => { const [error50, result] = await res; const call = info3.calls[0]; if (error50) { var _procedure$_def$type, _procedure; return { error: getErrorShape({ config: config3, ctx: ctxManager.valueOrUndefined(), error: error50, input: call.result(), path: call.path, type: (_procedure$_def$type = (_procedure = call.procedure) === null || _procedure === void 0 ? void 0 : _procedure._def.type) !== null && _procedure$_def$type !== void 0 ? _procedure$_def$type : "unknown" }) }; } const iterable = isObservable(result.data) ? observableToAsyncIterable(result.data, opts.req.signal) : Promise.resolve(result.data); return { result: Promise.resolve({ data: iterable }) }; }), serialize: (data) => config3.transformer.output.serialize(data), onError: (cause) => { var _opts$onError3, _info$type; (_opts$onError3 = opts.onError) === null || _opts$onError3 === void 0 || _opts$onError3.call(opts, { error: getTRPCErrorFromUnknown(cause), path: void 0, input: void 0, ctx: ctxManager.valueOrUndefined(), req: opts.req, type: (_info$type = info3 === null || info3 === void 0 ? void 0 : info3.type) !== null && _info$type !== void 0 ? _info$type : "unknown" }); }, formatError(errorOpts) { var _call$procedure$_def$3, _call$procedure4; const call = info3 === null || info3 === void 0 ? void 0 : info3.calls[errorOpts.path[0]]; const error50 = getTRPCErrorFromUnknown(errorOpts.error); const input = call === null || call === void 0 ? void 0 : call.result(); const path = call === null || call === void 0 ? void 0 : call.path; const type = (_call$procedure$_def$3 = call === null || call === void 0 || (_call$procedure4 = call.procedure) === null || _call$procedure4 === void 0 ? void 0 : _call$procedure4._def.type) !== null && _call$procedure$_def$3 !== void 0 ? _call$procedure$_def$3 : "unknown"; const shape = getErrorShape({ config: config3, ctx: ctxManager.valueOrUndefined(), error: error50, input, path, type }); return shape; } })); return new Response(stream, { headers, status: headResponse$1.status }); } headers.set("content-type", "application/json"); const results = (await Promise.all(rpcCalls)).map((res) => { const [error50, result] = res; if (error50) return res; if (isDataStream(result.data)) return [new TRPCError({ code: "UNSUPPORTED_MEDIA_TYPE", message: "Cannot use stream-like response in non-streaming request - use httpBatchStreamLink" }), void 0]; return res; }); const resultAsRPCResponse = results.map(([error50, result], index) => { const call = info3.calls[index]; if (error50) { var _call$procedure$_def$4, _call$procedure5; return { error: getErrorShape({ config: config3, ctx: ctxManager.valueOrUndefined(), error: error50, input: call.result(), path: call.path, type: (_call$procedure$_def$4 = (_call$procedure5 = call.procedure) === null || _call$procedure5 === void 0 ? void 0 : _call$procedure5._def.type) !== null && _call$procedure$_def$4 !== void 0 ? _call$procedure$_def$4 : "unknown" }) }; } return { result: { data: result.data } }; }); const errors = results.map(([error50]) => error50).filter(Boolean); const headResponse = initResponse({ ctx: ctxManager.valueOrUndefined(), info: info3, responseMeta: opts.responseMeta, untransformedJSON: resultAsRPCResponse, errors, headers }); return new Response(JSON.stringify(transformTRPCResponse(config3, resultAsRPCResponse)), { status: headResponse.status, headers }); } catch (cause) { var _info$type2; const [_infoError, info3] = infoTuple; const ctx = ctxManager.valueOrUndefined(); const { error: error50, untransformedJSON, body } = caughtErrorToData(cause, { opts, ctx: ctxManager.valueOrUndefined(), type: (_info$type2 = info3 === null || info3 === void 0 ? void 0 : info3.type) !== null && _info$type2 !== void 0 ? _info$type2 : "unknown" }); const headResponse = initResponse({ ctx, info: info3, responseMeta: opts.responseMeta, untransformedJSON, errors: [error50], headers }); return new Response(body, { status: headResponse.status, headers }); } } var import_objectSpread2$12, jsonContentTypeHandler, formDataContentTypeHandler, octetStreamContentTypeHandler, handlers, import_defineProperty2, _Symbol$toStringTag, subscribableCache, NOOP, Unpromise, _Symbol, _Symbol$dispose, _Symbol2, _Symbol2$asyncDispose, disposablePromiseTimerResult, require_usingCtx, require_OverloadYield, require_awaitAsyncGenerator, require_wrapAsyncGenerator, import_usingCtx$4, import_awaitAsyncGenerator$4, import_wrapAsyncGenerator$5, import_usingCtx$3, import_awaitAsyncGenerator$3, import_wrapAsyncGenerator$4, import_usingCtx$2, import_awaitAsyncGenerator$2, import_wrapAsyncGenerator$3, PING_SYM, require_asyncIterator, import_awaitAsyncGenerator$1, import_wrapAsyncGenerator$2, import_usingCtx$1, import_asyncIterator$1, CHUNK_VALUE_TYPE_PROMISE, CHUNK_VALUE_TYPE_ASYNC_ITERABLE, PROMISE_STATUS_FULFILLED, PROMISE_STATUS_REJECTED, ASYNC_ITERABLE_STATUS_RETURN, ASYNC_ITERABLE_STATUS_YIELD, ASYNC_ITERABLE_STATUS_ERROR, MaxDepthError, require_asyncGeneratorDelegate, import_asyncIterator, import_awaitAsyncGenerator, import_wrapAsyncGenerator$1, import_asyncGeneratorDelegate, import_usingCtx, PING_EVENT, SERIALIZED_ERROR_EVENT, CONNECTED_EVENT, RETURN_EVENT, sseHeaders, import_wrapAsyncGenerator, import_objectSpread23, TYPE_ACCEPTED_METHOD_MAP, TYPE_ACCEPTED_METHOD_MAP_WITH_METHOD_OVERRIDE; var init_resolveResponse_CHqBlAgR = __esm({ "../../node_modules/@trpc/server/dist/resolveResponse-CHqBlAgR.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getErrorShape_vC8mUXJD(); init_codes_DagpWZLc(); init_tracked_Bjtgv3wJ(); init_observable_UMO3vUa(); __name(parseConnectionParamsFromUnknown, "parseConnectionParamsFromUnknown"); __name(parseConnectionParamsFromString, "parseConnectionParamsFromString"); import_objectSpread2$12 = __toESM2(require_objectSpread2(), 1); __name(getAcceptHeader, "getAcceptHeader"); __name(memo, "memo"); jsonContentTypeHandler = { isMatch(req) { var _req$headers$get; return !!((_req$headers$get = req.headers.get("content-type")) === null || _req$headers$get === void 0 ? void 0 : _req$headers$get.startsWith("application/json")); }, async parse(opts) { var _types$values$next$va; const { req } = opts; const isBatchCall = opts.searchParams.get("batch") === "1"; const paths = isBatchCall ? opts.path.split(",") : [opts.path]; const getInputs = memo(async () => { let inputs = void 0; if (req.method === "GET") { const queryInput = opts.searchParams.get("input"); if (queryInput) inputs = JSON.parse(queryInput); } else inputs = await req.json(); if (inputs === void 0) return emptyObject(); if (!isBatchCall) { const result = emptyObject(); result[0] = opts.router._def._config.transformer.input.deserialize(inputs); return result; } if (!isObject(inputs)) throw new TRPCError({ code: "BAD_REQUEST", message: '"input" needs to be an object when doing a batch call' }); const acc = emptyObject(); for (const index of paths.keys()) { const input = inputs[index]; if (input !== void 0) acc[index] = opts.router._def._config.transformer.input.deserialize(input); } return acc; }); const calls = await Promise.all(paths.map(async (path, index) => { const procedure = await getProcedureAtPath(opts.router, path); return { batchIndex: index, path, procedure, getRawInput: async () => { const inputs = await getInputs.read(); let input = inputs[index]; if ((procedure === null || procedure === void 0 ? void 0 : procedure._def.type) === "subscription") { var _ref2, _opts$headers$get; const lastEventId = (_ref2 = (_opts$headers$get = opts.headers.get("last-event-id")) !== null && _opts$headers$get !== void 0 ? _opts$headers$get : opts.searchParams.get("lastEventId")) !== null && _ref2 !== void 0 ? _ref2 : opts.searchParams.get("Last-Event-Id"); if (lastEventId) if (isObject(input)) input = (0, import_objectSpread2$12.default)((0, import_objectSpread2$12.default)({}, input), {}, { lastEventId }); else { var _input; (_input = input) !== null && _input !== void 0 || (input = { lastEventId }); } } return input; }, result: () => { var _getInputs$result; return (_getInputs$result = getInputs.result()) === null || _getInputs$result === void 0 ? void 0 : _getInputs$result[index]; } }; })); const types = new Set(calls.map((call) => { var _call$procedure; return (_call$procedure = call.procedure) === null || _call$procedure === void 0 ? void 0 : _call$procedure._def.type; }).filter(Boolean)); if (types.size > 1) throw new TRPCError({ code: "BAD_REQUEST", message: `Cannot mix procedure types in call: ${Array.from(types).join(", ")}` }); const type = (_types$values$next$va = types.values().next().value) !== null && _types$values$next$va !== void 0 ? _types$values$next$va : "unknown"; const connectionParamsStr = opts.searchParams.get("connectionParams"); const info3 = { isBatchCall, accept: getAcceptHeader(req.headers), calls, type, connectionParams: connectionParamsStr === null ? null : parseConnectionParamsFromString(connectionParamsStr), signal: req.signal, url: opts.url }; return info3; } }; formDataContentTypeHandler = { isMatch(req) { var _req$headers$get2; return !!((_req$headers$get2 = req.headers.get("content-type")) === null || _req$headers$get2 === void 0 ? void 0 : _req$headers$get2.startsWith("multipart/form-data")); }, async parse(opts) { const { req } = opts; if (req.method !== "POST") throw new TRPCError({ code: "METHOD_NOT_SUPPORTED", message: "Only POST requests are supported for multipart/form-data requests" }); const getInputs = memo(async () => { const fd = await req.formData(); return fd; }); const procedure = await getProcedureAtPath(opts.router, opts.path); return { accept: null, calls: [{ batchIndex: 0, path: opts.path, getRawInput: getInputs.read, result: getInputs.result, procedure }], isBatchCall: false, type: "mutation", connectionParams: null, signal: req.signal, url: opts.url }; } }; octetStreamContentTypeHandler = { isMatch(req) { var _req$headers$get3; return !!((_req$headers$get3 = req.headers.get("content-type")) === null || _req$headers$get3 === void 0 ? void 0 : _req$headers$get3.startsWith("application/octet-stream")); }, async parse(opts) { const { req } = opts; if (req.method !== "POST") throw new TRPCError({ code: "METHOD_NOT_SUPPORTED", message: "Only POST requests are supported for application/octet-stream requests" }); const getInputs = memo(async () => { return req.body; }); return { calls: [{ batchIndex: 0, path: opts.path, getRawInput: getInputs.read, result: getInputs.result, procedure: await getProcedureAtPath(opts.router, opts.path) }], isBatchCall: false, accept: null, type: "mutation", connectionParams: null, signal: req.signal, url: opts.url }; } }; handlers = [ jsonContentTypeHandler, formDataContentTypeHandler, octetStreamContentTypeHandler ]; __name(getContentTypeHandler, "getContentTypeHandler"); __name(getRequestInfo, "getRequestInfo"); __name(isAbortError, "isAbortError"); __name(throwAbortError, "throwAbortError"); __name(isObject$1, "isObject$1"); __name(isPlainObject, "isPlainObject"); import_defineProperty2 = __toESM2(require_defineProperty(), 1); subscribableCache = /* @__PURE__ */ new WeakMap(); NOOP = /* @__PURE__ */ __name(() => { }, "NOOP"); _Symbol$toStringTag = Symbol.toStringTag; Unpromise = /* @__PURE__ */ __name(class Unpromise2 { constructor(arg) { (0, import_defineProperty2.default)(this, "promise", void 0); (0, import_defineProperty2.default)(this, "subscribers", []); (0, import_defineProperty2.default)(this, "settlement", null); (0, import_defineProperty2.default)(this, _Symbol$toStringTag, "Unpromise"); if (typeof arg === "function") this.promise = new Promise(arg); else this.promise = arg; const thenReturn = this.promise.then((value) => { const { subscribers } = this; this.subscribers = null; this.settlement = { status: "fulfilled", value }; subscribers === null || subscribers === void 0 || subscribers.forEach(({ resolve }) => { resolve(value); }); }); if ("catch" in thenReturn) thenReturn.catch((reason) => { const { subscribers } = this; this.subscribers = null; this.settlement = { status: "rejected", reason }; subscribers === null || subscribers === void 0 || subscribers.forEach(({ reject }) => { reject(reason); }); }); } /** Create a promise that mitigates uncontrolled subscription to a long-lived * Promise via .then() and .catch() - otherwise a source of memory leaks. * * The returned promise has an `unsubscribe()` method which can be called when * the Promise is no longer being tracked by application logic, and which * ensures that there is no reference chain from the original promise to the * new one, and therefore no memory leak. * * If original promise has not yet settled, this adds a new unique promise * that listens to then/catch events, along with an `unsubscribe()` method to * detach it. * * If original promise has settled, then creates a new Promise.resolve() or * Promise.reject() and provided unsubscribe is a noop. * * If you call `unsubscribe()` before the returned Promise has settled, it * will never settle. */ subscribe() { let promise2; let unsubscribe; const { settlement } = this; if (settlement === null) { if (this.subscribers === null) throw new Error("Unpromise settled but still has subscribers"); const subscriber = withResolvers(); this.subscribers = listWithMember(this.subscribers, subscriber); promise2 = subscriber.promise; unsubscribe = /* @__PURE__ */ __name(() => { if (this.subscribers !== null) this.subscribers = listWithoutMember(this.subscribers, subscriber); }, "unsubscribe"); } else { const { status } = settlement; if (status === "fulfilled") promise2 = Promise.resolve(settlement.value); else promise2 = Promise.reject(settlement.reason); unsubscribe = NOOP; } return Object.assign(promise2, { unsubscribe }); } /** STANDARD PROMISE METHODS (but returning a SubscribedPromise) */ then(onfulfilled, onrejected) { const subscribed = this.subscribe(); const { unsubscribe } = subscribed; return Object.assign(subscribed.then(onfulfilled, onrejected), { unsubscribe }); } catch(onrejected) { const subscribed = this.subscribe(); const { unsubscribe } = subscribed; return Object.assign(subscribed.catch(onrejected), { unsubscribe }); } finally(onfinally) { const subscribed = this.subscribe(); const { unsubscribe } = subscribed; return Object.assign(subscribed.finally(onfinally), { unsubscribe }); } /** Unpromise STATIC METHODS */ /** Create or Retrieve the proxy Unpromise (a re-used Unpromise for the VM lifetime * of the provided Promise reference) */ static proxy(promise2) { const cached2 = Unpromise2.getSubscribablePromise(promise2); return typeof cached2 !== "undefined" ? cached2 : Unpromise2.createSubscribablePromise(promise2); } /** Create and store an Unpromise keyed by an original Promise. */ static createSubscribablePromise(promise2) { const created = new Unpromise2(promise2); subscribableCache.set(promise2, created); subscribableCache.set(created, created); return created; } /** Retrieve a previously-created Unpromise keyed by an original Promise. */ static getSubscribablePromise(promise2) { return subscribableCache.get(promise2); } /** Promise STATIC METHODS */ /** Lookup the Unpromise for this promise, and derive a SubscribedPromise from * it (that can be later unsubscribed to eliminate Memory leaks) */ static resolve(value) { const promise2 = typeof value === "object" && value !== null && "then" in value && typeof value.then === "function" ? value : Promise.resolve(value); return Unpromise2.proxy(promise2).subscribe(); } static async any(values) { const valuesArray = Array.isArray(values) ? values : [...values]; const subscribedPromises = valuesArray.map(Unpromise2.resolve); try { return await Promise.any(subscribedPromises); } finally { subscribedPromises.forEach(({ unsubscribe }) => { unsubscribe(); }); } } static async race(values) { const valuesArray = Array.isArray(values) ? values : [...values]; const subscribedPromises = valuesArray.map(Unpromise2.resolve); try { return await Promise.race(subscribedPromises); } finally { subscribedPromises.forEach(({ unsubscribe }) => { unsubscribe(); }); } } /** Create a race of SubscribedPromises that will fulfil to a single winning * Promise (in a 1-Tuple). Eliminates memory leaks from long-lived promises * accumulating .then() and .catch() subscribers. Allows simple logic to * consume the result, like... * ```ts * const [ winner ] = await Unpromise.race([ promiseA, promiseB ]); * if(winner === promiseB){ * const result = await promiseB; * // do the thing * } * ``` * */ static async raceReferences(promises) { const selfPromises = promises.map(resolveSelfTuple); try { return await Promise.race(selfPromises); } finally { for (const promise2 of selfPromises) promise2.unsubscribe(); } } }, "Unpromise"); __name(resolveSelfTuple, "resolveSelfTuple"); __name(withResolvers, "withResolvers"); __name(listWithMember, "listWithMember"); __name(listWithoutIndex, "listWithoutIndex"); __name(listWithoutMember, "listWithoutMember"); (_Symbol$dispose = (_Symbol = Symbol).dispose) !== null && _Symbol$dispose !== void 0 || (_Symbol.dispose = Symbol()); (_Symbol2$asyncDispose = (_Symbol2 = Symbol).asyncDispose) !== null && _Symbol2$asyncDispose !== void 0 || (_Symbol2.asyncDispose = Symbol()); __name(makeResource, "makeResource"); __name(makeAsyncResource, "makeAsyncResource"); disposablePromiseTimerResult = Symbol(); __name(timerResource, "timerResource"); require_usingCtx = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) { function _usingCtx() { var r2 = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) { var n$1 = Error(); return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1; }, e2 = {}, n2 = []; function using(r$1, e$1) { if (null != e$1) { if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); if (r$1) var o2 = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")]; if (void 0 === o2 && (o2 = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t9 = o2; if ("function" != typeof o2) throw new TypeError("Object is not disposable."); t9 && (o2 = /* @__PURE__ */ __name(function o$1() { try { t9.call(e$1); } catch (r$2) { return Promise.reject(r$2); } }, "o$1")), n2.push({ v: e$1, d: o2, a: r$1 }); } else r$1 && n2.push({ d: e$1, a: r$1 }); return e$1; } __name(using, "using"); return { e: e2, u: using.bind(null, false), a: using.bind(null, true), d: /* @__PURE__ */ __name(function d2() { var o2, t9 = this.e, s2 = 0; function next() { for (; o2 = n2.pop(); ) try { if (!o2.a && 1 === s2) return s2 = 0, n2.push(o2), Promise.resolve().then(next); if (o2.d) { var r$1 = o2.d.call(o2.v); if (o2.a) return s2 |= 2, Promise.resolve(r$1).then(next, err); } else s2 |= 1; } catch (r$2) { return err(r$2); } if (1 === s2) return t9 !== e2 ? Promise.reject(t9) : Promise.resolve(); if (t9 !== e2) throw t9; } __name(next, "next"); function err(n$1) { return t9 = t9 !== e2 ? new r2(n$1, t9) : n$1, next(); } __name(err, "err"); return next(); }, "d") }; } __name(_usingCtx, "_usingCtx"); module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_OverloadYield = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(exports, module) { function _OverloadYield(e2, d2) { this.v = e2, this.k = d2; } __name(_OverloadYield, "_OverloadYield"); module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_awaitAsyncGenerator = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(exports, module) { var OverloadYield$2 = require_OverloadYield(); function _awaitAsyncGenerator$5(e2) { return new OverloadYield$2(e2, 0); } __name(_awaitAsyncGenerator$5, "_awaitAsyncGenerator$5"); module.exports = _awaitAsyncGenerator$5, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_wrapAsyncGenerator = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(exports, module) { var OverloadYield$1 = require_OverloadYield(); function _wrapAsyncGenerator$6(e2) { return function() { return new AsyncGenerator(e2.apply(this, arguments)); }; } __name(_wrapAsyncGenerator$6, "_wrapAsyncGenerator$6"); function AsyncGenerator(e2) { var r2, t9; function resume(r$1, t$1) { try { var n2 = e2[r$1](t$1), o2 = n2.value, u5 = o2 instanceof OverloadYield$1; Promise.resolve(u5 ? o2.v : o2).then(function(t$2) { if (u5) { var i2 = "return" === r$1 ? "return" : "next"; if (!o2.k || t$2.done) return resume(i2, t$2); t$2 = e2[i2](t$2).value; } settle2(n2.done ? "return" : "normal", t$2); }, function(e$1) { resume("throw", e$1); }); } catch (e$1) { settle2("throw", e$1); } } __name(resume, "resume"); function settle2(e$1, n2) { switch (e$1) { case "return": r2.resolve({ value: n2, done: true }); break; case "throw": r2.reject(n2); break; default: r2.resolve({ value: n2, done: false }); } (r2 = r2.next) ? resume(r2.key, r2.arg) : t9 = null; } __name(settle2, "settle"); this._invoke = function(e$1, n2) { return new Promise(function(o2, u5) { var i2 = { key: e$1, arg: n2, resolve: o2, reject: u5, next: null }; t9 ? t9 = t9.next = i2 : (r2 = t9 = i2, resume(e$1, n2)); }); }, "function" != typeof e2["return"] && (this["return"] = void 0); } __name(AsyncGenerator, "AsyncGenerator"); AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() { return this; }, AsyncGenerator.prototype.next = function(e2) { return this._invoke("next", e2); }, AsyncGenerator.prototype["throw"] = function(e2) { return this._invoke("throw", e2); }, AsyncGenerator.prototype["return"] = function(e2) { return this._invoke("return", e2); }; module.exports = _wrapAsyncGenerator$6, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); import_usingCtx$4 = __toESM2(require_usingCtx(), 1); import_awaitAsyncGenerator$4 = __toESM2(require_awaitAsyncGenerator(), 1); import_wrapAsyncGenerator$5 = __toESM2(require_wrapAsyncGenerator(), 1); __name(iteratorResource, "iteratorResource"); __name(takeWithGrace, "takeWithGrace"); __name(_takeWithGrace, "_takeWithGrace"); __name(createDeferred, "createDeferred"); import_usingCtx$3 = __toESM2(require_usingCtx(), 1); import_awaitAsyncGenerator$3 = __toESM2(require_awaitAsyncGenerator(), 1); import_wrapAsyncGenerator$4 = __toESM2(require_wrapAsyncGenerator(), 1); __name(createManagedIterator, "createManagedIterator"); __name(mergeAsyncIterables, "mergeAsyncIterables"); __name(readableStreamFrom, "readableStreamFrom"); import_usingCtx$2 = __toESM2(require_usingCtx(), 1); import_awaitAsyncGenerator$2 = __toESM2(require_awaitAsyncGenerator(), 1); import_wrapAsyncGenerator$3 = __toESM2(require_wrapAsyncGenerator(), 1); PING_SYM = Symbol("ping"); __name(withPing, "withPing"); __name(_withPing, "_withPing"); require_asyncIterator = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module) { function _asyncIterator$2(r2) { var n2, t9, o2, e2 = 2; for ("undefined" != typeof Symbol && (t9 = Symbol.asyncIterator, o2 = Symbol.iterator); e2--; ) { if (t9 && null != (n2 = r2[t9])) return n2.call(r2); if (o2 && null != (n2 = r2[o2])) return new AsyncFromSyncIterator(n2.call(r2)); t9 = "@@asyncIterator", o2 = "@@iterator"; } throw new TypeError("Object is not async iterable"); } __name(_asyncIterator$2, "_asyncIterator$2"); function AsyncFromSyncIterator(r2) { function AsyncFromSyncIteratorContinuation(r$1) { if (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + " is not an object.")); var n2 = r$1.done; return Promise.resolve(r$1.value).then(function(r$2) { return { value: r$2, done: n2 }; }); } __name(AsyncFromSyncIteratorContinuation, "AsyncFromSyncIteratorContinuation"); return AsyncFromSyncIterator = /* @__PURE__ */ __name(function AsyncFromSyncIterator$1(r$1) { this.s = r$1, this.n = r$1.next; }, "AsyncFromSyncIterator$1"), AsyncFromSyncIterator.prototype = { s: null, n: null, next: /* @__PURE__ */ __name(function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "next"), "return": /* @__PURE__ */ __name(function _return(r$1) { var n2 = this.s["return"]; return void 0 === n2 ? Promise.resolve({ value: r$1, done: true }) : AsyncFromSyncIteratorContinuation(n2.apply(this.s, arguments)); }, "_return"), "throw": /* @__PURE__ */ __name(function _throw(r$1) { var n2 = this.s["return"]; return void 0 === n2 ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n2.apply(this.s, arguments)); }, "_throw") }, new AsyncFromSyncIterator(r2); } __name(AsyncFromSyncIterator, "AsyncFromSyncIterator"); module.exports = _asyncIterator$2, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); import_awaitAsyncGenerator$1 = __toESM2(require_awaitAsyncGenerator(), 1); import_wrapAsyncGenerator$2 = __toESM2(require_wrapAsyncGenerator(), 1); import_usingCtx$1 = __toESM2(require_usingCtx(), 1); import_asyncIterator$1 = __toESM2(require_asyncIterator(), 1); CHUNK_VALUE_TYPE_PROMISE = 0; CHUNK_VALUE_TYPE_ASYNC_ITERABLE = 1; PROMISE_STATUS_FULFILLED = 0; PROMISE_STATUS_REJECTED = 1; ASYNC_ITERABLE_STATUS_RETURN = 0; ASYNC_ITERABLE_STATUS_YIELD = 1; ASYNC_ITERABLE_STATUS_ERROR = 2; __name(isPromise, "isPromise"); MaxDepthError = /* @__PURE__ */ __name(class extends Error { constructor(path) { super("Max depth reached at path: " + path.join(".")); this.path = path; } }, "MaxDepthError"); __name(createBatchStreamProducer, "createBatchStreamProducer"); __name(_createBatchStreamProducer, "_createBatchStreamProducer"); __name(jsonlStreamProducer, "jsonlStreamProducer"); require_asyncGeneratorDelegate = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js"(exports, module) { var OverloadYield = require_OverloadYield(); function _asyncGeneratorDelegate$1(t9) { var e2 = {}, n2 = false; function pump(e$1, r2) { return n2 = true, r2 = new Promise(function(n$1) { n$1(t9[e$1](r2)); }), { done: false, value: new OverloadYield(r2, 1) }; } __name(pump, "pump"); return e2["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function() { return this; }, e2.next = function(t$1) { return n2 ? (n2 = false, t$1) : pump("next", t$1); }, "function" == typeof t9["throw"] && (e2["throw"] = function(t$1) { if (n2) throw n2 = false, t$1; return pump("throw", t$1); }), "function" == typeof t9["return"] && (e2["return"] = function(t$1) { return n2 ? (n2 = false, t$1) : pump("return", t$1); }), e2; } __name(_asyncGeneratorDelegate$1, "_asyncGeneratorDelegate$1"); module.exports = _asyncGeneratorDelegate$1, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); import_asyncIterator = __toESM2(require_asyncIterator(), 1); import_awaitAsyncGenerator = __toESM2(require_awaitAsyncGenerator(), 1); import_wrapAsyncGenerator$1 = __toESM2(require_wrapAsyncGenerator(), 1); import_asyncGeneratorDelegate = __toESM2(require_asyncGeneratorDelegate(), 1); import_usingCtx = __toESM2(require_usingCtx(), 1); PING_EVENT = "ping"; SERIALIZED_ERROR_EVENT = "serialized-error"; CONNECTED_EVENT = "connected"; RETURN_EVENT = "return"; __name(sseStreamProducer, "sseStreamProducer"); sseHeaders = { "Content-Type": "text/event-stream", "Cache-Control": "no-cache, no-transform", "X-Accel-Buffering": "no", Connection: "keep-alive" }; import_wrapAsyncGenerator = __toESM2(require_wrapAsyncGenerator(), 1); import_objectSpread23 = __toESM2(require_objectSpread2(), 1); __name(errorToAsyncIterable, "errorToAsyncIterable"); __name(combinedAbortController, "combinedAbortController"); TYPE_ACCEPTED_METHOD_MAP = { mutation: ["POST"], query: ["GET"], subscription: ["GET"] }; TYPE_ACCEPTED_METHOD_MAP_WITH_METHOD_OVERRIDE = { mutation: ["POST"], query: ["GET", "POST"], subscription: ["GET", "POST"] }; __name(initResponse, "initResponse"); __name(caughtErrorToData, "caughtErrorToData"); __name(isDataStream, "isDataStream"); __name(resolveResponse, "resolveResponse"); } }); // ../../node_modules/@trpc/server/dist/adapters/fetch/index.mjs async function fetchRequestHandler(opts) { const resHeaders = new Headers(); const createContext = /* @__PURE__ */ __name(async (innerOpts) => { var _opts$createContext; return (_opts$createContext = opts.createContext) === null || _opts$createContext === void 0 ? void 0 : _opts$createContext.call(opts, (0, import_objectSpread24.default)({ req: opts.req, resHeaders }, innerOpts)); }, "createContext"); const url2 = new URL(opts.req.url); const pathname = trimSlashes(url2.pathname); const endpoint = trimSlashes(opts.endpoint); const path = trimSlashes(pathname.slice(endpoint.length)); return await resolveResponse((0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, opts), {}, { req: opts.req, createContext, path, error: null, onError(o2) { var _opts$onError; opts === null || opts === void 0 || (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, (0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, o2), {}, { req: opts.req })); }, responseMeta(data) { var _opts$responseMeta; const meta3 = (_opts$responseMeta = opts.responseMeta) === null || _opts$responseMeta === void 0 ? void 0 : _opts$responseMeta.call(opts, data); if (meta3 === null || meta3 === void 0 ? void 0 : meta3.headers) { if (meta3.headers instanceof Headers) for (const [key, value] of meta3.headers.entries()) resHeaders.append(key, value); else for (const [key, value] of Object.entries(meta3.headers)) if (Array.isArray(value)) for (const v3 of value) resHeaders.append(key, v3); else if (typeof value === "string") resHeaders.set(key, value); } return { headers: resHeaders, status: meta3 === null || meta3 === void 0 ? void 0 : meta3.status }; } })); } var import_objectSpread24, trimSlashes; var init_fetch = __esm({ "../../node_modules/@trpc/server/dist/adapters/fetch/index.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getErrorShape_vC8mUXJD(); init_resolveResponse_CHqBlAgR(); import_objectSpread24 = __toESM2(require_objectSpread2(), 1); trimSlashes = /* @__PURE__ */ __name((path) => { path = path.startsWith("/") ? path.slice(1) : path; path = path.endsWith("/") ? path.slice(0, -1) : path; return path; }, "trimSlashes"); __name(fetchRequestHandler, "fetchRequestHandler"); } }); // ../../node_modules/hono/dist/helper/route/index.js var matchedRoutes, routePath; var init_route = __esm({ "../../node_modules/hono/dist/helper/route/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants(); init_url(); matchedRoutes = /* @__PURE__ */ __name((c2) => ( // @ts-expect-error c.req[GET_MATCH_RESULT] is not typed c2.req[GET_MATCH_RESULT][0].map(([[, route]]) => route) ), "matchedRoutes"); routePath = /* @__PURE__ */ __name((c2, index) => matchedRoutes(c2).at(index ?? c2.req.routeIndex)?.path ?? "", "routePath"); } }); // ../../node_modules/@hono/trpc-server/dist/index.js var trpcServer; var init_dist2 = __esm({ "../../node_modules/@hono/trpc-server/dist/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fetch(); init_route(); trpcServer = /* @__PURE__ */ __name(({ endpoint, createContext, ...rest }) => { const bodyProps = /* @__PURE__ */ new Set([ "arrayBuffer", "blob", "formData", "json", "text" ]); return async (c2) => { const canWithBody = c2.req.method === "GET" || c2.req.method === "HEAD"; let resolvedEndpoint = endpoint; if (!endpoint) { const path = routePath(c2); if (path) resolvedEndpoint = path.replace(/\/\*+$/, "") || "/trpc"; else resolvedEndpoint = "/trpc"; } return await fetchRequestHandler({ ...rest, createContext: async (opts) => ({ ...createContext ? await createContext(opts, c2) : {}, env: c2.env }), endpoint: resolvedEndpoint, req: canWithBody ? c2.req.raw : new Proxy(c2.req.raw, { get(t9, p2, _r) { if (bodyProps.has(p2)) return () => c2.req[p2](); return Reflect.get(t9, p2, t9); } }) }); }; }, "trpcServer"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/entity.js function is(value, type) { if (!value || typeof value !== "object") { return false; } if (value instanceof type) { return true; } if (!Object.prototype.hasOwnProperty.call(type, entityKind)) { throw new Error( `Class "${type.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 cls = Object.getPrototypeOf(value).constructor; if (cls) { while (cls) { if (entityKind in cls && cls[entityKind] === type[entityKind]) { return true; } cls = Object.getPrototypeOf(cls); } } return false; } var entityKind, hasOwnEntityKind; var init_entity = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/entity.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); entityKind = Symbol.for("drizzle:entityKind"); hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind"); __name(is, "is"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/logger.js var _a, ConsoleLogWriter, _a2, DefaultLogger, _a3, NoopLogger; var init_logger2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/logger.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); ConsoleLogWriter = class { write(message2) { console.log(message2); } }; __name(ConsoleLogWriter, "ConsoleLogWriter"); _a = entityKind; __publicField(ConsoleLogWriter, _a, "ConsoleLogWriter"); DefaultLogger = class { writer; constructor(config3) { this.writer = config3?.writer ?? new ConsoleLogWriter(); } logQuery(query, params) { const stringifiedParams = params.map((p2) => { try { return JSON.stringify(p2); } catch { return String(p2); } }); const paramsStr = stringifiedParams.length ? ` -- params: [${stringifiedParams.join(", ")}]` : ""; this.writer.write(`Query: ${query}${paramsStr}`); } }; __name(DefaultLogger, "DefaultLogger"); _a2 = entityKind; __publicField(DefaultLogger, _a2, "DefaultLogger"); NoopLogger = class { logQuery() { } }; __name(NoopLogger, "NoopLogger"); _a3 = entityKind; __publicField(NoopLogger, _a3, "NoopLogger"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/table.utils.js var TableName; var init_table_utils = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/table.utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); TableName = Symbol.for("drizzle:Name"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/table.js function getTableName(table3) { return table3[TableName]; } function getTableUniqueName(table3) { return `${table3[Schema] ?? "public"}.${table3[TableName]}`; } var Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a4, Table; var init_table = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/table.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table_utils(); Schema = Symbol.for("drizzle:Schema"); Columns = Symbol.for("drizzle:Columns"); ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns"); OriginalName = Symbol.for("drizzle:OriginalName"); BaseName = Symbol.for("drizzle:BaseName"); IsAlias = Symbol.for("drizzle:IsAlias"); ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder"); IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable"); Table = class { /** * @internal * Can be changed if the table is aliased. */ [(_a4 = entityKind, TableName)]; /** * @internal * Used to store the original name of the table, before any aliasing. */ [OriginalName]; /** @internal */ [Schema]; /** @internal */ [Columns]; /** @internal */ [ExtraConfigColumns]; /** * @internal * Used to store the table name before the transformation via the `tableCreator` functions. */ [BaseName]; /** @internal */ [IsAlias] = false; /** @internal */ [IsDrizzleTable] = true; /** @internal */ [ExtraConfigBuilder] = void 0; constructor(name, schema, baseName) { this[TableName] = this[OriginalName] = name; this[Schema] = schema; this[BaseName] = baseName; } }; __name(Table, "Table"); __publicField(Table, _a4, "Table"); /** @internal */ __publicField(Table, "Symbol", { Name: TableName, Schema, OriginalName, Columns, ExtraConfigColumns, BaseName, IsAlias, ExtraConfigBuilder }); __name(getTableName, "getTableName"); __name(getTableUniqueName, "getTableUniqueName"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/column.js var _a5, Column; var init_column = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/column.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); Column = class { constructor(table3, config3) { this.table = table3; this.config = config3; this.name = config3.name; this.keyAsName = config3.keyAsName; this.notNull = config3.notNull; this.default = config3.default; this.defaultFn = config3.defaultFn; this.onUpdateFn = config3.onUpdateFn; this.hasDefault = config3.hasDefault; this.primary = config3.primaryKey; this.isUnique = config3.isUnique; this.uniqueName = config3.uniqueName; this.uniqueType = config3.uniqueType; this.dataType = config3.dataType; this.columnType = config3.columnType; this.generated = config3.generated; this.generatedIdentity = config3.generatedIdentity; } name; keyAsName; primary; notNull; default; defaultFn; onUpdateFn; hasDefault; isUnique; uniqueName; uniqueType; dataType; columnType; enumValues = void 0; generated = void 0; generatedIdentity = void 0; config; mapFromDriverValue(value) { return value; } mapToDriverValue(value) { return value; } // ** @internal */ shouldDisableInsert() { return this.config.generated !== void 0 && this.config.generated.type !== "byDefault"; } }; __name(Column, "Column"); _a5 = entityKind; __publicField(Column, _a5, "Column"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/column-builder.js var _a6, ColumnBuilder; var init_column_builder = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/column-builder.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); ColumnBuilder = class { config; constructor(name, dataType, columnType) { this.config = { name, keyAsName: name === "", notNull: false, default: void 0, hasDefault: false, primaryKey: false, isUnique: false, uniqueName: void 0, uniqueType: void 0, dataType, columnType, generated: void 0 }; } /** * Changes the data type of the column. Commonly used with `json` columns. Also, useful for branded types. * * @example * ```ts * const users = pgTable('users', { * id: integer('id').$type().primaryKey(), * details: json('details').$type().notNull(), * }); * ``` */ $type() { return this; } /** * Adds a `not null` clause to the column definition. * * Affects the `select` model of the table - columns *without* `not null` will be nullable on select. */ notNull() { this.config.notNull = true; return this; } /** * Adds a `default ` clause to the column definition. * * Affects the `insert` model of the table - columns *with* `default` are optional on insert. * * If you need to set a dynamic default value, use {@link $defaultFn} instead. */ default(value) { this.config.default = value; this.config.hasDefault = true; return this; } /** * Adds a dynamic default value to the column. * The function will be called when the row is inserted, and the returned value will be used as the column value. * * **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`. */ $defaultFn(fn) { this.config.defaultFn = fn; this.config.hasDefault = true; return this; } /** * Alias for {@link $defaultFn}. */ $default = this.$defaultFn; /** * Adds a dynamic update value to the column. * The function will be called when the row is updated, and the returned value will be used as the column value if none is provided. * If no `default` (or `$defaultFn`) value is provided, the function will be called when the row is inserted as well, and the returned value will be used as the column value. * * **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`. */ $onUpdateFn(fn) { this.config.onUpdateFn = fn; this.config.hasDefault = true; return this; } /** * Alias for {@link $onUpdateFn}. */ $onUpdate = this.$onUpdateFn; /** * Adds a `primary key` clause to the column definition. This implicitly makes the column `not null`. * * In SQLite, `integer primary key` implicitly makes the column auto-incrementing. */ primaryKey() { this.config.primaryKey = true; this.config.notNull = true; return this; } /** @internal Sets the name of the column to the key within the table definition if a name was not given. */ setName(name) { if (this.config.name !== "") return; this.config.name = name; } }; __name(ColumnBuilder, "ColumnBuilder"); _a6 = entityKind; __publicField(ColumnBuilder, _a6, "ColumnBuilder"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/foreign-keys.js var _a7, ForeignKeyBuilder, _a8, ForeignKey; var init_foreign_keys = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/foreign-keys.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table_utils(); ForeignKeyBuilder = class { /** @internal */ reference; /** @internal */ _onUpdate = "no action"; /** @internal */ _onDelete = "no action"; constructor(config3, actions) { this.reference = () => { const { name, columns, foreignColumns } = config3(); return { name, columns, foreignTable: foreignColumns[0].table, foreignColumns }; }; if (actions) { this._onUpdate = actions.onUpdate; this._onDelete = actions.onDelete; } } onUpdate(action) { this._onUpdate = action === void 0 ? "no action" : action; return this; } onDelete(action) { this._onDelete = action === void 0 ? "no action" : action; return this; } /** @internal */ build(table3) { return new ForeignKey(table3, this); } }; __name(ForeignKeyBuilder, "ForeignKeyBuilder"); _a7 = entityKind; __publicField(ForeignKeyBuilder, _a7, "PgForeignKeyBuilder"); ForeignKey = class { constructor(table3, builder) { this.table = table3; this.reference = builder.reference; this.onUpdate = builder._onUpdate; this.onDelete = builder._onDelete; } reference; onUpdate; onDelete; getName() { const { name, columns, foreignColumns } = this.reference(); const columnNames = columns.map((column) => column.name); const foreignColumnNames = foreignColumns.map((column) => column.name); const chunks = [ this.table[TableName], ...columnNames, foreignColumns[0].table[TableName], ...foreignColumnNames ]; return name ?? `${chunks.join("_")}_fk`; } }; __name(ForeignKey, "ForeignKey"); _a8 = entityKind; __publicField(ForeignKey, _a8, "PgForeignKey"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/tracing-utils.js function iife(fn, ...args) { return fn(...args); } var init_tracing_utils = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/tracing-utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(iife, "iife"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/unique-constraint.js function uniqueKeyName(table3, columns) { return `${table3[TableName]}_${columns.join("_")}_unique`; } var _a9, UniqueConstraintBuilder, _a10, UniqueOnConstraintBuilder, _a11, UniqueConstraint; var init_unique_constraint = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/unique-constraint.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table_utils(); __name(uniqueKeyName, "uniqueKeyName"); UniqueConstraintBuilder = class { constructor(columns, name) { this.name = name; this.columns = columns; } /** @internal */ columns; /** @internal */ nullsNotDistinctConfig = false; nullsNotDistinct() { this.nullsNotDistinctConfig = true; return this; } /** @internal */ build(table3) { return new UniqueConstraint(table3, this.columns, this.nullsNotDistinctConfig, this.name); } }; __name(UniqueConstraintBuilder, "UniqueConstraintBuilder"); _a9 = entityKind; __publicField(UniqueConstraintBuilder, _a9, "PgUniqueConstraintBuilder"); UniqueOnConstraintBuilder = class { /** @internal */ name; constructor(name) { this.name = name; } on(...columns) { return new UniqueConstraintBuilder(columns, this.name); } }; __name(UniqueOnConstraintBuilder, "UniqueOnConstraintBuilder"); _a10 = entityKind; __publicField(UniqueOnConstraintBuilder, _a10, "PgUniqueOnConstraintBuilder"); UniqueConstraint = class { constructor(table3, columns, nullsNotDistinct, name) { this.table = table3; this.columns = columns; this.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name)); this.nullsNotDistinct = nullsNotDistinct; } columns; name; nullsNotDistinct = false; getName() { return this.name; } }; __name(UniqueConstraint, "UniqueConstraint"); _a11 = entityKind; __publicField(UniqueConstraint, _a11, "PgUniqueConstraint"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/utils/array.js function parsePgArrayValue(arrayString, startFrom, inQuotes) { for (let i2 = startFrom; i2 < arrayString.length; i2++) { const char = arrayString[i2]; if (char === "\\") { i2++; continue; } if (char === '"') { return [arrayString.slice(startFrom, i2).replace(/\\/g, ""), i2 + 1]; } if (inQuotes) { continue; } if (char === "," || char === "}") { return [arrayString.slice(startFrom, i2).replace(/\\/g, ""), i2]; } } return [arrayString.slice(startFrom).replace(/\\/g, ""), arrayString.length]; } function parsePgNestedArray(arrayString, startFrom = 0) { const result = []; let i2 = startFrom; let lastCharIsComma = false; while (i2 < arrayString.length) { const char = arrayString[i2]; if (char === ",") { if (lastCharIsComma || i2 === startFrom) { result.push(""); } lastCharIsComma = true; i2++; continue; } lastCharIsComma = false; if (char === "\\") { i2 += 2; continue; } if (char === '"') { const [value2, startFrom2] = parsePgArrayValue(arrayString, i2 + 1, true); result.push(value2); i2 = startFrom2; continue; } if (char === "}") { return [result, i2 + 1]; } if (char === "{") { const [value2, startFrom2] = parsePgNestedArray(arrayString, i2 + 1); result.push(value2); i2 = startFrom2; continue; } const [value, newStartFrom] = parsePgArrayValue(arrayString, i2, false); result.push(value); i2 = newStartFrom; } return [result, i2]; } function parsePgArray(arrayString) { const [result] = parsePgNestedArray(arrayString, 1); return result; } function makePgArray(array2) { return `{${array2.map((item) => { if (Array.isArray(item)) { return makePgArray(item); } if (typeof item === "string") { return `"${item.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`; } return `${item}`; }).join(",")}}`; } var init_array = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/utils/array.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(parsePgArrayValue, "parsePgArrayValue"); __name(parsePgNestedArray, "parsePgNestedArray"); __name(parsePgArray, "parsePgArray"); __name(makePgArray, "makePgArray"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/columns/common.js var _a12, PgColumnBuilder, _a13, PgColumn, _a14, ExtraConfigColumn, _a15, IndexedColumn, _a16, PgArrayBuilder, _a17, _PgArray, PgArray; var init_common = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/columns/common.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_column_builder(); init_column(); init_entity(); init_foreign_keys(); init_tracing_utils(); init_unique_constraint(); init_array(); PgColumnBuilder = class extends ColumnBuilder { foreignKeyConfigs = []; array(size) { return new PgArrayBuilder(this.config.name, this, size); } references(ref, actions = {}) { this.foreignKeyConfigs.push({ ref, actions }); return this; } unique(name, config3) { this.config.isUnique = true; this.config.uniqueName = name; this.config.uniqueType = config3?.nulls; return this; } generatedAlwaysAs(as2) { this.config.generated = { as: as2, type: "always", mode: "stored" }; return this; } /** @internal */ buildForeignKeys(column, table3) { return this.foreignKeyConfigs.map(({ ref, actions }) => { return iife( (ref2, actions2) => { const builder = new ForeignKeyBuilder(() => { const foreignColumn = ref2(); return { columns: [column], foreignColumns: [foreignColumn] }; }); if (actions2.onUpdate) { builder.onUpdate(actions2.onUpdate); } if (actions2.onDelete) { builder.onDelete(actions2.onDelete); } return builder.build(table3); }, ref, actions ); }); } /** @internal */ buildExtraConfigColumn(table3) { return new ExtraConfigColumn(table3, this.config); } }; __name(PgColumnBuilder, "PgColumnBuilder"); _a12 = entityKind; __publicField(PgColumnBuilder, _a12, "PgColumnBuilder"); PgColumn = class extends Column { constructor(table3, config3) { if (!config3.uniqueName) { config3.uniqueName = uniqueKeyName(table3, [config3.name]); } super(table3, config3); this.table = table3; } }; __name(PgColumn, "PgColumn"); _a13 = entityKind; __publicField(PgColumn, _a13, "PgColumn"); ExtraConfigColumn = class extends PgColumn { 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() { this.indexConfig.order = "asc"; return this; } desc() { this.indexConfig.order = "desc"; return this; } nullsFirst() { this.indexConfig.nulls = "first"; return this; } nullsLast() { this.indexConfig.nulls = "last"; return this; } /** * ### PostgreSQL documentation quote * * > An operator class with optional parameters can be specified for each column of an index. * The operator class identifies the operators to be used by the index for that column. * For example, a B-tree index on four-byte integers would use the int4_ops class; * this operator class includes comparison functions for four-byte integers. * In practice the default operator class for the column's data type is usually sufficient. * The main point of having operator classes is that for some data types, there could be more than one meaningful ordering. * For example, we might want to sort a complex-number data type either by absolute value or by real part. * We could do this by defining two operator classes for the data type and then selecting the proper class when creating an index. * More information about operator classes check: * * ### Useful links * https://www.postgresql.org/docs/current/sql-createindex.html * * https://www.postgresql.org/docs/current/indexes-opclass.html * * https://www.postgresql.org/docs/current/xindex.html * * ### Additional types * If you have the `pg_vector` extension installed in your database, you can use the * `vector_l2_ops`, `vector_ip_ops`, `vector_cosine_ops`, `vector_l1_ops`, `bit_hamming_ops`, `bit_jaccard_ops`, `halfvec_l2_ops`, `sparsevec_l2_ops` options, which are predefined types. * * **You can always specify any string you want in the operator class, in case Drizzle doesn't have it natively in its types** * * @param opClass * @returns */ op(opClass) { this.indexConfig.opClass = opClass; return this; } }; __name(ExtraConfigColumn, "ExtraConfigColumn"); _a14 = entityKind; __publicField(ExtraConfigColumn, _a14, "ExtraConfigColumn"); IndexedColumn = class { constructor(name, keyAsName, type, indexConfig) { this.name = name; this.keyAsName = keyAsName; this.type = type; this.indexConfig = indexConfig; } name; keyAsName; type; indexConfig; }; __name(IndexedColumn, "IndexedColumn"); _a15 = entityKind; __publicField(IndexedColumn, _a15, "IndexedColumn"); PgArrayBuilder = class extends PgColumnBuilder { constructor(name, baseBuilder, size) { super(name, "array", "PgArray"); this.config.baseBuilder = baseBuilder; this.config.size = size; } /** @internal */ build(table3) { const baseColumn = this.config.baseBuilder.build(table3); return new PgArray( table3, this.config, baseColumn ); } }; __name(PgArrayBuilder, "PgArrayBuilder"); _a16 = entityKind; __publicField(PgArrayBuilder, _a16, "PgArrayBuilder"); _PgArray = class extends PgColumn { constructor(table3, config3, baseColumn, range2) { super(table3, config3); this.baseColumn = baseColumn; this.range = range2; this.size = config3.size; } size; getSQLType() { return `${this.baseColumn.getSQLType()}[${typeof this.size === "number" ? this.size : ""}]`; } mapFromDriverValue(value) { if (typeof value === "string") { value = parsePgArray(value); } return value.map((v3) => this.baseColumn.mapFromDriverValue(v3)); } mapToDriverValue(value, isNestedArray = false) { const a2 = value.map( (v3) => v3 === null ? null : is(this.baseColumn, _PgArray) ? this.baseColumn.mapToDriverValue(v3, true) : this.baseColumn.mapToDriverValue(v3) ); if (isNestedArray) return a2; return makePgArray(a2); } }; PgArray = _PgArray; __name(PgArray, "PgArray"); _a17 = entityKind; __publicField(PgArray, _a17, "PgArray"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/columns/enum.js function isPgEnum(obj) { return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true; } var _a18, PgEnumObjectColumnBuilder, _a19, PgEnumObjectColumn, isPgEnumSym, _a20, PgEnumColumnBuilder, _a21, PgEnumColumn; var init_enum = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/columns/enum.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_common(); PgEnumObjectColumnBuilder = class extends PgColumnBuilder { constructor(name, enumInstance) { super(name, "string", "PgEnumObjectColumn"); this.config.enum = enumInstance; } /** @internal */ build(table3) { return new PgEnumObjectColumn( table3, this.config ); } }; __name(PgEnumObjectColumnBuilder, "PgEnumObjectColumnBuilder"); _a18 = entityKind; __publicField(PgEnumObjectColumnBuilder, _a18, "PgEnumObjectColumnBuilder"); PgEnumObjectColumn = class extends PgColumn { enum; enumValues = this.config.enum.enumValues; constructor(table3, config3) { super(table3, config3); this.enum = config3.enum; } getSQLType() { return this.enum.enumName; } }; __name(PgEnumObjectColumn, "PgEnumObjectColumn"); _a19 = entityKind; __publicField(PgEnumObjectColumn, _a19, "PgEnumObjectColumn"); isPgEnumSym = Symbol.for("drizzle:isPgEnum"); __name(isPgEnum, "isPgEnum"); PgEnumColumnBuilder = class extends PgColumnBuilder { constructor(name, enumInstance) { super(name, "string", "PgEnumColumn"); this.config.enum = enumInstance; } /** @internal */ build(table3) { return new PgEnumColumn( table3, this.config ); } }; __name(PgEnumColumnBuilder, "PgEnumColumnBuilder"); _a20 = entityKind; __publicField(PgEnumColumnBuilder, _a20, "PgEnumColumnBuilder"); PgEnumColumn = class extends PgColumn { enum = this.config.enum; enumValues = this.config.enum.enumValues; constructor(table3, config3) { super(table3, config3); this.enum = config3.enum; } getSQLType() { return this.enum.enumName; } }; __name(PgEnumColumn, "PgEnumColumn"); _a21 = entityKind; __publicField(PgEnumColumn, _a21, "PgEnumColumn"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/subquery.js var _a22, Subquery, _a23, WithSubquery; var init_subquery = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/subquery.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); Subquery = class { constructor(sql2, fields, alias, isWith = false, usedTables = []) { this._ = { brand: "Subquery", sql: sql2, selectedFields: fields, alias, isWith, usedTables }; } // getSQL(): SQL { // return new SQL([this]); // } }; __name(Subquery, "Subquery"); _a22 = entityKind; __publicField(Subquery, _a22, "Subquery"); WithSubquery = class extends Subquery { }; __name(WithSubquery, "WithSubquery"); _a23 = entityKind; __publicField(WithSubquery, _a23, "WithSubquery"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/version.js var version2; var init_version = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/version.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); version2 = "0.44.7"; } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/tracing.js var otel, rawTracer, tracer; var init_tracing = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/tracing.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tracing_utils(); init_version(); tracer = { startActiveSpan(name, fn) { if (!otel) { return fn(); } if (!rawTracer) { rawTracer = otel.trace.getTracer("drizzle-orm", version2); } return iife( (otel2, rawTracer2) => rawTracer2.startActiveSpan( name, (span) => { try { return fn(span); } catch (e2) { span.setStatus({ code: otel2.SpanStatusCode.ERROR, message: e2 instanceof Error ? e2.message : "Unknown error" // eslint-disable-line no-instanceof/no-instanceof }); throw e2; } finally { span.end(); } } ), otel, rawTracer ); } }; } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/view-common.js var ViewBaseConfig; var init_view_common = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/view-common.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/sql.js function isSQLWrapper(value) { return value !== null && value !== void 0 && typeof value.getSQL === "function"; } function mergeQueries(queries) { const result = { sql: "", params: [] }; for (const query of queries) { result.sql += query.sql; result.params.push(...query.params); if (query.typings?.length) { if (!result.typings) { result.typings = []; } result.typings.push(...query.typings); } } return result; } function isDriverValueEncoder(value) { return typeof value === "object" && value !== null && "mapToDriverValue" in value && typeof value.mapToDriverValue === "function"; } function sql(strings, ...params) { const queryChunks = []; if (params.length > 0 || strings.length > 0 && strings[0] !== "") { queryChunks.push(new StringChunk(strings[0])); } for (const [paramIndex, param2] of params.entries()) { queryChunks.push(param2, new StringChunk(strings[paramIndex + 1])); } return new SQL(queryChunks); } function fillPlaceholders(params, values) { return params.map((p2) => { if (is(p2, Placeholder)) { if (!(p2.name in values)) { throw new Error(`No value for placeholder "${p2.name}" was provided`); } return values[p2.name]; } if (is(p2, Param) && is(p2.value, Placeholder)) { if (!(p2.value.name in values)) { throw new Error(`No value for placeholder "${p2.value.name}" was provided`); } return p2.encoder.mapToDriverValue(values[p2.value.name]); } return p2; }); } var _a24, FakePrimitiveParam, _a25, StringChunk, _a26, _SQL, SQL, _a27, Name, noopDecoder, noopEncoder, noopMapper, _a28, Param, _a29, Placeholder, IsDrizzleView, _a30, View; var init_sql = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/sql.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_enum(); init_subquery(); init_tracing(); init_view_common(); init_column(); init_table(); FakePrimitiveParam = class { }; __name(FakePrimitiveParam, "FakePrimitiveParam"); _a24 = entityKind; __publicField(FakePrimitiveParam, _a24, "FakePrimitiveParam"); __name(isSQLWrapper, "isSQLWrapper"); __name(mergeQueries, "mergeQueries"); StringChunk = class { value; constructor(value) { this.value = Array.isArray(value) ? value : [value]; } getSQL() { return new SQL([this]); } }; __name(StringChunk, "StringChunk"); _a25 = entityKind; __publicField(StringChunk, _a25, "StringChunk"); _SQL = class { constructor(queryChunks) { this.queryChunks = queryChunks; for (const chunk of queryChunks) { if (is(chunk, Table)) { const schemaName = chunk[Table.Symbol.Schema]; this.usedTables.push( schemaName === void 0 ? chunk[Table.Symbol.Name] : schemaName + "." + chunk[Table.Symbol.Name] ); } } } /** @internal */ decoder = noopDecoder; shouldInlineParams = false; /** @internal */ usedTables = []; append(query) { this.queryChunks.push(...query.queryChunks); return this; } toQuery(config3) { return tracer.startActiveSpan("drizzle.buildSQL", (span) => { const query = this.buildQueryFromSourceParams(this.queryChunks, config3); span?.setAttributes({ "drizzle.query.text": query.sql, "drizzle.query.params": JSON.stringify(query.params) }); return query; }); } buildQueryFromSourceParams(chunks, _config) { const config3 = Object.assign({}, _config, { inlineParams: _config.inlineParams || this.shouldInlineParams, paramStartIndex: _config.paramStartIndex || { value: 0 } }); const { casing, escapeName, escapeParam, prepareTyping, inlineParams, paramStartIndex } = config3; return mergeQueries(chunks.map((chunk) => { if (is(chunk, StringChunk)) { return { sql: chunk.value.join(""), params: [] }; } if (is(chunk, Name)) { return { sql: escapeName(chunk.value), params: [] }; } if (chunk === void 0) { return { sql: "", params: [] }; } if (Array.isArray(chunk)) { const result = [new StringChunk("(")]; for (const [i2, p2] of chunk.entries()) { result.push(p2); if (i2 < chunk.length - 1) { result.push(new StringChunk(", ")); } } result.push(new StringChunk(")")); return this.buildQueryFromSourceParams(result, config3); } if (is(chunk, _SQL)) { return this.buildQueryFromSourceParams(chunk.queryChunks, { ...config3, inlineParams: inlineParams || chunk.shouldInlineParams }); } if (is(chunk, Table)) { const schemaName = chunk[Table.Symbol.Schema]; const tableName = chunk[Table.Symbol.Name]; return { sql: schemaName === void 0 || chunk[IsAlias] ? escapeName(tableName) : escapeName(schemaName) + "." + escapeName(tableName), params: [] }; } if (is(chunk, Column)) { const columnName = casing.getColumnCasing(chunk); if (_config.invokeSource === "indexes") { return { sql: escapeName(columnName), params: [] }; } const schemaName = chunk.table[Table.Symbol.Schema]; return { sql: chunk.table[IsAlias] || schemaName === void 0 ? escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName) : escapeName(schemaName) + "." + escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName), params: [] }; } if (is(chunk, View)) { const schemaName = chunk[ViewBaseConfig].schema; const viewName = chunk[ViewBaseConfig].name; return { sql: schemaName === void 0 || chunk[ViewBaseConfig].isAlias ? escapeName(viewName) : escapeName(schemaName) + "." + escapeName(viewName), params: [] }; } if (is(chunk, Param)) { if (is(chunk.value, Placeholder)) { return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] }; } const mappedValue = chunk.value === null ? null : chunk.encoder.mapToDriverValue(chunk.value); if (is(mappedValue, _SQL)) { return this.buildQueryFromSourceParams([mappedValue], config3); } if (inlineParams) { return { sql: this.mapInlineParam(mappedValue, config3), params: [] }; } let typings = ["none"]; if (prepareTyping) { typings = [prepareTyping(chunk.encoder)]; } return { sql: escapeParam(paramStartIndex.value++, mappedValue), params: [mappedValue], typings }; } if (is(chunk, Placeholder)) { return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] }; } if (is(chunk, _SQL.Aliased) && chunk.fieldAlias !== void 0) { return { sql: escapeName(chunk.fieldAlias), params: [] }; } if (is(chunk, Subquery)) { if (chunk._.isWith) { return { sql: escapeName(chunk._.alias), params: [] }; } return this.buildQueryFromSourceParams([ new StringChunk("("), chunk._.sql, new StringChunk(") "), new Name(chunk._.alias) ], config3); } if (isPgEnum(chunk)) { if (chunk.schema) { return { sql: escapeName(chunk.schema) + "." + escapeName(chunk.enumName), params: [] }; } return { sql: escapeName(chunk.enumName), params: [] }; } if (isSQLWrapper(chunk)) { if (chunk.shouldOmitSQLParens?.()) { return this.buildQueryFromSourceParams([chunk.getSQL()], config3); } return this.buildQueryFromSourceParams([ new StringChunk("("), chunk.getSQL(), new StringChunk(")") ], config3); } if (inlineParams) { return { sql: this.mapInlineParam(chunk, config3), params: [] }; } return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] }; })); } mapInlineParam(chunk, { escapeString }) { if (chunk === null) { return "null"; } if (typeof chunk === "number" || typeof chunk === "boolean") { return chunk.toString(); } if (typeof chunk === "string") { return escapeString(chunk); } if (typeof chunk === "object") { const mappedValueAsString = chunk.toString(); if (mappedValueAsString === "[object Object]") { return escapeString(JSON.stringify(chunk)); } return escapeString(mappedValueAsString); } throw new Error("Unexpected param value: " + chunk); } getSQL() { return this; } as(alias) { if (alias === void 0) { return this; } return new _SQL.Aliased(this, alias); } mapWith(decoder2) { this.decoder = typeof decoder2 === "function" ? { mapFromDriverValue: decoder2 } : decoder2; return this; } inlineParams() { this.shouldInlineParams = true; return this; } /** * This method is used to conditionally include a part of the query. * * @param condition - Condition to check * @returns itself if the condition is `true`, otherwise `undefined` */ if(condition) { return condition ? this : void 0; } }; SQL = _SQL; __name(SQL, "SQL"); _a26 = entityKind; __publicField(SQL, _a26, "SQL"); Name = class { constructor(value) { this.value = value; } brand; getSQL() { return new SQL([this]); } }; __name(Name, "Name"); _a27 = entityKind; __publicField(Name, _a27, "Name"); __name(isDriverValueEncoder, "isDriverValueEncoder"); noopDecoder = { mapFromDriverValue: (value) => value }; noopEncoder = { mapToDriverValue: (value) => value }; noopMapper = { ...noopDecoder, ...noopEncoder }; Param = class { /** * @param value - Parameter value * @param encoder - Encoder to convert the value to a driver parameter */ constructor(value, encoder2 = noopEncoder) { this.value = value; this.encoder = encoder2; } brand; getSQL() { return new SQL([this]); } }; __name(Param, "Param"); _a28 = entityKind; __publicField(Param, _a28, "Param"); __name(sql, "sql"); ((sql2) => { function empty() { return new SQL([]); } __name(empty, "empty"); sql2.empty = empty; function fromList(list) { return new SQL(list); } __name(fromList, "fromList"); sql2.fromList = fromList; function raw2(str) { return new SQL([new StringChunk(str)]); } __name(raw2, "raw"); sql2.raw = raw2; function join(chunks, separator) { const result = []; for (const [i2, chunk] of chunks.entries()) { if (i2 > 0 && separator !== void 0) { result.push(separator); } result.push(chunk); } return new SQL(result); } __name(join, "join"); sql2.join = join; function identifier(value) { return new Name(value); } __name(identifier, "identifier"); sql2.identifier = identifier; function placeholder2(name2) { return new Placeholder(name2); } __name(placeholder2, "placeholder2"); sql2.placeholder = placeholder2; function param2(value, encoder2) { return new Param(value, encoder2); } __name(param2, "param2"); sql2.param = param2; })(sql || (sql = {})); ((SQL22) => { class Aliased { constructor(sql2, fieldAlias) { this.sql = sql2; this.fieldAlias = fieldAlias; } static [entityKind] = "SQL.Aliased"; /** @internal */ isSelectionField = false; getSQL() { return this.sql; } /** @internal */ clone() { return new Aliased(this.sql, this.fieldAlias); } } __name(Aliased, "Aliased"); SQL22.Aliased = Aliased; })(SQL || (SQL = {})); Placeholder = class { constructor(name2) { this.name = name2; } getSQL() { return new SQL([this]); } }; __name(Placeholder, "Placeholder"); _a29 = entityKind; __publicField(Placeholder, _a29, "Placeholder"); __name(fillPlaceholders, "fillPlaceholders"); IsDrizzleView = Symbol.for("drizzle:IsDrizzleView"); View = class { /** @internal */ [(_a30 = entityKind, ViewBaseConfig)]; /** @internal */ [IsDrizzleView] = true; constructor({ name: name2, schema, selectedFields, query }) { this[ViewBaseConfig] = { name: name2, originalName: name2, schema, selectedFields, query, isExisting: !query, isAlias: false }; } getSQL() { return new SQL([this]); } }; __name(View, "View"); __publicField(View, _a30, "View"); Column.prototype.getSQL = function() { return new SQL([this]); }; Table.prototype.getSQL = function() { return new SQL([this]); }; Subquery.prototype.getSQL = function() { return new SQL([this]); }; } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/utils.js function mapResultRow(columns, row, joinsNotNullableMap) { const nullifyMap = {}; const result = columns.reduce( (result2, { path, field }, columnIndex) => { let decoder2; if (is(field, Column)) { decoder2 = field; } else if (is(field, SQL)) { decoder2 = field.decoder; } else { decoder2 = field.sql.decoder; } let node = result2; for (const [pathChunkIndex, pathChunk] of path.entries()) { if (pathChunkIndex < path.length - 1) { if (!(pathChunk in node)) { node[pathChunk] = {}; } node = node[pathChunk]; } else { const rawValue = row[columnIndex]; const value = node[pathChunk] = rawValue === null ? null : decoder2.mapFromDriverValue(rawValue); if (joinsNotNullableMap && is(field, Column) && path.length === 2) { const objectName = path[0]; if (!(objectName in nullifyMap)) { nullifyMap[objectName] = value === null ? getTableName(field.table) : false; } else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table)) { nullifyMap[objectName] = false; } } } } return result2; }, {} ); if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) { for (const [objectName, tableName] of Object.entries(nullifyMap)) { if (typeof tableName === "string" && !joinsNotNullableMap[tableName]) { result[objectName] = null; } } } return result; } function orderSelectedFields(fields, pathPrefix) { return Object.entries(fields).reduce((result, [name, field]) => { if (typeof name !== "string") { return result; } const newPath = pathPrefix ? [...pathPrefix, name] : [name]; if (is(field, Column) || is(field, SQL) || is(field, SQL.Aliased)) { result.push({ path: newPath, field }); } else if (is(field, Table)) { result.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath)); } else { result.push(...orderSelectedFields(field, newPath)); } return result; }, []); } function haveSameKeys(left, right) { const leftKeys = Object.keys(left); const rightKeys = Object.keys(right); if (leftKeys.length !== rightKeys.length) { return false; } for (const [index, key] of leftKeys.entries()) { if (key !== rightKeys[index]) { return false; } } return true; } function mapUpdateSet(table3, values) { const entries = Object.entries(values).filter(([, value]) => value !== void 0).map(([key, value]) => { if (is(value, SQL) || is(value, Column)) { return [key, value]; } else { return [key, new Param(value, table3[Table.Symbol.Columns][key])]; } }); if (entries.length === 0) { throw new Error("No values to set"); } return Object.fromEntries(entries); } function applyMixins(baseClass, extendedClasses) { for (const extendedClass of extendedClasses) { for (const name of Object.getOwnPropertyNames(extendedClass.prototype)) { if (name === "constructor") continue; Object.defineProperty( baseClass.prototype, name, Object.getOwnPropertyDescriptor(extendedClass.prototype, name) || /* @__PURE__ */ Object.create(null) ); } } } function getTableColumns(table3) { return table3[Table.Symbol.Columns]; } function getTableLikeName(table3) { return is(table3, Subquery) ? table3._.alias : is(table3, View) ? table3[ViewBaseConfig].name : is(table3, SQL) ? void 0 : table3[Table.Symbol.IsAlias] ? table3[Table.Symbol.Name] : table3[Table.Symbol.BaseName]; } function getColumnNameAndConfig(a2, b2) { return { name: typeof a2 === "string" && a2.length > 0 ? a2 : "", config: typeof a2 === "object" ? a2 : b2 }; } var textDecoder; var init_utils2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_column(); init_entity(); init_sql(); init_subquery(); init_table(); init_view_common(); __name(mapResultRow, "mapResultRow"); __name(orderSelectedFields, "orderSelectedFields"); __name(haveSameKeys, "haveSameKeys"); __name(mapUpdateSet, "mapUpdateSet"); __name(applyMixins, "applyMixins"); __name(getTableColumns, "getTableColumns"); __name(getTableLikeName, "getTableLikeName"); __name(getColumnNameAndConfig, "getColumnNameAndConfig"); textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/table.js var InlineForeignKeys, EnableRLS, _a31, PgTable; var init_table2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/table.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table(); InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys"); EnableRLS = Symbol.for("drizzle:EnableRLS"); PgTable = class extends Table { /**@internal */ [(_a31 = entityKind, InlineForeignKeys)] = []; /** @internal */ [EnableRLS] = false; /** @internal */ [Table.Symbol.ExtraConfigBuilder] = void 0; /** @internal */ [Table.Symbol.ExtraConfigColumns] = {}; }; __name(PgTable, "PgTable"); __publicField(PgTable, _a31, "PgTable"); /** @internal */ __publicField(PgTable, "Symbol", Object.assign({}, Table.Symbol, { InlineForeignKeys, EnableRLS })); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/primary-keys.js var _a32, PrimaryKeyBuilder, _a33, PrimaryKey; var init_primary_keys = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/pg-core/primary-keys.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table2(); PrimaryKeyBuilder = class { /** @internal */ columns; /** @internal */ name; constructor(columns, name) { this.columns = columns; this.name = name; } /** @internal */ build(table3) { return new PrimaryKey(table3, this.columns, this.name); } }; __name(PrimaryKeyBuilder, "PrimaryKeyBuilder"); _a32 = entityKind; __publicField(PrimaryKeyBuilder, _a32, "PgPrimaryKeyBuilder"); PrimaryKey = class { constructor(table3, columns, name) { this.table = table3; this.columns = columns; this.name = name; } columns; name; getName() { return this.name ?? `${this.table[PgTable.Symbol.Name]}_${this.columns.map((column) => column.name).join("_")}_pk`; } }; __name(PrimaryKey, "PrimaryKey"); _a33 = entityKind; __publicField(PrimaryKey, _a33, "PgPrimaryKey"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/expressions/conditions.js function bindIfParam(value, column) { if (isDriverValueEncoder(column) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column) && !is(value, Table) && !is(value, View)) { return new Param(value, column); } return value; } function and(...unfilteredConditions) { const conditions = unfilteredConditions.filter( (c2) => c2 !== void 0 ); if (conditions.length === 0) { return void 0; } if (conditions.length === 1) { return new SQL(conditions); } return new SQL([ new StringChunk("("), sql.join(conditions, new StringChunk(" and ")), new StringChunk(")") ]); } function or(...unfilteredConditions) { const conditions = unfilteredConditions.filter( (c2) => c2 !== void 0 ); if (conditions.length === 0) { return void 0; } if (conditions.length === 1) { return new SQL(conditions); } return new SQL([ new StringChunk("("), sql.join(conditions, new StringChunk(" or ")), new StringChunk(")") ]); } function not(condition) { return sql`not ${condition}`; } function inArray(column, values) { if (Array.isArray(values)) { if (values.length === 0) { return sql`false`; } return sql`${column} in ${values.map((v3) => bindIfParam(v3, column))}`; } return sql`${column} in ${bindIfParam(values, column)}`; } function notInArray(column, values) { if (Array.isArray(values)) { if (values.length === 0) { return sql`true`; } return sql`${column} not in ${values.map((v3) => bindIfParam(v3, column))}`; } return sql`${column} not in ${bindIfParam(values, column)}`; } function isNull(value) { return sql`${value} is null`; } function isNotNull(value) { return sql`${value} is not null`; } function exists(subquery) { return sql`exists ${subquery}`; } function notExists(subquery) { return sql`not exists ${subquery}`; } function between(column, min, max2) { return sql`${column} between ${bindIfParam(min, column)} and ${bindIfParam( max2, column )}`; } function notBetween(column, min, max2) { return sql`${column} not between ${bindIfParam( min, column )} and ${bindIfParam(max2, column)}`; } function like(column, value) { return sql`${column} like ${value}`; } function notLike(column, value) { return sql`${column} not like ${value}`; } function ilike(column, value) { return sql`${column} ilike ${value}`; } function notIlike(column, value) { return sql`${column} not ilike ${value}`; } var eq, ne, gt, gte, lt, lte; var init_conditions = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/expressions/conditions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_column(); init_entity(); init_table(); init_sql(); __name(bindIfParam, "bindIfParam"); eq = /* @__PURE__ */ __name((left, right) => { return sql`${left} = ${bindIfParam(right, left)}`; }, "eq"); ne = /* @__PURE__ */ __name((left, right) => { return sql`${left} <> ${bindIfParam(right, left)}`; }, "ne"); __name(and, "and"); __name(or, "or"); __name(not, "not"); gt = /* @__PURE__ */ __name((left, right) => { return sql`${left} > ${bindIfParam(right, left)}`; }, "gt"); gte = /* @__PURE__ */ __name((left, right) => { return sql`${left} >= ${bindIfParam(right, left)}`; }, "gte"); lt = /* @__PURE__ */ __name((left, right) => { return sql`${left} < ${bindIfParam(right, left)}`; }, "lt"); lte = /* @__PURE__ */ __name((left, right) => { return sql`${left} <= ${bindIfParam(right, left)}`; }, "lte"); __name(inArray, "inArray"); __name(notInArray, "notInArray"); __name(isNull, "isNull"); __name(isNotNull, "isNotNull"); __name(exists, "exists"); __name(notExists, "notExists"); __name(between, "between"); __name(notBetween, "notBetween"); __name(like, "like"); __name(notLike, "notLike"); __name(ilike, "ilike"); __name(notIlike, "notIlike"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/expressions/select.js function asc(column) { return sql`${column} asc`; } function desc(column) { return sql`${column} desc`; } var init_select = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/expressions/select.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_sql(); __name(asc, "asc"); __name(desc, "desc"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/expressions/index.js var init_expressions = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/expressions/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_conditions(); init_select(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/relations.js function getOperators() { return { and, between, eq, exists, gt, gte, ilike, inArray, isNull, isNotNull, like, lt, lte, ne, not, notBetween, notExists, notLike, notIlike, notInArray, or, sql }; } function getOrderByOperators() { return { sql, asc, desc }; } function extractTablesRelationalConfig(schema, configHelpers) { if (Object.keys(schema).length === 1 && "default" in schema && !is(schema["default"], Table)) { schema = schema["default"]; } const tableNamesMap = {}; const relationsBuffer = {}; const tablesConfig = {}; for (const [key, value] of Object.entries(schema)) { if (is(value, Table)) { const dbName = getTableUniqueName(value); const bufferedRelations = relationsBuffer[dbName]; tableNamesMap[dbName] = key; tablesConfig[key] = { tsName: key, dbName: value[Table.Symbol.Name], schema: value[Table.Symbol.Schema], columns: value[Table.Symbol.Columns], relations: bufferedRelations?.relations ?? {}, primaryKey: bufferedRelations?.primaryKey ?? [] }; for (const column of Object.values( value[Table.Symbol.Columns] )) { if (column.primary) { tablesConfig[key].primaryKey.push(column); } } const extraConfig = value[Table.Symbol.ExtraConfigBuilder]?.(value[Table.Symbol.ExtraConfigColumns]); if (extraConfig) { for (const configEntry of Object.values(extraConfig)) { if (is(configEntry, PrimaryKeyBuilder)) { tablesConfig[key].primaryKey.push(...configEntry.columns); } } } } else if (is(value, Relations)) { const dbName = getTableUniqueName(value.table); const tableName = tableNamesMap[dbName]; const relations2 = value.config( configHelpers(value.table) ); let primaryKey2; for (const [relationName, relation] of Object.entries(relations2)) { if (tableName) { const tableConfig = tablesConfig[tableName]; tableConfig.relations[relationName] = relation; if (primaryKey2) { tableConfig.primaryKey.push(...primaryKey2); } } else { if (!(dbName in relationsBuffer)) { relationsBuffer[dbName] = { relations: {}, primaryKey: primaryKey2 }; } relationsBuffer[dbName].relations[relationName] = relation; } } } } return { tables: tablesConfig, tableNamesMap }; } function relations(table3, relations2) { return new Relations( table3, (helpers) => Object.fromEntries( Object.entries(relations2(helpers)).map(([key, value]) => [ key, value.withFieldName(key) ]) ) ); } function createOne(sourceTable) { return /* @__PURE__ */ __name(function one(table3, config3) { return new One( sourceTable, table3, config3, config3?.fields.reduce((res, f2) => res && f2.notNull, true) ?? false ); }, "one"); } function createMany(sourceTable) { return /* @__PURE__ */ __name(function many(referencedTable, config3) { return new Many(sourceTable, referencedTable, config3); }, "many"); } function normalizeRelation(schema, tableNamesMap, relation) { if (is(relation, One) && relation.config) { return { fields: relation.config.fields, references: relation.config.references }; } const referencedTableTsName = tableNamesMap[getTableUniqueName(relation.referencedTable)]; if (!referencedTableTsName) { throw new Error( `Table "${relation.referencedTable[Table.Symbol.Name]}" not found in schema` ); } const referencedTableConfig = schema[referencedTableTsName]; if (!referencedTableConfig) { throw new Error(`Table "${referencedTableTsName}" not found in schema`); } const sourceTable = relation.sourceTable; const sourceTableTsName = tableNamesMap[getTableUniqueName(sourceTable)]; if (!sourceTableTsName) { throw new Error( `Table "${sourceTable[Table.Symbol.Name]}" not found in schema` ); } const reverseRelations = []; for (const referencedTableRelation of Object.values( referencedTableConfig.relations )) { if (relation.relationName && relation !== referencedTableRelation && referencedTableRelation.relationName === relation.relationName || !relation.relationName && referencedTableRelation.referencedTable === relation.sourceTable) { reverseRelations.push(referencedTableRelation); } } if (reverseRelations.length > 1) { throw relation.relationName ? new Error( `There are multiple relations with name "${relation.relationName}" in table "${referencedTableTsName}"` ) : new Error( `There are multiple relations between "${referencedTableTsName}" and "${relation.sourceTable[Table.Symbol.Name]}". Please specify relation name` ); } if (reverseRelations[0] && is(reverseRelations[0], One) && reverseRelations[0].config) { return { fields: reverseRelations[0].config.references, references: reverseRelations[0].config.fields }; } throw new Error( `There is not enough information to infer relation "${sourceTableTsName}.${relation.fieldName}"` ); } function createTableRelationsHelpers(sourceTable) { return { one: createOne(sourceTable), many: createMany(sourceTable) }; } function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelection, mapColumnValue = (value) => value) { const result = {}; for (const [ selectionItemIndex, selectionItem ] of buildQueryResultSelection.entries()) { if (selectionItem.isJson) { const relation = tableConfig.relations[selectionItem.tsKey]; const rawSubRows = row[selectionItemIndex]; const subRows = typeof rawSubRows === "string" ? JSON.parse(rawSubRows) : rawSubRows; result[selectionItem.tsKey] = is(relation, One) ? subRows && mapRelationalRow( tablesConfig, tablesConfig[selectionItem.relationTableTsKey], subRows, selectionItem.selection, mapColumnValue ) : subRows.map( (subRow) => mapRelationalRow( tablesConfig, tablesConfig[selectionItem.relationTableTsKey], subRow, selectionItem.selection, mapColumnValue ) ); } else { const value = mapColumnValue(row[selectionItemIndex]); const field = selectionItem.field; let decoder2; if (is(field, Column)) { decoder2 = field; } else if (is(field, SQL)) { decoder2 = field.decoder; } else { decoder2 = field.sql.decoder; } result[selectionItem.tsKey] = value === null ? null : decoder2.mapFromDriverValue(value); } } return result; } var _a34, Relation, _a35, Relations, _a36, _One, One, _a37, _Many, Many; var init_relations = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/relations.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_table(); init_column(); init_entity(); init_primary_keys(); init_expressions(); init_sql(); Relation = class { constructor(sourceTable, referencedTable, relationName) { this.sourceTable = sourceTable; this.referencedTable = referencedTable; this.relationName = relationName; this.referencedTableName = referencedTable[Table.Symbol.Name]; } referencedTableName; fieldName; }; __name(Relation, "Relation"); _a34 = entityKind; __publicField(Relation, _a34, "Relation"); Relations = class { constructor(table3, config3) { this.table = table3; this.config = config3; } }; __name(Relations, "Relations"); _a35 = entityKind; __publicField(Relations, _a35, "Relations"); _One = class extends Relation { constructor(sourceTable, referencedTable, config3, isNullable) { super(sourceTable, referencedTable, config3?.relationName); this.config = config3; this.isNullable = isNullable; } withFieldName(fieldName) { const relation = new _One( this.sourceTable, this.referencedTable, this.config, this.isNullable ); relation.fieldName = fieldName; return relation; } }; One = _One; __name(One, "One"); _a36 = entityKind; __publicField(One, _a36, "One"); _Many = class extends Relation { constructor(sourceTable, referencedTable, config3) { super(sourceTable, referencedTable, config3?.relationName); this.config = config3; } withFieldName(fieldName) { const relation = new _Many( this.sourceTable, this.referencedTable, this.config ); relation.fieldName = fieldName; return relation; } }; Many = _Many; __name(Many, "Many"); _a37 = entityKind; __publicField(Many, _a37, "Many"); __name(getOperators, "getOperators"); __name(getOrderByOperators, "getOrderByOperators"); __name(extractTablesRelationalConfig, "extractTablesRelationalConfig"); __name(relations, "relations"); __name(createOne, "createOne"); __name(createMany, "createMany"); __name(normalizeRelation, "normalizeRelation"); __name(createTableRelationsHelpers, "createTableRelationsHelpers"); __name(mapRelationalRow, "mapRelationalRow"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/alias.js function aliasedTable(table3, tableAlias) { return new Proxy(table3, new TableAliasProxyHandler(tableAlias, false)); } function aliasedTableColumn(column, tableAlias) { return new Proxy( column, new ColumnAliasProxyHandler(new Proxy(column.table, new TableAliasProxyHandler(tableAlias, false))) ); } function mapColumnsInAliasedSQLToAlias(query, alias) { return new SQL.Aliased(mapColumnsInSQLToAlias(query.sql, alias), query.fieldAlias); } function mapColumnsInSQLToAlias(query, alias) { return sql.join(query.queryChunks.map((c2) => { if (is(c2, Column)) { return aliasedTableColumn(c2, alias); } if (is(c2, SQL)) { return mapColumnsInSQLToAlias(c2, alias); } if (is(c2, SQL.Aliased)) { return mapColumnsInAliasedSQLToAlias(c2, alias); } return c2; })); } var _a38, ColumnAliasProxyHandler, _a39, TableAliasProxyHandler, _a40, RelationTableAliasProxyHandler; var init_alias = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/alias.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_column(); init_entity(); init_sql(); init_table(); init_view_common(); ColumnAliasProxyHandler = class { constructor(table3) { this.table = table3; } get(columnObj, prop) { if (prop === "table") { return this.table; } return columnObj[prop]; } }; __name(ColumnAliasProxyHandler, "ColumnAliasProxyHandler"); _a38 = entityKind; __publicField(ColumnAliasProxyHandler, _a38, "ColumnAliasProxyHandler"); TableAliasProxyHandler = class { constructor(alias, replaceOriginalName) { this.alias = alias; this.replaceOriginalName = replaceOriginalName; } get(target, prop) { if (prop === Table.Symbol.IsAlias) { return true; } if (prop === Table.Symbol.Name) { return this.alias; } if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) { return this.alias; } if (prop === ViewBaseConfig) { return { ...target[ViewBaseConfig], name: this.alias, isAlias: true }; } if (prop === Table.Symbol.Columns) { const columns = target[Table.Symbol.Columns]; if (!columns) { return columns; } const proxiedColumns = {}; Object.keys(columns).map((key) => { proxiedColumns[key] = new Proxy( columns[key], new ColumnAliasProxyHandler(new Proxy(target, this)) ); }); return proxiedColumns; } const value = target[prop]; if (is(value, Column)) { return new Proxy(value, new ColumnAliasProxyHandler(new Proxy(target, this))); } return value; } }; __name(TableAliasProxyHandler, "TableAliasProxyHandler"); _a39 = entityKind; __publicField(TableAliasProxyHandler, _a39, "TableAliasProxyHandler"); RelationTableAliasProxyHandler = class { constructor(alias) { this.alias = alias; } get(target, prop) { if (prop === "sourceTable") { return aliasedTable(target.sourceTable, this.alias); } return target[prop]; } }; __name(RelationTableAliasProxyHandler, "RelationTableAliasProxyHandler"); _a40 = entityKind; __publicField(RelationTableAliasProxyHandler, _a40, "RelationTableAliasProxyHandler"); __name(aliasedTable, "aliasedTable"); __name(aliasedTableColumn, "aliasedTableColumn"); __name(mapColumnsInAliasedSQLToAlias, "mapColumnsInAliasedSQLToAlias"); __name(mapColumnsInSQLToAlias, "mapColumnsInSQLToAlias"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/selection-proxy.js var _a41, _SelectionProxyHandler, SelectionProxyHandler; var init_selection_proxy = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/selection-proxy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_alias(); init_column(); init_entity(); init_sql(); init_subquery(); init_view_common(); _SelectionProxyHandler = class { config; constructor(config3) { this.config = { ...config3 }; } get(subquery, prop) { if (prop === "_") { return { ...subquery["_"], selectedFields: new Proxy( subquery._.selectedFields, this ) }; } if (prop === ViewBaseConfig) { return { ...subquery[ViewBaseConfig], selectedFields: new Proxy( subquery[ViewBaseConfig].selectedFields, this ) }; } if (typeof prop === "symbol") { return subquery[prop]; } const columns = is(subquery, Subquery) ? subquery._.selectedFields : is(subquery, View) ? subquery[ViewBaseConfig].selectedFields : subquery; const value = columns[prop]; if (is(value, SQL.Aliased)) { if (this.config.sqlAliasedBehavior === "sql" && !value.isSelectionField) { return value.sql; } const newValue = value.clone(); newValue.isSelectionField = true; return newValue; } if (is(value, SQL)) { if (this.config.sqlBehavior === "sql") { return value; } throw new Error( `You tried to reference "${prop}" 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.` ); } if (is(value, Column)) { if (this.config.alias) { return new Proxy( value, new ColumnAliasProxyHandler( new Proxy( value.table, new TableAliasProxyHandler(this.config.alias, this.config.replaceOriginalName ?? false) ) ) ); } return value; } if (typeof value !== "object" || value === null) { return value; } return new Proxy(value, new _SelectionProxyHandler(this.config)); } }; SelectionProxyHandler = _SelectionProxyHandler; __name(SelectionProxyHandler, "SelectionProxyHandler"); _a41 = entityKind; __publicField(SelectionProxyHandler, _a41, "SelectionProxyHandler"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/query-promise.js var _a42, QueryPromise; var init_query_promise = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/query-promise.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); QueryPromise = class { [(_a42 = entityKind, Symbol.toStringTag)] = "QueryPromise"; catch(onRejected) { return this.then(void 0, onRejected); } finally(onFinally) { return this.then( (value) => { onFinally?.(); return value; }, (reason) => { onFinally?.(); throw reason; } ); } then(onFulfilled, onRejected) { return this.execute().then(onFulfilled, onRejected); } }; __name(QueryPromise, "QueryPromise"); __publicField(QueryPromise, _a42, "QueryPromise"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/foreign-keys.js var _a43, ForeignKeyBuilder2, _a44, ForeignKey2; var init_foreign_keys2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/foreign-keys.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table_utils(); ForeignKeyBuilder2 = class { /** @internal */ reference; /** @internal */ _onUpdate; /** @internal */ _onDelete; constructor(config3, actions) { this.reference = () => { const { name, columns, foreignColumns } = config3(); return { name, columns, foreignTable: foreignColumns[0].table, foreignColumns }; }; if (actions) { this._onUpdate = actions.onUpdate; this._onDelete = actions.onDelete; } } onUpdate(action) { this._onUpdate = action; return this; } onDelete(action) { this._onDelete = action; return this; } /** @internal */ build(table3) { return new ForeignKey2(table3, this); } }; __name(ForeignKeyBuilder2, "ForeignKeyBuilder"); _a43 = entityKind; __publicField(ForeignKeyBuilder2, _a43, "SQLiteForeignKeyBuilder"); ForeignKey2 = class { constructor(table3, builder) { this.table = table3; this.reference = builder.reference; this.onUpdate = builder._onUpdate; this.onDelete = builder._onDelete; } reference; onUpdate; onDelete; getName() { const { name, columns, foreignColumns } = this.reference(); const columnNames = columns.map((column) => column.name); const foreignColumnNames = foreignColumns.map((column) => column.name); const chunks = [ this.table[TableName], ...columnNames, foreignColumns[0].table[TableName], ...foreignColumnNames ]; return name ?? `${chunks.join("_")}_fk`; } }; __name(ForeignKey2, "ForeignKey"); _a44 = entityKind; __publicField(ForeignKey2, _a44, "SQLiteForeignKey"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/unique-constraint.js function uniqueKeyName2(table3, columns) { return `${table3[TableName]}_${columns.join("_")}_unique`; } var _a45, UniqueConstraintBuilder2, _a46, UniqueOnConstraintBuilder2, _a47, UniqueConstraint2; var init_unique_constraint2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/unique-constraint.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table_utils(); __name(uniqueKeyName2, "uniqueKeyName"); UniqueConstraintBuilder2 = class { constructor(columns, name) { this.name = name; this.columns = columns; } /** @internal */ columns; /** @internal */ build(table3) { return new UniqueConstraint2(table3, this.columns, this.name); } }; __name(UniqueConstraintBuilder2, "UniqueConstraintBuilder"); _a45 = entityKind; __publicField(UniqueConstraintBuilder2, _a45, "SQLiteUniqueConstraintBuilder"); UniqueOnConstraintBuilder2 = class { /** @internal */ name; constructor(name) { this.name = name; } on(...columns) { return new UniqueConstraintBuilder2(columns, this.name); } }; __name(UniqueOnConstraintBuilder2, "UniqueOnConstraintBuilder"); _a46 = entityKind; __publicField(UniqueOnConstraintBuilder2, _a46, "SQLiteUniqueOnConstraintBuilder"); UniqueConstraint2 = class { constructor(table3, columns, name) { this.table = table3; this.columns = columns; this.name = name ?? uniqueKeyName2(this.table, this.columns.map((column) => column.name)); } columns; name; getName() { return this.name; } }; __name(UniqueConstraint2, "UniqueConstraint"); _a47 = entityKind; __publicField(UniqueConstraint2, _a47, "SQLiteUniqueConstraint"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/common.js var _a48, SQLiteColumnBuilder, _a49, SQLiteColumn; var init_common2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/common.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_column_builder(); init_column(); init_entity(); init_foreign_keys2(); init_unique_constraint2(); SQLiteColumnBuilder = class extends ColumnBuilder { foreignKeyConfigs = []; references(ref, actions = {}) { this.foreignKeyConfigs.push({ ref, actions }); return this; } unique(name) { this.config.isUnique = true; this.config.uniqueName = name; return this; } generatedAlwaysAs(as2, config3) { this.config.generated = { as: as2, type: "always", mode: config3?.mode ?? "virtual" }; return this; } /** @internal */ buildForeignKeys(column, table3) { return this.foreignKeyConfigs.map(({ ref, actions }) => { return ((ref2, actions2) => { const builder = new ForeignKeyBuilder2(() => { const foreignColumn = ref2(); return { columns: [column], foreignColumns: [foreignColumn] }; }); if (actions2.onUpdate) { builder.onUpdate(actions2.onUpdate); } if (actions2.onDelete) { builder.onDelete(actions2.onDelete); } return builder.build(table3); })(ref, actions); }); } }; __name(SQLiteColumnBuilder, "SQLiteColumnBuilder"); _a48 = entityKind; __publicField(SQLiteColumnBuilder, _a48, "SQLiteColumnBuilder"); SQLiteColumn = class extends Column { constructor(table3, config3) { if (!config3.uniqueName) { config3.uniqueName = uniqueKeyName2(table3, [config3.name]); } super(table3, config3); this.table = table3; } }; __name(SQLiteColumn, "SQLiteColumn"); _a49 = entityKind; __publicField(SQLiteColumn, _a49, "SQLiteColumn"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/blob.js function blob(a2, b2) { const { name, config: config3 } = getColumnNameAndConfig(a2, b2); if (config3?.mode === "json") { return new SQLiteBlobJsonBuilder(name); } if (config3?.mode === "bigint") { return new SQLiteBigIntBuilder(name); } return new SQLiteBlobBufferBuilder(name); } var _a50, SQLiteBigIntBuilder, _a51, SQLiteBigInt, _a52, SQLiteBlobJsonBuilder, _a53, SQLiteBlobJson, _a54, SQLiteBlobBufferBuilder, _a55, SQLiteBlobBuffer; var init_blob = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/blob.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_utils2(); init_common2(); SQLiteBigIntBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "bigint", "SQLiteBigInt"); } /** @internal */ build(table3) { return new SQLiteBigInt(table3, this.config); } }; __name(SQLiteBigIntBuilder, "SQLiteBigIntBuilder"); _a50 = entityKind; __publicField(SQLiteBigIntBuilder, _a50, "SQLiteBigIntBuilder"); SQLiteBigInt = class extends SQLiteColumn { getSQLType() { return "blob"; } mapFromDriverValue(value) { if (typeof Buffer !== "undefined" && Buffer.from) { const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value); return BigInt(buf.toString("utf8")); } return BigInt(textDecoder.decode(value)); } mapToDriverValue(value) { return Buffer.from(value.toString()); } }; __name(SQLiteBigInt, "SQLiteBigInt"); _a51 = entityKind; __publicField(SQLiteBigInt, _a51, "SQLiteBigInt"); SQLiteBlobJsonBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "json", "SQLiteBlobJson"); } /** @internal */ build(table3) { return new SQLiteBlobJson( table3, this.config ); } }; __name(SQLiteBlobJsonBuilder, "SQLiteBlobJsonBuilder"); _a52 = entityKind; __publicField(SQLiteBlobJsonBuilder, _a52, "SQLiteBlobJsonBuilder"); SQLiteBlobJson = class extends SQLiteColumn { getSQLType() { return "blob"; } mapFromDriverValue(value) { if (typeof Buffer !== "undefined" && Buffer.from) { const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value); return JSON.parse(buf.toString("utf8")); } return JSON.parse(textDecoder.decode(value)); } mapToDriverValue(value) { return Buffer.from(JSON.stringify(value)); } }; __name(SQLiteBlobJson, "SQLiteBlobJson"); _a53 = entityKind; __publicField(SQLiteBlobJson, _a53, "SQLiteBlobJson"); SQLiteBlobBufferBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "buffer", "SQLiteBlobBuffer"); } /** @internal */ build(table3) { return new SQLiteBlobBuffer(table3, this.config); } }; __name(SQLiteBlobBufferBuilder, "SQLiteBlobBufferBuilder"); _a54 = entityKind; __publicField(SQLiteBlobBufferBuilder, _a54, "SQLiteBlobBufferBuilder"); SQLiteBlobBuffer = class extends SQLiteColumn { mapFromDriverValue(value) { if (Buffer.isBuffer(value)) { return value; } return Buffer.from(value); } getSQLType() { return "blob"; } }; __name(SQLiteBlobBuffer, "SQLiteBlobBuffer"); _a55 = entityKind; __publicField(SQLiteBlobBuffer, _a55, "SQLiteBlobBuffer"); __name(blob, "blob"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/custom.js function customType(customTypeParams) { return (a2, b2) => { const { name, config: config3 } = getColumnNameAndConfig(a2, b2); return new SQLiteCustomColumnBuilder( name, config3, customTypeParams ); }; } var _a56, SQLiteCustomColumnBuilder, _a57, SQLiteCustomColumn; var init_custom = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/custom.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_utils2(); init_common2(); SQLiteCustomColumnBuilder = class extends SQLiteColumnBuilder { constructor(name, fieldConfig, customTypeParams) { super(name, "custom", "SQLiteCustomColumn"); this.config.fieldConfig = fieldConfig; this.config.customTypeParams = customTypeParams; } /** @internal */ build(table3) { return new SQLiteCustomColumn( table3, this.config ); } }; __name(SQLiteCustomColumnBuilder, "SQLiteCustomColumnBuilder"); _a56 = entityKind; __publicField(SQLiteCustomColumnBuilder, _a56, "SQLiteCustomColumnBuilder"); SQLiteCustomColumn = class extends SQLiteColumn { sqlName; mapTo; mapFrom; constructor(table3, config3) { super(table3, config3); this.sqlName = config3.customTypeParams.dataType(config3.fieldConfig); this.mapTo = config3.customTypeParams.toDriver; this.mapFrom = config3.customTypeParams.fromDriver; } getSQLType() { return this.sqlName; } mapFromDriverValue(value) { return typeof this.mapFrom === "function" ? this.mapFrom(value) : value; } mapToDriverValue(value) { return typeof this.mapTo === "function" ? this.mapTo(value) : value; } }; __name(SQLiteCustomColumn, "SQLiteCustomColumn"); _a57 = entityKind; __publicField(SQLiteCustomColumn, _a57, "SQLiteCustomColumn"); __name(customType, "customType"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/integer.js function integer(a2, b2) { const { name, config: config3 } = getColumnNameAndConfig(a2, b2); if (config3?.mode === "timestamp" || config3?.mode === "timestamp_ms") { return new SQLiteTimestampBuilder(name, config3.mode); } if (config3?.mode === "boolean") { return new SQLiteBooleanBuilder(name, config3.mode); } return new SQLiteIntegerBuilder(name); } var _a58, SQLiteBaseIntegerBuilder, _a59, SQLiteBaseInteger, _a60, SQLiteIntegerBuilder, _a61, SQLiteInteger, _a62, SQLiteTimestampBuilder, _a63, SQLiteTimestamp, _a64, SQLiteBooleanBuilder, _a65, SQLiteBoolean; var init_integer = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/integer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_sql(); init_utils2(); init_common2(); SQLiteBaseIntegerBuilder = class extends SQLiteColumnBuilder { constructor(name, dataType, columnType) { super(name, dataType, columnType); this.config.autoIncrement = false; } primaryKey(config3) { if (config3?.autoIncrement) { this.config.autoIncrement = true; } this.config.hasDefault = true; return super.primaryKey(); } }; __name(SQLiteBaseIntegerBuilder, "SQLiteBaseIntegerBuilder"); _a58 = entityKind; __publicField(SQLiteBaseIntegerBuilder, _a58, "SQLiteBaseIntegerBuilder"); SQLiteBaseInteger = class extends SQLiteColumn { autoIncrement = this.config.autoIncrement; getSQLType() { return "integer"; } }; __name(SQLiteBaseInteger, "SQLiteBaseInteger"); _a59 = entityKind; __publicField(SQLiteBaseInteger, _a59, "SQLiteBaseInteger"); SQLiteIntegerBuilder = class extends SQLiteBaseIntegerBuilder { constructor(name) { super(name, "number", "SQLiteInteger"); } build(table3) { return new SQLiteInteger( table3, this.config ); } }; __name(SQLiteIntegerBuilder, "SQLiteIntegerBuilder"); _a60 = entityKind; __publicField(SQLiteIntegerBuilder, _a60, "SQLiteIntegerBuilder"); SQLiteInteger = class extends SQLiteBaseInteger { }; __name(SQLiteInteger, "SQLiteInteger"); _a61 = entityKind; __publicField(SQLiteInteger, _a61, "SQLiteInteger"); SQLiteTimestampBuilder = class extends SQLiteBaseIntegerBuilder { constructor(name, mode) { super(name, "date", "SQLiteTimestamp"); this.config.mode = mode; } /** * @deprecated Use `default()` with your own expression instead. * * Adds `DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer))` to the column, which is the current epoch timestamp in milliseconds. */ defaultNow() { return this.default(sql`(cast((julianday('now') - 2440587.5)*86400000 as integer))`); } build(table3) { return new SQLiteTimestamp( table3, this.config ); } }; __name(SQLiteTimestampBuilder, "SQLiteTimestampBuilder"); _a62 = entityKind; __publicField(SQLiteTimestampBuilder, _a62, "SQLiteTimestampBuilder"); SQLiteTimestamp = class extends SQLiteBaseInteger { mode = this.config.mode; mapFromDriverValue(value) { if (this.config.mode === "timestamp") { return new Date(value * 1e3); } return new Date(value); } mapToDriverValue(value) { const unix = value.getTime(); if (this.config.mode === "timestamp") { return Math.floor(unix / 1e3); } return unix; } }; __name(SQLiteTimestamp, "SQLiteTimestamp"); _a63 = entityKind; __publicField(SQLiteTimestamp, _a63, "SQLiteTimestamp"); SQLiteBooleanBuilder = class extends SQLiteBaseIntegerBuilder { constructor(name, mode) { super(name, "boolean", "SQLiteBoolean"); this.config.mode = mode; } build(table3) { return new SQLiteBoolean( table3, this.config ); } }; __name(SQLiteBooleanBuilder, "SQLiteBooleanBuilder"); _a64 = entityKind; __publicField(SQLiteBooleanBuilder, _a64, "SQLiteBooleanBuilder"); SQLiteBoolean = class extends SQLiteBaseInteger { mode = this.config.mode; mapFromDriverValue(value) { return Number(value) === 1; } mapToDriverValue(value) { return value ? 1 : 0; } }; __name(SQLiteBoolean, "SQLiteBoolean"); _a65 = entityKind; __publicField(SQLiteBoolean, _a65, "SQLiteBoolean"); __name(integer, "integer"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/numeric.js function numeric(a2, b2) { const { name, config: config3 } = getColumnNameAndConfig(a2, b2); const mode = config3?.mode; return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name); } var _a66, SQLiteNumericBuilder, _a67, SQLiteNumeric, _a68, SQLiteNumericNumberBuilder, _a69, SQLiteNumericNumber, _a70, SQLiteNumericBigIntBuilder, _a71, SQLiteNumericBigInt; var init_numeric = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/numeric.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_utils2(); init_common2(); SQLiteNumericBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "string", "SQLiteNumeric"); } /** @internal */ build(table3) { return new SQLiteNumeric( table3, this.config ); } }; __name(SQLiteNumericBuilder, "SQLiteNumericBuilder"); _a66 = entityKind; __publicField(SQLiteNumericBuilder, _a66, "SQLiteNumericBuilder"); SQLiteNumeric = class extends SQLiteColumn { mapFromDriverValue(value) { if (typeof value === "string") return value; return String(value); } getSQLType() { return "numeric"; } }; __name(SQLiteNumeric, "SQLiteNumeric"); _a67 = entityKind; __publicField(SQLiteNumeric, _a67, "SQLiteNumeric"); SQLiteNumericNumberBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "number", "SQLiteNumericNumber"); } /** @internal */ build(table3) { return new SQLiteNumericNumber( table3, this.config ); } }; __name(SQLiteNumericNumberBuilder, "SQLiteNumericNumberBuilder"); _a68 = entityKind; __publicField(SQLiteNumericNumberBuilder, _a68, "SQLiteNumericNumberBuilder"); SQLiteNumericNumber = class extends SQLiteColumn { mapFromDriverValue(value) { if (typeof value === "number") return value; return Number(value); } mapToDriverValue = String; getSQLType() { return "numeric"; } }; __name(SQLiteNumericNumber, "SQLiteNumericNumber"); _a69 = entityKind; __publicField(SQLiteNumericNumber, _a69, "SQLiteNumericNumber"); SQLiteNumericBigIntBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "bigint", "SQLiteNumericBigInt"); } /** @internal */ build(table3) { return new SQLiteNumericBigInt( table3, this.config ); } }; __name(SQLiteNumericBigIntBuilder, "SQLiteNumericBigIntBuilder"); _a70 = entityKind; __publicField(SQLiteNumericBigIntBuilder, _a70, "SQLiteNumericBigIntBuilder"); SQLiteNumericBigInt = class extends SQLiteColumn { mapFromDriverValue = BigInt; mapToDriverValue = String; getSQLType() { return "numeric"; } }; __name(SQLiteNumericBigInt, "SQLiteNumericBigInt"); _a71 = entityKind; __publicField(SQLiteNumericBigInt, _a71, "SQLiteNumericBigInt"); __name(numeric, "numeric"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/real.js function real(name) { return new SQLiteRealBuilder(name ?? ""); } var _a72, SQLiteRealBuilder, _a73, SQLiteReal; var init_real = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/real.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_common2(); SQLiteRealBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "number", "SQLiteReal"); } /** @internal */ build(table3) { return new SQLiteReal(table3, this.config); } }; __name(SQLiteRealBuilder, "SQLiteRealBuilder"); _a72 = entityKind; __publicField(SQLiteRealBuilder, _a72, "SQLiteRealBuilder"); SQLiteReal = class extends SQLiteColumn { getSQLType() { return "real"; } }; __name(SQLiteReal, "SQLiteReal"); _a73 = entityKind; __publicField(SQLiteReal, _a73, "SQLiteReal"); __name(real, "real"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/text.js function text(a2, b2 = {}) { const { name, config: config3 } = getColumnNameAndConfig(a2, b2); if (config3.mode === "json") { return new SQLiteTextJsonBuilder(name); } return new SQLiteTextBuilder(name, config3); } var _a74, SQLiteTextBuilder, _a75, SQLiteText, _a76, SQLiteTextJsonBuilder, _a77, SQLiteTextJson; var init_text = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/text.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_utils2(); init_common2(); SQLiteTextBuilder = class extends SQLiteColumnBuilder { constructor(name, config3) { super(name, "string", "SQLiteText"); this.config.enumValues = config3.enum; this.config.length = config3.length; } /** @internal */ build(table3) { return new SQLiteText( table3, this.config ); } }; __name(SQLiteTextBuilder, "SQLiteTextBuilder"); _a74 = entityKind; __publicField(SQLiteTextBuilder, _a74, "SQLiteTextBuilder"); SQLiteText = class extends SQLiteColumn { enumValues = this.config.enumValues; length = this.config.length; constructor(table3, config3) { super(table3, config3); } getSQLType() { return `text${this.config.length ? `(${this.config.length})` : ""}`; } }; __name(SQLiteText, "SQLiteText"); _a75 = entityKind; __publicField(SQLiteText, _a75, "SQLiteText"); SQLiteTextJsonBuilder = class extends SQLiteColumnBuilder { constructor(name) { super(name, "json", "SQLiteTextJson"); } /** @internal */ build(table3) { return new SQLiteTextJson( table3, this.config ); } }; __name(SQLiteTextJsonBuilder, "SQLiteTextJsonBuilder"); _a76 = entityKind; __publicField(SQLiteTextJsonBuilder, _a76, "SQLiteTextJsonBuilder"); SQLiteTextJson = class extends SQLiteColumn { getSQLType() { return "text"; } mapFromDriverValue(value) { return JSON.parse(value); } mapToDriverValue(value) { return JSON.stringify(value); } }; __name(SQLiteTextJson, "SQLiteTextJson"); _a77 = entityKind; __publicField(SQLiteTextJson, _a77, "SQLiteTextJson"); __name(text, "text"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/all.js function getSQLiteColumnBuilders() { return { blob, customType, integer, numeric, real, text }; } var init_all = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/all.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_blob(); init_custom(); init_integer(); init_numeric(); init_real(); init_text(); __name(getSQLiteColumnBuilders, "getSQLiteColumnBuilders"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/table.js function sqliteTableBase(name, columns, extraConfig, schema, baseName = name) { const rawTable = new SQLiteTable(name, schema, baseName); const parsedColumns = typeof columns === "function" ? columns(getSQLiteColumnBuilders()) : columns; const builtColumns = Object.fromEntries( Object.entries(parsedColumns).map(([name2, colBuilderBase]) => { const colBuilder = colBuilderBase; colBuilder.setName(name2); const column = colBuilder.build(rawTable); rawTable[InlineForeignKeys2].push(...colBuilder.buildForeignKeys(column, rawTable)); return [name2, column]; }) ); const table3 = Object.assign(rawTable, builtColumns); table3[Table.Symbol.Columns] = builtColumns; table3[Table.Symbol.ExtraConfigColumns] = builtColumns; if (extraConfig) { table3[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig; } return table3; } var InlineForeignKeys2, _a78, SQLiteTable, sqliteTable; var init_table3 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/table.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table(); init_all(); InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys"); SQLiteTable = class extends Table { /** @internal */ [(_a78 = entityKind, Table.Symbol.Columns)]; /** @internal */ [InlineForeignKeys2] = []; /** @internal */ [Table.Symbol.ExtraConfigBuilder] = void 0; }; __name(SQLiteTable, "SQLiteTable"); __publicField(SQLiteTable, _a78, "SQLiteTable"); /** @internal */ __publicField(SQLiteTable, "Symbol", Object.assign({}, Table.Symbol, { InlineForeignKeys: InlineForeignKeys2 })); __name(sqliteTableBase, "sqliteTableBase"); sqliteTable = /* @__PURE__ */ __name((name, columns, extraConfig) => { return sqliteTableBase(name, columns, extraConfig); }, "sqliteTable"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/checks.js function check(name, value) { return new CheckBuilder(name, value); } var _a79, CheckBuilder, _a80, Check; var init_checks = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/checks.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); CheckBuilder = class { constructor(name, value) { this.name = name; this.value = value; } brand; build(table3) { return new Check(table3, this); } }; __name(CheckBuilder, "CheckBuilder"); _a79 = entityKind; __publicField(CheckBuilder, _a79, "SQLiteCheckBuilder"); Check = class { constructor(table3, builder) { this.table = table3; this.name = builder.name; this.value = builder.value; } name; value; }; __name(Check, "Check"); _a80 = entityKind; __publicField(Check, _a80, "SQLiteCheck"); __name(check, "check"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/indexes.js function uniqueIndex(name) { return new IndexBuilderOn(name, true); } var _a81, IndexBuilderOn, _a82, IndexBuilder, _a83, Index; var init_indexes = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/indexes.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); IndexBuilderOn = class { constructor(name, unique) { this.name = name; this.unique = unique; } on(...columns) { return new IndexBuilder(this.name, columns, this.unique); } }; __name(IndexBuilderOn, "IndexBuilderOn"); _a81 = entityKind; __publicField(IndexBuilderOn, _a81, "SQLiteIndexBuilderOn"); IndexBuilder = class { /** @internal */ config; constructor(name, columns, unique) { this.config = { name, columns, unique, where: void 0 }; } /** * Condition for partial index. */ where(condition) { this.config.where = condition; return this; } /** @internal */ build(table3) { return new Index(this.config, table3); } }; __name(IndexBuilder, "IndexBuilder"); _a82 = entityKind; __publicField(IndexBuilder, _a82, "SQLiteIndexBuilder"); Index = class { config; constructor(config3, table3) { this.config = { ...config3, table: table3 }; } }; __name(Index, "Index"); _a83 = entityKind; __publicField(Index, _a83, "SQLiteIndex"); __name(uniqueIndex, "uniqueIndex"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/primary-keys.js function primaryKey(...config3) { if (config3[0].columns) { return new PrimaryKeyBuilder2(config3[0].columns, config3[0].name); } return new PrimaryKeyBuilder2(config3); } var _a84, PrimaryKeyBuilder2, _a85, PrimaryKey2; var init_primary_keys2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/primary-keys.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table3(); __name(primaryKey, "primaryKey"); PrimaryKeyBuilder2 = class { /** @internal */ columns; /** @internal */ name; constructor(columns, name) { this.columns = columns; this.name = name; } /** @internal */ build(table3) { return new PrimaryKey2(table3, this.columns, this.name); } }; __name(PrimaryKeyBuilder2, "PrimaryKeyBuilder"); _a84 = entityKind; __publicField(PrimaryKeyBuilder2, _a84, "SQLitePrimaryKeyBuilder"); PrimaryKey2 = class { constructor(table3, columns, name) { this.table = table3; this.columns = columns; this.name = name; } columns; name; getName() { return this.name ?? `${this.table[SQLiteTable.Symbol.Name]}_${this.columns.map((column) => column.name).join("_")}_pk`; } }; __name(PrimaryKey2, "PrimaryKey"); _a85 = entityKind; __publicField(PrimaryKey2, _a85, "SQLitePrimaryKey"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/utils.js function extractUsedTable(table3) { if (is(table3, SQLiteTable)) { return [`${table3[Table.Symbol.BaseName]}`]; } if (is(table3, Subquery)) { return table3._.usedTables ?? []; } if (is(table3, SQL)) { return table3.usedTables ?? []; } return []; } var init_utils3 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_sql(); init_subquery(); init_table(); init_table3(); __name(extractUsedTable, "extractUsedTable"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/delete.js var _a86, SQLiteDeleteBase; var init_delete = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/delete.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_query_promise(); init_selection_proxy(); init_table3(); init_table(); init_utils2(); init_utils3(); SQLiteDeleteBase = class extends QueryPromise { constructor(table3, session, dialect, withList) { super(); this.table = table3; this.session = session; this.dialect = dialect; this.config = { table: table3, withList }; } /** @internal */ config; /** * Adds a `where` clause to the query. * * Calling this method will delete only those rows that fulfill a specified condition. * * See docs: {@link https://orm.drizzle.team/docs/delete} * * @param where the `where` clause. * * @example * You can use conditional operators and `sql function` to filter the rows to be deleted. * * ```ts * // Delete all cars with green color * db.delete(cars).where(eq(cars.color, 'green')); * // or * db.delete(cars).where(sql`${cars.color} = 'green'`) * ``` * * You can logically combine conditional operators with `and()` and `or()` operators: * * ```ts * // Delete all BMW cars with a green color * db.delete(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); * * // Delete all cars with the green or blue color * db.delete(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); * ``` */ where(where) { this.config.where = where; return this; } orderBy(...columns) { if (typeof columns[0] === "function") { const orderBy = columns[0]( new Proxy( this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) ) ); const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy]; this.config.orderBy = orderByArray; } else { const orderByArray = columns; this.config.orderBy = orderByArray; } return this; } limit(limit) { this.config.limit = limit; return this; } returning(fields = this.table[SQLiteTable.Symbol.Columns]) { this.config.returning = orderSelectedFields(fields); return this; } /** @internal */ getSQL() { return this.dialect.buildDeleteQuery(this.config); } toSQL() { const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL()); return rest; } /** @internal */ _prepare(isOneTimeQuery = true) { return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( this.dialect.sqlToQuery(this.getSQL()), this.config.returning, this.config.returning ? "all" : "run", true, void 0, { type: "delete", tables: extractUsedTable(this.config.table) } ); } prepare() { return this._prepare(false); } run = (placeholderValues) => { return this._prepare().run(placeholderValues); }; all = (placeholderValues) => { return this._prepare().all(placeholderValues); }; get = (placeholderValues) => { return this._prepare().get(placeholderValues); }; values = (placeholderValues) => { return this._prepare().values(placeholderValues); }; async execute(placeholderValues) { return this._prepare().execute(placeholderValues); } $dynamic() { return this; } }; __name(SQLiteDeleteBase, "SQLiteDeleteBase"); _a86 = entityKind; __publicField(SQLiteDeleteBase, _a86, "SQLiteDelete"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/casing.js function toSnakeCase(input) { const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []; return words.map((word) => word.toLowerCase()).join("_"); } function toCamelCase(input) { const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []; return words.reduce((acc, word, i2) => { const formattedWord = i2 === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`; return acc + formattedWord; }, ""); } function noopCase(input) { return input; } var _a87, CasingCache; var init_casing = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/casing.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_table(); __name(toSnakeCase, "toSnakeCase"); __name(toCamelCase, "toCamelCase"); __name(noopCase, "noopCase"); CasingCache = class { /** @internal */ cache = {}; cachedTables = {}; convert; constructor(casing) { this.convert = casing === "snake_case" ? toSnakeCase : casing === "camelCase" ? toCamelCase : noopCase; } getColumnCasing(column) { if (!column.keyAsName) return column.name; const schema = column.table[Table.Symbol.Schema] ?? "public"; const tableName = column.table[Table.Symbol.OriginalName]; const key = `${schema}.${tableName}.${column.name}`; if (!this.cache[key]) { this.cacheTable(column.table); } return this.cache[key]; } cacheTable(table3) { const schema = table3[Table.Symbol.Schema] ?? "public"; const tableName = table3[Table.Symbol.OriginalName]; const tableKey = `${schema}.${tableName}`; if (!this.cachedTables[tableKey]) { for (const column of Object.values(table3[Table.Symbol.Columns])) { const columnKey = `${tableKey}.${column.name}`; this.cache[columnKey] = this.convert(column.name); } this.cachedTables[tableKey] = true; } } clearCache() { this.cache = {}; this.cachedTables = {}; } }; __name(CasingCache, "CasingCache"); _a87 = entityKind; __publicField(CasingCache, _a87, "CasingCache"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/errors.js var _a88, DrizzleError, DrizzleQueryError, _a89, TransactionRollbackError; var init_errors = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/errors.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); DrizzleError = class extends Error { constructor({ message: message2, cause }) { super(message2); this.name = "DrizzleError"; this.cause = cause; } }; __name(DrizzleError, "DrizzleError"); _a88 = entityKind; __publicField(DrizzleError, _a88, "DrizzleError"); DrizzleQueryError = class extends Error { constructor(query, params, cause) { super(`Failed query: ${query} params: ${params}`); this.query = query; this.params = params; this.cause = cause; Error.captureStackTrace(this, DrizzleQueryError); if (cause) this.cause = cause; } }; __name(DrizzleQueryError, "DrizzleQueryError"); TransactionRollbackError = class extends DrizzleError { constructor() { super({ message: "Rollback" }); } }; __name(TransactionRollbackError, "TransactionRollbackError"); _a89 = entityKind; __publicField(TransactionRollbackError, _a89, "TransactionRollbackError"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/functions/aggregate.js function count3(expression) { return sql`count(${expression || sql.raw("*")})`.mapWith(Number); } function max(expression) { return sql`max(${expression})`.mapWith(is(expression, Column) ? expression : String); } var init_aggregate = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/functions/aggregate.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_column(); init_entity(); init_sql(); __name(count3, "count"); __name(max, "max"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/functions/vector.js var init_vector = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/functions/vector.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/functions/index.js var init_functions = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/functions/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_aggregate(); init_vector(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/index.js var init_sql2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sql/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_expressions(); init_functions(); init_sql(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/index.js var init_columns = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/columns/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_blob(); init_common2(); init_custom(); init_integer(); init_numeric(); init_real(); init_text(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/view-base.js var _a90, SQLiteViewBase; var init_view_base = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/view-base.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_sql(); SQLiteViewBase = class extends View { }; __name(SQLiteViewBase, "SQLiteViewBase"); _a90 = entityKind; __publicField(SQLiteViewBase, _a90, "SQLiteViewBase"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/dialect.js var _a91, SQLiteDialect, _a92, SQLiteSyncDialect, _a93, SQLiteAsyncDialect; var init_dialect = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/dialect.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_alias(); init_casing(); init_column(); init_entity(); init_errors(); init_relations(); init_sql2(); init_sql(); init_columns(); init_table3(); init_subquery(); init_table(); init_utils2(); init_view_common(); init_view_base(); SQLiteDialect = class { /** @internal */ casing; constructor(config3) { this.casing = new CasingCache(config3?.casing); } escapeName(name) { return `"${name}"`; } escapeParam(_num) { return "?"; } escapeString(str) { return `'${str.replace(/'/g, "''")}'`; } buildWithCTE(queries) { if (!queries?.length) return void 0; const withSqlChunks = [sql`with `]; for (const [i2, w2] of queries.entries()) { withSqlChunks.push(sql`${sql.identifier(w2._.alias)} as (${w2._.sql})`); if (i2 < queries.length - 1) { withSqlChunks.push(sql`, `); } } withSqlChunks.push(sql` `); return sql.join(withSqlChunks); } buildDeleteQuery({ table: table3, where, returning, withList, limit, orderBy }) { const withSql = this.buildWithCTE(withList); const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0; const whereSql = where ? sql` where ${where}` : void 0; const orderBySql = this.buildOrderBy(orderBy); const limitSql = this.buildLimit(limit); return sql`${withSql}delete from ${table3}${whereSql}${returningSql}${orderBySql}${limitSql}`; } buildUpdateSet(table3, set2) { const tableColumns = table3[Table.Symbol.Columns]; const columnNames = Object.keys(tableColumns).filter( (colName) => set2[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0 ); const setSize = columnNames.length; return sql.join(columnNames.flatMap((colName, i2) => { const col = tableColumns[colName]; const value = set2[colName] ?? sql.param(col.onUpdateFn(), col); const res = sql`${sql.identifier(this.casing.getColumnCasing(col))} = ${value}`; if (i2 < setSize - 1) { return [res, sql.raw(", ")]; } return [res]; })); } buildUpdateQuery({ table: table3, set: set2, where, returning, withList, joins, from, limit, orderBy }) { const withSql = this.buildWithCTE(withList); const setSql = this.buildUpdateSet(table3, set2); const fromSql = from && sql.join([sql.raw(" from "), this.buildFromTable(from)]); const joinsSql = this.buildJoins(joins); const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0; const whereSql = where ? sql` where ${where}` : void 0; const orderBySql = this.buildOrderBy(orderBy); const limitSql = this.buildLimit(limit); return sql`${withSql}update ${table3} set ${setSql}${fromSql}${joinsSql}${whereSql}${returningSql}${orderBySql}${limitSql}`; } /** * Builds selection SQL with provided fields/expressions * * Examples: * * `select from` * * `insert ... returning ` * * If `isSingleTable` is true, then columns won't be prefixed with table name */ buildSelection(fields, { isSingleTable = false } = {}) { const columnsLen = fields.length; const chunks = fields.flatMap(({ field }, i2) => { const chunk = []; if (is(field, SQL.Aliased) && field.isSelectionField) { chunk.push(sql.identifier(field.fieldAlias)); } else if (is(field, SQL.Aliased) || is(field, SQL)) { const query = is(field, SQL.Aliased) ? field.sql : field; if (isSingleTable) { chunk.push( new SQL( query.queryChunks.map((c2) => { if (is(c2, Column)) { return sql.identifier(this.casing.getColumnCasing(c2)); } return c2; }) ) ); } else { chunk.push(query); } if (is(field, SQL.Aliased)) { chunk.push(sql` as ${sql.identifier(field.fieldAlias)}`); } } else if (is(field, Column)) { const tableName = field.table[Table.Symbol.Name]; if (field.columnType === "SQLiteNumericBigInt") { if (isSingleTable) { chunk.push(sql`cast(${sql.identifier(this.casing.getColumnCasing(field))} as text)`); } else { chunk.push( sql`cast(${sql.identifier(tableName)}.${sql.identifier(this.casing.getColumnCasing(field))} as text)` ); } } else { if (isSingleTable) { chunk.push(sql.identifier(this.casing.getColumnCasing(field))); } else { chunk.push(sql`${sql.identifier(tableName)}.${sql.identifier(this.casing.getColumnCasing(field))}`); } } } if (i2 < columnsLen - 1) { chunk.push(sql`, `); } return chunk; }); return sql.join(chunks); } buildJoins(joins) { if (!joins || joins.length === 0) { return void 0; } const joinsArray = []; if (joins) { for (const [index, joinMeta] of joins.entries()) { if (index === 0) { joinsArray.push(sql` `); } const table3 = joinMeta.table; const onSql = joinMeta.on ? sql` on ${joinMeta.on}` : void 0; if (is(table3, SQLiteTable)) { const tableName = table3[SQLiteTable.Symbol.Name]; const tableSchema = table3[SQLiteTable.Symbol.Schema]; const origTableName = table3[SQLiteTable.Symbol.OriginalName]; const alias = tableName === origTableName ? void 0 : joinMeta.alias; joinsArray.push( sql`${sql.raw(joinMeta.joinType)} join ${tableSchema ? sql`${sql.identifier(tableSchema)}.` : void 0}${sql.identifier(origTableName)}${alias && sql` ${sql.identifier(alias)}`}${onSql}` ); } else { joinsArray.push( sql`${sql.raw(joinMeta.joinType)} join ${table3}${onSql}` ); } if (index < joins.length - 1) { joinsArray.push(sql` `); } } } return sql.join(joinsArray); } buildLimit(limit) { return typeof limit === "object" || typeof limit === "number" && limit >= 0 ? sql` limit ${limit}` : void 0; } buildOrderBy(orderBy) { const orderByList = []; if (orderBy) { for (const [index, orderByValue] of orderBy.entries()) { orderByList.push(orderByValue); if (index < orderBy.length - 1) { orderByList.push(sql`, `); } } } return orderByList.length > 0 ? sql` order by ${sql.join(orderByList)}` : void 0; } buildFromTable(table3) { if (is(table3, Table) && table3[Table.Symbol.IsAlias]) { return sql`${sql`${sql.identifier(table3[Table.Symbol.Schema] ?? "")}.`.if(table3[Table.Symbol.Schema])}${sql.identifier(table3[Table.Symbol.OriginalName])} ${sql.identifier(table3[Table.Symbol.Name])}`; } return table3; } buildSelectQuery({ withList, fields, fieldsFlat, where, having, table: table3, joins, orderBy, groupBy, limit, offset, distinct, setOperators }) { const fieldsList = fieldsFlat ?? orderSelectedFields(fields); for (const f2 of fieldsList) { if (is(f2.field, Column) && getTableName(f2.field.table) !== (is(table3, Subquery) ? table3._.alias : is(table3, SQLiteViewBase) ? table3[ViewBaseConfig].name : is(table3, SQL) ? void 0 : getTableName(table3)) && !((table22) => joins?.some( ({ alias }) => alias === (table22[Table.Symbol.IsAlias] ? getTableName(table22) : table22[Table.Symbol.BaseName]) ))(f2.field.table)) { const tableName = getTableName(f2.field.table); throw new Error( `Your "${f2.path.join("->")}" field references a column "${tableName}"."${f2.field.name}", but the table "${tableName}" is not part of the query! Did you forget to join it?` ); } } const isSingleTable = !joins || joins.length === 0; const withSql = this.buildWithCTE(withList); const distinctSql = distinct ? sql` distinct` : void 0; const selection = this.buildSelection(fieldsList, { isSingleTable }); const tableSql = this.buildFromTable(table3); const joinsSql = this.buildJoins(joins); const whereSql = where ? sql` where ${where}` : void 0; const havingSql = having ? sql` having ${having}` : void 0; const groupByList = []; if (groupBy) { for (const [index, groupByValue] of groupBy.entries()) { groupByList.push(groupByValue); if (index < groupBy.length - 1) { groupByList.push(sql`, `); } } } const groupBySql = groupByList.length > 0 ? sql` group by ${sql.join(groupByList)}` : void 0; const orderBySql = this.buildOrderBy(orderBy); const limitSql = this.buildLimit(limit); const offsetSql = offset ? sql` offset ${offset}` : void 0; const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}`; if (setOperators.length > 0) { return this.buildSetOperations(finalQuery, setOperators); } return finalQuery; } buildSetOperations(leftSelect, setOperators) { const [setOperator, ...rest] = setOperators; if (!setOperator) { throw new Error("Cannot pass undefined values to any set operator"); } if (rest.length === 0) { return this.buildSetOperationQuery({ leftSelect, setOperator }); } return this.buildSetOperations( this.buildSetOperationQuery({ leftSelect, setOperator }), rest ); } buildSetOperationQuery({ leftSelect, setOperator: { type, isAll, rightSelect, limit, orderBy, offset } }) { const leftChunk = sql`${leftSelect.getSQL()} `; const rightChunk = sql`${rightSelect.getSQL()}`; let orderBySql; if (orderBy && orderBy.length > 0) { const orderByValues = []; for (const singleOrderBy of orderBy) { if (is(singleOrderBy, SQLiteColumn)) { orderByValues.push(sql.identifier(singleOrderBy.name)); } else if (is(singleOrderBy, SQL)) { for (let i2 = 0; i2 < singleOrderBy.queryChunks.length; i2++) { const chunk = singleOrderBy.queryChunks[i2]; if (is(chunk, SQLiteColumn)) { singleOrderBy.queryChunks[i2] = sql.identifier(this.casing.getColumnCasing(chunk)); } } orderByValues.push(sql`${singleOrderBy}`); } else { orderByValues.push(sql`${singleOrderBy}`); } } orderBySql = sql` order by ${sql.join(orderByValues, sql`, `)}`; } const limitSql = typeof limit === "object" || typeof limit === "number" && limit >= 0 ? sql` limit ${limit}` : void 0; const operatorChunk = sql.raw(`${type} ${isAll ? "all " : ""}`); const offsetSql = offset ? sql` offset ${offset}` : void 0; return sql`${leftChunk}${operatorChunk}${rightChunk}${orderBySql}${limitSql}${offsetSql}`; } buildInsertQuery({ table: table3, values: valuesOrSelect, onConflict, returning, withList, select }) { const valuesSqlList = []; const columns = table3[Table.Symbol.Columns]; const colEntries = Object.entries(columns).filter( ([_, col]) => !col.shouldDisableInsert() ); const insertOrder = colEntries.map(([, column]) => sql.identifier(this.casing.getColumnCasing(column))); if (select) { const select2 = valuesOrSelect; if (is(select2, SQL)) { valuesSqlList.push(select2); } else { valuesSqlList.push(select2.getSQL()); } } else { const values = valuesOrSelect; valuesSqlList.push(sql.raw("values ")); for (const [valueIndex, value] of values.entries()) { const valueList = []; for (const [fieldName, col] of colEntries) { const colValue = value[fieldName]; if (colValue === void 0 || is(colValue, Param) && colValue.value === void 0) { let defaultValue; if (col.default !== null && col.default !== void 0) { defaultValue = is(col.default, SQL) ? col.default : sql.param(col.default, col); } else if (col.defaultFn !== void 0) { const defaultFnResult = col.defaultFn(); defaultValue = is(defaultFnResult, SQL) ? defaultFnResult : sql.param(defaultFnResult, col); } else if (!col.default && col.onUpdateFn !== void 0) { const onUpdateFnResult = col.onUpdateFn(); defaultValue = is(onUpdateFnResult, SQL) ? onUpdateFnResult : sql.param(onUpdateFnResult, col); } else { defaultValue = sql`null`; } valueList.push(defaultValue); } else { valueList.push(colValue); } } valuesSqlList.push(valueList); if (valueIndex < values.length - 1) { valuesSqlList.push(sql`, `); } } } const withSql = this.buildWithCTE(withList); const valuesSql = sql.join(valuesSqlList); const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0; const onConflictSql = onConflict?.length ? sql.join(onConflict) : void 0; return sql`${withSql}insert into ${table3} ${insertOrder} ${valuesSql}${onConflictSql}${returningSql}`; } sqlToQuery(sql2, invokeSource) { return sql2.toQuery({ casing: this.casing, escapeName: this.escapeName, escapeParam: this.escapeParam, escapeString: this.escapeString, invokeSource }); } buildRelationalQuery({ fullSchema, schema, tableNamesMap, table: table3, tableConfig, queryConfig: config3, tableAlias, nestedQueryRelation, joinOn }) { let selection = []; let limit, offset, orderBy = [], where; const joins = []; if (config3 === true) { const selectionEntries = Object.entries(tableConfig.columns); selection = selectionEntries.map(([key, value]) => ({ dbKey: value.name, tsKey: key, field: aliasedTableColumn(value, tableAlias), relationTableTsKey: void 0, isJson: false, selection: [] })); } else { const aliasedColumns = Object.fromEntries( Object.entries(tableConfig.columns).map(([key, value]) => [key, aliasedTableColumn(value, tableAlias)]) ); if (config3.where) { const whereSql = typeof config3.where === "function" ? config3.where(aliasedColumns, getOperators()) : config3.where; where = whereSql && mapColumnsInSQLToAlias(whereSql, tableAlias); } const fieldsSelection = []; let selectedColumns = []; if (config3.columns) { let isIncludeMode = false; for (const [field, value] of Object.entries(config3.columns)) { if (value === void 0) { continue; } if (field in tableConfig.columns) { if (!isIncludeMode && value === true) { isIncludeMode = true; } selectedColumns.push(field); } } if (selectedColumns.length > 0) { selectedColumns = isIncludeMode ? selectedColumns.filter((c2) => config3.columns?.[c2] === true) : Object.keys(tableConfig.columns).filter((key) => !selectedColumns.includes(key)); } } else { selectedColumns = Object.keys(tableConfig.columns); } for (const field of selectedColumns) { const column = tableConfig.columns[field]; fieldsSelection.push({ tsKey: field, value: column }); } let selectedRelations = []; if (config3.with) { selectedRelations = Object.entries(config3.with).filter((entry) => !!entry[1]).map(([tsKey, queryConfig]) => ({ tsKey, queryConfig, relation: tableConfig.relations[tsKey] })); } let extras; if (config3.extras) { extras = typeof config3.extras === "function" ? config3.extras(aliasedColumns, { sql }) : config3.extras; for (const [tsKey, value] of Object.entries(extras)) { fieldsSelection.push({ tsKey, value: mapColumnsInAliasedSQLToAlias(value, tableAlias) }); } } for (const { tsKey, value } of fieldsSelection) { selection.push({ dbKey: is(value, SQL.Aliased) ? value.fieldAlias : tableConfig.columns[tsKey].name, tsKey, field: is(value, Column) ? aliasedTableColumn(value, tableAlias) : value, relationTableTsKey: void 0, isJson: false, selection: [] }); } let orderByOrig = typeof config3.orderBy === "function" ? config3.orderBy(aliasedColumns, getOrderByOperators()) : config3.orderBy ?? []; if (!Array.isArray(orderByOrig)) { orderByOrig = [orderByOrig]; } orderBy = orderByOrig.map((orderByValue) => { if (is(orderByValue, Column)) { return aliasedTableColumn(orderByValue, tableAlias); } return mapColumnsInSQLToAlias(orderByValue, tableAlias); }); limit = config3.limit; offset = config3.offset; for (const { tsKey: selectedRelationTsKey, queryConfig: selectedRelationConfigValue, relation } of selectedRelations) { const normalizedRelation = normalizeRelation(schema, tableNamesMap, relation); const relationTableName = getTableUniqueName(relation.referencedTable); const relationTableTsName = tableNamesMap[relationTableName]; const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`; const joinOn2 = and( ...normalizedRelation.fields.map( (field2, i2) => eq( aliasedTableColumn(normalizedRelation.references[i2], relationTableAlias), aliasedTableColumn(field2, tableAlias) ) ) ); const builtRelation = this.buildRelationalQuery({ fullSchema, schema, tableNamesMap, table: fullSchema[relationTableTsName], tableConfig: schema[relationTableTsName], queryConfig: is(relation, One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue, tableAlias: relationTableAlias, joinOn: joinOn2, nestedQueryRelation: relation }); const field = sql`(${builtRelation.sql})`.as(selectedRelationTsKey); selection.push({ dbKey: selectedRelationTsKey, tsKey: selectedRelationTsKey, field, relationTableTsKey: relationTableTsName, isJson: true, selection: builtRelation.selection }); } } if (selection.length === 0) { throw new DrizzleError({ message: `No fields selected for table "${tableConfig.tsName}" ("${tableAlias}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.` }); } let result; where = and(joinOn, where); if (nestedQueryRelation) { let field = sql`json_array(${sql.join( selection.map( ({ field: field2 }) => is(field2, SQLiteColumn) ? sql.identifier(this.casing.getColumnCasing(field2)) : is(field2, SQL.Aliased) ? field2.sql : field2 ), sql`, ` )})`; if (is(nestedQueryRelation, Many)) { field = sql`coalesce(json_group_array(${field}), json_array())`; } const nestedSelection = [{ dbKey: "data", tsKey: "data", field: field.as("data"), isJson: true, relationTableTsKey: tableConfig.tsName, selection }]; const needsSubquery = limit !== void 0 || offset !== void 0 || orderBy.length > 0; if (needsSubquery) { result = this.buildSelectQuery({ table: aliasedTable(table3, tableAlias), fields: {}, fieldsFlat: [ { path: [], field: sql.raw("*") } ], where, limit, offset, orderBy, setOperators: [] }); where = void 0; limit = void 0; offset = void 0; orderBy = void 0; } else { result = aliasedTable(table3, tableAlias); } result = this.buildSelectQuery({ table: is(result, SQLiteTable) ? result : new Subquery(result, {}, tableAlias), fields: {}, fieldsFlat: nestedSelection.map(({ field: field2 }) => ({ path: [], field: is(field2, Column) ? aliasedTableColumn(field2, tableAlias) : field2 })), joins, where, limit, offset, orderBy, setOperators: [] }); } else { result = this.buildSelectQuery({ table: aliasedTable(table3, tableAlias), fields: {}, fieldsFlat: selection.map(({ field }) => ({ path: [], field: is(field, Column) ? aliasedTableColumn(field, tableAlias) : field })), joins, where, limit, offset, orderBy, setOperators: [] }); } return { tableTsKey: tableConfig.tsName, sql: result, selection }; } }; __name(SQLiteDialect, "SQLiteDialect"); _a91 = entityKind; __publicField(SQLiteDialect, _a91, "SQLiteDialect"); SQLiteSyncDialect = class extends SQLiteDialect { migrate(migrations, session, config3) { const migrationsTable = config3 === void 0 ? "__drizzle_migrations" : typeof config3 === "string" ? "__drizzle_migrations" : config3.migrationsTable ?? "__drizzle_migrations"; const migrationTableCreate = sql` CREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric ) `; session.run(migrationTableCreate); const dbMigrations = session.values( sql`SELECT id, hash, created_at FROM ${sql.identifier(migrationsTable)} ORDER BY created_at DESC LIMIT 1` ); const lastDbMigration = dbMigrations[0] ?? void 0; session.run(sql`BEGIN`); try { for (const migration of migrations) { if (!lastDbMigration || Number(lastDbMigration[2]) < migration.folderMillis) { for (const stmt of migration.sql) { session.run(sql.raw(stmt)); } session.run( sql`INSERT INTO ${sql.identifier(migrationsTable)} ("hash", "created_at") VALUES(${migration.hash}, ${migration.folderMillis})` ); } } session.run(sql`COMMIT`); } catch (e2) { session.run(sql`ROLLBACK`); throw e2; } } }; __name(SQLiteSyncDialect, "SQLiteSyncDialect"); _a92 = entityKind; __publicField(SQLiteSyncDialect, _a92, "SQLiteSyncDialect"); SQLiteAsyncDialect = class extends SQLiteDialect { async migrate(migrations, session, config3) { const migrationsTable = config3 === void 0 ? "__drizzle_migrations" : typeof config3 === "string" ? "__drizzle_migrations" : config3.migrationsTable ?? "__drizzle_migrations"; const migrationTableCreate = sql` CREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric ) `; await session.run(migrationTableCreate); const dbMigrations = await session.values( sql`SELECT id, hash, created_at FROM ${sql.identifier(migrationsTable)} ORDER BY created_at DESC LIMIT 1` ); const lastDbMigration = dbMigrations[0] ?? void 0; await session.transaction(async (tx) => { for (const migration of migrations) { if (!lastDbMigration || Number(lastDbMigration[2]) < migration.folderMillis) { for (const stmt of migration.sql) { await tx.run(sql.raw(stmt)); } await tx.run( sql`INSERT INTO ${sql.identifier(migrationsTable)} ("hash", "created_at") VALUES(${migration.hash}, ${migration.folderMillis})` ); } } }); } }; __name(SQLiteAsyncDialect, "SQLiteAsyncDialect"); _a93 = entityKind; __publicField(SQLiteAsyncDialect, _a93, "SQLiteAsyncDialect"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/query-builders/query-builder.js var _a94, TypedQueryBuilder; var init_query_builder = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/query-builders/query-builder.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); TypedQueryBuilder = class { /** @internal */ getSelectedFields() { return this._.selectedFields; } }; __name(TypedQueryBuilder, "TypedQueryBuilder"); _a94 = entityKind; __publicField(TypedQueryBuilder, _a94, "TypedQueryBuilder"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/select.js function createSetOperator(type, isAll) { return (leftSelect, rightSelect, ...restSelects) => { const setOperators = [rightSelect, ...restSelects].map((select) => ({ type, isAll, rightSelect: select })); for (const setOperator of setOperators) { if (!haveSameKeys(leftSelect.getSelectedFields(), setOperator.rightSelect.getSelectedFields())) { throw new Error( "Set operator error (union / intersect / except): selected fields are not the same or are in a different order" ); } } return leftSelect.addSetOperators(setOperators); }; } var _a95, SQLiteSelectBuilder, _a96, SQLiteSelectQueryBuilderBase, _a97, SQLiteSelectBase, getSQLiteSetOperators, union, unionAll, intersect, except; var init_select2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/select.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_query_builder(); init_query_promise(); init_selection_proxy(); init_sql(); init_subquery(); init_table(); init_utils2(); init_view_common(); init_utils3(); init_view_base(); SQLiteSelectBuilder = class { fields; session; dialect; withList; distinct; constructor(config3) { this.fields = config3.fields; this.session = config3.session; this.dialect = config3.dialect; this.withList = config3.withList; this.distinct = config3.distinct; } from(source) { const isPartialSelect = !!this.fields; let fields; if (this.fields) { fields = this.fields; } else if (is(source, Subquery)) { fields = Object.fromEntries( Object.keys(source._.selectedFields).map((key) => [key, source[key]]) ); } else if (is(source, SQLiteViewBase)) { fields = source[ViewBaseConfig].selectedFields; } else if (is(source, SQL)) { fields = {}; } else { fields = getTableColumns(source); } return new SQLiteSelectBase({ table: source, fields, isPartialSelect, session: this.session, dialect: this.dialect, withList: this.withList, distinct: this.distinct }); } }; __name(SQLiteSelectBuilder, "SQLiteSelectBuilder"); _a95 = entityKind; __publicField(SQLiteSelectBuilder, _a95, "SQLiteSelectBuilder"); SQLiteSelectQueryBuilderBase = class extends TypedQueryBuilder { _; /** @internal */ config; joinsNotNullableMap; tableName; isPartialSelect; session; dialect; cacheConfig = void 0; usedTables = /* @__PURE__ */ new Set(); constructor({ table: table3, fields, isPartialSelect, session, dialect, withList, distinct }) { super(); this.config = { withList, table: table3, fields: { ...fields }, distinct, setOperators: [] }; this.isPartialSelect = isPartialSelect; this.session = session; this.dialect = dialect; this._ = { selectedFields: fields, config: this.config }; this.tableName = getTableLikeName(table3); this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {}; for (const item of extractUsedTable(table3)) this.usedTables.add(item); } /** @internal */ getUsedTables() { return [...this.usedTables]; } createJoin(joinType) { return (table3, on2) => { const baseTableName = this.tableName; const tableName = getTableLikeName(table3); for (const item of extractUsedTable(table3)) this.usedTables.add(item); if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) { throw new Error(`Alias "${tableName}" is already used in this query`); } if (!this.isPartialSelect) { if (Object.keys(this.joinsNotNullableMap).length === 1 && typeof baseTableName === "string") { this.config.fields = { [baseTableName]: this.config.fields }; } if (typeof tableName === "string" && !is(table3, SQL)) { const selection = is(table3, Subquery) ? table3._.selectedFields : is(table3, View) ? table3[ViewBaseConfig].selectedFields : table3[Table.Symbol.Columns]; this.config.fields[tableName] = selection; } } if (typeof on2 === "function") { on2 = on2( new Proxy( this.config.fields, new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) ) ); } if (!this.config.joins) { this.config.joins = []; } this.config.joins.push({ on: on2, table: table3, joinType, alias: tableName }); if (typeof tableName === "string") { switch (joinType) { case "left": { this.joinsNotNullableMap[tableName] = false; break; } case "right": { this.joinsNotNullableMap = Object.fromEntries( Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false]) ); this.joinsNotNullableMap[tableName] = true; break; } case "cross": case "inner": { this.joinsNotNullableMap[tableName] = true; break; } case "full": { this.joinsNotNullableMap = Object.fromEntries( Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false]) ); this.joinsNotNullableMap[tableName] = false; break; } } } return this; }; } /** * Executes a `left join` operation by adding another table to the current query. * * Calling this method associates each row of the table with the corresponding row from the joined table, if a match is found. If no matching row exists, it sets all columns of the joined table to null. * * See docs: {@link https://orm.drizzle.team/docs/joins#left-join} * * @param table the table to join. * @param on the `on` clause. * * @example * * ```ts * // Select all users and their pets * const usersWithPets: { user: User; pets: Pet | null; }[] = await db.select() * .from(users) * .leftJoin(pets, eq(users.id, pets.ownerId)) * * // Select userId and petId * const usersIdsAndPetIds: { userId: number; petId: number | null; }[] = await db.select({ * userId: users.id, * petId: pets.id, * }) * .from(users) * .leftJoin(pets, eq(users.id, pets.ownerId)) * ``` */ leftJoin = this.createJoin("left"); /** * Executes a `right join` operation by adding another table to the current query. * * Calling this method associates each row of the joined table with the corresponding row from the main table, if a match is found. If no matching row exists, it sets all columns of the main table to null. * * See docs: {@link https://orm.drizzle.team/docs/joins#right-join} * * @param table the table to join. * @param on the `on` clause. * * @example * * ```ts * // Select all users and their pets * const usersWithPets: { user: User | null; pets: Pet; }[] = await db.select() * .from(users) * .rightJoin(pets, eq(users.id, pets.ownerId)) * * // Select userId and petId * const usersIdsAndPetIds: { userId: number | null; petId: number; }[] = await db.select({ * userId: users.id, * petId: pets.id, * }) * .from(users) * .rightJoin(pets, eq(users.id, pets.ownerId)) * ``` */ rightJoin = this.createJoin("right"); /** * Executes an `inner join` operation, creating a new table by combining rows from two tables that have matching values. * * Calling this method retrieves rows that have corresponding entries in both joined tables. Rows without matching entries in either table are excluded, resulting in a table that includes only matching pairs. * * See docs: {@link https://orm.drizzle.team/docs/joins#inner-join} * * @param table the table to join. * @param on the `on` clause. * * @example * * ```ts * // Select all users and their pets * const usersWithPets: { user: User; pets: Pet; }[] = await db.select() * .from(users) * .innerJoin(pets, eq(users.id, pets.ownerId)) * * // Select userId and petId * const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({ * userId: users.id, * petId: pets.id, * }) * .from(users) * .innerJoin(pets, eq(users.id, pets.ownerId)) * ``` */ innerJoin = this.createJoin("inner"); /** * Executes a `full join` operation by combining rows from two tables into a new table. * * Calling this method retrieves all rows from both main and joined tables, merging rows with matching values and filling in `null` for non-matching columns. * * See docs: {@link https://orm.drizzle.team/docs/joins#full-join} * * @param table the table to join. * @param on the `on` clause. * * @example * * ```ts * // Select all users and their pets * const usersWithPets: { user: User | null; pets: Pet | null; }[] = await db.select() * .from(users) * .fullJoin(pets, eq(users.id, pets.ownerId)) * * // Select userId and petId * const usersIdsAndPetIds: { userId: number | null; petId: number | null; }[] = await db.select({ * userId: users.id, * petId: pets.id, * }) * .from(users) * .fullJoin(pets, eq(users.id, pets.ownerId)) * ``` */ fullJoin = this.createJoin("full"); /** * Executes a `cross join` operation by combining rows from two tables into a new table. * * Calling this method retrieves all rows from both main and joined tables, merging all rows from each table. * * See docs: {@link https://orm.drizzle.team/docs/joins#cross-join} * * @param table the table to join. * * @example * * ```ts * // Select all users, each user with every pet * const usersWithPets: { user: User; pets: Pet; }[] = await db.select() * .from(users) * .crossJoin(pets) * * // Select userId and petId * const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({ * userId: users.id, * petId: pets.id, * }) * .from(users) * .crossJoin(pets) * ``` */ crossJoin = this.createJoin("cross"); createSetOperator(type, isAll) { return (rightSelection) => { const rightSelect = typeof rightSelection === "function" ? rightSelection(getSQLiteSetOperators()) : rightSelection; if (!haveSameKeys(this.getSelectedFields(), rightSelect.getSelectedFields())) { throw new Error( "Set operator error (union / intersect / except): selected fields are not the same or are in a different order" ); } this.config.setOperators.push({ type, isAll, rightSelect }); return this; }; } /** * Adds `union` set operator to the query. * * Calling this method will combine the result sets of the `select` statements and remove any duplicate rows that appear across them. * * See docs: {@link https://orm.drizzle.team/docs/set-operations#union} * * @example * * ```ts * // Select all unique names from customers and users tables * await db.select({ name: users.name }) * .from(users) * .union( * db.select({ name: customers.name }).from(customers) * ); * // or * import { union } from 'drizzle-orm/sqlite-core' * * await union( * db.select({ name: users.name }).from(users), * db.select({ name: customers.name }).from(customers) * ); * ``` */ union = this.createSetOperator("union", false); /** * Adds `union all` set operator to the query. * * Calling this method will combine the result-set of the `select` statements and keep all duplicate rows that appear across them. * * See docs: {@link https://orm.drizzle.team/docs/set-operations#union-all} * * @example * * ```ts * // Select all transaction ids from both online and in-store sales * await db.select({ transaction: onlineSales.transactionId }) * .from(onlineSales) * .unionAll( * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales) * ); * // or * import { unionAll } from 'drizzle-orm/sqlite-core' * * await unionAll( * db.select({ transaction: onlineSales.transactionId }).from(onlineSales), * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales) * ); * ``` */ unionAll = this.createSetOperator("union", true); /** * Adds `intersect` set operator to the query. * * Calling this method will retain only the rows that are present in both result sets and eliminate duplicates. * * See docs: {@link https://orm.drizzle.team/docs/set-operations#intersect} * * @example * * ```ts * // Select course names that are offered in both departments A and B * await db.select({ courseName: depA.courseName }) * .from(depA) * .intersect( * db.select({ courseName: depB.courseName }).from(depB) * ); * // or * import { intersect } from 'drizzle-orm/sqlite-core' * * await intersect( * db.select({ courseName: depA.courseName }).from(depA), * db.select({ courseName: depB.courseName }).from(depB) * ); * ``` */ intersect = this.createSetOperator("intersect", false); /** * Adds `except` set operator to the query. * * Calling this method will retrieve all unique rows from the left query, except for the rows that are present in the result set of the right query. * * See docs: {@link https://orm.drizzle.team/docs/set-operations#except} * * @example * * ```ts * // Select all courses offered in department A but not in department B * await db.select({ courseName: depA.courseName }) * .from(depA) * .except( * db.select({ courseName: depB.courseName }).from(depB) * ); * // or * import { except } from 'drizzle-orm/sqlite-core' * * await except( * db.select({ courseName: depA.courseName }).from(depA), * db.select({ courseName: depB.courseName }).from(depB) * ); * ``` */ except = this.createSetOperator("except", false); /** @internal */ addSetOperators(setOperators) { this.config.setOperators.push(...setOperators); return this; } /** * Adds a `where` clause to the query. * * Calling this method will select only those rows that fulfill a specified condition. * * See docs: {@link https://orm.drizzle.team/docs/select#filtering} * * @param where the `where` clause. * * @example * You can use conditional operators and `sql function` to filter the rows to be selected. * * ```ts * // Select all cars with green color * await db.select().from(cars).where(eq(cars.color, 'green')); * // or * await db.select().from(cars).where(sql`${cars.color} = 'green'`) * ``` * * You can logically combine conditional operators with `and()` and `or()` operators: * * ```ts * // Select all BMW cars with a green color * await db.select().from(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); * * // Select all cars with the green or blue color * await db.select().from(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); * ``` */ where(where) { if (typeof where === "function") { where = where( new Proxy( this.config.fields, new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) ) ); } this.config.where = where; return this; } /** * Adds a `having` clause to the query. * * Calling this method will select only those rows that fulfill a specified condition. It is typically used with aggregate functions to filter the aggregated data based on a specified condition. * * See docs: {@link https://orm.drizzle.team/docs/select#aggregations} * * @param having the `having` clause. * * @example * * ```ts * // Select all brands with more than one car * await db.select({ * brand: cars.brand, * count: sql`cast(count(${cars.id}) as int)`, * }) * .from(cars) * .groupBy(cars.brand) * .having(({ count }) => gt(count, 1)); * ``` */ having(having) { if (typeof having === "function") { having = having( new Proxy( this.config.fields, new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) ) ); } this.config.having = having; return this; } groupBy(...columns) { if (typeof columns[0] === "function") { const groupBy = columns[0]( new Proxy( this.config.fields, new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) ) ); this.config.groupBy = Array.isArray(groupBy) ? groupBy : [groupBy]; } else { this.config.groupBy = columns; } return this; } orderBy(...columns) { if (typeof columns[0] === "function") { const orderBy = columns[0]( new Proxy( this.config.fields, new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) ) ); const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy]; if (this.config.setOperators.length > 0) { this.config.setOperators.at(-1).orderBy = orderByArray; } else { this.config.orderBy = orderByArray; } } else { const orderByArray = columns; if (this.config.setOperators.length > 0) { this.config.setOperators.at(-1).orderBy = orderByArray; } else { this.config.orderBy = orderByArray; } } return this; } /** * Adds a `limit` clause to the query. * * Calling this method will set the maximum number of rows that will be returned by this query. * * See docs: {@link https://orm.drizzle.team/docs/select#limit--offset} * * @param limit the `limit` clause. * * @example * * ```ts * // Get the first 10 people from this query. * await db.select().from(people).limit(10); * ``` */ limit(limit) { if (this.config.setOperators.length > 0) { this.config.setOperators.at(-1).limit = limit; } else { this.config.limit = limit; } return this; } /** * Adds an `offset` clause to the query. * * Calling this method will skip a number of rows when returning results from this query. * * See docs: {@link https://orm.drizzle.team/docs/select#limit--offset} * * @param offset the `offset` clause. * * @example * * ```ts * // Get the 10th-20th people from this query. * await db.select().from(people).offset(10).limit(10); * ``` */ offset(offset) { if (this.config.setOperators.length > 0) { this.config.setOperators.at(-1).offset = offset; } else { this.config.offset = offset; } return this; } /** @internal */ getSQL() { return this.dialect.buildSelectQuery(this.config); } toSQL() { const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL()); return rest; } as(alias) { const usedTables = []; usedTables.push(...extractUsedTable(this.config.table)); if (this.config.joins) { for (const it of this.config.joins) usedTables.push(...extractUsedTable(it.table)); } return new Proxy( new Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]), new SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" }) ); } /** @internal */ getSelectedFields() { return new Proxy( this.config.fields, new SelectionProxyHandler({ alias: this.tableName, sqlAliasedBehavior: "alias", sqlBehavior: "error" }) ); } $dynamic() { return this; } }; __name(SQLiteSelectQueryBuilderBase, "SQLiteSelectQueryBuilderBase"); _a96 = entityKind; __publicField(SQLiteSelectQueryBuilderBase, _a96, "SQLiteSelectQueryBuilder"); SQLiteSelectBase = class extends SQLiteSelectQueryBuilderBase { /** @internal */ _prepare(isOneTimeQuery = true) { if (!this.session) { throw new Error("Cannot execute a query on a query builder. Please use a database instance instead."); } const fieldsList = orderSelectedFields(this.config.fields); const query = this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( this.dialect.sqlToQuery(this.getSQL()), fieldsList, "all", true, void 0, { type: "select", tables: [...this.usedTables] }, this.cacheConfig ); query.joinsNotNullableMap = this.joinsNotNullableMap; return query; } $withCache(config3) { this.cacheConfig = config3 === void 0 ? { config: {}, enable: true, autoInvalidate: true } : config3 === false ? { enable: false } : { enable: true, autoInvalidate: true, ...config3 }; return this; } prepare() { return this._prepare(false); } run = (placeholderValues) => { return this._prepare().run(placeholderValues); }; all = (placeholderValues) => { return this._prepare().all(placeholderValues); }; get = (placeholderValues) => { return this._prepare().get(placeholderValues); }; values = (placeholderValues) => { return this._prepare().values(placeholderValues); }; async execute() { return this.all(); } }; __name(SQLiteSelectBase, "SQLiteSelectBase"); _a97 = entityKind; __publicField(SQLiteSelectBase, _a97, "SQLiteSelect"); applyMixins(SQLiteSelectBase, [QueryPromise]); __name(createSetOperator, "createSetOperator"); getSQLiteSetOperators = /* @__PURE__ */ __name(() => ({ union, unionAll, intersect, except }), "getSQLiteSetOperators"); union = createSetOperator("union", false); unionAll = createSetOperator("union", true); intersect = createSetOperator("intersect", false); except = createSetOperator("except", false); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/query-builder.js var _a98, QueryBuilder; var init_query_builder2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/query-builder.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_selection_proxy(); init_dialect(); init_subquery(); init_select2(); QueryBuilder = class { dialect; dialectConfig; constructor(dialect) { this.dialect = is(dialect, SQLiteDialect) ? dialect : void 0; this.dialectConfig = is(dialect, SQLiteDialect) ? void 0 : dialect; } $with = (alias, selection) => { const queryBuilder = this; const as2 = /* @__PURE__ */ __name((qb) => { if (typeof qb === "function") { qb = qb(queryBuilder); } return new Proxy( new WithSubquery( qb.getSQL(), selection ?? ("getSelectedFields" in qb ? qb.getSelectedFields() ?? {} : {}), alias, true ), new SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" }) ); }, "as"); return { as: as2 }; }; with(...queries) { const self2 = this; function select(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: void 0, dialect: self2.getDialect(), withList: queries }); } __name(select, "select"); function selectDistinct(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: void 0, dialect: self2.getDialect(), withList: queries, distinct: true }); } __name(selectDistinct, "selectDistinct"); return { select, selectDistinct }; } select(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: void 0, dialect: this.getDialect() }); } selectDistinct(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: void 0, dialect: this.getDialect(), distinct: true }); } // Lazy load dialect to avoid circular dependency getDialect() { if (!this.dialect) { this.dialect = new SQLiteSyncDialect(this.dialectConfig); } return this.dialect; } }; __name(QueryBuilder, "QueryBuilder"); _a98 = entityKind; __publicField(QueryBuilder, _a98, "SQLiteQueryBuilder"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/insert.js var _a99, SQLiteInsertBuilder, _a100, SQLiteInsertBase; var init_insert = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/insert.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_query_promise(); init_sql(); init_table3(); init_table(); init_utils2(); init_utils3(); init_query_builder2(); SQLiteInsertBuilder = class { constructor(table3, session, dialect, withList) { this.table = table3; this.session = session; this.dialect = dialect; this.withList = withList; } values(values) { values = Array.isArray(values) ? values : [values]; if (values.length === 0) { throw new Error("values() must be called with at least one value"); } const mappedValues = values.map((entry) => { const result = {}; const cols = this.table[Table.Symbol.Columns]; for (const colKey of Object.keys(entry)) { const colValue = entry[colKey]; result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]); } return result; }); return new SQLiteInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList); } select(selectQuery) { const select = typeof selectQuery === "function" ? selectQuery(new QueryBuilder()) : selectQuery; if (!is(select, SQL) && !haveSameKeys(this.table[Columns], select._.selectedFields)) { throw new Error( "Insert select error: selected fields are not the same or are in a different order compared to the table definition" ); } return new SQLiteInsertBase(this.table, select, this.session, this.dialect, this.withList, true); } }; __name(SQLiteInsertBuilder, "SQLiteInsertBuilder"); _a99 = entityKind; __publicField(SQLiteInsertBuilder, _a99, "SQLiteInsertBuilder"); SQLiteInsertBase = class extends QueryPromise { constructor(table3, values, session, dialect, withList, select) { super(); this.session = session; this.dialect = dialect; this.config = { table: table3, values, withList, select }; } /** @internal */ config; returning(fields = this.config.table[SQLiteTable.Symbol.Columns]) { this.config.returning = orderSelectedFields(fields); return this; } /** * Adds an `on conflict do nothing` clause to the query. * * Calling this method simply avoids inserting a row as its alternative action. * * See docs: {@link https://orm.drizzle.team/docs/insert#on-conflict-do-nothing} * * @param config The `target` and `where` clauses. * * @example * ```ts * // Insert one row and cancel the insert if there's a conflict * await db.insert(cars) * .values({ id: 1, brand: 'BMW' }) * .onConflictDoNothing(); * * // Explicitly specify conflict target * await db.insert(cars) * .values({ id: 1, brand: 'BMW' }) * .onConflictDoNothing({ target: cars.id }); * ``` */ onConflictDoNothing(config3 = {}) { if (!this.config.onConflict) this.config.onConflict = []; if (config3.target === void 0) { this.config.onConflict.push(sql` on conflict do nothing`); } else { const targetSql = Array.isArray(config3.target) ? sql`${config3.target}` : sql`${[config3.target]}`; const whereSql = config3.where ? sql` where ${config3.where}` : sql``; this.config.onConflict.push(sql` on conflict ${targetSql} do nothing${whereSql}`); } return this; } /** * Adds an `on conflict do update` clause to the query. * * Calling this method will update the existing row that conflicts with the row proposed for insertion as its alternative action. * * See docs: {@link https://orm.drizzle.team/docs/insert#upserts-and-conflicts} * * @param config The `target`, `set` and `where` clauses. * * @example * ```ts * // Update the row if there's a conflict * await db.insert(cars) * .values({ id: 1, brand: 'BMW' }) * .onConflictDoUpdate({ * target: cars.id, * set: { brand: 'Porsche' } * }); * * // Upsert with 'where' clause * await db.insert(cars) * .values({ id: 1, brand: 'BMW' }) * .onConflictDoUpdate({ * target: cars.id, * set: { brand: 'newBMW' }, * where: sql`${cars.createdAt} > '2023-01-01'::date`, * }); * ``` */ onConflictDoUpdate(config3) { if (config3.where && (config3.targetWhere || config3.setWhere)) { throw new Error( 'You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.' ); } if (!this.config.onConflict) this.config.onConflict = []; const whereSql = config3.where ? sql` where ${config3.where}` : void 0; const targetWhereSql = config3.targetWhere ? sql` where ${config3.targetWhere}` : void 0; const setWhereSql = config3.setWhere ? sql` where ${config3.setWhere}` : void 0; const targetSql = Array.isArray(config3.target) ? sql`${config3.target}` : sql`${[config3.target]}`; const setSql = this.dialect.buildUpdateSet(this.config.table, mapUpdateSet(this.config.table, config3.set)); this.config.onConflict.push( sql` on conflict ${targetSql}${targetWhereSql} do update set ${setSql}${whereSql}${setWhereSql}` ); return this; } /** @internal */ getSQL() { return this.dialect.buildInsertQuery(this.config); } toSQL() { const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL()); return rest; } /** @internal */ _prepare(isOneTimeQuery = true) { return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( this.dialect.sqlToQuery(this.getSQL()), this.config.returning, this.config.returning ? "all" : "run", true, void 0, { type: "insert", tables: extractUsedTable(this.config.table) } ); } prepare() { return this._prepare(false); } run = (placeholderValues) => { return this._prepare().run(placeholderValues); }; all = (placeholderValues) => { return this._prepare().all(placeholderValues); }; get = (placeholderValues) => { return this._prepare().get(placeholderValues); }; values = (placeholderValues) => { return this._prepare().values(placeholderValues); }; async execute() { return this.config.returning ? this.all() : this.run(); } $dynamic() { return this; } }; __name(SQLiteInsertBase, "SQLiteInsertBase"); _a100 = entityKind; __publicField(SQLiteInsertBase, _a100, "SQLiteInsert"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js var init_select_types = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/update.js var _a101, SQLiteUpdateBuilder, _a102, SQLiteUpdateBase; var init_update = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/update.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_query_promise(); init_selection_proxy(); init_table3(); init_subquery(); init_table(); init_utils2(); init_view_common(); init_utils3(); init_view_base(); SQLiteUpdateBuilder = class { constructor(table3, session, dialect, withList) { this.table = table3; this.session = session; this.dialect = dialect; this.withList = withList; } set(values) { return new SQLiteUpdateBase( this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList ); } }; __name(SQLiteUpdateBuilder, "SQLiteUpdateBuilder"); _a101 = entityKind; __publicField(SQLiteUpdateBuilder, _a101, "SQLiteUpdateBuilder"); SQLiteUpdateBase = class extends QueryPromise { constructor(table3, set2, session, dialect, withList) { super(); this.session = session; this.dialect = dialect; this.config = { set: set2, table: table3, withList, joins: [] }; } /** @internal */ config; from(source) { this.config.from = source; return this; } createJoin(joinType) { return (table3, on2) => { const tableName = getTableLikeName(table3); if (typeof tableName === "string" && this.config.joins.some((join) => join.alias === tableName)) { throw new Error(`Alias "${tableName}" is already used in this query`); } if (typeof on2 === "function") { const from = this.config.from ? is(table3, SQLiteTable) ? table3[Table.Symbol.Columns] : is(table3, Subquery) ? table3._.selectedFields : is(table3, SQLiteViewBase) ? table3[ViewBaseConfig].selectedFields : void 0 : void 0; on2 = on2( new Proxy( this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) ), from && new Proxy( from, new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) ) ); } this.config.joins.push({ on: on2, table: table3, joinType, alias: tableName }); return this; }; } leftJoin = this.createJoin("left"); rightJoin = this.createJoin("right"); innerJoin = this.createJoin("inner"); fullJoin = this.createJoin("full"); /** * Adds a 'where' clause to the query. * * Calling this method will update only those rows that fulfill a specified condition. * * See docs: {@link https://orm.drizzle.team/docs/update} * * @param where the 'where' clause. * * @example * You can use conditional operators and `sql function` to filter the rows to be updated. * * ```ts * // Update all cars with green color * db.update(cars).set({ color: 'red' }) * .where(eq(cars.color, 'green')); * // or * db.update(cars).set({ color: 'red' }) * .where(sql`${cars.color} = 'green'`) * ``` * * You can logically combine conditional operators with `and()` and `or()` operators: * * ```ts * // Update all BMW cars with a green color * db.update(cars).set({ color: 'red' }) * .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); * * // Update all cars with the green or blue color * db.update(cars).set({ color: 'red' }) * .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); * ``` */ where(where) { this.config.where = where; return this; } orderBy(...columns) { if (typeof columns[0] === "function") { const orderBy = columns[0]( new Proxy( this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) ) ); const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy]; this.config.orderBy = orderByArray; } else { const orderByArray = columns; this.config.orderBy = orderByArray; } return this; } limit(limit) { this.config.limit = limit; return this; } returning(fields = this.config.table[SQLiteTable.Symbol.Columns]) { this.config.returning = orderSelectedFields(fields); return this; } /** @internal */ getSQL() { return this.dialect.buildUpdateQuery(this.config); } toSQL() { const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL()); return rest; } /** @internal */ _prepare(isOneTimeQuery = true) { return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( this.dialect.sqlToQuery(this.getSQL()), this.config.returning, this.config.returning ? "all" : "run", true, void 0, { type: "insert", tables: extractUsedTable(this.config.table) } ); } prepare() { return this._prepare(false); } run = (placeholderValues) => { return this._prepare().run(placeholderValues); }; all = (placeholderValues) => { return this._prepare().all(placeholderValues); }; get = (placeholderValues) => { return this._prepare().get(placeholderValues); }; values = (placeholderValues) => { return this._prepare().values(placeholderValues); }; async execute() { return this.config.returning ? this.all() : this.run(); } $dynamic() { return this; } }; __name(SQLiteUpdateBase, "SQLiteUpdateBase"); _a102 = entityKind; __publicField(SQLiteUpdateBase, _a102, "SQLiteUpdate"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/index.js var init_query_builders = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_delete(); init_insert(); init_query_builder2(); init_select2(); init_select_types(); init_update(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/count.js var _a103, _SQLiteCountBuilder, SQLiteCountBuilder; var init_count = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/count.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_sql(); _SQLiteCountBuilder = class extends SQL { constructor(params) { super(_SQLiteCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks); this.params = params; this.session = params.session; this.sql = _SQLiteCountBuilder.buildCount( params.source, params.filters ); } sql; [(_a103 = entityKind, Symbol.toStringTag)] = "SQLiteCountBuilderAsync"; session; static buildEmbeddedCount(source, filters) { return sql`(select count(*) from ${source}${sql.raw(" where ").if(filters)}${filters})`; } static buildCount(source, filters) { return sql`select count(*) from ${source}${sql.raw(" where ").if(filters)}${filters}`; } then(onfulfilled, onrejected) { return Promise.resolve(this.session.count(this.sql)).then( onfulfilled, onrejected ); } catch(onRejected) { return this.then(void 0, onRejected); } finally(onFinally) { return this.then( (value) => { onFinally?.(); return value; }, (reason) => { onFinally?.(); throw reason; } ); } }; SQLiteCountBuilder = _SQLiteCountBuilder; __name(SQLiteCountBuilder, "SQLiteCountBuilder"); __publicField(SQLiteCountBuilder, _a103, "SQLiteCountBuilderAsync"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/query.js var _a104, RelationalQueryBuilder, _a105, SQLiteRelationalQuery, _a106, SQLiteSyncRelationalQuery; var init_query = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/query.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_query_promise(); init_relations(); RelationalQueryBuilder = class { constructor(mode, fullSchema, schema, tableNamesMap, table3, tableConfig, dialect, session) { this.mode = mode; this.fullSchema = fullSchema; this.schema = schema; this.tableNamesMap = tableNamesMap; this.table = table3; this.tableConfig = tableConfig; this.dialect = dialect; this.session = session; } findMany(config3) { return this.mode === "sync" ? new SQLiteSyncRelationalQuery( this.fullSchema, this.schema, this.tableNamesMap, this.table, this.tableConfig, this.dialect, this.session, config3 ? config3 : {}, "many" ) : new SQLiteRelationalQuery( this.fullSchema, this.schema, this.tableNamesMap, this.table, this.tableConfig, this.dialect, this.session, config3 ? config3 : {}, "many" ); } findFirst(config3) { return this.mode === "sync" ? new SQLiteSyncRelationalQuery( this.fullSchema, this.schema, this.tableNamesMap, this.table, this.tableConfig, this.dialect, this.session, config3 ? { ...config3, limit: 1 } : { limit: 1 }, "first" ) : new SQLiteRelationalQuery( this.fullSchema, this.schema, this.tableNamesMap, this.table, this.tableConfig, this.dialect, this.session, config3 ? { ...config3, limit: 1 } : { limit: 1 }, "first" ); } }; __name(RelationalQueryBuilder, "RelationalQueryBuilder"); _a104 = entityKind; __publicField(RelationalQueryBuilder, _a104, "SQLiteAsyncRelationalQueryBuilder"); SQLiteRelationalQuery = class extends QueryPromise { constructor(fullSchema, schema, tableNamesMap, table3, tableConfig, dialect, session, config3, mode) { super(); this.fullSchema = fullSchema; this.schema = schema; this.tableNamesMap = tableNamesMap; this.table = table3; this.tableConfig = tableConfig; this.dialect = dialect; this.session = session; this.config = config3; this.mode = mode; } /** @internal */ mode; /** @internal */ getSQL() { return this.dialect.buildRelationalQuery({ fullSchema: this.fullSchema, schema: this.schema, tableNamesMap: this.tableNamesMap, table: this.table, tableConfig: this.tableConfig, queryConfig: this.config, tableAlias: this.tableConfig.tsName }).sql; } /** @internal */ _prepare(isOneTimeQuery = false) { const { query, builtQuery } = this._toSQL(); return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( builtQuery, void 0, this.mode === "first" ? "get" : "all", true, (rawRows, mapColumnValue) => { const rows = rawRows.map( (row) => mapRelationalRow(this.schema, this.tableConfig, row, query.selection, mapColumnValue) ); if (this.mode === "first") { return rows[0]; } return rows; } ); } prepare() { return this._prepare(false); } _toSQL() { const query = this.dialect.buildRelationalQuery({ fullSchema: this.fullSchema, schema: this.schema, tableNamesMap: this.tableNamesMap, table: this.table, tableConfig: this.tableConfig, queryConfig: this.config, tableAlias: this.tableConfig.tsName }); const builtQuery = this.dialect.sqlToQuery(query.sql); return { query, builtQuery }; } toSQL() { return this._toSQL().builtQuery; } /** @internal */ executeRaw() { if (this.mode === "first") { return this._prepare(false).get(); } return this._prepare(false).all(); } async execute() { return this.executeRaw(); } }; __name(SQLiteRelationalQuery, "SQLiteRelationalQuery"); _a105 = entityKind; __publicField(SQLiteRelationalQuery, _a105, "SQLiteAsyncRelationalQuery"); SQLiteSyncRelationalQuery = class extends SQLiteRelationalQuery { sync() { return this.executeRaw(); } }; __name(SQLiteSyncRelationalQuery, "SQLiteSyncRelationalQuery"); _a106 = entityKind; __publicField(SQLiteSyncRelationalQuery, _a106, "SQLiteSyncRelationalQuery"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/raw.js var _a107, SQLiteRaw; var init_raw = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/query-builders/raw.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_query_promise(); SQLiteRaw = class extends QueryPromise { constructor(execute, getSQL, action, dialect, mapBatchResult) { super(); this.execute = execute; this.getSQL = getSQL; this.dialect = dialect; this.mapBatchResult = mapBatchResult; this.config = { action }; } /** @internal */ config; getQuery() { return { ...this.dialect.sqlToQuery(this.getSQL()), method: this.config.action }; } mapResult(result, isFromBatch) { return isFromBatch ? this.mapBatchResult(result) : result; } _prepare() { return this; } /** @internal */ isResponseInArrayMode() { return false; } }; __name(SQLiteRaw, "SQLiteRaw"); _a107 = entityKind; __publicField(SQLiteRaw, _a107, "SQLiteRaw"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/db.js var _a108, BaseSQLiteDatabase; var init_db = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/db.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_selection_proxy(); init_sql(); init_query_builders(); init_subquery(); init_count(); init_query(); init_raw(); BaseSQLiteDatabase = class { constructor(resultKind, dialect, session, schema) { this.resultKind = resultKind; this.dialect = dialect; this.session = session; this._ = schema ? { schema: schema.schema, fullSchema: schema.fullSchema, tableNamesMap: schema.tableNamesMap } : { schema: void 0, fullSchema: {}, tableNamesMap: {} }; this.query = {}; const query = this.query; if (this._.schema) { for (const [tableName, columns] of Object.entries(this._.schema)) { query[tableName] = new RelationalQueryBuilder( resultKind, schema.fullSchema, this._.schema, this._.tableNamesMap, schema.fullSchema[tableName], columns, dialect, session ); } } this.$cache = { invalidate: async (_params) => { } }; } query; /** * Creates a subquery that defines a temporary named result set as a CTE. * * It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query. * * See docs: {@link https://orm.drizzle.team/docs/select#with-clause} * * @param alias The alias for the subquery. * * Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries. * * @example * * ```ts * // Create a subquery with alias 'sq' and use it in the select query * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42))); * * const result = await db.with(sq).select().from(sq); * ``` * * To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them: * * ```ts * // Select an arbitrary SQL value as a field in a CTE and reference it in the main query * const sq = db.$with('sq').as(db.select({ * name: sql`upper(${users.name})`.as('name'), * }) * .from(users)); * * const result = await db.with(sq).select({ name: sq.name }).from(sq); * ``` */ $with = (alias, selection) => { const self2 = this; const as2 = /* @__PURE__ */ __name((qb) => { if (typeof qb === "function") { qb = qb(new QueryBuilder(self2.dialect)); } return new Proxy( new WithSubquery( qb.getSQL(), selection ?? ("getSelectedFields" in qb ? qb.getSelectedFields() ?? {} : {}), alias, true ), new SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" }) ); }, "as"); return { as: as2 }; }; $count(source, filters) { return new SQLiteCountBuilder({ source, filters, session: this.session }); } /** * Incorporates a previously defined CTE (using `$with`) into the main query. * * This method allows the main query to reference a temporary named result set. * * See docs: {@link https://orm.drizzle.team/docs/select#with-clause} * * @param queries The CTEs to incorporate into the main query. * * @example * * ```ts * // Define a subquery 'sq' as a CTE using $with * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42))); * * // Incorporate the CTE 'sq' into the main query and select from it * const result = await db.with(sq).select().from(sq); * ``` */ with(...queries) { const self2 = this; function select(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: self2.session, dialect: self2.dialect, withList: queries }); } __name(select, "select"); function selectDistinct(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: self2.session, dialect: self2.dialect, withList: queries, distinct: true }); } __name(selectDistinct, "selectDistinct"); function update(table3) { return new SQLiteUpdateBuilder(table3, self2.session, self2.dialect, queries); } __name(update, "update"); function insert(into) { return new SQLiteInsertBuilder(into, self2.session, self2.dialect, queries); } __name(insert, "insert"); function delete_(from) { return new SQLiteDeleteBase(from, self2.session, self2.dialect, queries); } __name(delete_, "delete_"); return { select, selectDistinct, update, insert, delete: delete_ }; } select(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: this.session, dialect: this.dialect }); } selectDistinct(fields) { return new SQLiteSelectBuilder({ fields: fields ?? void 0, session: this.session, dialect: this.dialect, distinct: true }); } /** * Creates an update query. * * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated. * * Use `.set()` method to specify which values to update. * * See docs: {@link https://orm.drizzle.team/docs/update} * * @param table The table to update. * * @example * * ```ts * // Update all rows in the 'cars' table * await db.update(cars).set({ color: 'red' }); * * // Update rows with filters and conditions * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW')); * * // Update with returning clause * const updatedCar: Car[] = await db.update(cars) * .set({ color: 'red' }) * .where(eq(cars.id, 1)) * .returning(); * ``` */ update(table3) { return new SQLiteUpdateBuilder(table3, this.session, this.dialect); } $cache; /** * Creates an insert query. * * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert. * * See docs: {@link https://orm.drizzle.team/docs/insert} * * @param table The table to insert into. * * @example * * ```ts * // Insert one row * await db.insert(cars).values({ brand: 'BMW' }); * * // Insert multiple rows * await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]); * * // Insert with returning clause * const insertedCar: Car[] = await db.insert(cars) * .values({ brand: 'BMW' }) * .returning(); * ``` */ insert(into) { return new SQLiteInsertBuilder(into, this.session, this.dialect); } /** * Creates a delete query. * * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted. * * See docs: {@link https://orm.drizzle.team/docs/delete} * * @param table The table to delete from. * * @example * * ```ts * // Delete all rows in the 'cars' table * await db.delete(cars); * * // Delete rows with filters and conditions * await db.delete(cars).where(eq(cars.color, 'green')); * * // Delete with returning clause * const deletedCar: Car[] = await db.delete(cars) * .where(eq(cars.id, 1)) * .returning(); * ``` */ delete(from) { return new SQLiteDeleteBase(from, this.session, this.dialect); } run(query) { const sequel = typeof query === "string" ? sql.raw(query) : query.getSQL(); if (this.resultKind === "async") { return new SQLiteRaw( async () => this.session.run(sequel), () => sequel, "run", this.dialect, this.session.extractRawRunValueFromBatchResult.bind(this.session) ); } return this.session.run(sequel); } all(query) { const sequel = typeof query === "string" ? sql.raw(query) : query.getSQL(); if (this.resultKind === "async") { return new SQLiteRaw( async () => this.session.all(sequel), () => sequel, "all", this.dialect, this.session.extractRawAllValueFromBatchResult.bind(this.session) ); } return this.session.all(sequel); } get(query) { const sequel = typeof query === "string" ? sql.raw(query) : query.getSQL(); if (this.resultKind === "async") { return new SQLiteRaw( async () => this.session.get(sequel), () => sequel, "get", this.dialect, this.session.extractRawGetValueFromBatchResult.bind(this.session) ); } return this.session.get(sequel); } values(query) { const sequel = typeof query === "string" ? sql.raw(query) : query.getSQL(); if (this.resultKind === "async") { return new SQLiteRaw( async () => this.session.values(sequel), () => sequel, "values", this.dialect, this.session.extractRawValuesValueFromBatchResult.bind(this.session) ); } return this.session.values(sequel); } transaction(transaction, config3) { return this.session.transaction(transaction, config3); } }; __name(BaseSQLiteDatabase, "BaseSQLiteDatabase"); _a108 = entityKind; __publicField(BaseSQLiteDatabase, _a108, "BaseSQLiteDatabase"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/cache/core/cache.js async function hashQuery(sql2, params) { const dataToHash = `${sql2}-${JSON.stringify(params)}`; const encoder2 = new TextEncoder(); const data = encoder2.encode(dataToHash); const hashBuffer = await crypto.subtle.digest("SHA-256", data); const hashArray = [...new Uint8Array(hashBuffer)]; const hashHex = hashArray.map((b2) => b2.toString(16).padStart(2, "0")).join(""); return hashHex; } var _a109, Cache, _a110, NoopCache; var init_cache = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/cache/core/cache.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); Cache = class { }; __name(Cache, "Cache"); _a109 = entityKind; __publicField(Cache, _a109, "Cache"); NoopCache = class extends Cache { strategy() { return "all"; } async get(_key2) { return void 0; } async put(_hashedQuery, _response, _tables, _config) { } async onMutate(_params) { } }; __name(NoopCache, "NoopCache"); _a110 = entityKind; __publicField(NoopCache, _a110, "NoopCache"); __name(hashQuery, "hashQuery"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/cache/core/index.js var init_core = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/cache/core/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_cache(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/alias.js var init_alias2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/alias.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/session.js var _a111, ExecuteResultSync, _a112, SQLitePreparedQuery, _a113, SQLiteSession, _a114, SQLiteTransaction; var init_session = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/session.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_cache(); init_entity(); init_errors(); init_query_promise(); init_db(); ExecuteResultSync = class extends QueryPromise { constructor(resultCb) { super(); this.resultCb = resultCb; } async execute() { return this.resultCb(); } sync() { return this.resultCb(); } }; __name(ExecuteResultSync, "ExecuteResultSync"); _a111 = entityKind; __publicField(ExecuteResultSync, _a111, "ExecuteResultSync"); SQLitePreparedQuery = class { constructor(mode, executeMethod, query, cache3, queryMetadata, cacheConfig) { this.mode = mode; this.executeMethod = executeMethod; this.query = query; this.cache = cache3; this.queryMetadata = queryMetadata; this.cacheConfig = cacheConfig; if (cache3 && cache3.strategy() === "all" && cacheConfig === void 0) { this.cacheConfig = { enable: true, autoInvalidate: true }; } if (!this.cacheConfig?.enable) { this.cacheConfig = void 0; } } /** @internal */ joinsNotNullableMap; /** @internal */ async queryWithCache(queryString, params, query) { if (this.cache === void 0 || is(this.cache, NoopCache) || this.queryMetadata === void 0) { try { return await query(); } catch (e2) { throw new DrizzleQueryError(queryString, params, e2); } } if (this.cacheConfig && !this.cacheConfig.enable) { try { return await query(); } catch (e2) { throw new DrizzleQueryError(queryString, params, e2); } } if ((this.queryMetadata.type === "insert" || this.queryMetadata.type === "update" || this.queryMetadata.type === "delete") && this.queryMetadata.tables.length > 0) { try { const [res] = await Promise.all([ query(), this.cache.onMutate({ tables: this.queryMetadata.tables }) ]); return res; } catch (e2) { throw new DrizzleQueryError(queryString, params, e2); } } if (!this.cacheConfig) { try { return await query(); } catch (e2) { throw new DrizzleQueryError(queryString, params, e2); } } if (this.queryMetadata.type === "select") { const fromCache = await this.cache.get( this.cacheConfig.tag ?? await hashQuery(queryString, params), this.queryMetadata.tables, this.cacheConfig.tag !== void 0, this.cacheConfig.autoInvalidate ); if (fromCache === void 0) { let result; try { result = await query(); } catch (e2) { throw new DrizzleQueryError(queryString, params, e2); } await this.cache.put( this.cacheConfig.tag ?? await hashQuery(queryString, params), result, // make sure we send tables that were used in a query only if user wants to invalidate it on each write this.cacheConfig.autoInvalidate ? this.queryMetadata.tables : [], this.cacheConfig.tag !== void 0, this.cacheConfig.config ); return result; } return fromCache; } try { return await query(); } catch (e2) { throw new DrizzleQueryError(queryString, params, e2); } } getQuery() { return this.query; } mapRunResult(result, _isFromBatch) { return result; } mapAllResult(_result, _isFromBatch) { throw new Error("Not implemented"); } mapGetResult(_result, _isFromBatch) { throw new Error("Not implemented"); } execute(placeholderValues) { if (this.mode === "async") { return this[this.executeMethod](placeholderValues); } return new ExecuteResultSync(() => this[this.executeMethod](placeholderValues)); } mapResult(response, isFromBatch) { switch (this.executeMethod) { case "run": { return this.mapRunResult(response, isFromBatch); } case "all": { return this.mapAllResult(response, isFromBatch); } case "get": { return this.mapGetResult(response, isFromBatch); } } } }; __name(SQLitePreparedQuery, "SQLitePreparedQuery"); _a112 = entityKind; __publicField(SQLitePreparedQuery, _a112, "PreparedQuery"); SQLiteSession = class { constructor(dialect) { this.dialect = dialect; } prepareOneTimeQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { return this.prepareQuery( query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig ); } run(query) { const staticQuery = this.dialect.sqlToQuery(query); try { return this.prepareOneTimeQuery(staticQuery, void 0, "run", false).run(); } catch (err) { throw new DrizzleError({ cause: err, message: `Failed to run the query '${staticQuery.sql}'` }); } } /** @internal */ extractRawRunValueFromBatchResult(result) { return result; } all(query) { return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).all(); } /** @internal */ extractRawAllValueFromBatchResult(_result) { throw new Error("Not implemented"); } get(query) { return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).get(); } /** @internal */ extractRawGetValueFromBatchResult(_result) { throw new Error("Not implemented"); } values(query) { return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).values(); } async count(sql2) { const result = await this.values(sql2); return result[0][0]; } /** @internal */ extractRawValuesValueFromBatchResult(_result) { throw new Error("Not implemented"); } }; __name(SQLiteSession, "SQLiteSession"); _a113 = entityKind; __publicField(SQLiteSession, _a113, "SQLiteSession"); SQLiteTransaction = class extends BaseSQLiteDatabase { constructor(resultType, dialect, session, schema, nestedIndex = 0) { super(resultType, dialect, session, schema); this.schema = schema; this.nestedIndex = nestedIndex; } rollback() { throw new TransactionRollbackError(); } }; __name(SQLiteTransaction, "SQLiteTransaction"); _a114 = entityKind; __publicField(SQLiteTransaction, _a114, "SQLiteTransaction"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/subquery.js var init_subquery2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/subquery.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/view.js var _a115, ViewBuilderCore, _a116, ViewBuilder, _a117, ManualViewBuilder, _a118, SQLiteView; var init_view = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/view.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_selection_proxy(); init_utils2(); init_query_builder2(); init_table3(); init_view_base(); ViewBuilderCore = class { constructor(name) { this.name = name; } config = {}; }; __name(ViewBuilderCore, "ViewBuilderCore"); _a115 = entityKind; __publicField(ViewBuilderCore, _a115, "SQLiteViewBuilderCore"); ViewBuilder = class extends ViewBuilderCore { as(qb) { if (typeof qb === "function") { qb = qb(new QueryBuilder()); } const selectionProxy = new SelectionProxyHandler({ alias: this.name, sqlBehavior: "error", sqlAliasedBehavior: "alias", replaceOriginalName: true }); const aliasedSelectedFields = qb.getSelectedFields(); return new Proxy( new SQLiteView({ // sqliteConfig: this.config, config: { name: this.name, schema: void 0, selectedFields: aliasedSelectedFields, query: qb.getSQL().inlineParams() } }), selectionProxy ); } }; __name(ViewBuilder, "ViewBuilder"); _a116 = entityKind; __publicField(ViewBuilder, _a116, "SQLiteViewBuilder"); ManualViewBuilder = class extends ViewBuilderCore { columns; constructor(name, columns) { super(name); this.columns = getTableColumns(sqliteTable(name, columns)); } existing() { return new Proxy( new SQLiteView({ config: { name: this.name, schema: void 0, selectedFields: this.columns, query: void 0 } }), new SelectionProxyHandler({ alias: this.name, sqlBehavior: "error", sqlAliasedBehavior: "alias", replaceOriginalName: true }) ); } as(query) { return new Proxy( new SQLiteView({ config: { name: this.name, schema: void 0, selectedFields: this.columns, query: query.inlineParams() } }), new SelectionProxyHandler({ alias: this.name, sqlBehavior: "error", sqlAliasedBehavior: "alias", replaceOriginalName: true }) ); } }; __name(ManualViewBuilder, "ManualViewBuilder"); _a117 = entityKind; __publicField(ManualViewBuilder, _a117, "SQLiteManualViewBuilder"); SQLiteView = class extends SQLiteViewBase { constructor({ config: config3 }) { super(config3); } }; __name(SQLiteView, "SQLiteView"); _a118 = entityKind; __publicField(SQLiteView, _a118, "SQLiteView"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/index.js var init_sqlite_core = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/sqlite-core/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_alias2(); init_checks(); init_columns(); init_db(); init_dialect(); init_foreign_keys2(); init_indexes(); init_primary_keys2(); init_query_builders(); init_session(); init_subquery2(); init_table3(); init_unique_constraint2(); init_utils3(); init_view(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/d1/session.js function d1ToRawMapping(results) { const rows = []; for (const row of results) { const entry = Object.keys(row).map((k2) => row[k2]); rows.push(entry); } return rows; } var _a119, SQLiteD1Session, _a120, _D1Transaction, D1Transaction, _a121, D1PreparedQuery; var init_session2 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/d1/session.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core(); init_entity(); init_logger2(); init_sql(); init_sqlite_core(); init_session(); init_utils2(); SQLiteD1Session = class extends SQLiteSession { constructor(client, dialect, schema, options = {}) { super(dialect); this.client = client; this.schema = schema; this.options = options; this.logger = options.logger ?? new NoopLogger(); this.cache = options.cache ?? new NoopCache(); } logger; cache; prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { const stmt = this.client.prepare(query.sql); return new D1PreparedQuery( stmt, query, this.logger, this.cache, queryMetadata, cacheConfig, fields, executeMethod, isResponseInArrayMode, customResultMapper ); } async batch(queries) { const preparedQueries = []; const builtQueries = []; for (const query of queries) { const preparedQuery = query._prepare(); const builtQuery = preparedQuery.getQuery(); preparedQueries.push(preparedQuery); if (builtQuery.params.length > 0) { builtQueries.push(preparedQuery.stmt.bind(...builtQuery.params)); } else { const builtQuery2 = preparedQuery.getQuery(); builtQueries.push( this.client.prepare(builtQuery2.sql).bind(...builtQuery2.params) ); } } const batchResults = await this.client.batch(builtQueries); return batchResults.map((result, i2) => preparedQueries[i2].mapResult(result, true)); } extractRawAllValueFromBatchResult(result) { return result.results; } extractRawGetValueFromBatchResult(result) { return result.results[0]; } extractRawValuesValueFromBatchResult(result) { return d1ToRawMapping(result.results); } async transaction(transaction, config3) { const tx = new D1Transaction("async", this.dialect, this, this.schema); await this.run(sql.raw(`begin${config3?.behavior ? " " + config3.behavior : ""}`)); try { const result = await transaction(tx); await this.run(sql`commit`); return result; } catch (err) { await this.run(sql`rollback`); throw err; } } }; __name(SQLiteD1Session, "SQLiteD1Session"); _a119 = entityKind; __publicField(SQLiteD1Session, _a119, "SQLiteD1Session"); _D1Transaction = class extends SQLiteTransaction { async transaction(transaction) { const savepointName = `sp${this.nestedIndex}`; const tx = new _D1Transaction("async", this.dialect, this.session, this.schema, this.nestedIndex + 1); await this.session.run(sql.raw(`savepoint ${savepointName}`)); try { const result = await transaction(tx); await this.session.run(sql.raw(`release savepoint ${savepointName}`)); return result; } catch (err) { await this.session.run(sql.raw(`rollback to savepoint ${savepointName}`)); throw err; } } }; D1Transaction = _D1Transaction; __name(D1Transaction, "D1Transaction"); _a120 = entityKind; __publicField(D1Transaction, _a120, "D1Transaction"); __name(d1ToRawMapping, "d1ToRawMapping"); D1PreparedQuery = class extends SQLitePreparedQuery { constructor(stmt, query, logger3, cache3, queryMetadata, cacheConfig, fields, executeMethod, _isResponseInArrayMode, customResultMapper) { super("async", executeMethod, query, cache3, queryMetadata, cacheConfig); this.logger = logger3; this._isResponseInArrayMode = _isResponseInArrayMode; this.customResultMapper = customResultMapper; this.fields = fields; this.stmt = stmt; } /** @internal */ customResultMapper; /** @internal */ fields; /** @internal */ stmt; async run(placeholderValues) { const params = fillPlaceholders(this.query.params, placeholderValues ?? {}); this.logger.logQuery(this.query.sql, params); return await this.queryWithCache(this.query.sql, params, async () => { return this.stmt.bind(...params).run(); }); } async all(placeholderValues) { const { fields, query, logger: logger3, stmt, customResultMapper } = this; if (!fields && !customResultMapper) { const params = fillPlaceholders(query.params, placeholderValues ?? {}); logger3.logQuery(query.sql, params); return await this.queryWithCache(query.sql, params, async () => { return stmt.bind(...params).all().then(({ results }) => this.mapAllResult(results)); }); } const rows = await this.values(placeholderValues); return this.mapAllResult(rows); } mapAllResult(rows, isFromBatch) { if (isFromBatch) { rows = d1ToRawMapping(rows.results); } if (!this.fields && !this.customResultMapper) { return rows; } if (this.customResultMapper) { return this.customResultMapper(rows); } return rows.map((row) => mapResultRow(this.fields, row, this.joinsNotNullableMap)); } async get(placeholderValues) { const { fields, joinsNotNullableMap, query, logger: logger3, stmt, customResultMapper } = this; if (!fields && !customResultMapper) { const params = fillPlaceholders(query.params, placeholderValues ?? {}); logger3.logQuery(query.sql, params); return await this.queryWithCache(query.sql, params, async () => { return stmt.bind(...params).all().then(({ results }) => results[0]); }); } const rows = await this.values(placeholderValues); if (!rows[0]) { return void 0; } if (customResultMapper) { return customResultMapper(rows); } return mapResultRow(fields, rows[0], joinsNotNullableMap); } mapGetResult(result, isFromBatch) { if (isFromBatch) { result = d1ToRawMapping(result.results)[0]; } if (!this.fields && !this.customResultMapper) { return result; } if (this.customResultMapper) { return this.customResultMapper([result]); } return mapResultRow(this.fields, result, this.joinsNotNullableMap); } async values(placeholderValues) { const params = fillPlaceholders(this.query.params, placeholderValues ?? {}); this.logger.logQuery(this.query.sql, params); return await this.queryWithCache(this.query.sql, params, async () => { return this.stmt.bind(...params).raw(); }); } /** @internal */ isResponseInArrayMode() { return this._isResponseInArrayMode; } }; __name(D1PreparedQuery, "D1PreparedQuery"); _a121 = entityKind; __publicField(D1PreparedQuery, _a121, "D1PreparedQuery"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/d1/driver.js function drizzle(client, config3 = {}) { const dialect = new SQLiteAsyncDialect({ casing: config3.casing }); let logger3; if (config3.logger === true) { logger3 = new DefaultLogger(); } else if (config3.logger !== false) { logger3 = config3.logger; } let schema; if (config3.schema) { const tablesConfig = extractTablesRelationalConfig( config3.schema, createTableRelationsHelpers ); schema = { fullSchema: config3.schema, schema: tablesConfig.tables, tableNamesMap: tablesConfig.tableNamesMap }; } const session = new SQLiteD1Session(client, dialect, schema, { logger: logger3, cache: config3.cache }); const db3 = new DrizzleD1Database("async", dialect, session, schema); db3.$client = client; db3.$cache = config3.cache; if (db3.$cache) { db3.$cache["invalidate"] = config3.cache?.onMutate; } return db3; } var _a122, DrizzleD1Database; var init_driver = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/d1/driver.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_entity(); init_logger2(); init_relations(); init_db(); init_dialect(); init_session2(); DrizzleD1Database = class extends BaseSQLiteDatabase { async batch(batch) { return this.session.batch(batch); } }; __name(DrizzleD1Database, "DrizzleD1Database"); _a122 = entityKind; __publicField(DrizzleD1Database, _a122, "D1Database"); __name(drizzle, "drizzle"); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/d1/index.js var init_d1 = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/d1/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_driver(); init_session2(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/operations.js var init_operations = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/operations.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../packages/db_helper_sqlite/node_modules/drizzle-orm/index.js var init_drizzle_orm = __esm({ "../../packages/db_helper_sqlite/node_modules/drizzle-orm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_alias(); init_column_builder(); init_column(); init_entity(); init_errors(); init_logger2(); init_operations(); init_query_promise(); init_relations(); init_sql2(); init_subquery(); init_table(); init_utils2(); init_view_common(); } }); // ../../packages/db_helper_sqlite/src/db/schema.ts var schema_exports = {}; __export(schema_exports, { addressAreas: () => addressAreas, addressAreasRelations: () => addressAreasRelations, addressZones: () => addressZones, addressZonesRelations: () => addressZonesRelations, addresses: () => addresses, addressesRelations: () => addressesRelations, cartItems: () => cartItems, cartItemsRelations: () => cartItemsRelations, complaints: () => complaints, complaintsRelations: () => complaintsRelations, couponApplicableProducts: () => couponApplicableProducts, couponApplicableProductsRelations: () => couponApplicableProductsRelations, couponApplicableUsers: () => couponApplicableUsers, couponApplicableUsersRelations: () => couponApplicableUsersRelations, couponUsage: () => couponUsage, couponUsageRelations: () => couponUsageRelations, coupons: () => coupons, couponsRelations: () => couponsRelations, deliverySlotInfo: () => deliverySlotInfo, deliverySlotInfoRelations: () => deliverySlotInfoRelations, homeBanners: () => homeBanners, homeBannersRelations: () => homeBannersRelations, keyValStore: () => keyValStore, notifCreds: () => notifCreds, notifCredsRelations: () => notifCredsRelations, notifications: () => notifications, notificationsRelations: () => notificationsRelations, orderItems: () => orderItems, orderItemsRelations: () => orderItemsRelations, orderStatus: () => orderStatus, orderStatusRelations: () => orderStatusRelations, orders: () => orders, ordersRelations: () => ordersRelations, paymentInfoRelations: () => paymentInfoRelations, paymentInfoTable: () => paymentInfoTable, paymentStatusEnum: () => paymentStatusEnum, payments: () => payments, paymentsRelations: () => paymentsRelations, productCategories: () => productCategories, productCategoriesRelations: () => productCategoriesRelations, productGroupInfo: () => productGroupInfo, productGroupInfoRelations: () => productGroupInfoRelations, productGroupMembership: () => productGroupMembership, productGroupMembershipRelations: () => productGroupMembershipRelations, productInfo: () => productInfo, productInfoRelations: () => productInfoRelations, productReviews: () => productReviews, productReviewsRelations: () => productReviewsRelations, productSlots: () => productSlots, productSlotsRelations: () => productSlotsRelations, productTagInfo: () => productTagInfo, productTagInfoRelations: () => productTagInfoRelations, productTags: () => productTags, productTagsRelations: () => productTagsRelations, refunds: () => refunds, refundsRelations: () => refundsRelations, reservedCoupons: () => reservedCoupons, reservedCouponsRelations: () => reservedCouponsRelations, specialDeals: () => specialDeals, specialDealsRelations: () => specialDealsRelations, staffPermissionEnum: () => staffPermissionEnum, staffPermissions: () => staffPermissions, staffPermissionsRelations: () => staffPermissionsRelations, staffRoleEnum: () => staffRoleEnum, staffRolePermissions: () => staffRolePermissions, staffRolePermissionsRelations: () => staffRolePermissionsRelations, staffRoles: () => staffRoles, staffRolesRelations: () => staffRolesRelations, staffUsers: () => staffUsers, staffUsersRelations: () => staffUsersRelations, storeInfo: () => storeInfo, storeInfoRelations: () => storeInfoRelations, units: () => units, unitsRelations: () => unitsRelations, unloggedUserTokens: () => unloggedUserTokens, uploadStatusEnum: () => uploadStatusEnum, uploadUrlStatus: () => uploadUrlStatus, userCreds: () => userCreds, userCredsRelations: () => userCredsRelations, userDetails: () => userDetails, userDetailsRelations: () => userDetailsRelations, userIncidents: () => userIncidents, userIncidentsRelations: () => userIncidentsRelations, userNotifications: () => userNotifications, userNotificationsRelations: () => userNotificationsRelations, users: () => users, usersRelations: () => usersRelations, vendorSnippets: () => vendorSnippets, vendorSnippetsRelations: () => vendorSnippetsRelations }); var jsonText, numericText, staffRoleValues, staffPermissionValues, uploadStatusValues, paymentStatusValues, staffRoleEnum, staffPermissionEnum, uploadStatusEnum, paymentStatusEnum, users, userDetails, userCreds, addressZones, addressAreas, addresses, staffRoles, staffPermissions, staffRolePermissions, staffUsers, storeInfo, units, productInfo, productGroupInfo, productGroupMembership, homeBanners, productReviews, uploadUrlStatus, productTagInfo, productTags, deliverySlotInfo, vendorSnippets, productSlots, specialDeals, paymentInfoTable, orders, orderItems, orderStatus, payments, refunds, keyValStore, notifications, productCategories, cartItems, complaints, coupons, couponUsage, couponApplicableUsers, couponApplicableProducts, userIncidents, reservedCoupons, notifCreds, unloggedUserTokens, userNotifications, usersRelations, userCredsRelations, staffUsersRelations, addressesRelations, unitsRelations, productInfoRelations, productTagInfoRelations, productTagsRelations, deliverySlotInfoRelations, productSlotsRelations, specialDealsRelations, ordersRelations, orderItemsRelations, orderStatusRelations, paymentInfoRelations, paymentsRelations, refundsRelations, notificationsRelations, productCategoriesRelations, cartItemsRelations, complaintsRelations, couponsRelations, couponUsageRelations, userDetailsRelations, notifCredsRelations, userNotificationsRelations, storeInfoRelations, couponApplicableUsersRelations, couponApplicableProductsRelations, reservedCouponsRelations, productReviewsRelations, addressZonesRelations, addressAreasRelations, productGroupInfoRelations, productGroupMembershipRelations, homeBannersRelations, staffRolesRelations, staffPermissionsRelations, staffRolePermissionsRelations, userIncidentsRelations, vendorSnippetsRelations; var init_schema = __esm({ "../../packages/db_helper_sqlite/src/db/schema.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_sqlite_core(); init_drizzle_orm(); jsonText = /* @__PURE__ */ __name((name) => customType({ dataType() { return "text"; }, toDriver(value) { if (value === void 0 || value === null) return null; return JSON.stringify(value); }, fromDriver(value) { if (value === null || value === void 0) return null; try { return JSON.parse(String(value)); } catch { return null; } } })(name), "jsonText"); numericText = /* @__PURE__ */ __name((name) => customType({ dataType() { return "text"; }, toDriver(value) { if (value === void 0 || value === null) return null; return String(value); }, fromDriver(value) { if (value === null || value === void 0) return null; return String(value); } })(name), "numericText"); staffRoleValues = ["super_admin", "admin", "marketer", "delivery_staff"]; staffPermissionValues = ["crud_product", "make_coupon", "crud_staff_users"]; uploadStatusValues = ["pending", "claimed"]; paymentStatusValues = ["pending", "success", "cod", "failed"]; staffRoleEnum = /* @__PURE__ */ __name((name) => text(name, { enum: staffRoleValues }), "staffRoleEnum"); staffPermissionEnum = /* @__PURE__ */ __name((name) => text(name, { enum: staffPermissionValues }), "staffPermissionEnum"); uploadStatusEnum = /* @__PURE__ */ __name((name) => text(name, { enum: uploadStatusValues }), "uploadStatusEnum"); paymentStatusEnum = /* @__PURE__ */ __name((name) => text(name, { enum: paymentStatusValues }), "paymentStatusEnum"); users = sqliteTable("users", { id: integer().primaryKey({ autoIncrement: true }), name: text(), email: text(), mobile: text(), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }, (t9) => ({ unq_email: uniqueIndex("unique_email").on(t9.email) })); userDetails = sqliteTable("user_details", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id).unique(), bio: text("bio"), dateOfBirth: integer("date_of_birth", { mode: "timestamp" }), gender: text("gender"), occupation: text("occupation"), profileImage: text("profile_image"), isSuspended: integer("is_suspended", { mode: "boolean" }).notNull().default(false), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow(), updatedAt: integer("updated_at", { mode: "timestamp" }).notNull().defaultNow() }); userCreds = sqliteTable("user_creds", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), userPassword: text("user_password").notNull(), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); addressZones = sqliteTable("address_zones", { id: integer().primaryKey({ autoIncrement: true }), zoneName: text("zone_name").notNull(), addedAt: integer("added_at", { mode: "timestamp" }).notNull().defaultNow() }); addressAreas = sqliteTable("address_areas", { id: integer().primaryKey({ autoIncrement: true }), placeName: text("place_name").notNull(), zoneId: integer("zone_id").references(() => addressZones.id), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); addresses = sqliteTable("addresses", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), name: text("name").notNull(), phone: text("phone").notNull(), addressLine1: text("address_line1").notNull(), addressLine2: text("address_line2"), city: text("city").notNull(), state: text("state").notNull(), pincode: text("pincode").notNull(), isDefault: integer("is_default", { mode: "boolean" }).notNull().default(false), latitude: real("latitude"), longitude: real("longitude"), googleMapsUrl: text("google_maps_url"), adminLatitude: real("admin_latitude"), adminLongitude: real("admin_longitude"), zoneId: integer("zone_id").references(() => addressZones.id), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); staffRoles = sqliteTable("staff_roles", { id: integer().primaryKey({ autoIncrement: true }), roleName: staffRoleEnum("role_name").notNull(), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }, (t9) => ({ unq_role_name: uniqueIndex("unique_role_name").on(t9.roleName) })); staffPermissions = sqliteTable("staff_permissions", { id: integer().primaryKey({ autoIncrement: true }), permissionName: staffPermissionEnum("permission_name").notNull(), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }, (t9) => ({ unq_permission_name: uniqueIndex("unique_permission_name").on(t9.permissionName) })); staffRolePermissions = sqliteTable("staff_role_permissions", { id: integer().primaryKey({ autoIncrement: true }), staffRoleId: integer("staff_role_id").notNull().references(() => staffRoles.id), staffPermissionId: integer("staff_permission_id").notNull().references(() => staffPermissions.id), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }, (t9) => ({ unq_role_permission: uniqueIndex("unique_role_permission").on(t9.staffRoleId, t9.staffPermissionId) })); staffUsers = sqliteTable("staff_users", { id: integer().primaryKey({ autoIncrement: true }), name: text().notNull(), password: text().notNull(), staffRoleId: integer("staff_role_id").references(() => staffRoles.id), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); storeInfo = sqliteTable("store_info", { id: integer().primaryKey({ autoIncrement: true }), name: text().notNull(), description: text(), imageUrl: text("image_url"), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow(), owner: integer("owner").notNull().references(() => staffUsers.id) }); units = sqliteTable("units", { id: integer().primaryKey({ autoIncrement: true }), shortNotation: text("short_notation").notNull(), fullName: text("full_name").notNull() }, (t9) => ({ unq_short_notation: uniqueIndex("unique_short_notation").on(t9.shortNotation) })); productInfo = sqliteTable("product_info", { id: integer().primaryKey({ autoIncrement: true }), name: text().notNull(), shortDescription: text("short_description"), longDescription: text("long_description"), unitId: integer("unit_id").notNull().references(() => units.id), price: numericText("price").notNull(), marketPrice: numericText("market_price"), images: jsonText("images"), isOutOfStock: integer("is_out_of_stock", { mode: "boolean" }).notNull().default(false), isSuspended: integer("is_suspended", { mode: "boolean" }).notNull().default(false), isFlashAvailable: integer("is_flash_available", { mode: "boolean" }).notNull().default(false), flashPrice: numericText("flash_price"), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow(), incrementStep: real("increment_step").notNull().default(1), productQuantity: real("product_quantity").notNull().default(1), storeId: integer("store_id").references(() => storeInfo.id) }); productGroupInfo = sqliteTable("product_group_info", { id: integer().primaryKey({ autoIncrement: true }), groupName: text("group_name").notNull(), description: text(), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); productGroupMembership = sqliteTable("product_group_membership", { productId: integer("product_id").notNull().references(() => productInfo.id), groupId: integer("group_id").notNull().references(() => productGroupInfo.id), addedAt: integer("added_at", { mode: "timestamp" }).notNull().defaultNow() }, (t9) => ({ pk: primaryKey({ columns: [t9.productId, t9.groupId], name: "product_group_membership_pk" }) })); homeBanners = sqliteTable("home_banners", { id: integer().primaryKey({ autoIncrement: true }), name: text("name").notNull(), imageUrl: text("image_url").notNull(), description: text("description"), productIds: jsonText("product_ids"), redirectUrl: text("redirect_url"), serialNum: integer("serial_num"), isActive: integer("is_active", { mode: "boolean" }).notNull().default(false), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow(), lastUpdated: integer("last_updated", { mode: "timestamp" }).notNull().defaultNow() }); productReviews = sqliteTable("product_reviews", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), productId: integer("product_id").notNull().references(() => productInfo.id), reviewBody: text("review_body").notNull(), imageUrls: jsonText("image_urls").$defaultFn(() => []), reviewTime: integer("review_time", { mode: "timestamp" }).notNull().defaultNow(), ratings: real("ratings").notNull(), adminResponse: text("admin_response"), adminResponseImages: jsonText("admin_response_images").$defaultFn(() => []) }, (t9) => ({ ratingCheck: check("rating_check", sql`${t9.ratings} >= 1 AND ${t9.ratings} <= 5`) })); uploadUrlStatus = sqliteTable("upload_url_status", { id: integer().primaryKey({ autoIncrement: true }), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow(), key: text("key").notNull(), status: uploadStatusEnum("status").notNull().default("pending") }); productTagInfo = sqliteTable("product_tag_info", { id: integer().primaryKey({ autoIncrement: true }), tagName: text("tag_name").notNull().unique(), tagDescription: text("tag_description"), imageUrl: text("image_url"), isDashboardTag: integer("is_dashboard_tag", { mode: "boolean" }).notNull().default(false), relatedStores: jsonText("related_stores").$defaultFn(() => []), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); productTags = sqliteTable("product_tags", { id: integer().primaryKey({ autoIncrement: true }), productId: integer("product_id").notNull().references(() => productInfo.id), tagId: integer("tag_id").notNull().references(() => productTagInfo.id), assignedAt: integer("assigned_at", { mode: "timestamp" }).notNull().defaultNow() }, (t9) => ({ unq_product_tag: uniqueIndex("unique_product_tag").on(t9.productId, t9.tagId) })); deliverySlotInfo = sqliteTable("delivery_slot_info", { id: integer().primaryKey({ autoIncrement: true }), deliveryTime: integer("delivery_time", { mode: "timestamp" }).notNull(), freezeTime: integer("freeze_time", { mode: "timestamp" }).notNull(), isActive: integer("is_active", { mode: "boolean" }).notNull().default(true), isFlash: integer("is_flash", { mode: "boolean" }).notNull().default(false), isCapacityFull: integer("is_capacity_full", { mode: "boolean" }).notNull().default(false), deliverySequence: jsonText("delivery_sequence").$defaultFn(() => ({})), groupIds: jsonText("group_ids").$defaultFn(() => []) }); vendorSnippets = sqliteTable("vendor_snippets", { id: integer().primaryKey({ autoIncrement: true }), snippetCode: text("snippet_code").notNull().unique(), slotId: integer("slot_id").references(() => deliverySlotInfo.id), isPermanent: integer("is_permanent", { mode: "boolean" }).notNull().default(false), productIds: jsonText("product_ids").notNull(), validTill: integer("valid_till", { mode: "timestamp" }), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); productSlots = sqliteTable("product_slots", { productId: integer("product_id").notNull().references(() => productInfo.id), slotId: integer("slot_id").notNull().references(() => deliverySlotInfo.id) }, (t9) => ({ pk: primaryKey({ columns: [t9.productId, t9.slotId], name: "product_slot_pk" }) })); specialDeals = sqliteTable("special_deals", { id: integer().primaryKey({ autoIncrement: true }), productId: integer("product_id").notNull().references(() => productInfo.id), quantity: numericText("quantity").notNull(), price: numericText("price").notNull(), validTill: integer("valid_till", { mode: "timestamp" }).notNull() }); paymentInfoTable = sqliteTable("payment_info", { id: integer().primaryKey({ autoIncrement: true }), status: text().notNull(), gateway: text().notNull(), orderId: text("order_id"), token: text("token"), merchantOrderId: text("merchant_order_id").notNull().unique(), payload: jsonText("payload") }); orders = sqliteTable("orders", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), addressId: integer("address_id").notNull().references(() => addresses.id), slotId: integer("slot_id").references(() => deliverySlotInfo.id), isCod: integer("is_cod", { mode: "boolean" }).notNull().default(false), isOnlinePayment: integer("is_online_payment", { mode: "boolean" }).notNull().default(false), paymentInfoId: integer("payment_info_id").references(() => paymentInfoTable.id), totalAmount: numericText("total_amount").notNull(), deliveryCharge: numericText("delivery_charge").notNull().default("0"), readableId: integer("readable_id").notNull(), adminNotes: text("admin_notes"), userNotes: text("user_notes"), orderGroupId: text("order_group_id"), orderGroupProportion: numericText("order_group_proportion"), isFlashDelivery: integer("is_flash_delivery", { mode: "boolean" }).notNull().default(false), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); orderItems = sqliteTable("order_items", { id: integer().primaryKey({ autoIncrement: true }), orderId: integer("order_id").notNull().references(() => orders.id), productId: integer("product_id").notNull().references(() => productInfo.id), quantity: text("quantity").notNull(), price: numericText("price").notNull(), discountedPrice: numericText("discounted_price"), is_packaged: integer("is_packaged", { mode: "boolean" }).notNull().default(false), is_package_verified: integer("is_package_verified", { mode: "boolean" }).notNull().default(false) }); orderStatus = sqliteTable("order_status", { id: integer().primaryKey({ autoIncrement: true }), orderTime: integer("order_time", { mode: "timestamp" }).notNull().defaultNow(), userId: integer("user_id").notNull().references(() => users.id), orderId: integer("order_id").notNull().references(() => orders.id), isPackaged: integer("is_packaged", { mode: "boolean" }).notNull().default(false), isDelivered: integer("is_delivered", { mode: "boolean" }).notNull().default(false), isCancelled: integer("is_cancelled", { mode: "boolean" }).notNull().default(false), cancelReason: text("cancel_reason"), isCancelledByAdmin: integer("is_cancelled_by_admin", { mode: "boolean" }), paymentStatus: paymentStatusEnum("payment_state").notNull().default("pending"), cancellationUserNotes: text("cancellation_user_notes"), cancellationAdminNotes: text("cancellation_admin_notes"), cancellationReviewed: integer("cancellation_reviewed", { mode: "boolean" }).notNull().default(false), cancellationReviewedAt: integer("cancellation_reviewed_at", { mode: "timestamp" }), refundCouponId: integer("refund_coupon_id").references(() => coupons.id) }); payments = sqliteTable("payments", { id: integer().primaryKey({ autoIncrement: true }), status: text().notNull(), gateway: text().notNull(), orderId: integer("order_id").notNull().references(() => orders.id), token: text("token"), merchantOrderId: text("merchant_order_id").notNull().unique(), payload: jsonText("payload") }); refunds = sqliteTable("refunds", { id: integer().primaryKey({ autoIncrement: true }), orderId: integer("order_id").notNull().references(() => orders.id), refundAmount: numericText("refund_amount"), refundStatus: text("refund_status").default("none"), merchantRefundId: text("merchant_refund_id"), refundProcessedAt: integer("refund_processed_at", { mode: "timestamp" }), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); keyValStore = sqliteTable("key_val_store", { key: text("key").primaryKey(), value: jsonText("value") }); notifications = sqliteTable("notifications", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), title: text().notNull(), body: text().notNull(), type: text(), isRead: integer("is_read", { mode: "boolean" }).notNull().default(false), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); productCategories = sqliteTable("product_categories", { id: integer().primaryKey({ autoIncrement: true }), name: text().notNull(), description: text() }); cartItems = sqliteTable("cart_items", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), productId: integer("product_id").notNull().references(() => productInfo.id), quantity: numericText("quantity").notNull(), addedAt: integer("added_at", { mode: "timestamp" }).notNull().defaultNow() }, (t9) => ({ unq_user_product: uniqueIndex("unique_user_product").on(t9.userId, t9.productId) })); complaints = sqliteTable("complaints", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), orderId: integer("order_id").references(() => orders.id), complaintBody: text("complaint_body").notNull(), images: jsonText("images"), response: text("response"), isResolved: integer("is_resolved", { mode: "boolean" }).notNull().default(false), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); coupons = sqliteTable("coupons", { id: integer().primaryKey({ autoIncrement: true }), couponCode: text("coupon_code").notNull().unique(), isUserBased: integer("is_user_based", { mode: "boolean" }).notNull().default(false), discountPercent: numericText("discount_percent"), flatDiscount: numericText("flat_discount"), minOrder: numericText("min_order"), productIds: jsonText("product_ids"), createdBy: integer("created_by").notNull().references(() => staffUsers.id), maxValue: numericText("max_value"), isApplyForAll: integer("is_apply_for_all", { mode: "boolean" }).notNull().default(false), validTill: integer("valid_till", { mode: "timestamp" }), maxLimitForUser: integer("max_limit_for_user"), isInvalidated: integer("is_invalidated", { mode: "boolean" }).notNull().default(false), exclusiveApply: integer("exclusive_apply", { mode: "boolean" }).notNull().default(false), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); couponUsage = sqliteTable("coupon_usage", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), couponId: integer("coupon_id").notNull().references(() => coupons.id), orderId: integer("order_id").references(() => orders.id), orderItemId: integer("order_item_id").references(() => orderItems.id), usedAt: integer("used_at", { mode: "timestamp" }).notNull().defaultNow() }); couponApplicableUsers = sqliteTable("coupon_applicable_users", { id: integer().primaryKey({ autoIncrement: true }), couponId: integer("coupon_id").notNull().references(() => coupons.id), userId: integer("user_id").notNull().references(() => users.id) }, (t9) => ({ unq_coupon_user: uniqueIndex("unique_coupon_user").on(t9.couponId, t9.userId) })); couponApplicableProducts = sqliteTable("coupon_applicable_products", { id: integer().primaryKey({ autoIncrement: true }), couponId: integer("coupon_id").notNull().references(() => coupons.id), productId: integer("product_id").notNull().references(() => productInfo.id) }, (t9) => ({ unq_coupon_product: uniqueIndex("unique_coupon_product").on(t9.couponId, t9.productId) })); userIncidents = sqliteTable("user_incidents", { id: integer().primaryKey({ autoIncrement: true }), userId: integer("user_id").notNull().references(() => users.id), orderId: integer("order_id").references(() => orders.id), dateAdded: integer("date_added", { mode: "timestamp" }).notNull().defaultNow(), adminComment: text("admin_comment"), addedBy: integer("added_by").references(() => staffUsers.id), negativityScore: integer("negativity_score") }); reservedCoupons = sqliteTable("reserved_coupons", { id: integer().primaryKey({ autoIncrement: true }), secretCode: text("secret_code").notNull().unique(), couponCode: text("coupon_code").notNull(), discountPercent: numericText("discount_percent"), flatDiscount: numericText("flat_discount"), minOrder: numericText("min_order"), productIds: jsonText("product_ids"), maxValue: numericText("max_value"), validTill: integer("valid_till", { mode: "timestamp" }), maxLimitForUser: integer("max_limit_for_user"), exclusiveApply: integer("exclusive_apply", { mode: "boolean" }).notNull().default(false), isRedeemed: integer("is_redeemed", { mode: "boolean" }).notNull().default(false), redeemedBy: integer("redeemed_by").references(() => users.id), redeemedAt: integer("redeemed_at", { mode: "timestamp" }), createdBy: integer("created_by").notNull().references(() => staffUsers.id), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow() }); notifCreds = sqliteTable("notif_creds", { id: integer().primaryKey({ autoIncrement: true }), token: text().notNull().unique(), addedAt: integer("added_at", { mode: "timestamp" }).notNull().defaultNow(), userId: integer("user_id").notNull().references(() => users.id), lastVerified: integer("last_verified", { mode: "timestamp" }) }); unloggedUserTokens = sqliteTable("unlogged_user_tokens", { id: integer().primaryKey({ autoIncrement: true }), token: text().notNull().unique(), addedAt: integer("added_at", { mode: "timestamp" }).notNull().defaultNow(), lastVerified: integer("last_verified", { mode: "timestamp" }) }); userNotifications = sqliteTable("user_notifications", { id: integer().primaryKey({ autoIncrement: true }), title: text("title").notNull(), imageUrl: text("image_url"), createdAt: integer("created_at", { mode: "timestamp" }).notNull().defaultNow(), body: text("body").notNull(), applicableUsers: jsonText("applicable_users") }); usersRelations = relations(users, ({ many, one }) => ({ addresses: many(addresses), orders: many(orders), notifications: many(notifications), cartItems: many(cartItems), userCreds: one(userCreds), coupons: many(coupons), couponUsages: many(couponUsage), applicableCoupons: many(couponApplicableUsers), userDetails: one(userDetails), notifCreds: many(notifCreds), userIncidents: many(userIncidents) })); userCredsRelations = relations(userCreds, ({ one }) => ({ user: one(users, { fields: [userCreds.userId], references: [users.id] }) })); staffUsersRelations = relations(staffUsers, ({ one, many }) => ({ role: one(staffRoles, { fields: [staffUsers.staffRoleId], references: [staffRoles.id] }), coupons: many(coupons), stores: many(storeInfo) })); addressesRelations = relations(addresses, ({ one, many }) => ({ user: one(users, { fields: [addresses.userId], references: [users.id] }), orders: many(orders), zone: one(addressZones, { fields: [addresses.zoneId], references: [addressZones.id] }) })); unitsRelations = relations(units, ({ many }) => ({ products: many(productInfo) })); productInfoRelations = relations(productInfo, ({ one, many }) => ({ unit: one(units, { fields: [productInfo.unitId], references: [units.id] }), store: one(storeInfo, { fields: [productInfo.storeId], references: [storeInfo.id] }), productSlots: many(productSlots), specialDeals: many(specialDeals), orderItems: many(orderItems), cartItems: many(cartItems), tags: many(productTags), applicableCoupons: many(couponApplicableProducts), reviews: many(productReviews), groups: many(productGroupMembership) })); productTagInfoRelations = relations(productTagInfo, ({ many }) => ({ products: many(productTags) })); productTagsRelations = relations(productTags, ({ one }) => ({ product: one(productInfo, { fields: [productTags.productId], references: [productInfo.id] }), tag: one(productTagInfo, { fields: [productTags.tagId], references: [productTagInfo.id] }) })); deliverySlotInfoRelations = relations(deliverySlotInfo, ({ many }) => ({ productSlots: many(productSlots), orders: many(orders), vendorSnippets: many(vendorSnippets) })); productSlotsRelations = relations(productSlots, ({ one }) => ({ product: one(productInfo, { fields: [productSlots.productId], references: [productInfo.id] }), slot: one(deliverySlotInfo, { fields: [productSlots.slotId], references: [deliverySlotInfo.id] }) })); specialDealsRelations = relations(specialDeals, ({ one }) => ({ product: one(productInfo, { fields: [specialDeals.productId], references: [productInfo.id] }) })); ordersRelations = relations(orders, ({ one, many }) => ({ user: one(users, { fields: [orders.userId], references: [users.id] }), address: one(addresses, { fields: [orders.addressId], references: [addresses.id] }), slot: one(deliverySlotInfo, { fields: [orders.slotId], references: [deliverySlotInfo.id] }), orderItems: many(orderItems), payment: one(payments), paymentInfo: one(paymentInfoTable, { fields: [orders.paymentInfoId], references: [paymentInfoTable.id] }), orderStatus: many(orderStatus), refunds: many(refunds), couponUsages: many(couponUsage), userIncidents: many(userIncidents) })); orderItemsRelations = relations(orderItems, ({ one }) => ({ order: one(orders, { fields: [orderItems.orderId], references: [orders.id] }), product: one(productInfo, { fields: [orderItems.productId], references: [productInfo.id] }) })); orderStatusRelations = relations(orderStatus, ({ one }) => ({ order: one(orders, { fields: [orderStatus.orderId], references: [orders.id] }), user: one(users, { fields: [orderStatus.userId], references: [users.id] }), refundCoupon: one(coupons, { fields: [orderStatus.refundCouponId], references: [coupons.id] }) })); paymentInfoRelations = relations(paymentInfoTable, ({ one }) => ({ order: one(orders, { fields: [paymentInfoTable.id], references: [orders.paymentInfoId] }) })); paymentsRelations = relations(payments, ({ one }) => ({ order: one(orders, { fields: [payments.orderId], references: [orders.id] }) })); refundsRelations = relations(refunds, ({ one }) => ({ order: one(orders, { fields: [refunds.orderId], references: [orders.id] }) })); notificationsRelations = relations(notifications, ({ one }) => ({ user: one(users, { fields: [notifications.userId], references: [users.id] }) })); productCategoriesRelations = relations(productCategories, ({}) => ({})); cartItemsRelations = relations(cartItems, ({ one }) => ({ user: one(users, { fields: [cartItems.userId], references: [users.id] }), product: one(productInfo, { fields: [cartItems.productId], references: [productInfo.id] }) })); complaintsRelations = relations(complaints, ({ one }) => ({ user: one(users, { fields: [complaints.userId], references: [users.id] }), order: one(orders, { fields: [complaints.orderId], references: [orders.id] }) })); couponsRelations = relations(coupons, ({ one, many }) => ({ creator: one(staffUsers, { fields: [coupons.createdBy], references: [staffUsers.id] }), usages: many(couponUsage), applicableUsers: many(couponApplicableUsers), applicableProducts: many(couponApplicableProducts) })); couponUsageRelations = relations(couponUsage, ({ one }) => ({ user: one(users, { fields: [couponUsage.userId], references: [users.id] }), coupon: one(coupons, { fields: [couponUsage.couponId], references: [coupons.id] }), order: one(orders, { fields: [couponUsage.orderId], references: [orders.id] }), orderItem: one(orderItems, { fields: [couponUsage.orderItemId], references: [orderItems.id] }) })); userDetailsRelations = relations(userDetails, ({ one }) => ({ user: one(users, { fields: [userDetails.userId], references: [users.id] }) })); notifCredsRelations = relations(notifCreds, ({ one }) => ({ user: one(users, { fields: [notifCreds.userId], references: [users.id] }) })); userNotificationsRelations = relations(userNotifications, ({}) => ({ // No relations needed for now })); storeInfoRelations = relations(storeInfo, ({ one, many }) => ({ owner: one(staffUsers, { fields: [storeInfo.owner], references: [staffUsers.id] }), products: many(productInfo) })); couponApplicableUsersRelations = relations(couponApplicableUsers, ({ one }) => ({ coupon: one(coupons, { fields: [couponApplicableUsers.couponId], references: [coupons.id] }), user: one(users, { fields: [couponApplicableUsers.userId], references: [users.id] }) })); couponApplicableProductsRelations = relations(couponApplicableProducts, ({ one }) => ({ coupon: one(coupons, { fields: [couponApplicableProducts.couponId], references: [coupons.id] }), product: one(productInfo, { fields: [couponApplicableProducts.productId], references: [productInfo.id] }) })); reservedCouponsRelations = relations(reservedCoupons, ({ one }) => ({ redeemedUser: one(users, { fields: [reservedCoupons.redeemedBy], references: [users.id] }), creator: one(staffUsers, { fields: [reservedCoupons.createdBy], references: [staffUsers.id] }) })); productReviewsRelations = relations(productReviews, ({ one }) => ({ user: one(users, { fields: [productReviews.userId], references: [users.id] }), product: one(productInfo, { fields: [productReviews.productId], references: [productInfo.id] }) })); addressZonesRelations = relations(addressZones, ({ many }) => ({ addresses: many(addresses), areas: many(addressAreas) })); addressAreasRelations = relations(addressAreas, ({ one }) => ({ zone: one(addressZones, { fields: [addressAreas.zoneId], references: [addressZones.id] }) })); productGroupInfoRelations = relations(productGroupInfo, ({ many }) => ({ memberships: many(productGroupMembership) })); productGroupMembershipRelations = relations(productGroupMembership, ({ one }) => ({ product: one(productInfo, { fields: [productGroupMembership.productId], references: [productInfo.id] }), group: one(productGroupInfo, { fields: [productGroupMembership.groupId], references: [productGroupInfo.id] }) })); homeBannersRelations = relations(homeBanners, ({}) => ({ // Relations for productIds array would be more complex, skipping for now })); staffRolesRelations = relations(staffRoles, ({ many }) => ({ staffUsers: many(staffUsers), rolePermissions: many(staffRolePermissions) })); staffPermissionsRelations = relations(staffPermissions, ({ many }) => ({ rolePermissions: many(staffRolePermissions) })); staffRolePermissionsRelations = relations(staffRolePermissions, ({ one }) => ({ role: one(staffRoles, { fields: [staffRolePermissions.staffRoleId], references: [staffRoles.id] }), permission: one(staffPermissions, { fields: [staffRolePermissions.staffPermissionId], references: [staffPermissions.id] }) })); userIncidentsRelations = relations(userIncidents, ({ one }) => ({ user: one(users, { fields: [userIncidents.userId], references: [users.id] }), order: one(orders, { fields: [userIncidents.orderId], references: [orders.id] }), addedBy: one(staffUsers, { fields: [userIncidents.addedBy], references: [staffUsers.id] }) })); vendorSnippetsRelations = relations(vendorSnippets, ({ one }) => ({ slot: one(deliverySlotInfo, { fields: [vendorSnippets.slotId], references: [deliverySlotInfo.id] }) })); } }); // ../../packages/db_helper_sqlite/src/db/db_index.ts function initDb(database) { const base = drizzle(database, { schema: schema_exports }); dbInstance = Object.assign(base, { transaction: async (handler) => { return handler(base); } }); } var dbInstance, db; var init_db_index = __esm({ "../../packages/db_helper_sqlite/src/db/db_index.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_d1(); init_schema(); dbInstance = null; __name(initDb, "initDb"); db = new Proxy({}, { get(_target, prop) { if (!dbInstance) { throw new Error("D1 database not initialized. Call initDb(env.DB) before using db helpers."); } return dbInstance[prop]; } }); } }); // ../../packages/db_helper_sqlite/src/admin-apis/banner.ts async function getBanners() { const banners = await db.query.homeBanners.findMany({ orderBy: desc(homeBanners.createdAt) }); return banners.map((banner) => ({ id: banner.id, name: banner.name, imageUrl: banner.imageUrl, description: banner.description, productIds: banner.productIds || [], redirectUrl: banner.redirectUrl, serialNum: banner.serialNum, isActive: banner.isActive, createdAt: banner.createdAt, lastUpdated: banner.lastUpdated })); } async function getBannerById(id) { const banner = await db.query.homeBanners.findFirst({ where: eq(homeBanners.id, id) }); if (!banner) return null; return { id: banner.id, name: banner.name, imageUrl: banner.imageUrl, description: banner.description, productIds: banner.productIds || [], redirectUrl: banner.redirectUrl, serialNum: banner.serialNum, isActive: banner.isActive, createdAt: banner.createdAt, lastUpdated: banner.lastUpdated }; } async function createBanner(input) { const [banner] = await db.insert(homeBanners).values({ name: input.name, imageUrl: input.imageUrl, description: input.description, productIds: input.productIds || [], redirectUrl: input.redirectUrl, serialNum: input.serialNum, isActive: input.isActive }).returning(); return { id: banner.id, name: banner.name, imageUrl: banner.imageUrl, description: banner.description, productIds: banner.productIds || [], redirectUrl: banner.redirectUrl, serialNum: banner.serialNum, isActive: banner.isActive, createdAt: banner.createdAt, lastUpdated: banner.lastUpdated }; } async function updateBanner(id, input) { const [banner] = await db.update(homeBanners).set({ ...input, lastUpdated: /* @__PURE__ */ new Date() }).where(eq(homeBanners.id, id)).returning(); return { id: banner.id, name: banner.name, imageUrl: banner.imageUrl, description: banner.description, productIds: banner.productIds || [], redirectUrl: banner.redirectUrl, serialNum: banner.serialNum, isActive: banner.isActive, createdAt: banner.createdAt, lastUpdated: banner.lastUpdated }; } async function deleteBanner(id) { await db.delete(homeBanners).where(eq(homeBanners.id, id)); } var init_banner = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/banner.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getBanners, "getBanners"); __name(getBannerById, "getBannerById"); __name(createBanner, "createBanner"); __name(updateBanner, "updateBanner"); __name(deleteBanner, "deleteBanner"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/complaint.ts async function getComplaints(cursor, limit = 20) { const whereCondition = cursor ? lt(complaints.id, cursor) : void 0; const complaintsData = await db.select({ id: complaints.id, complaintBody: complaints.complaintBody, userId: complaints.userId, orderId: complaints.orderId, isResolved: complaints.isResolved, response: complaints.response, createdAt: complaints.createdAt, images: complaints.images, userName: users.name, userMobile: users.mobile }).from(complaints).leftJoin(users, eq(complaints.userId, users.id)).where(whereCondition).orderBy(desc(complaints.id)).limit(limit + 1); const hasMore = complaintsData.length > limit; const complaintsToReturn = hasMore ? complaintsData.slice(0, limit) : complaintsData; return { complaints: complaintsToReturn.map((c2) => ({ id: c2.id, complaintBody: c2.complaintBody, userId: c2.userId, orderId: c2.orderId, isResolved: c2.isResolved, response: c2.response, createdAt: c2.createdAt, images: c2.images, userName: c2.userName, userMobile: c2.userMobile })), hasMore }; } async function resolveComplaint(id, response) { await db.update(complaints).set({ isResolved: true, response }).where(eq(complaints.id, id)); } var init_complaint = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/complaint.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getComplaints, "getComplaints"); __name(resolveComplaint, "resolveComplaint"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/const.ts async function getAllConstants() { const constants2 = await db.select().from(keyValStore); return constants2.map((c2) => ({ key: c2.key, value: c2.value })); } async function upsertConstants(constants2) { await db.transaction(async (tx) => { for (const { key, value } of constants2) { await tx.insert(keyValStore).values({ key, value }).onConflictDoUpdate({ target: keyValStore.key, set: { value } }); } }); } var init_const = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/const.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); __name(getAllConstants, "getAllConstants"); __name(upsertConstants, "upsertConstants"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/coupon.ts async function getAllCoupons(cursor, limit = 50, search) { let whereCondition = void 0; const conditions = []; if (cursor) { conditions.push(lt(coupons.id, cursor)); } if (search && search.trim()) { conditions.push(like(coupons.couponCode, `%${search}%`)); } if (conditions.length > 0) { whereCondition = and(...conditions); } const result = await db.query.coupons.findMany({ where: whereCondition, with: { creator: true, applicableUsers: { with: { user: true } }, applicableProducts: { with: { product: true } } }, orderBy: desc(coupons.createdAt), limit: limit + 1 }); const hasMore = result.length > limit; const couponsList = hasMore ? result.slice(0, limit) : result; return { coupons: couponsList, hasMore }; } async function getCouponById(id) { return await db.query.coupons.findFirst({ where: eq(coupons.id, id), with: { creator: true, applicableUsers: { with: { user: true } }, applicableProducts: { with: { product: true } } } }); } async function createCouponWithRelations(input, applicableUsers, applicableProducts) { return await db.transaction(async (tx) => { const [coupon] = await tx.insert(coupons).values({ couponCode: input.couponCode, isUserBased: input.isUserBased, discountPercent: input.discountPercent, flatDiscount: input.flatDiscount, minOrder: input.minOrder, productIds: input.productIds, createdBy: input.createdBy, maxValue: input.maxValue, isApplyForAll: input.isApplyForAll, validTill: input.validTill, maxLimitForUser: input.maxLimitForUser, exclusiveApply: input.exclusiveApply }).returning(); if (applicableUsers && applicableUsers.length > 0) { await tx.insert(couponApplicableUsers).values( applicableUsers.map((userId) => ({ couponId: coupon.id, userId })) ); } if (applicableProducts && applicableProducts.length > 0) { await tx.insert(couponApplicableProducts).values( applicableProducts.map((productId) => ({ couponId: coupon.id, productId })) ); } return coupon; }); } async function updateCouponWithRelations(id, input, applicableUsers, applicableProducts) { return await db.transaction(async (tx) => { const [coupon] = await tx.update(coupons).set({ ...input }).where(eq(coupons.id, id)).returning(); if (applicableUsers !== void 0) { await tx.delete(couponApplicableUsers).where(eq(couponApplicableUsers.couponId, id)); if (applicableUsers.length > 0) { await tx.insert(couponApplicableUsers).values( applicableUsers.map((userId) => ({ couponId: id, userId })) ); } } if (applicableProducts !== void 0) { await tx.delete(couponApplicableProducts).where(eq(couponApplicableProducts.couponId, id)); if (applicableProducts.length > 0) { await tx.insert(couponApplicableProducts).values( applicableProducts.map((productId) => ({ couponId: id, productId })) ); } } return coupon; }); } async function invalidateCoupon(id) { const result = await db.update(coupons).set({ isInvalidated: true }).where(eq(coupons.id, id)).returning(); return result[0]; } async function validateCoupon(code, userId, orderAmount) { const coupon = await db.query.coupons.findFirst({ where: and( eq(coupons.couponCode, code.toUpperCase()), eq(coupons.isInvalidated, false) ) }); if (!coupon) { return { valid: false, message: "Coupon not found or invalidated" }; } if (coupon.validTill && new Date(coupon.validTill) < /* @__PURE__ */ new Date()) { return { valid: false, message: "Coupon has expired" }; } if (!coupon.isApplyForAll && !coupon.isUserBased) { return { valid: false, message: "Coupon is not available for use" }; } const minOrderValue2 = coupon.minOrder ? parseFloat(coupon.minOrder) : 0; if (minOrderValue2 > 0 && orderAmount < minOrderValue2) { return { valid: false, message: `Minimum order amount is ${minOrderValue2}` }; } let discountAmount = 0; if (coupon.discountPercent) { const percent = parseFloat(coupon.discountPercent); discountAmount = orderAmount * percent / 100; } else if (coupon.flatDiscount) { discountAmount = parseFloat(coupon.flatDiscount); } const maxValueLimit = coupon.maxValue ? parseFloat(coupon.maxValue) : 0; if (maxValueLimit > 0 && discountAmount > maxValueLimit) { discountAmount = maxValueLimit; } return { valid: true, discountAmount, coupon: { id: coupon.id, discountPercent: coupon.discountPercent, flatDiscount: coupon.flatDiscount, maxValue: coupon.maxValue } }; } async function getReservedCoupons(cursor, limit = 50, search) { let whereCondition = void 0; const conditions = []; if (cursor) { conditions.push(lt(reservedCoupons.id, cursor)); } if (search && search.trim()) { conditions.push(or( like(reservedCoupons.secretCode, `%${search}%`), like(reservedCoupons.couponCode, `%${search}%`) )); } if (conditions.length > 0) { whereCondition = and(...conditions); } const result = await db.query.reservedCoupons.findMany({ where: whereCondition, with: { redeemedUser: true, creator: true }, orderBy: desc(reservedCoupons.createdAt), limit: limit + 1 }); const hasMore = result.length > limit; const couponsList = hasMore ? result.slice(0, limit) : result; return { coupons: couponsList, hasMore }; } async function createReservedCouponWithProducts(input, applicableProducts) { return await db.transaction(async (tx) => { const [coupon] = await tx.insert(reservedCoupons).values({ secretCode: input.secretCode, couponCode: input.couponCode, discountPercent: input.discountPercent, flatDiscount: input.flatDiscount, minOrder: input.minOrder, productIds: input.productIds, maxValue: input.maxValue, validTill: input.validTill, maxLimitForUser: input.maxLimitForUser, exclusiveApply: input.exclusiveApply, createdBy: input.createdBy }).returning(); if (applicableProducts && applicableProducts.length > 0) { await tx.insert(couponApplicableProducts).values( applicableProducts.map((productId) => ({ couponId: coupon.id, productId })) ); } return coupon; }); } async function checkUsersExist(userIds) { const existingUsers = await db.query.users.findMany({ where: inArray(users.id, userIds), columns: { id: true } }); return existingUsers.length === userIds.length; } async function checkCouponExists(couponCode) { const existing = await db.query.coupons.findFirst({ where: eq(coupons.couponCode, couponCode) }); return !!existing; } async function checkReservedCouponExists(secretCode) { const existing = await db.query.reservedCoupons.findFirst({ where: eq(reservedCoupons.secretCode, secretCode) }); return !!existing; } async function generateCancellationCoupon(orderId, staffUserId, userId, orderAmount, couponCode) { return await db.transaction(async (tx) => { const expiryDate = /* @__PURE__ */ new Date(); expiryDate.setDate(expiryDate.getDate() + 30); const [coupon] = await tx.insert(coupons).values({ couponCode, isUserBased: true, flatDiscount: orderAmount.toString(), minOrder: orderAmount.toString(), maxValue: orderAmount.toString(), validTill: expiryDate, maxLimitForUser: 1, createdBy: staffUserId, isApplyForAll: false }).returning(); await tx.insert(couponApplicableUsers).values({ couponId: coupon.id, userId }); await tx.update(orderStatus).set({ refundCouponId: coupon.id }).where(eq(orderStatus.orderId, orderId)); return coupon; }); } async function getOrderWithUser(orderId) { return await db.query.orders.findFirst({ where: eq(orders.id, orderId), with: { user: true } }); } async function createCouponForUser(mobile, couponCode, staffUserId) { return await db.transaction(async (tx) => { let user = await tx.query.users.findFirst({ where: eq(users.mobile, mobile) }); if (!user) { const [newUser] = await tx.insert(users).values({ name: null, email: null, mobile }).returning(); user = newUser; } const [coupon] = await tx.insert(coupons).values({ couponCode, isUserBased: true, discountPercent: "20", minOrder: "1000", maxValue: "500", maxLimitForUser: 1, isApplyForAll: false, exclusiveApply: false, createdBy: staffUserId, validTill: new Date(Date.now() + 90 * 24 * 60 * 60 * 1e3) }).returning(); await tx.insert(couponApplicableUsers).values({ couponId: coupon.id, userId: user.id }); return { coupon, user: { id: user.id, mobile: user.mobile, name: user.name } }; }); } async function getUsersForCoupon(search, limit = 20, offset = 0) { let whereCondition = void 0; if (search && search.trim()) { whereCondition = or( like(users.name, `%${search}%`), like(users.mobile, `%${search}%`) ); } const userList = await db.query.users.findMany({ where: whereCondition, columns: { id: true, name: true, mobile: true }, limit, offset, orderBy: asc(users.name) }); return { users: userList.map((user) => ({ id: user.id, name: user.name || "Unknown", mobile: user.mobile })) }; } var init_coupon = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/coupon.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getAllCoupons, "getAllCoupons"); __name(getCouponById, "getCouponById"); __name(createCouponWithRelations, "createCouponWithRelations"); __name(updateCouponWithRelations, "updateCouponWithRelations"); __name(invalidateCoupon, "invalidateCoupon"); __name(validateCoupon, "validateCoupon"); __name(getReservedCoupons, "getReservedCoupons"); __name(createReservedCouponWithProducts, "createReservedCouponWithProducts"); __name(checkUsersExist, "checkUsersExist"); __name(checkCouponExists, "checkCouponExists"); __name(checkReservedCouponExists, "checkReservedCouponExists"); __name(generateCancellationCoupon, "generateCancellationCoupon"); __name(getOrderWithUser, "getOrderWithUser"); __name(createCouponForUser, "createCouponForUser"); __name(getUsersForCoupon, "getUsersForCoupon"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/order.ts async function updateOrderNotes(orderId, adminNotes) { const [result] = await db.update(orders).set({ adminNotes }).where(eq(orders.id, orderId)).returning(); return result || null; } async function updateOrderPackaged(orderId, isPackaged) { const orderIdNumber = parseInt(orderId); await db.update(orderItems).set({ is_packaged: isPackaged }).where(eq(orderItems.orderId, orderIdNumber)); if (!isPackaged) { await db.update(orderStatus).set({ isPackaged, isDelivered: false }).where(eq(orderStatus.orderId, orderIdNumber)); } else { await db.update(orderStatus).set({ isPackaged }).where(eq(orderStatus.orderId, orderIdNumber)); } const order = await db.query.orders.findFirst({ where: eq(orders.id, orderIdNumber) }); return { success: true, userId: order?.userId ?? null }; } async function updateOrderDelivered(orderId, isDelivered) { const orderIdNumber = parseInt(orderId); await db.update(orderStatus).set({ isDelivered }).where(eq(orderStatus.orderId, orderIdNumber)); const order = await db.query.orders.findFirst({ where: eq(orders.id, orderIdNumber) }); return { success: true, userId: order?.userId ?? null }; } async function getOrderDetails(orderId) { const orderData = await db.query.orders.findFirst({ where: eq(orders.id, orderId), with: { user: true, address: true, slot: true, orderItems: { with: { product: { with: { unit: true } } } }, payment: true, paymentInfo: true, orderStatus: true, refunds: true } }); if (!orderData) { return null; } const couponUsageData = await db.query.couponUsage.findMany({ where: eq(couponUsage.orderId, orderData.id), with: { coupon: true } }); let couponData = null; if (couponUsageData.length > 0) { let totalDiscountAmount = 0; const orderTotal = parseFloat((orderData.totalAmount ?? "0").toString()); for (const usage of couponUsageData) { let discountAmount = 0; if (usage.coupon.discountPercent) { discountAmount = orderTotal * parseFloat(usage.coupon.discountPercent.toString()) / 100; } else if (usage.coupon.flatDiscount) { discountAmount = parseFloat(usage.coupon.flatDiscount.toString()); } if (usage.coupon.maxValue && discountAmount > parseFloat(usage.coupon.maxValue.toString())) { discountAmount = parseFloat(usage.coupon.maxValue.toString()); } totalDiscountAmount += discountAmount; } couponData = { couponCode: couponUsageData.map((u5) => u5.coupon.couponCode).join(", "), couponDescription: `${couponUsageData.length} coupons applied`, discountAmount: totalDiscountAmount }; } const statusRecord = orderData.orderStatus?.[0]; const orderStatusRecord = statusRecord ? mapOrderStatusRecord(statusRecord) : null; let status = "pending"; if (orderStatusRecord?.isCancelled) { status = "cancelled"; } else if (orderStatusRecord?.isDelivered) { status = "delivered"; } const refund = orderData.refunds?.[0]; const refundStatus = refund?.refundStatus && isRefundStatus(refund.refundStatus) ? refund.refundStatus : null; const refundRecord = refund ? { id: refund.id, orderId: refund.orderId, refundAmount: refund.refundAmount, refundStatus, merchantRefundId: refund.merchantRefundId, refundProcessedAt: refund.refundProcessedAt, createdAt: refund.createdAt } : null; return { id: orderData.id, readableId: orderData.id, userId: orderData.user.id, customerName: `${orderData.user.name}`, customerEmail: orderData.user.email, customerMobile: orderData.user.mobile, address: { name: orderData.address.name, line1: orderData.address.addressLine1, line2: orderData.address.addressLine2, city: orderData.address.city, state: orderData.address.state, pincode: orderData.address.pincode, phone: orderData.address.phone }, slotInfo: orderData.slot ? { time: orderData.slot.deliveryTime.toISOString(), sequence: orderData.slot.deliverySequence } : null, isCod: orderData.isCod, isOnlinePayment: orderData.isOnlinePayment, totalAmount: parseFloat(orderData.totalAmount?.toString() || "0") - parseFloat(orderData.deliveryCharge?.toString() || "0"), deliveryCharge: parseFloat(orderData.deliveryCharge?.toString() || "0"), adminNotes: orderData.adminNotes, userNotes: orderData.userNotes, createdAt: orderData.createdAt, status, isPackaged: orderStatusRecord?.isPackaged || false, isDelivered: orderStatusRecord?.isDelivered || false, items: orderData.orderItems.map((item) => ({ id: item.id, name: item.product.name, quantity: item.quantity, productSize: item.product.productQuantity, price: item.price, unit: item.product.unit?.shortNotation, amount: parseFloat(item.price.toString()) * parseFloat(item.quantity || "0"), isPackaged: item.is_packaged, isPackageVerified: item.is_package_verified })), payment: orderData.payment ? { status: orderData.payment.status, gateway: orderData.payment.gateway, merchantOrderId: orderData.payment.merchantOrderId } : null, paymentInfo: orderData.paymentInfo ? { status: orderData.paymentInfo.status, gateway: orderData.paymentInfo.gateway, merchantOrderId: orderData.paymentInfo.merchantOrderId } : null, cancelReason: orderStatusRecord?.cancelReason || null, cancellationReviewed: orderStatusRecord?.cancellationReviewed || false, isRefundDone: refundStatus === "processed" || false, refundStatus, refundAmount: refund?.refundAmount ? parseFloat(refund.refundAmount.toString()) : null, couponData, couponCode: couponData?.couponCode || null, couponDescription: couponData?.couponDescription || null, discountAmount: couponData?.discountAmount || null, orderStatus: orderStatusRecord, refundRecord, isFlashDelivery: orderData.isFlashDelivery }; } async function updateOrderItemPackaging(orderItemId, isPackaged, isPackageVerified) { const orderItem = await db.query.orderItems.findFirst({ where: eq(orderItems.id, orderItemId) }); if (!orderItem) { return { success: false, updated: false }; } const updateData = {}; if (isPackaged !== void 0) { updateData.is_packaged = isPackaged; } if (isPackageVerified !== void 0) { updateData.is_package_verified = isPackageVerified; } await db.update(orderItems).set(updateData).where(eq(orderItems.id, orderItemId)); return { success: true, updated: true }; } async function removeDeliveryCharge(orderId) { const order = await db.query.orders.findFirst({ where: eq(orders.id, orderId) }); if (!order) { return null; } const currentDeliveryCharge = parseFloat(order.deliveryCharge?.toString() || "0"); const currentTotalAmount = parseFloat(order.totalAmount?.toString() || "0"); const newTotalAmount = currentTotalAmount - currentDeliveryCharge; await db.update(orders).set({ deliveryCharge: "0", totalAmount: newTotalAmount.toString() }).where(eq(orders.id, orderId)); return { success: true, message: "Delivery charge removed" }; } async function getSlotOrders(slotId) { const slotOrders = await db.query.orders.findMany({ where: eq(orders.slotId, parseInt(slotId)), with: { user: true, address: true, slot: true, orderItems: { with: { product: { with: { unit: true } } } }, orderStatus: true } }); const filteredOrders = slotOrders.filter((order) => { const statusRecord = order.orderStatus[0]; return order.isCod || statusRecord && statusRecord.paymentStatus === "success"; }); const formattedOrders = filteredOrders.map((order) => { const statusRecord = order.orderStatus[0]; let status = "pending"; if (statusRecord?.isCancelled) { status = "cancelled"; } else if (statusRecord?.isDelivered) { status = "delivered"; } const items = order.orderItems.map((item) => ({ id: item.id, name: item.product.name, quantity: parseFloat(item.quantity), price: parseFloat(item.price.toString()), amount: parseFloat(item.quantity) * parseFloat(item.price.toString()), unit: item.product.unit?.shortNotation || "", isPackaged: item.is_packaged, isPackageVerified: item.is_package_verified })); const paymentMode = order.isCod ? "COD" : "Online"; return { id: order.id, readableId: order.id, customerName: order.user.name || order.user.mobile + "", address: `${order.address.addressLine1}${order.address.addressLine2 ? `, ${order.address.addressLine2}` : ""}, ${order.address.city}, ${order.address.state} - ${order.address.pincode}, Phone: ${order.address.phone}`, addressId: order.addressId, latitude: order.address.adminLatitude ?? order.address.latitude, longitude: order.address.adminLongitude ?? order.address.longitude, totalAmount: parseFloat(order.totalAmount), items, deliveryTime: order.slot?.deliveryTime.toISOString() || null, status, isPackaged: order.orderItems.every((item) => item.is_packaged) || false, isDelivered: statusRecord?.isDelivered || false, isCod: order.isCod, paymentMode, paymentStatus: isPaymentStatus(statusRecord?.paymentStatus || "pending") ? statusRecord?.paymentStatus || "pending" : "pending", slotId: order.slotId, adminNotes: order.adminNotes, userNotes: order.userNotes }; }); return { success: true, data: formattedOrders }; } async function updateAddressCoords(addressId, latitude, longitude) { const result = await db.update(addresses).set({ adminLatitude: latitude, adminLongitude: longitude }).where(eq(addresses.id, addressId)).returning(); return { success: result.length > 0 }; } async function getAllOrders(input) { const { cursor, limit, slotId, packagedFilter, deliveredFilter, cancellationFilter, flashDeliveryFilter } = input; let whereCondition = eq(orders.id, orders.id); if (cursor) { whereCondition = and(whereCondition, lt(orders.id, cursor)); } if (slotId) { whereCondition = and(whereCondition, eq(orders.slotId, slotId)); } if (packagedFilter === "packaged") { whereCondition = and(whereCondition, eq(orderStatus.isPackaged, true)); } else if (packagedFilter === "not_packaged") { whereCondition = and(whereCondition, eq(orderStatus.isPackaged, false)); } if (deliveredFilter === "delivered") { whereCondition = and(whereCondition, eq(orderStatus.isDelivered, true)); } else if (deliveredFilter === "not_delivered") { whereCondition = and(whereCondition, eq(orderStatus.isDelivered, false)); } if (cancellationFilter === "cancelled") { whereCondition = and(whereCondition, eq(orderStatus.isCancelled, true)); } else if (cancellationFilter === "not_cancelled") { whereCondition = and(whereCondition, eq(orderStatus.isCancelled, false)); } if (flashDeliveryFilter === "flash") { whereCondition = and(whereCondition, eq(orders.isFlashDelivery, true)); } else if (flashDeliveryFilter === "regular") { whereCondition = and(whereCondition, eq(orders.isFlashDelivery, false)); } const allOrders = await db.query.orders.findMany({ where: whereCondition, orderBy: desc(orders.createdAt), limit: limit + 1, with: { user: true, address: true, slot: true, orderItems: { with: { product: { with: { unit: true } } } }, orderStatus: true } }); const hasMore = allOrders.length > limit; const ordersToReturn = hasMore ? allOrders.slice(0, limit) : allOrders; const filteredOrders = ordersToReturn.filter((order) => { const statusRecord = order.orderStatus[0]; return order.isCod || statusRecord && statusRecord.paymentStatus === "success"; }); const formattedOrders = filteredOrders.map((order) => { const statusRecord = order.orderStatus[0]; let status = "pending"; if (statusRecord?.isCancelled) { status = "cancelled"; } else if (statusRecord?.isDelivered) { status = "delivered"; } const items = order.orderItems.map((item) => ({ id: item.id, name: item.product.name, quantity: parseFloat(item.quantity), price: parseFloat(item.price.toString()), amount: parseFloat(item.quantity) * parseFloat(item.price.toString()), unit: item.product.unit?.shortNotation || "", productSize: item.product.productQuantity, isPackaged: item.is_packaged, isPackageVerified: item.is_package_verified })).sort((first, second) => first.id - second.id); return { id: order.id, orderId: order.id.toString(), readableId: order.id, customerName: order.user.name || order.user.mobile + "", customerMobile: order.user.mobile, address: `${order.address.addressLine1}${order.address.addressLine2 ? `, ${order.address.addressLine2}` : ""}, ${order.address.city}, ${order.address.state} - ${order.address.pincode}, Phone: ${order.address.phone}`, addressId: order.addressId, latitude: order.address.adminLatitude ?? order.address.latitude, longitude: order.address.adminLongitude ?? order.address.longitude, totalAmount: parseFloat(order.totalAmount), deliveryCharge: parseFloat(order.deliveryCharge || "0"), items, createdAt: order.createdAt, deliveryTime: order.slot?.deliveryTime.toISOString() || null, status, isPackaged: order.orderItems.every((item) => item.is_packaged) || false, isDelivered: statusRecord?.isDelivered || false, isCod: order.isCod, isFlashDelivery: order.isFlashDelivery, userNotes: order.userNotes, adminNotes: order.adminNotes, userNegativityScore: 0, userId: order.userId }; }); return { orders: formattedOrders, nextCursor: hasMore ? ordersToReturn[ordersToReturn.length - 1].id : void 0 }; } async function rebalanceSlots(slotIds) { const ordersList = await db.query.orders.findMany({ where: inArray(orders.slotId, slotIds), with: { orderItems: { with: { product: true } }, couponUsages: { with: { coupon: true } } } }); const processedOrdersData = ordersList.map((order) => { let newTotal = order.orderItems.reduce((acc, item) => { const latestPrice = +item.product.price; const amount = latestPrice * Number(item.quantity); return acc + amount; }, 0); order.orderItems.forEach((item) => { item.price = item.product.price; item.discountedPrice = item.product.price; }); const coupon = order.couponUsages[0]?.coupon; let discount = 0; if (coupon && !coupon.isInvalidated && (!coupon.validTill || new Date(coupon.validTill) > /* @__PURE__ */ new Date())) { const proportion = Number(order.orderGroupProportion || 1); if (coupon.discountPercent) { const maxDiscount = Number(coupon.maxValue || Infinity) * proportion; discount = Math.min(newTotal * parseFloat(coupon.discountPercent) / 100, maxDiscount); } else { discount = Number(coupon.flatDiscount) * proportion; } } newTotal -= discount; const { couponUsages, orderItems: orderItemsRaw, ...rest } = order; const updatedOrderItems = orderItemsRaw.map((item) => { const { product, ...rawOrderItem } = item; return rawOrderItem; }); return { order: rest, updatedOrderItems, newTotal }; }); const updatedOrderIds = []; await db.transaction(async (tx) => { for (const { order, updatedOrderItems, newTotal } of processedOrdersData) { await tx.update(orders).set({ totalAmount: newTotal.toString() }).where(eq(orders.id, order.id)); updatedOrderIds.push(order.id); for (const item of updatedOrderItems) { await tx.update(orderItems).set({ price: item.price, discountedPrice: item.discountedPrice }).where(eq(orderItems.id, item.id)); } } }); return { success: true, updatedOrders: updatedOrderIds, message: `Rebalanced ${updatedOrderIds.length} orders.` }; } async function cancelOrder(orderId, reason) { const order = await db.query.orders.findFirst({ where: eq(orders.id, orderId), with: { orderStatus: true } }); if (!order) { return { success: false, message: "Order not found", error: "order_not_found" }; } const status = order.orderStatus[0]; if (!status) { return { success: false, message: "Order status not found", error: "status_not_found" }; } if (status.isCancelled) { return { success: false, message: "Order is already cancelled", error: "already_cancelled" }; } if (status.isDelivered) { return { success: false, message: "Cannot cancel delivered order", error: "already_delivered" }; } const result = await db.transaction(async (tx) => { await tx.update(orderStatus).set({ isCancelled: true, isCancelledByAdmin: true, cancelReason: reason, cancellationAdminNotes: reason, cancellationReviewed: true, cancellationReviewedAt: /* @__PURE__ */ new Date() }).where(eq(orderStatus.id, status.id)); const refundStatus = order.isCod ? "na" : "pending"; await tx.insert(refunds).values({ orderId: order.id, refundStatus }); return { orderId: order.id, userId: order.userId }; }); return { success: true, message: "Order cancelled successfully", orderId: result.orderId, userId: result.userId }; } async function deleteOrderById(orderId) { await db.transaction(async (tx) => { await tx.delete(orderItems).where(eq(orderItems.orderId, orderId)); await tx.delete(orderStatus).where(eq(orderStatus.orderId, orderId)); await tx.delete(payments).where(eq(payments.orderId, orderId)); await tx.delete(refunds).where(eq(refunds.orderId, orderId)); await tx.delete(couponUsage).where(eq(couponUsage.orderId, orderId)); await tx.delete(complaints).where(eq(complaints.orderId, orderId)); await tx.delete(orders).where(eq(orders.id, orderId)); }); } var isPaymentStatus, isRefundStatus, mapOrderStatusRecord; var init_order = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/order.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); isPaymentStatus = /* @__PURE__ */ __name((value) => value === "pending" || value === "success" || value === "cod" || value === "failed", "isPaymentStatus"); isRefundStatus = /* @__PURE__ */ __name((value) => value === "success" || value === "pending" || value === "failed" || value === "none" || value === "na" || value === "processed", "isRefundStatus"); mapOrderStatusRecord = /* @__PURE__ */ __name((record2) => ({ id: record2.id, orderTime: record2.orderTime, userId: record2.userId, orderId: record2.orderId, isPackaged: record2.isPackaged, isDelivered: record2.isDelivered, isCancelled: record2.isCancelled, cancelReason: record2.cancelReason ?? null, isCancelledByAdmin: record2.isCancelledByAdmin ?? null, paymentStatus: isPaymentStatus(record2.paymentStatus) ? record2.paymentStatus : "pending", cancellationUserNotes: record2.cancellationUserNotes ?? null, cancellationAdminNotes: record2.cancellationAdminNotes ?? null, cancellationReviewed: record2.cancellationReviewed, cancellationReviewedAt: record2.cancellationReviewedAt ?? null, refundCouponId: record2.refundCouponId ?? null }), "mapOrderStatusRecord"); __name(updateOrderNotes, "updateOrderNotes"); __name(updateOrderPackaged, "updateOrderPackaged"); __name(updateOrderDelivered, "updateOrderDelivered"); __name(getOrderDetails, "getOrderDetails"); __name(updateOrderItemPackaging, "updateOrderItemPackaging"); __name(removeDeliveryCharge, "removeDeliveryCharge"); __name(getSlotOrders, "getSlotOrders"); __name(updateAddressCoords, "updateAddressCoords"); __name(getAllOrders, "getAllOrders"); __name(rebalanceSlots, "rebalanceSlots"); __name(cancelOrder, "cancelOrder"); __name(deleteOrderById, "deleteOrderById"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/product.ts async function getAllProducts() { const products = await db.query.productInfo.findMany({ orderBy: productInfo.name, with: { unit: true, store: true } }); return products.map((product) => ({ ...mapProduct(product), unit: mapUnit(product.unit), store: product.store ? mapStore(product.store) : null })); } async function getProductById(id) { const product = await db.query.productInfo.findFirst({ where: eq(productInfo.id, id), with: { unit: true } }); if (!product) { return null; } const deals = await db.query.specialDeals.findMany({ where: eq(specialDeals.productId, id), orderBy: specialDeals.quantity }); const productTagsData = await db.query.productTags.findMany({ where: eq(productTags.productId, id), with: { tag: true } }); return { ...mapProduct(product), unit: mapUnit(product.unit), deals: deals.map(mapSpecialDeal), tags: productTagsData.map((tag2) => mapTagInfo(tag2.tag)) }; } async function deleteProduct(id) { const [deletedProduct] = await db.delete(productInfo).where(eq(productInfo.id, id)).returning(); if (!deletedProduct) { return null; } return mapProduct(deletedProduct); } async function createProduct(input) { const [product] = await db.insert(productInfo).values(input).returning(); return mapProduct(product); } async function updateProduct(id, updates) { const [product] = await db.update(productInfo).set(updates).where(eq(productInfo.id, id)).returning(); if (!product) { return null; } return mapProduct(product); } async function toggleProductOutOfStock(id) { const product = await db.query.productInfo.findFirst({ where: eq(productInfo.id, id) }); if (!product) { return null; } const [updatedProduct] = await db.update(productInfo).set({ isOutOfStock: !product.isOutOfStock }).where(eq(productInfo.id, id)).returning(); if (!updatedProduct) { return null; } return mapProduct(updatedProduct); } async function updateSlotProducts(slotId, productIds) { const currentAssociations = await db.query.productSlots.findMany({ where: eq(productSlots.slotId, parseInt(slotId)), columns: { productId: true } }); const currentProductIds = currentAssociations.map((assoc) => assoc.productId); const newProductIds = productIds.map((id) => parseInt(id)); const productsToAdd = newProductIds.filter((id) => !currentProductIds.includes(id)); const productsToRemove = currentProductIds.filter((id) => !newProductIds.includes(id)); if (productsToRemove.length > 0) { await db.delete(productSlots).where( and( eq(productSlots.slotId, parseInt(slotId)), inArray(productSlots.productId, productsToRemove) ) ); } if (productsToAdd.length > 0) { const newAssociations = productsToAdd.map((productId) => ({ productId, slotId: parseInt(slotId) })); await db.insert(productSlots).values(newAssociations); } return { message: "Slot products updated successfully", added: productsToAdd.length, removed: productsToRemove.length }; } async function getSlotProductIds(slotId) { const associations = await db.query.productSlots.findMany({ where: eq(productSlots.slotId, parseInt(slotId)), columns: { productId: true } }); return associations.map((assoc) => assoc.productId); } async function getAllUnits() { const allUnits = await db.query.units.findMany({ orderBy: units.shortNotation }); return allUnits.map(mapUnit); } async function getAllProductTags() { const tags = await db.query.productTagInfo.findMany({ with: { products: { with: { product: true } } } }); return tags.map((tag2) => ({ ...mapTagInfo(tag2), products: tag2.products.map((assignment) => ({ productId: assignment.productId, tagId: assignment.tagId, assignedAt: assignment.assignedAt, product: mapProduct(assignment.product) })) })); } async function getAllProductTagInfos() { const tags = await db.query.productTagInfo.findMany({ orderBy: productTagInfo.tagName }); return tags.map(mapTagInfo); } async function getProductTagInfoById(tagId) { const tag2 = await db.query.productTagInfo.findFirst({ where: eq(productTagInfo.id, tagId) }); if (!tag2) { return null; } return mapTagInfo(tag2); } async function createProductTag(input) { const [tag2] = await db.insert(productTagInfo).values({ tagName: input.tagName, tagDescription: input.tagDescription || null, imageUrl: input.imageUrl || null, isDashboardTag: input.isDashboardTag || false, relatedStores: input.relatedStores || [] }).returning(); return { ...mapTagInfo(tag2), products: [] }; } async function getProductTagById(tagId) { const tag2 = await db.query.productTagInfo.findFirst({ where: eq(productTagInfo.id, tagId), with: { products: { with: { product: true } } } }); if (!tag2) { return null; } return { ...mapTagInfo(tag2), products: tag2.products.map((assignment) => ({ productId: assignment.productId, tagId: assignment.tagId, assignedAt: assignment.assignedAt, product: mapProduct(assignment.product) })) }; } async function updateProductTag(tagId, input) { const [tag2] = await db.update(productTagInfo).set({ ...input.tagName !== void 0 && { tagName: input.tagName }, ...input.tagDescription !== void 0 && { tagDescription: input.tagDescription }, ...input.imageUrl !== void 0 && { imageUrl: input.imageUrl }, ...input.isDashboardTag !== void 0 && { isDashboardTag: input.isDashboardTag }, ...input.relatedStores !== void 0 && { relatedStores: input.relatedStores } }).where(eq(productTagInfo.id, tagId)).returning(); const fullTag = await db.query.productTagInfo.findFirst({ where: eq(productTagInfo.id, tagId), with: { products: { with: { product: true } } } }); return { ...mapTagInfo(tag2), products: fullTag?.products.map((assignment) => ({ productId: assignment.productId, tagId: assignment.tagId, assignedAt: assignment.assignedAt, product: mapProduct(assignment.product) })) || [] }; } async function deleteProductTag(tagId) { await db.delete(productTagInfo).where(eq(productTagInfo.id, tagId)); } async function checkProductTagExistsByName(tagName) { const tag2 = await db.query.productTagInfo.findFirst({ where: eq(productTagInfo.tagName, tagName) }); return !!tag2; } async function getSlotsProductIds(slotIds) { if (slotIds.length === 0) { return {}; } const associations = await db.query.productSlots.findMany({ where: inArray(productSlots.slotId, slotIds), columns: { slotId: true, productId: true } }); const result = {}; for (const assoc of associations) { if (!result[assoc.slotId]) { result[assoc.slotId] = []; } result[assoc.slotId].push(assoc.productId); } slotIds.forEach((slotId) => { if (!result[slotId]) { result[slotId] = []; } }); return result; } async function getProductReviews(productId, limit, offset) { const reviews = await db.select({ id: productReviews.id, reviewBody: productReviews.reviewBody, ratings: productReviews.ratings, imageUrls: productReviews.imageUrls, reviewTime: productReviews.reviewTime, adminResponse: productReviews.adminResponse, adminResponseImages: productReviews.adminResponseImages, userName: users.name }).from(productReviews).innerJoin(users, eq(productReviews.userId, users.id)).where(eq(productReviews.productId, productId)).orderBy(desc(productReviews.reviewTime)).limit(limit).offset(offset); const totalCountResult = await db.select({ count: sql`count(*)` }).from(productReviews).where(eq(productReviews.productId, productId)); const totalCount = Number(totalCountResult[0].count); const mappedReviews = reviews.map((review) => ({ id: review.id, reviewBody: review.reviewBody, ratings: review.ratings, imageUrls: review.imageUrls, reviewTime: review.reviewTime, adminResponse: review.adminResponse ?? null, adminResponseImages: review.adminResponseImages, userName: review.userName ?? null })); return { reviews: mappedReviews, totalCount }; } async function respondToReview(reviewId, adminResponse, adminResponseImages) { const [updatedReview] = await db.update(productReviews).set({ adminResponse, adminResponseImages }).where(eq(productReviews.id, reviewId)).returning(); if (!updatedReview) { return null; } return { id: updatedReview.id, reviewBody: updatedReview.reviewBody, ratings: updatedReview.ratings, imageUrls: updatedReview.imageUrls, reviewTime: updatedReview.reviewTime, adminResponse: updatedReview.adminResponse ?? null, adminResponseImages: updatedReview.adminResponseImages, userName: null }; } async function getAllProductGroups() { const groups = await db.query.productGroupInfo.findMany({ with: { memberships: { with: { product: true } } }, orderBy: desc(productGroupInfo.createdAt) }); return groups.map((group6) => ({ id: group6.id, groupName: group6.groupName, description: group6.description ?? null, createdAt: group6.createdAt, products: group6.memberships.map((membership) => mapProduct(membership.product)), productCount: group6.memberships.length, memberships: group6.memberships })); } async function createProductGroup(groupName, description, productIds) { const [newGroup] = await db.insert(productGroupInfo).values({ groupName, description }).returning(); if (productIds.length > 0) { const memberships = productIds.map((productId) => ({ productId, groupId: newGroup.id })); await db.insert(productGroupMembership).values(memberships); } return { id: newGroup.id, groupName: newGroup.groupName, description: newGroup.description ?? null, createdAt: newGroup.createdAt }; } async function updateProductGroup(id, groupName, description, productIds) { const updateData = {}; if (groupName !== void 0) updateData.groupName = groupName; if (description !== void 0) updateData.description = description; const [updatedGroup] = await db.update(productGroupInfo).set(updateData).where(eq(productGroupInfo.id, id)).returning(); if (!updatedGroup) { return null; } if (productIds !== void 0) { await db.delete(productGroupMembership).where(eq(productGroupMembership.groupId, id)); if (productIds.length > 0) { const memberships = productIds.map((productId) => ({ productId, groupId: id })); await db.insert(productGroupMembership).values(memberships); } } return { id: updatedGroup.id, groupName: updatedGroup.groupName, description: updatedGroup.description ?? null, createdAt: updatedGroup.createdAt }; } async function deleteProductGroup(id) { await db.delete(productGroupMembership).where(eq(productGroupMembership.groupId, id)); const [deletedGroup] = await db.delete(productGroupInfo).where(eq(productGroupInfo.id, id)).returning(); if (!deletedGroup) { return null; } return { id: deletedGroup.id, groupName: deletedGroup.groupName, description: deletedGroup.description ?? null, createdAt: deletedGroup.createdAt }; } async function addProductToGroup(groupId, productId) { await db.insert(productGroupMembership).values({ groupId, productId }); } async function removeProductFromGroup(groupId, productId) { await db.delete(productGroupMembership).where(and( eq(productGroupMembership.groupId, groupId), eq(productGroupMembership.productId, productId) )); } async function updateProductPrices(updates) { if (updates.length === 0) { return { updatedCount: 0, invalidIds: [] }; } const productIds = updates.map((update) => update.productId); const existingProducts = await db.query.productInfo.findMany({ where: inArray(productInfo.id, productIds), columns: { id: true } }); const existingIds = new Set(existingProducts.map((product) => product.id)); const invalidIds = productIds.filter((id) => !existingIds.has(id)); if (invalidIds.length > 0) { return { updatedCount: 0, invalidIds }; } const updatePromises = updates.map((update) => { const { productId, price, marketPrice, flashPrice, isFlashAvailable } = update; const updateData = {}; if (price !== void 0) updateData.price = price.toString(); if (marketPrice !== void 0) updateData.marketPrice = marketPrice === null ? null : marketPrice.toString(); if (flashPrice !== void 0) updateData.flashPrice = flashPrice === null ? null : flashPrice.toString(); if (isFlashAvailable !== void 0) updateData.isFlashAvailable = isFlashAvailable; return db.update(productInfo).set(updateData).where(eq(productInfo.id, productId)); }); await Promise.all(updatePromises); return { updatedCount: updates.length, invalidIds: [] }; } async function checkProductExistsByName(name) { const product = await db.query.productInfo.findFirst({ where: eq(productInfo.name, name), columns: { id: true } }); return !!product; } async function checkUnitExists(unitId) { const unit = await db.query.units.findFirst({ where: eq(units.id, unitId), columns: { id: true } }); return !!unit; } async function getProductImagesById(productId) { const product = await db.query.productInfo.findFirst({ where: eq(productInfo.id, productId), columns: { images: true } }); if (!product) { return null; } return getStringArray(product.images) || []; } async function createSpecialDealsForProduct(productId, deals) { if (deals.length === 0) { return []; } const dealInserts = deals.map((deal) => ({ productId, quantity: deal.quantity.toString(), price: deal.price.toString(), validTill: new Date(deal.validTill) })); const createdDeals = await db.insert(specialDeals).values(dealInserts).returning(); return createdDeals.map(mapSpecialDeal); } async function updateProductDeals(productId, deals) { if (deals.length === 0) { await db.delete(specialDeals).where(eq(specialDeals.productId, productId)); return; } const existingDeals = await db.query.specialDeals.findMany({ where: eq(specialDeals.productId, productId) }); const existingDealsMap = new Map( existingDeals.map((deal) => [`${deal.quantity}-${deal.price}`, deal]) ); const newDealsMap = new Map( deals.map((deal) => [`${deal.quantity}-${deal.price}`, deal]) ); const dealsToAdd = deals.filter((deal) => { const key = `${deal.quantity}-${deal.price}`; return !existingDealsMap.has(key); }); const dealsToRemove = existingDeals.filter((deal) => { const key = `${deal.quantity}-${deal.price}`; return !newDealsMap.has(key); }); const dealsToUpdate = deals.filter((deal) => { const key = `${deal.quantity}-${deal.price}`; const existing = existingDealsMap.get(key); const nextValidTill = deal.validTill instanceof Date ? deal.validTill.toISOString().split("T")[0] : String(deal.validTill); return existing && existing.validTill.toISOString().split("T")[0] !== nextValidTill; }); if (dealsToRemove.length > 0) { await db.delete(specialDeals).where( inArray(specialDeals.id, dealsToRemove.map((deal) => deal.id)) ); } if (dealsToAdd.length > 0) { const dealInserts = dealsToAdd.map((deal) => ({ productId, quantity: deal.quantity.toString(), price: deal.price.toString(), validTill: new Date(deal.validTill) })); await db.insert(specialDeals).values(dealInserts); } for (const deal of dealsToUpdate) { const key = `${deal.quantity}-${deal.price}`; const existingDeal = existingDealsMap.get(key); if (existingDeal) { await db.update(specialDeals).set({ validTill: new Date(deal.validTill) }).where(eq(specialDeals.id, existingDeal.id)); } } } async function replaceProductTags(productId, tagIds) { await db.delete(productTags).where(eq(productTags.productId, productId)); if (tagIds.length === 0) { return; } const tagAssociations = tagIds.map((tagId) => ({ productId, tagId })); await db.insert(productTags).values(tagAssociations); } var getStringArray, mapUnit, mapStore, mapProduct, mapSpecialDeal, mapTagInfo; var init_product = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/product.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); getStringArray = /* @__PURE__ */ __name((value) => { if (!Array.isArray(value)) return null; return value.map((item) => String(item)); }, "getStringArray"); mapUnit = /* @__PURE__ */ __name((unit) => ({ id: unit.id, shortNotation: unit.shortNotation, fullName: unit.fullName }), "mapUnit"); mapStore = /* @__PURE__ */ __name((store) => ({ id: store.id, name: store.name, description: store.description, imageUrl: store.imageUrl, owner: store.owner, createdAt: store.createdAt // updatedAt: store.createdAt, }), "mapStore"); mapProduct = /* @__PURE__ */ __name((product) => ({ id: product.id, name: product.name, shortDescription: product.shortDescription ?? null, longDescription: product.longDescription ?? null, unitId: product.unitId, price: String(product.price ?? "0"), marketPrice: product.marketPrice ? String(product.marketPrice) : null, images: getStringArray(product.images), imageKeys: getStringArray(product.images), isOutOfStock: product.isOutOfStock, isSuspended: product.isSuspended, isFlashAvailable: product.isFlashAvailable, flashPrice: product.flashPrice ? String(product.flashPrice) : null, createdAt: product.createdAt, incrementStep: product.incrementStep, productQuantity: product.productQuantity, storeId: product.storeId }), "mapProduct"); mapSpecialDeal = /* @__PURE__ */ __name((deal) => ({ id: deal.id, productId: deal.productId, quantity: String(deal.quantity ?? "0"), price: String(deal.price ?? "0"), validTill: deal.validTill }), "mapSpecialDeal"); mapTagInfo = /* @__PURE__ */ __name((tag2) => ({ id: tag2.id, tagName: tag2.tagName, tagDescription: tag2.tagDescription ?? null, imageUrl: tag2.imageUrl ?? null, isDashboardTag: tag2.isDashboardTag, relatedStores: tag2.relatedStores, createdAt: tag2.createdAt }), "mapTagInfo"); __name(getAllProducts, "getAllProducts"); __name(getProductById, "getProductById"); __name(deleteProduct, "deleteProduct"); __name(createProduct, "createProduct"); __name(updateProduct, "updateProduct"); __name(toggleProductOutOfStock, "toggleProductOutOfStock"); __name(updateSlotProducts, "updateSlotProducts"); __name(getSlotProductIds, "getSlotProductIds"); __name(getAllUnits, "getAllUnits"); __name(getAllProductTags, "getAllProductTags"); __name(getAllProductTagInfos, "getAllProductTagInfos"); __name(getProductTagInfoById, "getProductTagInfoById"); __name(createProductTag, "createProductTag"); __name(getProductTagById, "getProductTagById"); __name(updateProductTag, "updateProductTag"); __name(deleteProductTag, "deleteProductTag"); __name(checkProductTagExistsByName, "checkProductTagExistsByName"); __name(getSlotsProductIds, "getSlotsProductIds"); __name(getProductReviews, "getProductReviews"); __name(respondToReview, "respondToReview"); __name(getAllProductGroups, "getAllProductGroups"); __name(createProductGroup, "createProductGroup"); __name(updateProductGroup, "updateProductGroup"); __name(deleteProductGroup, "deleteProductGroup"); __name(addProductToGroup, "addProductToGroup"); __name(removeProductFromGroup, "removeProductFromGroup"); __name(updateProductPrices, "updateProductPrices"); __name(checkProductExistsByName, "checkProductExistsByName"); __name(checkUnitExists, "checkUnitExists"); __name(getProductImagesById, "getProductImagesById"); __name(createSpecialDealsForProduct, "createSpecialDealsForProduct"); __name(updateProductDeals, "updateProductDeals"); __name(replaceProductTags, "replaceProductTags"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/slots.ts async function getActiveSlotsWithProducts() { const slots = await db.query.deliverySlotInfo.findMany({ where: eq(deliverySlotInfo.isActive, true), orderBy: desc(deliverySlotInfo.deliveryTime), with: { productSlots: { with: { product: { columns: { id: true, name: true, images: true } } } } } }); return slots.map((slot) => ({ ...mapDeliverySlot(slot), deliverySequence: getNumberArray(slot.deliverySequence), products: slot.productSlots.map((ps) => mapSlotProductSummary(ps.product)) })); } async function getActiveSlots() { const slots = await db.query.deliverySlotInfo.findMany({ where: eq(deliverySlotInfo.isActive, true) }); return slots.map(mapDeliverySlot); } async function getSlotsAfterDate(afterDate) { const slots = await db.query.deliverySlotInfo.findMany({ where: and( eq(deliverySlotInfo.isActive, true), gt(deliverySlotInfo.deliveryTime, afterDate) ), orderBy: asc(deliverySlotInfo.deliveryTime) }); return slots.map(mapDeliverySlot); } async function getSlotByIdWithRelations(id) { const slot = await db.query.deliverySlotInfo.findFirst({ where: eq(deliverySlotInfo.id, id), with: { productSlots: { with: { product: { columns: { id: true, name: true, images: true } } } }, vendorSnippets: true } }); if (!slot) { return null; } return { ...mapDeliverySlot(slot), deliverySequence: getNumberArray(slot.deliverySequence), groupIds: getNumberArray(slot.groupIds), products: slot.productSlots.map((ps) => mapSlotProductSummary(ps.product)), vendorSnippets: slot.vendorSnippets.map(mapVendorSnippet) }; } async function createSlotWithRelations(input) { const { deliveryTime, freezeTime, isActive, productIds, vendorSnippets: snippets, groupIds } = input; const result = await db.transaction(async (tx) => { const [newSlot] = await tx.insert(deliverySlotInfo).values({ deliveryTime: new Date(deliveryTime), freezeTime: new Date(freezeTime), isActive: isActive !== void 0 ? isActive : true, groupIds: groupIds !== void 0 ? groupIds : [] }).returning(); if (productIds && productIds.length > 0) { const associations = productIds.map((productId) => ({ productId, slotId: newSlot.id })); await tx.insert(productSlots).values(associations); } let createdSnippets = []; if (snippets && snippets.length > 0) { for (const snippet of snippets) { const products = await tx.query.productInfo.findMany({ where: inArray(productInfo.id, snippet.productIds) }); if (products.length !== snippet.productIds.length) { throw new Error(`One or more invalid product IDs in snippet "${snippet.name}"`); } const existingSnippet = await tx.query.vendorSnippets.findFirst({ where: eq(vendorSnippets.snippetCode, snippet.name) }); if (existingSnippet) { throw new Error(`Snippet name "${snippet.name}" already exists`); } const [createdSnippet] = await tx.insert(vendorSnippets).values({ snippetCode: snippet.name, slotId: newSlot.id, productIds: snippet.productIds, validTill: snippet.validTill ? new Date(snippet.validTill) : void 0 }).returning(); createdSnippets.push(mapVendorSnippet(createdSnippet)); } } return { slot: mapDeliverySlot(newSlot), createdSnippets, message: "Slot created successfully" }; }); return result; } async function updateSlotWithRelations(input) { const { id, deliveryTime, freezeTime, isActive, productIds, vendorSnippets: snippets, groupIds } = input; let validGroupIds = groupIds; if (groupIds && groupIds.length > 0) { const existingGroups = await db.query.productGroupInfo.findMany({ where: inArray(productGroupInfo.id, groupIds), columns: { id: true } }); validGroupIds = existingGroups.map((group6) => group6.id); } const result = await db.transaction(async (tx) => { const [updatedSlot] = await tx.update(deliverySlotInfo).set({ deliveryTime: new Date(deliveryTime), freezeTime: new Date(freezeTime), isActive: isActive !== void 0 ? isActive : true, groupIds: validGroupIds !== void 0 ? validGroupIds : [] }).where(eq(deliverySlotInfo.id, id)).returning(); if (!updatedSlot) { return null; } if (productIds !== void 0) { await tx.delete(productSlots).where(eq(productSlots.slotId, id)); if (productIds.length > 0) { const associations = productIds.map((productId) => ({ productId, slotId: id })); await tx.insert(productSlots).values(associations); } } let createdSnippets = []; if (snippets && snippets.length > 0) { for (const snippet of snippets) { const products = await tx.query.productInfo.findMany({ where: inArray(productInfo.id, snippet.productIds) }); if (products.length !== snippet.productIds.length) { throw new Error(`One or more invalid product IDs in snippet "${snippet.name}"`); } const existingSnippet = await tx.query.vendorSnippets.findFirst({ where: eq(vendorSnippets.snippetCode, snippet.name) }); if (existingSnippet) { throw new Error(`Snippet name "${snippet.name}" already exists`); } const [createdSnippet] = await tx.insert(vendorSnippets).values({ snippetCode: snippet.name, slotId: id, productIds: snippet.productIds, validTill: snippet.validTill ? new Date(snippet.validTill) : void 0 }).returning(); createdSnippets.push(mapVendorSnippet(createdSnippet)); } } return { slot: mapDeliverySlot(updatedSlot), createdSnippets, message: "Slot updated successfully" }; }); return result; } async function deleteSlotById(id) { const [deletedSlot] = await db.update(deliverySlotInfo).set({ isActive: false }).where(eq(deliverySlotInfo.id, id)).returning(); if (!deletedSlot) { return null; } return mapDeliverySlot(deletedSlot); } async function getSlotDeliverySequence(slotId) { const slot = await db.query.deliverySlotInfo.findFirst({ where: eq(deliverySlotInfo.id, slotId) }); if (!slot) { return null; } return mapDeliverySlot(slot); } async function updateSlotDeliverySequence(slotId, sequence) { const [updatedSlot] = await db.update(deliverySlotInfo).set({ deliverySequence: sequence }).where(eq(deliverySlotInfo.id, slotId)).returning({ id: deliverySlotInfo.id, deliverySequence: deliverySlotInfo.deliverySequence }); return updatedSlot || null; } async function updateSlotCapacity(slotId, isCapacityFull) { const [updatedSlot] = await db.update(deliverySlotInfo).set({ isCapacityFull }).where(eq(deliverySlotInfo.id, slotId)).returning(); if (!updatedSlot) { return null; } return { success: true, slot: mapDeliverySlot(updatedSlot), message: `Slot ${isCapacityFull ? "marked as full capacity" : "capacity reset"}` }; } var getStringArray2, getNumberArray, mapDeliverySlot, mapSlotProductSummary, mapVendorSnippet; var init_slots = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/slots.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); getStringArray2 = /* @__PURE__ */ __name((value) => { if (!Array.isArray(value)) return null; return value.map((item) => String(item)); }, "getStringArray"); getNumberArray = /* @__PURE__ */ __name((value) => { if (!Array.isArray(value)) return []; return value.map((item) => Number(item)); }, "getNumberArray"); mapDeliverySlot = /* @__PURE__ */ __name((slot) => ({ id: slot.id, deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, isActive: slot.isActive, isFlash: slot.isFlash, isCapacityFull: slot.isCapacityFull, deliverySequence: slot.deliverySequence, groupIds: slot.groupIds }), "mapDeliverySlot"); mapSlotProductSummary = /* @__PURE__ */ __name((product) => ({ id: product.id, name: product.name, images: getStringArray2(product.images) }), "mapSlotProductSummary"); mapVendorSnippet = /* @__PURE__ */ __name((snippet) => ({ id: snippet.id, snippetCode: snippet.snippetCode, slotId: snippet.slotId ?? null, productIds: snippet.productIds || [], isPermanent: snippet.isPermanent, validTill: snippet.validTill ?? null, createdAt: snippet.createdAt }), "mapVendorSnippet"); __name(getActiveSlotsWithProducts, "getActiveSlotsWithProducts"); __name(getActiveSlots, "getActiveSlots"); __name(getSlotsAfterDate, "getSlotsAfterDate"); __name(getSlotByIdWithRelations, "getSlotByIdWithRelations"); __name(createSlotWithRelations, "createSlotWithRelations"); __name(updateSlotWithRelations, "updateSlotWithRelations"); __name(deleteSlotById, "deleteSlotById"); __name(getSlotDeliverySequence, "getSlotDeliverySequence"); __name(updateSlotDeliverySequence, "updateSlotDeliverySequence"); __name(updateSlotCapacity, "updateSlotCapacity"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/staff-user.ts async function getStaffUserByName(name) { const staff = await db.query.staffUsers.findFirst({ where: eq(staffUsers.name, name) }); return staff || null; } async function getStaffUserById(staffId) { const staff = await db.query.staffUsers.findFirst({ where: eq(staffUsers.id, staffId) }); return staff || null; } async function getAllStaff() { const staff = await db.query.staffUsers.findMany({ columns: { id: true, name: true }, with: { role: { with: { rolePermissions: { with: { permission: true } } } } } }); return staff; } async function getAllUsers(cursor, limit = 20, search) { let whereCondition = void 0; if (search) { whereCondition = or( like(users.name, `%${search}%`), like(users.email, `%${search}%`), like(users.mobile, `%${search}%`) ); } if (cursor) { const cursorCondition = lt(users.id, cursor); whereCondition = whereCondition ? and(whereCondition, cursorCondition) : cursorCondition; } const allUsers = await db.query.users.findMany({ where: whereCondition, with: { userDetails: true }, orderBy: desc(users.id), limit: limit + 1 }); const hasMore = allUsers.length > limit; const usersToReturn = hasMore ? allUsers.slice(0, limit) : allUsers; return { users: usersToReturn, hasMore }; } async function getUserWithDetails(userId) { const user = await db.query.users.findFirst({ where: eq(users.id, userId), with: { userDetails: true, orders: { orderBy: desc(orders.createdAt), limit: 1 } } }); return user || null; } async function updateUserSuspensionStatus(userId, isSuspended) { await db.insert(userDetails).values({ userId, isSuspended }).onConflictDoUpdate({ target: userDetails.userId, set: { isSuspended } }); } async function checkStaffUserExists(name) { const existingUser = await db.query.staffUsers.findFirst({ where: eq(staffUsers.name, name) }); return !!existingUser; } async function checkStaffRoleExists(roleId) { const role = await db.query.staffRoles.findFirst({ where: eq(staffRoles.id, roleId) }); return !!role; } async function createStaffUser(name, password, roleId) { const [newUser] = await db.insert(staffUsers).values({ name: name.trim(), password, staffRoleId: roleId }).returning(); return { id: newUser.id, name: newUser.name, password: newUser.password, staffRoleId: newUser.staffRoleId, createdAt: newUser.createdAt }; } async function getAllRoles() { const roles = await db.query.staffRoles.findMany({ columns: { id: true, roleName: true } }); return roles; } var init_staff_user = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/staff-user.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getStaffUserByName, "getStaffUserByName"); __name(getStaffUserById, "getStaffUserById"); __name(getAllStaff, "getAllStaff"); __name(getAllUsers, "getAllUsers"); __name(getUserWithDetails, "getUserWithDetails"); __name(updateUserSuspensionStatus, "updateUserSuspensionStatus"); __name(checkStaffUserExists, "checkStaffUserExists"); __name(checkStaffRoleExists, "checkStaffRoleExists"); __name(createStaffUser, "createStaffUser"); __name(getAllRoles, "getAllRoles"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/store.ts async function getAllStores() { const stores = await db.query.storeInfo.findMany({ with: { owner: true } }); return stores; } async function getStoreById(id) { const store = await db.query.storeInfo.findFirst({ where: eq(storeInfo.id, id), with: { owner: true } }); return store || null; } async function createStore(input, products) { const [newStore] = await db.insert(storeInfo).values({ name: input.name, description: input.description, imageUrl: input.imageUrl, owner: input.owner }).returning(); if (products && products.length > 0) { await db.update(productInfo).set({ storeId: newStore.id }).where(inArray(productInfo.id, products)); } return { id: newStore.id, name: newStore.name, description: newStore.description, imageUrl: newStore.imageUrl, owner: newStore.owner, createdAt: newStore.createdAt // updatedAt: newStore.updatedAt, }; } async function updateStore(id, input, products) { const [updatedStore] = await db.update(storeInfo).set({ ...input // updatedAt: new Date(), }).where(eq(storeInfo.id, id)).returning(); if (!updatedStore) { throw new Error("Store not found"); } if (products !== void 0) { await db.update(productInfo).set({ storeId: null }).where(eq(productInfo.storeId, id)); if (products.length > 0) { await db.update(productInfo).set({ storeId: id }).where(inArray(productInfo.id, products)); } } return { id: updatedStore.id, name: updatedStore.name, description: updatedStore.description, imageUrl: updatedStore.imageUrl, owner: updatedStore.owner, createdAt: updatedStore.createdAt // updatedAt: updatedStore.updatedAt, }; } async function deleteStore(id) { return await db.transaction(async (tx) => { await tx.update(productInfo).set({ storeId: null }).where(eq(productInfo.storeId, id)); const [deletedStore] = await tx.delete(storeInfo).where(eq(storeInfo.id, id)).returning(); if (!deletedStore) { throw new Error("Store not found"); } return { message: "Store deleted successfully" }; }); } var init_store = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getAllStores, "getAllStores"); __name(getStoreById, "getStoreById"); __name(createStore, "createStore"); __name(updateStore, "updateStore"); __name(deleteStore, "deleteStore"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/user.ts async function createUserByMobile(mobile) { const [newUser] = await db.insert(users).values({ name: null, email: null, mobile }).returning(); return newUser; } async function getUserByMobile(mobile) { const [existingUser] = await db.select().from(users).where(eq(users.mobile, mobile)).limit(1); return existingUser || null; } async function getUnresolvedComplaintsCount() { const result = await db.select({ count: count3(complaints.id) }).from(complaints).where(eq(complaints.isResolved, false)); return result[0]?.count || 0; } async function getAllUsersWithFilters(limit, cursor, search) { const whereConditions = []; if (search && search.trim()) { whereConditions.push(sql`${users.mobile} LIKE ${`%${search.trim()}%`}`); } if (cursor) { whereConditions.push(sql`${users.id} > ${cursor}`); } const usersList = await db.select({ id: users.id, name: users.name, mobile: users.mobile, createdAt: users.createdAt }).from(users).where(whereConditions.length > 0 ? sql.join(whereConditions, sql` AND `) : void 0).orderBy(asc(users.id)).limit(limit + 1); const hasMore = usersList.length > limit; const usersToReturn = hasMore ? usersList.slice(0, limit) : usersList; return { users: usersToReturn, hasMore }; } async function getOrderCountsByUserIds(userIds) { if (userIds.length === 0) return []; return await db.select({ userId: orders.userId, totalOrders: count3(orders.id) }).from(orders).where(sql`${orders.userId} IN (${sql.join(userIds, sql`, `)})`).groupBy(orders.userId); } async function getLastOrdersByUserIds(userIds) { if (userIds.length === 0) return []; return await db.select({ userId: orders.userId, lastOrderDate: max(orders.createdAt) }).from(orders).where(sql`${orders.userId} IN (${sql.join(userIds, sql`, `)})`).groupBy(orders.userId); } async function getSuspensionStatusesByUserIds(userIds) { if (userIds.length === 0) return []; return await db.select({ userId: userDetails.userId, isSuspended: userDetails.isSuspended }).from(userDetails).where(sql`${userDetails.userId} IN (${sql.join(userIds, sql`, `)})`); } async function getUserBasicInfo(userId) { const user = await db.select({ id: users.id, name: users.name, mobile: users.mobile, createdAt: users.createdAt }).from(users).where(eq(users.id, userId)).limit(1); return user[0] || null; } async function getUserSuspensionStatus(userId) { const userDetail = await db.select({ isSuspended: userDetails.isSuspended }).from(userDetails).where(eq(userDetails.userId, userId)).limit(1); return userDetail[0]?.isSuspended ?? false; } async function getUserOrders(userId) { return await db.select({ id: orders.id, readableId: orders.readableId, totalAmount: orders.totalAmount, createdAt: orders.createdAt, isFlashDelivery: orders.isFlashDelivery }).from(orders).where(eq(orders.userId, userId)).orderBy(desc(orders.createdAt)); } async function getOrderStatusesByOrderIds(orderIds) { if (orderIds.length === 0) return []; return await db.select({ orderId: orderStatus.orderId, isDelivered: orderStatus.isDelivered, isCancelled: orderStatus.isCancelled }).from(orderStatus).where(sql`${orderStatus.orderId} IN (${sql.join(orderIds, sql`, `)})`); } async function getItemCountsByOrderIds(orderIds) { if (orderIds.length === 0) return []; return await db.select({ orderId: orderItems.orderId, itemCount: count3(orderItems.id) }).from(orderItems).where(sql`${orderItems.orderId} IN (${sql.join(orderIds, sql`, `)})`).groupBy(orderItems.orderId); } async function upsertUserSuspension(userId, isSuspended) { const existingDetail = await db.select({ id: userDetails.id }).from(userDetails).where(eq(userDetails.userId, userId)).limit(1); if (existingDetail.length > 0) { await db.update(userDetails).set({ isSuspended }).where(eq(userDetails.userId, userId)); } else { await db.insert(userDetails).values({ userId, isSuspended }); } } async function searchUsers(search) { if (search && search.trim()) { return await db.select({ id: users.id, name: users.name, mobile: users.mobile }).from(users).where(sql`${users.mobile} LIKE ${`%${search.trim()}%`} OR ${users.name} LIKE ${`%${search.trim()}%`}`); } else { return await db.select({ id: users.id, name: users.name, mobile: users.mobile }).from(users); } } async function getAllNotifCreds() { return await db.select({ userId: notifCreds.userId, token: notifCreds.token }).from(notifCreds); } async function getAllUnloggedTokens() { return await db.select({ token: unloggedUserTokens.token }).from(unloggedUserTokens); } async function getNotifTokensByUserIds(userIds) { return await db.select({ token: notifCreds.token }).from(notifCreds).where(inArray(notifCreds.userId, userIds)); } async function getUserIncidentsWithRelations(userId) { return await db.query.userIncidents.findMany({ where: eq(userIncidents.userId, userId), with: { order: { with: { orderStatus: true } }, addedBy: true }, orderBy: desc(userIncidents.dateAdded) }); } async function createUserIncident(userId, orderId, adminComment, adminUserId, negativityScore) { const [incident] = await db.insert(userIncidents).values({ userId, orderId, adminComment, addedBy: adminUserId, negativityScore }).returning(); return incident; } var init_user = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/user.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(createUserByMobile, "createUserByMobile"); __name(getUserByMobile, "getUserByMobile"); __name(getUnresolvedComplaintsCount, "getUnresolvedComplaintsCount"); __name(getAllUsersWithFilters, "getAllUsersWithFilters"); __name(getOrderCountsByUserIds, "getOrderCountsByUserIds"); __name(getLastOrdersByUserIds, "getLastOrdersByUserIds"); __name(getSuspensionStatusesByUserIds, "getSuspensionStatusesByUserIds"); __name(getUserBasicInfo, "getUserBasicInfo"); __name(getUserSuspensionStatus, "getUserSuspensionStatus"); __name(getUserOrders, "getUserOrders"); __name(getOrderStatusesByOrderIds, "getOrderStatusesByOrderIds"); __name(getItemCountsByOrderIds, "getItemCountsByOrderIds"); __name(upsertUserSuspension, "upsertUserSuspension"); __name(searchUsers, "searchUsers"); __name(getAllNotifCreds, "getAllNotifCreds"); __name(getAllUnloggedTokens, "getAllUnloggedTokens"); __name(getNotifTokensByUserIds, "getNotifTokensByUserIds"); __name(getUserIncidentsWithRelations, "getUserIncidentsWithRelations"); __name(createUserIncident, "createUserIncident"); } }); // ../../packages/db_helper_sqlite/src/admin-apis/vendor-snippets.ts async function checkVendorSnippetExists(snippetCode) { const existingSnippet = await db.query.vendorSnippets.findFirst({ where: eq(vendorSnippets.snippetCode, snippetCode) }); return !!existingSnippet; } async function getVendorSnippetById(id) { const snippet = await db.query.vendorSnippets.findFirst({ where: eq(vendorSnippets.id, id), with: { slot: true } }); if (!snippet) { return null; } return { ...mapVendorSnippet2(snippet), slot: snippet.slot ? mapDeliverySlot2(snippet.slot) : null }; } async function getVendorSnippetByCode(snippetCode) { const snippet = await db.query.vendorSnippets.findFirst({ where: eq(vendorSnippets.snippetCode, snippetCode) }); return snippet ? mapVendorSnippet2(snippet) : null; } async function getAllVendorSnippets() { const snippets = await db.query.vendorSnippets.findMany({ with: { slot: true }, orderBy: desc(vendorSnippets.createdAt) }); return snippets.map((snippet) => ({ ...mapVendorSnippet2(snippet), slot: snippet.slot ? mapDeliverySlot2(snippet.slot) : null })); } async function createVendorSnippet(input) { const [result] = await db.insert(vendorSnippets).values({ snippetCode: input.snippetCode, slotId: input.slotId, productIds: input.productIds, isPermanent: input.isPermanent, validTill: input.validTill }).returning(); return mapVendorSnippet2(result); } async function updateVendorSnippet(id, updates) { const [result] = await db.update(vendorSnippets).set(updates).where(eq(vendorSnippets.id, id)).returning(); return result ? mapVendorSnippet2(result) : null; } async function deleteVendorSnippet(id) { const [result] = await db.delete(vendorSnippets).where(eq(vendorSnippets.id, id)).returning(); return result ? mapVendorSnippet2(result) : null; } async function getProductsByIds(productIds) { const products = await db.query.productInfo.findMany({ where: inArray(productInfo.id, productIds), columns: { id: true, name: true } }); const prods = products.map(mapProductSummary); return prods; } async function getVendorSlotById(slotId) { const slot = await db.query.deliverySlotInfo.findFirst({ where: eq(deliverySlotInfo.id, slotId) }); return slot ? mapDeliverySlot2(slot) : null; } async function getVendorOrdersBySlotId(slotId) { return await db.query.orders.findMany({ where: eq(orders.slotId, slotId), with: { orderItems: { with: { product: { with: { unit: true } } } }, orderStatus: true, user: true, slot: true }, orderBy: desc(orders.createdAt) }); } async function getVendorOrders() { return await db.query.orders.findMany({ with: { user: true, orderItems: { with: { product: { with: { unit: true } } } } }, orderBy: desc(orders.createdAt) }); } async function getOrderItemsByOrderIds(orderIds) { return await db.query.orderItems.findMany({ where: inArray(orderItems.orderId, orderIds), with: { product: { with: { unit: true } } } }); } async function getOrderStatusByOrderIds(orderIds) { return await db.query.orderStatus.findMany({ where: inArray(orderStatus.orderId, orderIds) }); } async function updateVendorOrderItemPackaging(orderItemId, isPackaged) { const orderItem = await db.query.orderItems.findFirst({ where: eq(orderItems.id, orderItemId), with: { order: { with: { slot: true } } } }); if (!orderItem) { return { success: false, message: "Order item not found" }; } if (!orderItem.order.slotId) { return { success: false, message: "Order item not associated with a vendor slot" }; } const snippetExists = await db.query.vendorSnippets.findFirst({ where: eq(vendorSnippets.slotId, orderItem.order.slotId) }); if (!snippetExists) { return { success: false, message: "No vendor snippet found for this order's slot" }; } const [updatedItem] = await db.update(orderItems).set({ is_packaged: isPackaged }).where(eq(orderItems.id, orderItemId)).returning({ id: orderItems.id }); if (!updatedItem) { return { success: false, message: "Failed to update packaging status" }; } return { success: true, orderItemId, is_packaged: isPackaged }; } var mapVendorSnippet2, mapDeliverySlot2, mapProductSummary; var init_vendor_snippets = __esm({ "../../packages/db_helper_sqlite/src/admin-apis/vendor-snippets.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); mapVendorSnippet2 = /* @__PURE__ */ __name((snippet) => ({ id: snippet.id, snippetCode: snippet.snippetCode, slotId: snippet.slotId ?? null, productIds: snippet.productIds || [], isPermanent: snippet.isPermanent, validTill: snippet.validTill ?? null, createdAt: snippet.createdAt }), "mapVendorSnippet"); mapDeliverySlot2 = /* @__PURE__ */ __name((slot) => ({ id: slot.id, deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, isActive: slot.isActive, isFlash: slot.isFlash, isCapacityFull: slot.isCapacityFull, deliverySequence: slot.deliverySequence, groupIds: slot.groupIds }), "mapDeliverySlot"); mapProductSummary = /* @__PURE__ */ __name((product) => ({ id: product.id, name: product.name }), "mapProductSummary"); __name(checkVendorSnippetExists, "checkVendorSnippetExists"); __name(getVendorSnippetById, "getVendorSnippetById"); __name(getVendorSnippetByCode, "getVendorSnippetByCode"); __name(getAllVendorSnippets, "getAllVendorSnippets"); __name(createVendorSnippet, "createVendorSnippet"); __name(updateVendorSnippet, "updateVendorSnippet"); __name(deleteVendorSnippet, "deleteVendorSnippet"); __name(getProductsByIds, "getProductsByIds"); __name(getVendorSlotById, "getVendorSlotById"); __name(getVendorOrdersBySlotId, "getVendorOrdersBySlotId"); __name(getVendorOrders, "getVendorOrders"); __name(getOrderItemsByOrderIds, "getOrderItemsByOrderIds"); __name(getOrderStatusByOrderIds, "getOrderStatusByOrderIds"); __name(updateVendorOrderItemPackaging, "updateVendorOrderItemPackaging"); } }); // ../../packages/db_helper_sqlite/src/user-apis/address.ts async function getDefaultAddress(userId) { const [defaultAddress] = await db.select().from(addresses).where(and(eq(addresses.userId, userId), eq(addresses.isDefault, true))).limit(1); return defaultAddress ? mapUserAddress(defaultAddress) : null; } async function getUserAddresses(userId) { const userAddresses = await db.select().from(addresses).where(eq(addresses.userId, userId)); return userAddresses.map(mapUserAddress); } async function getUserAddressById(userId, addressId) { const [address] = await db.select().from(addresses).where(and(eq(addresses.id, addressId), eq(addresses.userId, userId))).limit(1); return address ? mapUserAddress(address) : null; } async function clearDefaultAddress(userId) { await db.update(addresses).set({ isDefault: false }).where(eq(addresses.userId, userId)); } async function createUserAddress(input) { const [newAddress] = await db.insert(addresses).values({ userId: input.userId, name: input.name, phone: input.phone, addressLine1: input.addressLine1, addressLine2: input.addressLine2, city: input.city, state: input.state, pincode: input.pincode, isDefault: input.isDefault, latitude: input.latitude, longitude: input.longitude, googleMapsUrl: input.googleMapsUrl }).returning(); return mapUserAddress(newAddress); } async function updateUserAddress(input) { const [updatedAddress] = await db.update(addresses).set({ name: input.name, phone: input.phone, addressLine1: input.addressLine1, addressLine2: input.addressLine2, city: input.city, state: input.state, pincode: input.pincode, isDefault: input.isDefault, googleMapsUrl: input.googleMapsUrl, latitude: input.latitude, longitude: input.longitude }).where(and(eq(addresses.id, input.addressId), eq(addresses.userId, input.userId))).returning(); return updatedAddress ? mapUserAddress(updatedAddress) : null; } async function deleteUserAddress(userId, addressId) { const [deleted] = await db.delete(addresses).where(and(eq(addresses.id, addressId), eq(addresses.userId, userId))).returning({ id: addresses.id }); return !!deleted; } async function hasOngoingOrdersForAddress(addressId) { const ongoingOrders = await db.select({ orderId: orders.id }).from(orders).innerJoin(orderStatus, eq(orders.id, orderStatus.orderId)).innerJoin(deliverySlotInfo, eq(orders.slotId, deliverySlotInfo.id)).where(and( eq(orders.addressId, addressId), eq(orderStatus.isCancelled, false), gte(deliverySlotInfo.deliveryTime, /* @__PURE__ */ new Date()) )).limit(1); return ongoingOrders.length > 0; } var mapUserAddress; var init_address = __esm({ "../../packages/db_helper_sqlite/src/user-apis/address.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); mapUserAddress = /* @__PURE__ */ __name((address) => ({ id: address.id, userId: address.userId, name: address.name, phone: address.phone, addressLine1: address.addressLine1, addressLine2: address.addressLine2 ?? null, city: address.city, state: address.state, pincode: address.pincode, isDefault: address.isDefault, latitude: address.latitude ?? null, longitude: address.longitude ?? null, googleMapsUrl: address.googleMapsUrl ?? null, adminLatitude: address.adminLatitude ?? null, adminLongitude: address.adminLongitude ?? null, zoneId: address.zoneId ?? null, createdAt: address.createdAt }), "mapUserAddress"); __name(getDefaultAddress, "getDefaultAddress"); __name(getUserAddresses, "getUserAddresses"); __name(getUserAddressById, "getUserAddressById"); __name(clearDefaultAddress, "clearDefaultAddress"); __name(createUserAddress, "createUserAddress"); __name(updateUserAddress, "updateUserAddress"); __name(deleteUserAddress, "deleteUserAddress"); __name(hasOngoingOrdersForAddress, "hasOngoingOrdersForAddress"); } }); // ../../packages/db_helper_sqlite/src/user-apis/banners.ts async function getActiveBanners() { const banners = await db.query.homeBanners.findMany({ where: isNotNull(homeBanners.serialNum), orderBy: asc(homeBanners.serialNum) }); return banners.map(mapBanner); } var mapBanner; var init_banners = __esm({ "../../packages/db_helper_sqlite/src/user-apis/banners.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); mapBanner = /* @__PURE__ */ __name((banner) => ({ id: banner.id, name: banner.name, imageUrl: banner.imageUrl, description: banner.description ?? null, productIds: banner.productIds ?? null, redirectUrl: banner.redirectUrl ?? null, serialNum: banner.serialNum ?? null, isActive: banner.isActive, createdAt: banner.createdAt, lastUpdated: banner.lastUpdated }), "mapBanner"); __name(getActiveBanners, "getActiveBanners"); } }); // ../../packages/db_helper_sqlite/src/user-apis/cart.ts async function getCartItemsWithProducts(userId) { const cartItemsWithProducts = await db.select({ cartId: cartItems.id, productId: productInfo.id, productName: productInfo.name, productPrice: productInfo.price, productImages: productInfo.images, productQuantity: productInfo.productQuantity, isOutOfStock: productInfo.isOutOfStock, unitShortNotation: units.shortNotation, quantity: cartItems.quantity, addedAt: cartItems.addedAt }).from(cartItems).innerJoin(productInfo, eq(cartItems.productId, productInfo.id)).innerJoin(units, eq(productInfo.unitId, units.id)).where(eq(cartItems.userId, userId)); return cartItemsWithProducts.map((item) => { const priceValue = item.productPrice ?? "0"; const quantityValue = item.quantity ?? "0"; return { id: item.cartId, productId: item.productId, quantity: parseFloat(quantityValue), addedAt: item.addedAt, product: { id: item.productId, name: item.productName, price: priceValue.toString(), productQuantity: item.productQuantity, unit: item.unitShortNotation, isOutOfStock: item.isOutOfStock, images: getStringArray3(item.productImages) }, subtotal: parseFloat(priceValue.toString()) * parseFloat(quantityValue) }; }); } async function getProductById2(productId) { return db.query.productInfo.findFirst({ where: eq(productInfo.id, productId) }); } async function getCartItemByUserProduct(userId, productId) { return db.query.cartItems.findFirst({ where: and(eq(cartItems.userId, userId), eq(cartItems.productId, productId)) }); } async function incrementCartItemQuantity(itemId, quantity) { await db.update(cartItems).set({ quantity: sql`${cartItems.quantity} + ${quantity}` }).where(eq(cartItems.id, itemId)); } async function insertCartItem(userId, productId, quantity) { await db.insert(cartItems).values({ userId, productId, quantity: quantity.toString() }); } async function updateCartItemQuantity(userId, itemId, quantity) { const [updatedItem] = await db.update(cartItems).set({ quantity: quantity.toString() }).where(and(eq(cartItems.id, itemId), eq(cartItems.userId, userId))).returning({ id: cartItems.id }); return !!updatedItem; } async function deleteCartItem(userId, itemId) { const [deletedItem] = await db.delete(cartItems).where(and(eq(cartItems.id, itemId), eq(cartItems.userId, userId))).returning({ id: cartItems.id }); return !!deletedItem; } async function clearUserCart(userId) { await db.delete(cartItems).where(eq(cartItems.userId, userId)); } var getStringArray3; var init_cart = __esm({ "../../packages/db_helper_sqlite/src/user-apis/cart.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); getStringArray3 = /* @__PURE__ */ __name((value) => { if (!Array.isArray(value)) return []; return value.map((item) => String(item)); }, "getStringArray"); __name(getCartItemsWithProducts, "getCartItemsWithProducts"); __name(getProductById2, "getProductById"); __name(getCartItemByUserProduct, "getCartItemByUserProduct"); __name(incrementCartItemQuantity, "incrementCartItemQuantity"); __name(insertCartItem, "insertCartItem"); __name(updateCartItemQuantity, "updateCartItemQuantity"); __name(deleteCartItem, "deleteCartItem"); __name(clearUserCart, "clearUserCart"); } }); // ../../packages/db_helper_sqlite/src/user-apis/complaint.ts async function getUserComplaints(userId) { const userComplaints = await db.select({ id: complaints.id, complaintBody: complaints.complaintBody, response: complaints.response, isResolved: complaints.isResolved, createdAt: complaints.createdAt, orderId: complaints.orderId }).from(complaints).where(eq(complaints.userId, userId)).orderBy(asc(complaints.createdAt)); return userComplaints.map((complaint) => ({ id: complaint.id, complaintBody: complaint.complaintBody, response: complaint.response ?? null, isResolved: complaint.isResolved, createdAt: complaint.createdAt, orderId: complaint.orderId ?? null })); } async function createComplaint(userId, orderId, complaintBody, images) { await db.insert(complaints).values({ userId, orderId, complaintBody, images: images || null }); } var init_complaint2 = __esm({ "../../packages/db_helper_sqlite/src/user-apis/complaint.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getUserComplaints, "getUserComplaints"); __name(createComplaint, "createComplaint"); } }); // ../../packages/db_helper_sqlite/src/user-apis/stores.ts async function getStoreSummaries() { const storesData = await db.select({ id: storeInfo.id, name: storeInfo.name, description: storeInfo.description, imageUrl: storeInfo.imageUrl, productCount: sql`count(${productInfo.id})`.as("productCount") }).from(storeInfo).leftJoin( productInfo, and(eq(productInfo.storeId, storeInfo.id), eq(productInfo.isSuspended, false)) ).groupBy(storeInfo.id); const storesWithDetails = await Promise.all( storesData.map(async (store) => { const sampleProducts = await db.select({ id: productInfo.id, name: productInfo.name, images: productInfo.images }).from(productInfo).where(and(eq(productInfo.storeId, store.id), eq(productInfo.isSuspended, false))).limit(3); return { id: store.id, name: store.name, description: store.description ?? null, imageUrl: store.imageUrl ?? null, productCount: store.productCount || 0, sampleProducts: sampleProducts.map((product) => ({ id: product.id, name: product.name, images: getStringArray4(product.images) })) }; }) ); return storesWithDetails; } async function getStoreDetail(storeId) { const storeData = await db.query.storeInfo.findFirst({ where: eq(storeInfo.id, storeId), columns: { id: true, name: true, description: true, imageUrl: true } }); if (!storeData) { return null; } const productsData = await db.select({ id: productInfo.id, name: productInfo.name, shortDescription: productInfo.shortDescription, price: productInfo.price, marketPrice: productInfo.marketPrice, images: productInfo.images, isOutOfStock: productInfo.isOutOfStock, incrementStep: productInfo.incrementStep, unitShortNotation: units.shortNotation, productQuantity: productInfo.productQuantity }).from(productInfo).innerJoin(units, eq(productInfo.unitId, units.id)).where(and(eq(productInfo.storeId, storeId), eq(productInfo.isSuspended, false))); const products = productsData.map((product) => ({ id: product.id, name: product.name, shortDescription: product.shortDescription ?? null, price: String(product.price ?? "0"), marketPrice: product.marketPrice ? String(product.marketPrice) : null, incrementStep: product.incrementStep, unit: product.unitShortNotation, unitNotation: product.unitShortNotation, images: getStringArray4(product.images), isOutOfStock: product.isOutOfStock, productQuantity: product.productQuantity })); return { store: { id: storeData.id, name: storeData.name, description: storeData.description ?? null, imageUrl: storeData.imageUrl ?? null }, products }; } async function getStoresSummary() { return db.query.storeInfo.findMany({ columns: { id: true, name: true, description: true } }); } var getStringArray4; var init_stores = __esm({ "../../packages/db_helper_sqlite/src/user-apis/stores.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); getStringArray4 = /* @__PURE__ */ __name((value) => { if (!Array.isArray(value)) return null; return value.map((item) => String(item)); }, "getStringArray"); __name(getStoreSummaries, "getStoreSummaries"); __name(getStoreDetail, "getStoreDetail"); __name(getStoresSummary, "getStoresSummary"); } }); // ../../packages/db_helper_sqlite/src/user-apis/product.ts async function getProductDetailById(productId) { const productData = await db.select({ id: productInfo.id, name: productInfo.name, shortDescription: productInfo.shortDescription, longDescription: productInfo.longDescription, price: productInfo.price, marketPrice: productInfo.marketPrice, images: productInfo.images, isOutOfStock: productInfo.isOutOfStock, storeId: productInfo.storeId, unitShortNotation: units.shortNotation, incrementStep: productInfo.incrementStep, productQuantity: productInfo.productQuantity, isFlashAvailable: productInfo.isFlashAvailable, flashPrice: productInfo.flashPrice }).from(productInfo).innerJoin(units, eq(productInfo.unitId, units.id)).where(eq(productInfo.id, productId)).limit(1); if (productData.length === 0) { return null; } const product = productData[0]; const storeData = product.storeId ? await db.query.storeInfo.findFirst({ where: eq(storeInfo.id, product.storeId), columns: { id: true, name: true, description: true } }) : null; const deliverySlotsData = await db.select({ id: deliverySlotInfo.id, deliveryTime: deliverySlotInfo.deliveryTime, freezeTime: deliverySlotInfo.freezeTime }).from(productSlots).innerJoin(deliverySlotInfo, eq(productSlots.slotId, deliverySlotInfo.id)).where( and( eq(productSlots.productId, productId), eq(deliverySlotInfo.isActive, true), eq(deliverySlotInfo.isCapacityFull, false), gt(deliverySlotInfo.deliveryTime, sql`CURRENT_TIMESTAMP`), gt(deliverySlotInfo.freezeTime, sql`CURRENT_TIMESTAMP`) ) ).orderBy(deliverySlotInfo.deliveryTime); const specialDealsData = await db.select({ quantity: specialDeals.quantity, price: specialDeals.price, validTill: specialDeals.validTill }).from(specialDeals).where( and( eq(specialDeals.productId, productId), gt(specialDeals.validTill, sql`CURRENT_TIMESTAMP`) ) ).orderBy(specialDeals.quantity); return { id: product.id, name: product.name, shortDescription: product.shortDescription ?? null, longDescription: product.longDescription ?? null, price: String(product.price ?? "0"), marketPrice: product.marketPrice ? String(product.marketPrice) : null, unitNotation: product.unitShortNotation, images: getStringArray5(product.images), isOutOfStock: product.isOutOfStock, store: storeData ? { id: storeData.id, name: storeData.name, description: storeData.description ?? null } : null, incrementStep: product.incrementStep, productQuantity: product.productQuantity, isFlashAvailable: product.isFlashAvailable, flashPrice: product.flashPrice?.toString() || null, deliverySlots: deliverySlotsData, specialDeals: specialDealsData.map((deal) => ({ quantity: String(deal.quantity ?? "0"), price: String(deal.price ?? "0"), validTill: deal.validTill })) }; } async function getProductReviews2(productId, limit, offset) { const reviews = await db.select({ id: productReviews.id, reviewBody: productReviews.reviewBody, ratings: productReviews.ratings, imageUrls: productReviews.imageUrls, reviewTime: productReviews.reviewTime, userName: users.name }).from(productReviews).innerJoin(users, eq(productReviews.userId, users.id)).where(eq(productReviews.productId, productId)).orderBy(desc(productReviews.reviewTime)).limit(limit).offset(offset); const totalCountResult = await db.select({ count: sql`count(*)` }).from(productReviews).where(eq(productReviews.productId, productId)); const totalCount = Number(totalCountResult[0].count); const mappedReviews = reviews.map((review) => ({ id: review.id, reviewBody: review.reviewBody, ratings: review.ratings, imageUrls: getStringArray5(review.imageUrls), reviewTime: review.reviewTime, userName: review.userName ?? null })); return { reviews: mappedReviews, totalCount }; } async function getProductById3(productId) { return db.query.productInfo.findFirst({ where: eq(productInfo.id, productId) }); } async function createProductReview(userId, productId, reviewBody, ratings, imageUrls) { const [newReview] = await db.insert(productReviews).values({ userId, productId, reviewBody, ratings, imageUrls }).returning({ id: productReviews.id, reviewBody: productReviews.reviewBody, ratings: productReviews.ratings, imageUrls: productReviews.imageUrls, reviewTime: productReviews.reviewTime }); return { id: newReview.id, reviewBody: newReview.reviewBody, ratings: newReview.ratings, imageUrls: getStringArray5(newReview.imageUrls), reviewTime: newReview.reviewTime, userName: null }; } async function getAllProductsWithUnits(tagId) { let productIds = null; if (tagId) { const taggedProducts = await db.select({ productId: productTags.productId }).from(productTags).where(eq(productTags.tagId, tagId)); productIds = taggedProducts.map((tp) => tp.productId); } let whereCondition = void 0; if (productIds && productIds.length > 0) { whereCondition = inArray(productInfo.id, productIds); } const results = await db.select({ id: productInfo.id, name: productInfo.name, shortDescription: productInfo.shortDescription, price: productInfo.price, marketPrice: productInfo.marketPrice, images: productInfo.images, isOutOfStock: productInfo.isOutOfStock, unitShortNotation: units.shortNotation, productQuantity: productInfo.productQuantity }).from(productInfo).innerJoin(units, eq(productInfo.unitId, units.id)).where(whereCondition); return results.map((product) => ({ ...product, price: String(product.price ?? "0"), marketPrice: product.marketPrice ? String(product.marketPrice) : null })); } async function getSuspendedProductIds() { const suspendedProducts = await db.select({ id: productInfo.id }).from(productInfo).where(eq(productInfo.isSuspended, true)); return suspendedProducts.map((sp) => sp.id); } async function getNextDeliveryDateWithCapacity(productId) { const result = await db.select({ deliveryTime: deliverySlotInfo.deliveryTime }).from(productSlots).innerJoin(deliverySlotInfo, eq(productSlots.slotId, deliverySlotInfo.id)).where( and( eq(productSlots.productId, productId), eq(deliverySlotInfo.isActive, true), eq(deliverySlotInfo.isCapacityFull, false), gt(deliverySlotInfo.deliveryTime, sql`CURRENT_TIMESTAMP`) ) ).orderBy(deliverySlotInfo.deliveryTime).limit(1); return result[0]?.deliveryTime || null; } var getStringArray5; var init_product2 = __esm({ "../../packages/db_helper_sqlite/src/user-apis/product.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); getStringArray5 = /* @__PURE__ */ __name((value) => { if (!Array.isArray(value)) return null; return value.map((item) => String(item)); }, "getStringArray"); __name(getProductDetailById, "getProductDetailById"); __name(getProductReviews2, "getProductReviews"); __name(getProductById3, "getProductById"); __name(createProductReview, "createProductReview"); __name(getAllProductsWithUnits, "getAllProductsWithUnits"); __name(getSuspendedProductIds, "getSuspendedProductIds"); __name(getNextDeliveryDateWithCapacity, "getNextDeliveryDateWithCapacity"); } }); // ../../packages/db_helper_sqlite/src/user-apis/slots.ts async function getActiveSlotsList() { const slots = await db.query.deliverySlotInfo.findMany({ where: eq(deliverySlotInfo.isActive, true), orderBy: asc(deliverySlotInfo.deliveryTime) }); return slots.map(mapSlot); } async function getProductAvailability() { const products = await db.select({ id: productInfo.id, name: productInfo.name, isOutOfStock: productInfo.isOutOfStock, isFlashAvailable: productInfo.isFlashAvailable }).from(productInfo).where(eq(productInfo.isSuspended, false)); return products.map((product) => ({ id: product.id, name: product.name, isOutOfStock: product.isOutOfStock, isFlashAvailable: product.isFlashAvailable })); } var mapSlot; var init_slots2 = __esm({ "../../packages/db_helper_sqlite/src/user-apis/slots.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); mapSlot = /* @__PURE__ */ __name((slot) => ({ id: slot.id, deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, isActive: slot.isActive, isFlash: slot.isFlash, isCapacityFull: slot.isCapacityFull, deliverySequence: slot.deliverySequence, groupIds: slot.groupIds }), "mapSlot"); __name(getActiveSlotsList, "getActiveSlotsList"); __name(getProductAvailability, "getProductAvailability"); } }); // ../../packages/db_helper_sqlite/src/user-apis/payments.ts async function getOrderById(orderId) { return db.query.orders.findFirst({ where: eq(orders.id, orderId) }); } async function getPaymentByOrderId(orderId) { return db.query.payments.findFirst({ where: eq(payments.orderId, orderId) }); } async function getPaymentByMerchantOrderId(merchantOrderId) { return db.query.payments.findFirst({ where: eq(payments.merchantOrderId, merchantOrderId) }); } async function updatePaymentSuccess(merchantOrderId, payload) { const [updatedPayment] = await db.update(payments).set({ status: "success", payload }).where(eq(payments.merchantOrderId, merchantOrderId)).returning({ id: payments.id, orderId: payments.orderId }); return updatedPayment || null; } async function updateOrderPaymentStatus(orderId, status) { await db.update(orderStatus).set({ paymentStatus: status }).where(eq(orderStatus.orderId, orderId)); } async function markPaymentFailed(paymentId) { await db.update(payments).set({ status: "failed" }).where(eq(payments.id, paymentId)); } var init_payments = __esm({ "../../packages/db_helper_sqlite/src/user-apis/payments.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getOrderById, "getOrderById"); __name(getPaymentByOrderId, "getPaymentByOrderId"); __name(getPaymentByMerchantOrderId, "getPaymentByMerchantOrderId"); __name(updatePaymentSuccess, "updatePaymentSuccess"); __name(updateOrderPaymentStatus, "updateOrderPaymentStatus"); __name(markPaymentFailed, "markPaymentFailed"); } }); // ../../packages/db_helper_sqlite/src/user-apis/auth.ts async function getUserByEmail(email3) { const [user] = await db.select().from(users).where(eq(users.email, email3)).limit(1); return user || null; } async function getUserByMobile2(mobile) { const [user] = await db.select().from(users).where(eq(users.mobile, mobile)).limit(1); return user || null; } async function getUserById(userId) { const [user] = await db.select().from(users).where(eq(users.id, userId)).limit(1); return user || null; } async function getUserCreds(userId) { const [creds] = await db.select().from(userCreds).where(eq(userCreds.userId, userId)).limit(1); return creds || null; } async function getUserDetails(userId) { const [details] = await db.select().from(userDetails).where(eq(userDetails.userId, userId)).limit(1); return details || null; } async function isUserSuspended(userId) { const details = await getUserDetails(userId); return details?.isSuspended ?? false; } async function createUserWithProfile(input) { return db.transaction(async (tx) => { const [user] = await tx.insert(users).values({ name: input.name, email: input.email, mobile: input.mobile }).returning(); await tx.insert(userCreds).values({ userId: user.id, userPassword: input.hashedPassword }); await tx.insert(userDetails).values({ userId: user.id, profileImage: input.profileImage || null }); return user; }); } async function getUserDetailsByUserId(userId) { const [details] = await db.select().from(userDetails).where(eq(userDetails.userId, userId)).limit(1); return details || null; } async function updateUserProfile(userId, data) { return db.transaction(async (tx) => { const userUpdate = {}; if (data.name !== void 0) userUpdate.name = data.name; if (data.email !== void 0) userUpdate.email = data.email; if (data.mobile !== void 0) userUpdate.mobile = data.mobile; if (Object.keys(userUpdate).length > 0) { await tx.update(users).set(userUpdate).where(eq(users.id, userId)); } if (data.hashedPassword) { await tx.update(userCreds).set({ userPassword: data.hashedPassword }).where(eq(userCreds.userId, userId)); } const detailsUpdate = {}; if (data.bio !== void 0) detailsUpdate.bio = data.bio; if (data.dateOfBirth !== void 0) detailsUpdate.dateOfBirth = data.dateOfBirth; if (data.gender !== void 0) detailsUpdate.gender = data.gender; if (data.occupation !== void 0) detailsUpdate.occupation = data.occupation; if (data.profileImage !== void 0) detailsUpdate.profileImage = data.profileImage; detailsUpdate.updatedAt = /* @__PURE__ */ new Date(); const [existingDetails] = await tx.select().from(userDetails).where(eq(userDetails.userId, userId)).limit(1); if (existingDetails) { await tx.update(userDetails).set(detailsUpdate).where(eq(userDetails.userId, userId)); } else { await tx.insert(userDetails).values({ userId, ...detailsUpdate, createdAt: /* @__PURE__ */ new Date() }); } const [user] = await tx.select().from(users).where(eq(users.id, userId)).limit(1); return user; }); } async function createUserWithCreds(input) { return db.transaction(async (tx) => { const [user] = await tx.insert(users).values({ name: input.name, email: input.email, mobile: input.mobile }).returning(); await tx.insert(userCreds).values({ userId: user.id, userPassword: input.hashedPassword }); return user; }); } async function createUserWithMobile(mobile) { const [user] = await db.insert(users).values({ name: null, email: null, mobile }).returning(); return user; } async function upsertUserPassword(userId, hashedPassword) { try { await db.insert(userCreds).values({ userId, userPassword: hashedPassword }); return; } catch (error50) { if (error50.code === "23505") { await db.update(userCreds).set({ userPassword: hashedPassword }).where(eq(userCreds.userId, userId)); return; } throw error50; } } async function deleteUserAccount(userId) { await db.transaction(async (tx) => { await tx.delete(notifCreds).where(eq(notifCreds.userId, userId)); await tx.delete(couponApplicableUsers).where(eq(couponApplicableUsers.userId, userId)); await tx.delete(couponUsage).where(eq(couponUsage.userId, userId)); await tx.delete(complaints).where(eq(complaints.userId, userId)); await tx.delete(cartItems).where(eq(cartItems.userId, userId)); await tx.delete(notifications).where(eq(notifications.userId, userId)); await tx.delete(productReviews).where(eq(productReviews.userId, userId)); await tx.update(reservedCoupons).set({ redeemedBy: null }).where(eq(reservedCoupons.redeemedBy, userId)); const userOrders = await tx.select({ id: orders.id }).from(orders).where(eq(orders.userId, userId)); for (const order of userOrders) { await tx.delete(orderItems).where(eq(orderItems.orderId, order.id)); await tx.delete(orderStatus).where(eq(orderStatus.orderId, order.id)); await tx.delete(payments).where(eq(payments.orderId, order.id)); await tx.delete(refunds).where(eq(refunds.orderId, order.id)); await tx.delete(couponUsage).where(eq(couponUsage.orderId, order.id)); await tx.delete(complaints).where(eq(complaints.orderId, order.id)); } await tx.delete(orders).where(eq(orders.userId, userId)); await tx.delete(addresses).where(eq(addresses.userId, userId)); await tx.delete(userDetails).where(eq(userDetails.userId, userId)); await tx.delete(userCreds).where(eq(userCreds.userId, userId)); await tx.delete(users).where(eq(users.id, userId)); }); } var init_auth = __esm({ "../../packages/db_helper_sqlite/src/user-apis/auth.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getUserByEmail, "getUserByEmail"); __name(getUserByMobile2, "getUserByMobile"); __name(getUserById, "getUserById"); __name(getUserCreds, "getUserCreds"); __name(getUserDetails, "getUserDetails"); __name(isUserSuspended, "isUserSuspended"); __name(createUserWithProfile, "createUserWithProfile"); __name(getUserDetailsByUserId, "getUserDetailsByUserId"); __name(updateUserProfile, "updateUserProfile"); __name(createUserWithCreds, "createUserWithCreds"); __name(createUserWithMobile, "createUserWithMobile"); __name(upsertUserPassword, "upsertUserPassword"); __name(deleteUserAccount, "deleteUserAccount"); } }); // ../../packages/db_helper_sqlite/src/user-apis/coupon.ts async function getActiveCouponsWithRelations(userId) { const allCoupons = await db.query.coupons.findMany({ where: and( eq(coupons.isInvalidated, false), or( isNull(coupons.validTill), gt(coupons.validTill, /* @__PURE__ */ new Date()) ) ), with: { usages: { where: eq(couponUsage.userId, userId) }, applicableUsers: true, applicableProducts: true } }); return allCoupons.map(mapCouponWithRelations); } async function getAllCouponsWithRelations(userId) { const allCoupons = await db.query.coupons.findMany({ with: { usages: { where: eq(couponUsage.userId, userId) }, applicableUsers: true, applicableProducts: true } }); return allCoupons.map(mapCouponWithRelations); } async function getReservedCouponByCode(secretCode) { const reserved = await db.query.reservedCoupons.findFirst({ where: and( eq(reservedCoupons.secretCode, secretCode.toUpperCase()), eq(reservedCoupons.isRedeemed, false) ) }); return reserved || null; } async function redeemReservedCoupon(userId, reservedCoupon) { const couponResult = await db.transaction(async (tx) => { const [coupon] = await tx.insert(coupons).values({ couponCode: reservedCoupon.couponCode, isUserBased: true, discountPercent: reservedCoupon.discountPercent, flatDiscount: reservedCoupon.flatDiscount, minOrder: reservedCoupon.minOrder, productIds: reservedCoupon.productIds, maxValue: reservedCoupon.maxValue, isApplyForAll: false, validTill: reservedCoupon.validTill, maxLimitForUser: reservedCoupon.maxLimitForUser, exclusiveApply: reservedCoupon.exclusiveApply, createdBy: reservedCoupon.createdBy }).returning(); await tx.insert(couponApplicableUsers).values({ couponId: coupon.id, userId }); await tx.update(reservedCoupons).set({ isRedeemed: true, redeemedBy: userId, redeemedAt: /* @__PURE__ */ new Date() }).where(eq(reservedCoupons.id, reservedCoupon.id)); return coupon; }); return mapCoupon(couponResult); } var mapCoupon, mapUsage, mapApplicableUser, mapApplicableProduct, mapCouponWithRelations; var init_coupon2 = __esm({ "../../packages/db_helper_sqlite/src/user-apis/coupon.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); mapCoupon = /* @__PURE__ */ __name((coupon) => ({ id: coupon.id, couponCode: coupon.couponCode, isUserBased: coupon.isUserBased, discountPercent: coupon.discountPercent ? coupon.discountPercent.toString() : null, flatDiscount: coupon.flatDiscount ? coupon.flatDiscount.toString() : null, minOrder: coupon.minOrder ? coupon.minOrder.toString() : null, productIds: coupon.productIds, maxValue: coupon.maxValue ? coupon.maxValue.toString() : null, isApplyForAll: coupon.isApplyForAll, validTill: coupon.validTill ?? null, maxLimitForUser: coupon.maxLimitForUser ?? null, isInvalidated: coupon.isInvalidated, exclusiveApply: coupon.exclusiveApply, createdAt: coupon.createdAt }), "mapCoupon"); mapUsage = /* @__PURE__ */ __name((usage) => ({ id: usage.id, userId: usage.userId, couponId: usage.couponId, orderId: usage.orderId ?? null, orderItemId: usage.orderItemId ?? null, usedAt: usage.usedAt }), "mapUsage"); mapApplicableUser = /* @__PURE__ */ __name((applicable) => ({ id: applicable.id, couponId: applicable.couponId, userId: applicable.userId }), "mapApplicableUser"); mapApplicableProduct = /* @__PURE__ */ __name((applicable) => ({ id: applicable.id, couponId: applicable.couponId, productId: applicable.productId }), "mapApplicableProduct"); mapCouponWithRelations = /* @__PURE__ */ __name((coupon) => ({ ...mapCoupon(coupon), usages: coupon.usages.map(mapUsage), applicableUsers: coupon.applicableUsers.map(mapApplicableUser), applicableProducts: coupon.applicableProducts.map(mapApplicableProduct) }), "mapCouponWithRelations"); __name(getActiveCouponsWithRelations, "getActiveCouponsWithRelations"); __name(getAllCouponsWithRelations, "getAllCouponsWithRelations"); __name(getReservedCouponByCode, "getReservedCouponByCode"); __name(redeemReservedCoupon, "redeemReservedCoupon"); } }); // ../../packages/db_helper_sqlite/src/user-apis/user.ts async function getUserById2(userId) { const [user] = await db.select().from(users).where(eq(users.id, userId)).limit(1); return user || null; } async function getUserDetailByUserId(userId) { const [detail] = await db.select().from(userDetails).where(eq(userDetails.userId, userId)).limit(1); return detail || null; } async function getUserWithCreds(userId) { const result = await db.select().from(users).leftJoin(userCreds, eq(users.id, userCreds.userId)).where(eq(users.id, userId)).limit(1); if (result.length === 0) return null; return { user: result[0].users, creds: result[0].user_creds }; } async function getNotifCred(userId, token) { return db.query.notifCreds.findFirst({ where: and(eq(notifCreds.userId, userId), eq(notifCreds.token, token)) }); } async function upsertNotifCred(userId, token) { const existing = await getNotifCred(userId, token); if (existing) { await db.update(notifCreds).set({ lastVerified: /* @__PURE__ */ new Date() }).where(eq(notifCreds.id, existing.id)); return; } await db.insert(notifCreds).values({ userId, token, lastVerified: /* @__PURE__ */ new Date() }); } async function deleteUnloggedToken(token) { await db.delete(unloggedUserTokens).where(eq(unloggedUserTokens.token, token)); } async function getUnloggedToken(token) { return db.query.unloggedUserTokens.findFirst({ where: eq(unloggedUserTokens.token, token) }); } async function upsertUnloggedToken(token) { const existing = await getUnloggedToken(token); if (existing) { await db.update(unloggedUserTokens).set({ lastVerified: /* @__PURE__ */ new Date() }).where(eq(unloggedUserTokens.id, existing.id)); return; } await db.insert(unloggedUserTokens).values({ token, lastVerified: /* @__PURE__ */ new Date() }); } var init_user2 = __esm({ "../../packages/db_helper_sqlite/src/user-apis/user.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getUserById2, "getUserById"); __name(getUserDetailByUserId, "getUserDetailByUserId"); __name(getUserWithCreds, "getUserWithCreds"); __name(getNotifCred, "getNotifCred"); __name(upsertNotifCred, "upsertNotifCred"); __name(deleteUnloggedToken, "deleteUnloggedToken"); __name(getUnloggedToken, "getUnloggedToken"); __name(upsertUnloggedToken, "upsertUnloggedToken"); } }); // ../../packages/db_helper_sqlite/src/user-apis/order.ts async function validateAndGetCoupon(couponId, userId, totalAmount) { if (!couponId) return null; const coupon = await db.query.coupons.findFirst({ where: eq(coupons.id, couponId), with: { usages: { where: eq(couponUsage.userId, userId) } } }); if (!coupon) throw new Error("Invalid coupon"); if (coupon.isInvalidated) throw new Error("Coupon is no longer valid"); if (coupon.validTill && new Date(coupon.validTill) < /* @__PURE__ */ new Date()) throw new Error("Coupon has expired"); if (coupon.maxLimitForUser && coupon.usages.length >= coupon.maxLimitForUser) throw new Error("Coupon usage limit exceeded"); if (coupon.minOrder && parseFloat(coupon.minOrder.toString()) > totalAmount) throw new Error("Order amount does not meet coupon minimum requirement"); return coupon; } function applyDiscountToOrder(orderTotal, appliedCoupon, proportion) { let finalOrderTotal = orderTotal; if (appliedCoupon) { if (appliedCoupon.discountPercent) { const discount = Math.min( orderTotal * parseFloat(appliedCoupon.discountPercent.toString()) / 100, appliedCoupon.maxValue ? parseFloat(appliedCoupon.maxValue.toString()) * proportion : Infinity ); finalOrderTotal -= discount; } else if (appliedCoupon.flatDiscount) { const discount = Math.min( parseFloat(appliedCoupon.flatDiscount.toString()) * proportion, appliedCoupon.maxValue ? parseFloat(appliedCoupon.maxValue.toString()) * proportion : finalOrderTotal ); finalOrderTotal -= discount; } } return { finalOrderTotal, orderGroupProportion: proportion }; } async function getAddressByIdAndUser(addressId, userId) { return db.query.addresses.findFirst({ where: and(eq(addresses.userId, userId), eq(addresses.id, addressId)) }); } async function getProductById4(productId) { return db.query.productInfo.findFirst({ where: eq(productInfo.id, productId) }); } async function checkUserSuspended(userId) { const userDetail = await db.query.userDetails.findFirst({ where: eq(userDetails.userId, userId) }); return userDetail?.isSuspended ?? false; } async function getSlotCapacityStatus(slotId) { const slot = await db.query.deliverySlotInfo.findFirst({ where: eq(deliverySlotInfo.id, slotId), columns: { isCapacityFull: true } }); return slot?.isCapacityFull ?? false; } async function placeOrderTransaction(params) { const { userId, ordersData, paymentMethod } = params; return db.transaction(async (tx) => { let sharedPaymentInfoId = null; if (paymentMethod === "online") { const [paymentInfo] = await tx.insert(paymentInfoTable).values({ status: "pending", gateway: "razorpay", merchantOrderId: `multi_order_${Date.now()}` }).returning(); sharedPaymentInfoId = paymentInfo.id; } const ordersToInsert = ordersData.map((od) => ({ ...od.order, paymentInfoId: sharedPaymentInfoId })); const insertedOrders = await tx.insert(orders).values(ordersToInsert).returning(); const allOrderItems = []; const allOrderStatuses = []; insertedOrders.forEach((order, index) => { const od = ordersData[index]; od.orderItems.forEach((item) => { allOrderItems.push({ ...item, orderId: order.id }); }); allOrderStatuses.push({ ...od.orderStatus, orderId: order.id }); }); await tx.insert(orderItems).values(allOrderItems); await tx.insert(orderStatus).values(allOrderStatuses); return insertedOrders; }); } async function deleteCartItemsForOrder(userId, productIds) { await db.delete(cartItems).where( and( eq(cartItems.userId, userId), inArray(cartItems.productId, productIds) ) ); } async function recordCouponUsage(userId, couponId, orderId) { await db.insert(couponUsage).values({ userId, couponId, orderId, orderItemId: null, usedAt: /* @__PURE__ */ new Date() }); } async function getOrdersWithRelations(userId, offset, pageSize) { return db.query.orders.findMany({ where: eq(orders.userId, userId), with: { orderItems: { with: { product: { columns: { id: true, name: true, images: true } } } }, slot: { columns: { deliveryTime: true } }, paymentInfo: { columns: { id: true, status: true } }, orderStatus: { columns: { id: true, isCancelled: true, isDelivered: true, paymentStatus: true, cancelReason: true } }, refunds: { columns: { refundStatus: true, refundAmount: true } } }, orderBy: [desc(orders.createdAt)], limit: pageSize, offset }); } async function getOrderCount(userId) { const result = await db.select({ count: sql`count(*)` }).from(orders).where(eq(orders.userId, userId)); return Number(result[0]?.count ?? 0); } async function getOrderByIdWithRelations(orderId, userId) { const order = await db.query.orders.findFirst({ where: and(eq(orders.id, orderId), eq(orders.userId, userId)), with: { orderItems: { with: { product: { columns: { id: true, name: true, images: true } } } }, slot: { columns: { deliveryTime: true } }, paymentInfo: { columns: { id: true, status: true } }, orderStatus: { columns: { id: true, isCancelled: true, isDelivered: true, paymentStatus: true, cancelReason: true }, with: { refundCoupon: { columns: { id: true, couponCode: true } } } }, refunds: { columns: { refundStatus: true, refundAmount: true } } } }); return order; } async function getCouponUsageForOrder(orderId) { return db.query.couponUsage.findMany({ where: eq(couponUsage.orderId, orderId), with: { coupon: { columns: { id: true, couponCode: true, discountPercent: true, flatDiscount: true, maxValue: true } } } }); } async function getOrderBasic(orderId) { return db.query.orders.findFirst({ where: eq(orders.id, orderId), with: { orderStatus: { columns: { id: true, isCancelled: true, isDelivered: true } } } }); } async function cancelOrderTransaction(orderId, statusId, reason, isCod) { await db.transaction(async (tx) => { await tx.update(orderStatus).set({ isCancelled: true, cancelReason: reason, cancellationUserNotes: reason, cancellationReviewed: false }).where(eq(orderStatus.id, statusId)); const refundStatus = isCod ? "na" : "pending"; await tx.insert(refunds).values({ orderId, refundStatus }); }); } async function updateOrderNotes2(orderId, userNotes) { await db.update(orders).set({ userNotes: userNotes || null }).where(eq(orders.id, orderId)); } async function getRecentlyDeliveredOrderIds(userId, limit, since) { const recentOrders = await db.select({ id: orders.id }).from(orders).innerJoin(orderStatus, eq(orders.id, orderStatus.orderId)).where( and( eq(orders.userId, userId), eq(orderStatus.isDelivered, true), gte(orders.createdAt, since) ) ).orderBy(desc(orders.createdAt)).limit(limit); return recentOrders.map((order) => order.id); } async function getProductIdsFromOrders(orderIds) { const orderItemsResult = await db.select({ productId: orderItems.productId }).from(orderItems).where(inArray(orderItems.orderId, orderIds)); return [...new Set(orderItemsResult.map((item) => item.productId))]; } async function getProductsForRecentOrders(productIds, limit) { const results = await db.select({ id: productInfo.id, name: productInfo.name, shortDescription: productInfo.shortDescription, price: productInfo.price, images: productInfo.images, isOutOfStock: productInfo.isOutOfStock, unitShortNotation: units.shortNotation, incrementStep: productInfo.incrementStep }).from(productInfo).innerJoin(units, eq(productInfo.unitId, units.id)).where( and( inArray(productInfo.id, productIds), eq(productInfo.isSuspended, false) ) ).orderBy(desc(productInfo.createdAt)).limit(limit); return results.map((product) => ({ ...product, price: String(product.price ?? "0") })); } async function getOrdersByIdsWithFullData(orderIds) { return db.query.orders.findMany({ where: inArray(orders.id, orderIds), with: { address: { columns: { name: true, addressLine1: true, addressLine2: true, city: true, state: true, pincode: true, phone: true } }, orderItems: { with: { product: { columns: { name: true } } } }, slot: { columns: { deliveryTime: true } } } }); } async function getOrderByIdWithFullData(orderId) { return db.query.orders.findFirst({ where: eq(orders.id, orderId), with: { address: { columns: { name: true, addressLine1: true, addressLine2: true, city: true, state: true, pincode: true, phone: true } }, orderItems: { with: { product: { columns: { name: true } } } }, slot: { columns: { deliveryTime: true } }, refunds: { columns: { refundStatus: true } } } }); } var init_order2 = __esm({ "../../packages/db_helper_sqlite/src/user-apis/order.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(validateAndGetCoupon, "validateAndGetCoupon"); __name(applyDiscountToOrder, "applyDiscountToOrder"); __name(getAddressByIdAndUser, "getAddressByIdAndUser"); __name(getProductById4, "getProductById"); __name(checkUserSuspended, "checkUserSuspended"); __name(getSlotCapacityStatus, "getSlotCapacityStatus"); __name(placeOrderTransaction, "placeOrderTransaction"); __name(deleteCartItemsForOrder, "deleteCartItemsForOrder"); __name(recordCouponUsage, "recordCouponUsage"); __name(getOrdersWithRelations, "getOrdersWithRelations"); __name(getOrderCount, "getOrderCount"); __name(getOrderByIdWithRelations, "getOrderByIdWithRelations"); __name(getCouponUsageForOrder, "getCouponUsageForOrder"); __name(getOrderBasic, "getOrderBasic"); __name(cancelOrderTransaction, "cancelOrderTransaction"); __name(updateOrderNotes2, "updateOrderNotes"); __name(getRecentlyDeliveredOrderIds, "getRecentlyDeliveredOrderIds"); __name(getProductIdsFromOrders, "getProductIdsFromOrders"); __name(getProductsForRecentOrders, "getProductsForRecentOrders"); __name(getOrdersByIdsWithFullData, "getOrdersByIdsWithFullData"); __name(getOrderByIdWithFullData, "getOrderByIdWithFullData"); } }); // ../../packages/db_helper_sqlite/src/stores/store-helpers.ts async function getAllBannersForCache() { return db.query.homeBanners.findMany({ where: isNotNull(homeBanners.serialNum), orderBy: asc(homeBanners.serialNum) }); } async function getAllProductsForCache() { const results = await db.select({ id: productInfo.id, name: productInfo.name, shortDescription: productInfo.shortDescription, longDescription: productInfo.longDescription, price: productInfo.price, marketPrice: productInfo.marketPrice, images: productInfo.images, isOutOfStock: productInfo.isOutOfStock, storeId: productInfo.storeId, unitShortNotation: units.shortNotation, incrementStep: productInfo.incrementStep, productQuantity: productInfo.productQuantity, isFlashAvailable: productInfo.isFlashAvailable, flashPrice: productInfo.flashPrice }).from(productInfo).innerJoin(units, eq(productInfo.unitId, units.id)); return results.map((product) => ({ ...product, price: String(product.price ?? "0"), marketPrice: product.marketPrice ? String(product.marketPrice) : null, flashPrice: product.flashPrice ? String(product.flashPrice) : null })); } async function getAllStoresForCache() { return db.query.storeInfo.findMany({ columns: { id: true, name: true, description: true } }); } async function getAllDeliverySlotsForCache() { return db.select({ productId: productSlots.productId, id: deliverySlotInfo.id, deliveryTime: deliverySlotInfo.deliveryTime, freezeTime: deliverySlotInfo.freezeTime, isCapacityFull: deliverySlotInfo.isCapacityFull }).from(productSlots).innerJoin(deliverySlotInfo, eq(productSlots.slotId, deliverySlotInfo.id)).where( and( eq(deliverySlotInfo.isActive, true), eq(deliverySlotInfo.isCapacityFull, false), gt(deliverySlotInfo.deliveryTime, sql`CURRENT_TIMESTAMP`) ) ); } async function getAllSpecialDealsForCache() { const results = await db.select({ productId: specialDeals.productId, quantity: specialDeals.quantity, price: specialDeals.price, validTill: specialDeals.validTill }).from(specialDeals).where(gt(specialDeals.validTill, sql`CURRENT_TIMESTAMP`)); return results.map((deal) => ({ ...deal, quantity: String(deal.quantity ?? "0"), price: String(deal.price ?? "0") })); } async function getAllProductTagsForCache() { return db.select({ productId: productTags.productId, tagName: productTagInfo.tagName }).from(productTags).innerJoin(productTagInfo, eq(productTags.tagId, productTagInfo.id)); } async function getAllTagsForCache() { return db.select({ id: productTagInfo.id, tagName: productTagInfo.tagName, tagDescription: productTagInfo.tagDescription, imageUrl: productTagInfo.imageUrl, isDashboardTag: productTagInfo.isDashboardTag, relatedStores: productTagInfo.relatedStores }).from(productTagInfo); } async function getAllTagProductMappings() { return db.select({ tagId: productTags.tagId, productId: productTags.productId }).from(productTags); } async function getAllSlotsWithProductsForCache() { const now = /* @__PURE__ */ new Date(); return db.query.deliverySlotInfo.findMany({ where: and( eq(deliverySlotInfo.isActive, true), gt(deliverySlotInfo.deliveryTime, now) ), with: { productSlots: { with: { product: { with: { unit: true, store: true } } } } }, orderBy: asc(deliverySlotInfo.deliveryTime) }); } async function getAllUserNegativityScores() { const results = await db.select({ userId: userIncidents.userId, totalNegativityScore: sql`sum(${userIncidents.negativityScore})` }).from(userIncidents).groupBy(userIncidents.userId); return results.map((result) => ({ userId: result.userId, totalNegativityScore: Number(result.totalNegativityScore ?? 0) })); } async function getUserNegativityScore(userId) { const [result] = await db.select({ totalNegativityScore: sql`sum(${userIncidents.negativityScore})` }).from(userIncidents).where(eq(userIncidents.userId, userId)).limit(1); return Number(result?.totalNegativityScore ?? 0); } var init_store_helpers = __esm({ "../../packages/db_helper_sqlite/src/stores/store-helpers.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(getAllBannersForCache, "getAllBannersForCache"); __name(getAllProductsForCache, "getAllProductsForCache"); __name(getAllStoresForCache, "getAllStoresForCache"); __name(getAllDeliverySlotsForCache, "getAllDeliverySlotsForCache"); __name(getAllSpecialDealsForCache, "getAllSpecialDealsForCache"); __name(getAllProductTagsForCache, "getAllProductTagsForCache"); __name(getAllTagsForCache, "getAllTagsForCache"); __name(getAllTagProductMappings, "getAllTagProductMappings"); __name(getAllSlotsWithProductsForCache, "getAllSlotsWithProductsForCache"); __name(getAllUserNegativityScores, "getAllUserNegativityScores"); __name(getUserNegativityScore, "getUserNegativityScore"); } }); // ../../packages/db_helper_sqlite/src/lib/automated-jobs.ts async function toggleFlashDeliveryForItems(isAvailable, productIds) { await db.update(productInfo).set({ isFlashAvailable: isAvailable }).where(inArray(productInfo.id, productIds)); } async function toggleKeyVal(key, value) { await db.update(keyValStore).set({ value }).where(eq(keyValStore.key, key)); } async function getAllKeyValStore() { return db.select().from(keyValStore); } var init_automated_jobs = __esm({ "../../packages/db_helper_sqlite/src/lib/automated-jobs.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(toggleFlashDeliveryForItems, "toggleFlashDeliveryForItems"); __name(toggleKeyVal, "toggleKeyVal"); __name(getAllKeyValStore, "getAllKeyValStore"); } }); // ../../packages/db_helper_sqlite/src/lib/health-check.ts async function healthCheck() { try { await db.select({ key: keyValStore.key }).from(keyValStore).limit(1); return { status: "ok" }; } catch { await db.select({ name: productInfo.name }).from(productInfo).limit(1); return { status: "ok" }; } } var init_health_check = __esm({ "../../packages/db_helper_sqlite/src/lib/health-check.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); __name(healthCheck, "healthCheck"); } }); // ../../packages/db_helper_sqlite/src/lib/delete-orders.ts async function deleteOrdersWithRelations(orderIds) { if (orderIds.length === 0) { return; } await db.delete(couponUsage).where(inArray(couponUsage.orderId, orderIds)); await db.delete(complaints).where(inArray(complaints.orderId, orderIds)); await db.delete(refunds).where(inArray(refunds.orderId, orderIds)); await db.delete(payments).where(inArray(payments.orderId, orderIds)); await db.delete(orderStatus).where(inArray(orderStatus.orderId, orderIds)); await db.delete(orderItems).where(inArray(orderItems.orderId, orderIds)); await db.delete(orders).where(inArray(orders.id, orderIds)); } var init_delete_orders = __esm({ "../../packages/db_helper_sqlite/src/lib/delete-orders.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_drizzle_orm(); __name(deleteOrdersWithRelations, "deleteOrdersWithRelations"); } }); // ../../packages/db_helper_sqlite/src/helper_methods/upload-url.ts async function createUploadUrlStatus(key) { await db.insert(uploadUrlStatus).values({ key, status: "pending" }); } async function claimUploadUrlStatus(key) { const result = await db.update(uploadUrlStatus).set({ status: "claimed" }).where(and(eq(uploadUrlStatus.key, key), eq(uploadUrlStatus.status, "pending"))).returning(); return result.length > 0; } var init_upload_url = __esm({ "../../packages/db_helper_sqlite/src/helper_methods/upload-url.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_drizzle_orm(); init_db_index(); init_schema(); __name(createUploadUrlStatus, "createUploadUrlStatus"); __name(claimUploadUrlStatus, "claimUploadUrlStatus"); } }); // ../../packages/db_helper_sqlite/src/lib/seed.ts async function seedUnits(unitsToSeed) { for (const unit of unitsToSeed) { const { units: unitsTable } = await Promise.resolve().then(() => (init_schema(), schema_exports)); const existingUnit = await db.query.units.findFirst({ where: eq(unitsTable.shortNotation, unit.shortNotation) }); if (!existingUnit) { await db.insert(unitsTable).values(unit); } } } async function seedStaffRoles(rolesToSeed) { for (const roleName of rolesToSeed) { const { staffRoles: staffRoles2 } = await Promise.resolve().then(() => (init_schema(), schema_exports)); const existingRole = await db.query.staffRoles.findFirst({ where: eq(staffRoles2.roleName, roleName) }); if (!existingRole) { await db.insert(staffRoles2).values({ roleName }); } } } async function seedStaffPermissions(permissionsToSeed) { for (const permissionName of permissionsToSeed) { const { staffPermissions: staffPermissions2 } = await Promise.resolve().then(() => (init_schema(), schema_exports)); const existingPermission = await db.query.staffPermissions.findFirst({ where: eq(staffPermissions2.permissionName, permissionName) }); if (!existingPermission) { await db.insert(staffPermissions2).values({ permissionName }); } } } async function seedRolePermissions(assignments) { await db.transaction(async (tx) => { const { staffRoles: staffRoles2, staffPermissions: staffPermissions2, staffRolePermissions: staffRolePermissions2 } = await Promise.resolve().then(() => (init_schema(), schema_exports)); for (const assignment of assignments) { const role = await tx.query.staffRoles.findFirst({ where: eq(staffRoles2.roleName, assignment.roleName) }); const permission2 = await tx.query.staffPermissions.findFirst({ where: eq(staffPermissions2.permissionName, assignment.permissionName) }); if (role && permission2) { const existing = await tx.query.staffRolePermissions.findFirst({ where: and( eq(staffRolePermissions2.staffRoleId, role.id), eq(staffRolePermissions2.staffPermissionId, permission2.id) ) }); if (!existing) { await tx.insert(staffRolePermissions2).values({ staffRoleId: role.id, staffPermissionId: permission2.id }); } } } }); } async function seedKeyValStore(constantsToSeed) { for (const constant of constantsToSeed) { const { keyValStore: keyValStore2 } = await Promise.resolve().then(() => (init_schema(), schema_exports)); const existing = await db.query.keyValStore.findFirst({ where: eq(keyValStore2.key, constant.key) }); if (!existing) { await db.insert(keyValStore2).values({ key: constant.key, value: constant.value }); } } } var init_seed = __esm({ "../../packages/db_helper_sqlite/src/lib/seed.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_drizzle_orm(); __name(seedUnits, "seedUnits"); __name(seedStaffRoles, "seedStaffRoles"); __name(seedStaffPermissions, "seedStaffPermissions"); __name(seedRolePermissions, "seedRolePermissions"); __name(seedKeyValStore, "seedKeyValStore"); } }); // ../../packages/db_helper_sqlite/index.ts var init_db_helper_sqlite = __esm({ "../../packages/db_helper_sqlite/index.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_index(); init_schema(); init_schema(); init_banner(); init_complaint(); init_const(); init_coupon(); init_order(); init_product(); init_slots(); init_staff_user(); init_store(); init_user(); init_vendor_snippets(); init_address(); init_banners(); init_cart(); init_complaint2(); init_stores(); init_product2(); init_slots2(); init_payments(); init_auth(); init_coupon2(); init_user2(); init_order2(); init_store_helpers(); init_automated_jobs(); init_health_check(); init_product2(); init_stores(); init_delete_orders(); init_upload_url(); init_seed(); } }); // src/sqliteImporter.ts var init_sqliteImporter = __esm({ "src/sqliteImporter.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_db_helper_sqlite(); init_db_helper_sqlite(); init_db_helper_sqlite(); } }); // src/dbService.ts var dbService_exports = {}; __export(dbService_exports, { addProductToGroup: () => addProductToGroup, addressAreas: () => addressAreas, addressAreasRelations: () => addressAreasRelations, addressZones: () => addressZones, addressZonesRelations: () => addressZonesRelations, addresses: () => addresses, addressesRelations: () => addressesRelations, applyDiscountToUserOrder: () => applyDiscountToOrder, cancelOrder: () => cancelOrder, cancelUserOrderTransaction: () => cancelOrderTransaction, cartItems: () => cartItems, cartItemsRelations: () => cartItemsRelations, checkCouponExists: () => checkCouponExists, checkProductExistsByName: () => checkProductExistsByName, checkProductTagExistsByName: () => checkProductTagExistsByName, checkReservedCouponExists: () => checkReservedCouponExists, checkStaffRoleExists: () => checkStaffRoleExists, checkStaffUserExists: () => checkStaffUserExists, checkUnitExists: () => checkUnitExists, checkUserSuspended: () => checkUserSuspended, checkUsersExist: () => checkUsersExist, checkVendorSnippetExists: () => checkVendorSnippetExists, claimUploadUrlStatus: () => claimUploadUrlStatus, clearUserCart: () => clearUserCart, clearUserDefaultAddress: () => clearDefaultAddress, complaints: () => complaints, complaintsRelations: () => complaintsRelations, couponApplicableProducts: () => couponApplicableProducts, couponApplicableProductsRelations: () => couponApplicableProductsRelations, couponApplicableUsers: () => couponApplicableUsers, couponApplicableUsersRelations: () => couponApplicableUsersRelations, couponUsage: () => couponUsage, couponUsageRelations: () => couponUsageRelations, coupons: () => coupons, couponsRelations: () => couponsRelations, createBanner: () => createBanner, createCouponForUser: () => createCouponForUser, createCouponWithRelations: () => createCouponWithRelations, createProduct: () => createProduct, createProductGroup: () => createProductGroup, createProductTag: () => createProductTag, createReservedCouponWithProducts: () => createReservedCouponWithProducts, createSlotWithRelations: () => createSlotWithRelations, createSpecialDealsForProduct: () => createSpecialDealsForProduct, createStaffUser: () => createStaffUser, createStore: () => createStore, createUploadUrlStatus: () => createUploadUrlStatus, createUserAddress: () => createUserAddress, createUserAuthWithCreds: () => createUserWithCreds, createUserAuthWithMobile: () => createUserWithMobile, createUserByMobile: () => createUserByMobile, createUserComplaint: () => createComplaint, createUserIncident: () => createUserIncident, createUserProductReview: () => createProductReview, createUserWithProfile: () => createUserWithProfile, createVendorSnippet: () => createVendorSnippet, db: () => db, deleteBanner: () => deleteBanner, deleteOrderById: () => deleteOrderById, deleteOrdersWithRelations: () => deleteOrdersWithRelations, deleteProduct: () => deleteProduct, deleteProductGroup: () => deleteProductGroup, deleteProductTag: () => deleteProductTag, deleteSlotById: () => deleteSlotById, deleteStore: () => deleteStore, deleteUserAddress: () => deleteUserAddress, deleteUserAuthAccount: () => deleteUserAccount, deleteUserCartItem: () => deleteCartItem, deleteUserCartItemsForOrder: () => deleteCartItemsForOrder, deleteUserUnloggedToken: () => deleteUnloggedToken, deleteVendorSnippet: () => deleteVendorSnippet, deliverySlotInfo: () => deliverySlotInfo, deliverySlotInfoRelations: () => deliverySlotInfoRelations, generateCancellationCoupon: () => generateCancellationCoupon, getActiveSlots: () => getActiveSlots, getActiveSlotsWithProducts: () => getActiveSlotsWithProducts, getAllBannersForCache: () => getAllBannersForCache, getAllConstants: () => getAllConstants, getAllCoupons: () => getAllCoupons, getAllDeliverySlotsForCache: () => getAllDeliverySlotsForCache, getAllKeyValStore: () => getAllKeyValStore, getAllNotifCreds: () => getAllNotifCreds, getAllOrders: () => getAllOrders, getAllProductGroups: () => getAllProductGroups, getAllProductTagInfos: () => getAllProductTagInfos, getAllProductTags: () => getAllProductTags, getAllProductTagsForCache: () => getAllProductTagsForCache, getAllProducts: () => getAllProducts, getAllProductsForCache: () => getAllProductsForCache, getAllProductsWithUnits: () => getAllProductsWithUnits, getAllRoles: () => getAllRoles, getAllSlotsWithProductsForCache: () => getAllSlotsWithProductsForCache, getAllSpecialDealsForCache: () => getAllSpecialDealsForCache, getAllStaff: () => getAllStaff, getAllStores: () => getAllStores, getAllStoresForCache: () => getAllStoresForCache, getAllTagProductMappings: () => getAllTagProductMappings, getAllTagsForCache: () => getAllTagsForCache, getAllUnits: () => getAllUnits, getAllUnloggedTokens: () => getAllUnloggedTokens, getAllUserNegativityScores: () => getAllUserNegativityScores, getAllUsers: () => getAllUsers, getAllUsersWithFilters: () => getAllUsersWithFilters, getAllVendorSnippets: () => getAllVendorSnippets, getBannerById: () => getBannerById, getBanners: () => getBanners, getComplaints: () => getComplaints, getCouponById: () => getCouponById, getItemCountsByOrderIds: () => getItemCountsByOrderIds, getLastOrdersByUserIds: () => getLastOrdersByUserIds, getNextDeliveryDateWithCapacity: () => getNextDeliveryDateWithCapacity, getNotifTokensByUserIds: () => getNotifTokensByUserIds, getOrderByIdWithFullData: () => getOrderByIdWithFullData, getOrderCountsByUserIds: () => getOrderCountsByUserIds, getOrderDetails: () => getOrderDetails, getOrderDetailsWrapper: () => getOrderDetailsWrapper, getOrderItemsByOrderIds: () => getOrderItemsByOrderIds, getOrderProductById: () => getProductById4, getOrderStatusByOrderIds: () => getOrderStatusByOrderIds, getOrderStatusesByOrderIds: () => getOrderStatusesByOrderIds, getOrderWithUser: () => getOrderWithUser, getOrdersByIdsWithFullData: () => getOrdersByIdsWithFullData, getProductById: () => getProductById, getProductImagesById: () => getProductImagesById, getProductReviews: () => getProductReviews, getProductTagById: () => getProductTagById, getProductTagInfoById: () => getProductTagInfoById, getProductsByIds: () => getProductsByIds, getReservedCoupons: () => getReservedCoupons, getSlotByIdWithRelations: () => getSlotByIdWithRelations, getSlotDeliverySequence: () => getSlotDeliverySequence, getSlotOrders: () => getSlotOrders, getSlotProductIds: () => getSlotProductIds, getSlotsAfterDate: () => getSlotsAfterDate, getSlotsProductIds: () => getSlotsProductIds, getStaffUserById: () => getStaffUserById, getStaffUserByName: () => getStaffUserByName, getStoreById: () => getStoreById, getStoresSummary: () => getStoresSummary, getSuspendedProductIds: () => getSuspendedProductIds, getSuspensionStatusesByUserIds: () => getSuspensionStatusesByUserIds, getUnresolvedComplaintsCount: () => getUnresolvedComplaintsCount, getUserActiveBanners: () => getActiveBanners, getUserActiveCouponsWithRelations: () => getActiveCouponsWithRelations, getUserActiveSlotsList: () => getActiveSlotsList, getUserAddressById: () => getUserAddressById, getUserAddressByIdAndUser: () => getAddressByIdAndUser, getUserAddresses: () => getUserAddresses, getUserAllCouponsWithRelations: () => getAllCouponsWithRelations, getUserAuthByEmail: () => getUserByEmail, getUserAuthById: () => getUserById, getUserAuthByMobile: () => getUserByMobile2, getUserAuthCreds: () => getUserCreds, getUserAuthDetails: () => getUserDetails, getUserBasicInfo: () => getUserBasicInfo, getUserByMobile: () => getUserByMobile, getUserCartItemByUserProduct: () => getCartItemByUserProduct, getUserCartItemsWithProducts: () => getCartItemsWithProducts, getUserComplaints: () => getUserComplaints, getUserCouponUsageForOrder: () => getCouponUsageForOrder, getUserDefaultAddress: () => getDefaultAddress, getUserDetailsByUserId: () => getUserDetailsByUserId, getUserIncidentsWithRelations: () => getUserIncidentsWithRelations, getUserNegativityScore: () => getUserNegativityScore, getUserNotifCred: () => getNotifCred, getUserOrderBasic: () => getOrderBasic, getUserOrderByIdWithRelations: () => getOrderByIdWithRelations, getUserOrderCount: () => getOrderCount, getUserOrders: () => getUserOrders, getUserOrdersWithRelations: () => getOrdersWithRelations, getUserPaymentByMerchantOrderId: () => getPaymentByMerchantOrderId, getUserPaymentByOrderId: () => getPaymentByOrderId, getUserPaymentOrderById: () => getOrderById, getUserProductAvailability: () => getProductAvailability, getUserProductById: () => getProductById2, getUserProductByIdBasic: () => getProductById3, getUserProductDetailById: () => getProductDetailById, getUserProductIdsFromOrders: () => getProductIdsFromOrders, getUserProductReviews: () => getProductReviews2, getUserProductsForRecentOrders: () => getProductsForRecentOrders, getUserProfileById: () => getUserById2, getUserProfileDetailById: () => getUserDetailByUserId, getUserRecentlyDeliveredOrderIds: () => getRecentlyDeliveredOrderIds, getUserReservedCouponByCode: () => getReservedCouponByCode, getUserSlotCapacityStatus: () => getSlotCapacityStatus, getUserStoreDetail: () => getStoreDetail, getUserStoreSummaries: () => getStoreSummaries, getUserSuspensionStatus: () => getUserSuspensionStatus, getUserUnloggedToken: () => getUnloggedToken, getUserWithCreds: () => getUserWithCreds, getUserWithDetails: () => getUserWithDetails, getUsersForCoupon: () => getUsersForCoupon, getVendorOrders: () => getVendorOrders, getVendorOrdersBySlotId: () => getVendorOrdersBySlotId, getVendorSlotById: () => getVendorSlotById, getVendorSnippetByCode: () => getVendorSnippetByCode, getVendorSnippetById: () => getVendorSnippetById, hasOngoingOrdersForAddress: () => hasOngoingOrdersForAddress, healthCheck: () => healthCheck, homeBanners: () => homeBanners, homeBannersRelations: () => homeBannersRelations, incrementUserCartItemQuantity: () => incrementCartItemQuantity, initDb: () => initDb, insertUserCartItem: () => insertCartItem, invalidateCoupon: () => invalidateCoupon, isUserSuspended: () => isUserSuspended, keyValStore: () => keyValStore, markUserPaymentFailed: () => markPaymentFailed, notifCreds: () => notifCreds, notifCredsRelations: () => notifCredsRelations, notifications: () => notifications, notificationsRelations: () => notificationsRelations, orderItems: () => orderItems, orderItemsRelations: () => orderItemsRelations, orderStatus: () => orderStatus, orderStatusRelations: () => orderStatusRelations, orders: () => orders, ordersRelations: () => ordersRelations, paymentInfoRelations: () => paymentInfoRelations, paymentInfoTable: () => paymentInfoTable, paymentStatusEnum: () => paymentStatusEnum, payments: () => payments, paymentsRelations: () => paymentsRelations, placeUserOrderTransaction: () => placeOrderTransaction, productCategories: () => productCategories, productCategoriesRelations: () => productCategoriesRelations, productGroupInfo: () => productGroupInfo, productGroupInfoRelations: () => productGroupInfoRelations, productGroupMembership: () => productGroupMembership, productGroupMembershipRelations: () => productGroupMembershipRelations, productInfo: () => productInfo, productInfoRelations: () => productInfoRelations, productReviews: () => productReviews, productReviewsRelations: () => productReviewsRelations, productSlots: () => productSlots, productSlotsRelations: () => productSlotsRelations, productTagInfo: () => productTagInfo, productTagInfoRelations: () => productTagInfoRelations, productTags: () => productTags, productTagsRelations: () => productTagsRelations, rebalanceSlots: () => rebalanceSlots, recordUserCouponUsage: () => recordCouponUsage, redeemUserReservedCoupon: () => redeemReservedCoupon, refunds: () => refunds, refundsRelations: () => refundsRelations, removeDeliveryCharge: () => removeDeliveryCharge, removeProductFromGroup: () => removeProductFromGroup, replaceProductTags: () => replaceProductTags, reservedCoupons: () => reservedCoupons, reservedCouponsRelations: () => reservedCouponsRelations, resolveComplaint: () => resolveComplaint, respondToReview: () => respondToReview, searchUsers: () => searchUsers, seedKeyValStore: () => seedKeyValStore, seedRolePermissions: () => seedRolePermissions, seedStaffPermissions: () => seedStaffPermissions, seedStaffRoles: () => seedStaffRoles, seedUnits: () => seedUnits, specialDeals: () => specialDeals, specialDealsRelations: () => specialDealsRelations, staffPermissionEnum: () => staffPermissionEnum, staffPermissions: () => staffPermissions, staffPermissionsRelations: () => staffPermissionsRelations, staffRoleEnum: () => staffRoleEnum, staffRolePermissions: () => staffRolePermissions, staffRolePermissionsRelations: () => staffRolePermissionsRelations, staffRoles: () => staffRoles, staffRolesRelations: () => staffRolesRelations, staffUsers: () => staffUsers, staffUsersRelations: () => staffUsersRelations, storeInfo: () => storeInfo, storeInfoRelations: () => storeInfoRelations, toggleFlashDeliveryForItems: () => toggleFlashDeliveryForItems, toggleKeyVal: () => toggleKeyVal, toggleProductOutOfStock: () => toggleProductOutOfStock, units: () => units, unitsRelations: () => unitsRelations, unloggedUserTokens: () => unloggedUserTokens, updateAddressCoords: () => updateAddressCoords, updateBanner: () => updateBanner, updateCouponWithRelations: () => updateCouponWithRelations, updateOrderDelivered: () => updateOrderDelivered, updateOrderItemPackaging: () => updateOrderItemPackaging, updateOrderNotes: () => updateOrderNotes, updateOrderPackaged: () => updateOrderPackaged, updateProduct: () => updateProduct, updateProductDeals: () => updateProductDeals, updateProductGroup: () => updateProductGroup, updateProductPrices: () => updateProductPrices, updateProductTag: () => updateProductTag, updateSlotCapacity: () => updateSlotCapacity, updateSlotDeliverySequence: () => updateSlotDeliverySequence, updateSlotProducts: () => updateSlotProducts, updateSlotWithRelations: () => updateSlotWithRelations, updateStore: () => updateStore, updateUserAddress: () => updateUserAddress, updateUserCartItemQuantity: () => updateCartItemQuantity, updateUserOrderNotes: () => updateOrderNotes2, updateUserOrderPaymentStatus: () => updateOrderPaymentStatus, updateUserPaymentSuccess: () => updatePaymentSuccess, updateUserProfile: () => updateUserProfile, updateUserSuspensionStatus: () => updateUserSuspensionStatus, updateVendorOrderItemPackaging: () => updateVendorOrderItemPackaging, updateVendorSnippet: () => updateVendorSnippet, uploadStatusEnum: () => uploadStatusEnum, uploadUrlStatus: () => uploadUrlStatus, upsertConstants: () => upsertConstants, upsertUserAuthPassword: () => upsertUserPassword, upsertUserNotifCred: () => upsertNotifCred, upsertUserSuspension: () => upsertUserSuspension, upsertUserUnloggedToken: () => upsertUnloggedToken, userCreds: () => userCreds, userCredsRelations: () => userCredsRelations, userDetails: () => userDetails, userDetailsRelations: () => userDetailsRelations, userIncidents: () => userIncidents, userIncidentsRelations: () => userIncidentsRelations, userNotifications: () => userNotifications, userNotificationsRelations: () => userNotificationsRelations, users: () => users, usersRelations: () => usersRelations, validateAndGetUserCoupon: () => validateAndGetCoupon, validateCoupon: () => validateCoupon, vendorSnippets: () => vendorSnippets, vendorSnippetsRelations: () => vendorSnippetsRelations }); async function getOrderDetailsWrapper(orderId) { return getOrderDetails(orderId); } var init_dbService = __esm({ "src/dbService.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_sqliteImporter(); init_sqliteImporter(); __name(getOrderDetailsWrapper, "getOrderDetailsWrapper"); } }); // ../../node_modules/jose/dist/webapi/lib/buffer_utils.js function concat(...buffers) { const size = buffers.reduce((acc, { length }) => acc + length, 0); const buf = new Uint8Array(size); let i2 = 0; for (const buffer of buffers) { buf.set(buffer, i2); i2 += buffer.length; } return buf; } function encode(string4) { const bytes = new Uint8Array(string4.length); for (let i2 = 0; i2 < string4.length; i2++) { const code = string4.charCodeAt(i2); if (code > 127) { throw new TypeError("non-ASCII string encountered in encode()"); } bytes[i2] = code; } return bytes; } var encoder, decoder, MAX_INT32; var init_buffer_utils = __esm({ "../../node_modules/jose/dist/webapi/lib/buffer_utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); encoder = new TextEncoder(); decoder = new TextDecoder(); MAX_INT32 = 2 ** 32; __name(concat, "concat"); __name(encode, "encode"); } }); // ../../node_modules/jose/dist/webapi/lib/base64.js function encodeBase64(input) { if (Uint8Array.prototype.toBase64) { return input.toBase64(); } const CHUNK_SIZE = 32768; const arr = []; for (let i2 = 0; i2 < input.length; i2 += CHUNK_SIZE) { arr.push(String.fromCharCode.apply(null, input.subarray(i2, i2 + CHUNK_SIZE))); } return btoa(arr.join("")); } function decodeBase64(encoded) { if (Uint8Array.fromBase64) { return Uint8Array.fromBase64(encoded); } const binary = atob(encoded); const bytes = new Uint8Array(binary.length); for (let i2 = 0; i2 < binary.length; i2++) { bytes[i2] = binary.charCodeAt(i2); } return bytes; } var init_base64 = __esm({ "../../node_modules/jose/dist/webapi/lib/base64.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(encodeBase64, "encodeBase64"); __name(decodeBase64, "decodeBase64"); } }); // ../../node_modules/jose/dist/webapi/util/base64url.js function decode(input) { if (Uint8Array.fromBase64) { return Uint8Array.fromBase64(typeof input === "string" ? input : decoder.decode(input), { alphabet: "base64url" }); } let encoded = input; if (encoded instanceof Uint8Array) { encoded = decoder.decode(encoded); } encoded = encoded.replace(/-/g, "+").replace(/_/g, "/"); try { return decodeBase64(encoded); } catch { throw new TypeError("The input to be decoded is not correctly encoded."); } } function encode2(input) { let unencoded = input; if (typeof unencoded === "string") { unencoded = encoder.encode(unencoded); } if (Uint8Array.prototype.toBase64) { return unencoded.toBase64({ alphabet: "base64url", omitPadding: true }); } return encodeBase64(unencoded).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); } var init_base64url = __esm({ "../../node_modules/jose/dist/webapi/util/base64url.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_buffer_utils(); init_base64(); __name(decode, "decode"); __name(encode2, "encode"); } }); // ../../node_modules/jose/dist/webapi/lib/crypto_key.js function getHashLength(hash4) { return parseInt(hash4.name.slice(4), 10); } function checkHashLength(algorithm, expected) { const actual = getHashLength(algorithm.hash); if (actual !== expected) throw unusable(`SHA-${expected}`, "algorithm.hash"); } function getNamedCurve(alg) { switch (alg) { case "ES256": return "P-256"; case "ES384": return "P-384"; case "ES512": return "P-521"; default: throw new Error("unreachable"); } } function checkUsage(key, usage) { if (usage && !key.usages.includes(usage)) { throw new TypeError(`CryptoKey does not support this operation, its usages must include ${usage}.`); } } function checkSigCryptoKey(key, alg, usage) { switch (alg) { case "HS256": case "HS384": case "HS512": { if (!isAlgorithm(key.algorithm, "HMAC")) throw unusable("HMAC"); checkHashLength(key.algorithm, parseInt(alg.slice(2), 10)); break; } case "RS256": case "RS384": case "RS512": { if (!isAlgorithm(key.algorithm, "RSASSA-PKCS1-v1_5")) throw unusable("RSASSA-PKCS1-v1_5"); checkHashLength(key.algorithm, parseInt(alg.slice(2), 10)); break; } case "PS256": case "PS384": case "PS512": { if (!isAlgorithm(key.algorithm, "RSA-PSS")) throw unusable("RSA-PSS"); checkHashLength(key.algorithm, parseInt(alg.slice(2), 10)); break; } case "Ed25519": case "EdDSA": { if (!isAlgorithm(key.algorithm, "Ed25519")) throw unusable("Ed25519"); break; } case "ML-DSA-44": case "ML-DSA-65": case "ML-DSA-87": { if (!isAlgorithm(key.algorithm, alg)) throw unusable(alg); break; } case "ES256": case "ES384": case "ES512": { if (!isAlgorithm(key.algorithm, "ECDSA")) throw unusable("ECDSA"); const expected = getNamedCurve(alg); const actual = key.algorithm.namedCurve; if (actual !== expected) throw unusable(expected, "algorithm.namedCurve"); break; } default: throw new TypeError("CryptoKey does not support this operation"); } checkUsage(key, usage); } var unusable, isAlgorithm; var init_crypto_key = __esm({ "../../node_modules/jose/dist/webapi/lib/crypto_key.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); unusable = /* @__PURE__ */ __name((name, prop = "algorithm.name") => new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`), "unusable"); isAlgorithm = /* @__PURE__ */ __name((algorithm, name) => algorithm.name === name, "isAlgorithm"); __name(getHashLength, "getHashLength"); __name(checkHashLength, "checkHashLength"); __name(getNamedCurve, "getNamedCurve"); __name(checkUsage, "checkUsage"); __name(checkSigCryptoKey, "checkSigCryptoKey"); } }); // ../../node_modules/jose/dist/webapi/lib/invalid_key_input.js function message(msg, actual, ...types) { types = types.filter(Boolean); if (types.length > 2) { const last = types.pop(); msg += `one of type ${types.join(", ")}, or ${last}.`; } else if (types.length === 2) { msg += `one of type ${types[0]} or ${types[1]}.`; } else { msg += `of type ${types[0]}.`; } if (actual == null) { msg += ` Received ${actual}`; } else if (typeof actual === "function" && actual.name) { msg += ` Received function ${actual.name}`; } else if (typeof actual === "object" && actual != null) { if (actual.constructor?.name) { msg += ` Received an instance of ${actual.constructor.name}`; } } return msg; } var invalidKeyInput, withAlg; var init_invalid_key_input = __esm({ "../../node_modules/jose/dist/webapi/lib/invalid_key_input.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(message, "message"); invalidKeyInput = /* @__PURE__ */ __name((actual, ...types) => message("Key must be ", actual, ...types), "invalidKeyInput"); withAlg = /* @__PURE__ */ __name((alg, actual, ...types) => message(`Key for the ${alg} algorithm must be `, actual, ...types), "withAlg"); } }); // ../../node_modules/jose/dist/webapi/util/errors.js var JOSEError, JWTClaimValidationFailed, JWTExpired, JOSEAlgNotAllowed, JOSENotSupported, JWSInvalid, JWTInvalid, JWKSMultipleMatchingKeys, JWSSignatureVerificationFailed; var init_errors2 = __esm({ "../../node_modules/jose/dist/webapi/util/errors.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); JOSEError = class extends Error { code = "ERR_JOSE_GENERIC"; constructor(message2, options) { super(message2, options); this.name = this.constructor.name; Error.captureStackTrace?.(this, this.constructor); } }; __name(JOSEError, "JOSEError"); __publicField(JOSEError, "code", "ERR_JOSE_GENERIC"); JWTClaimValidationFailed = class extends JOSEError { code = "ERR_JWT_CLAIM_VALIDATION_FAILED"; claim; reason; payload; constructor(message2, payload, claim = "unspecified", reason = "unspecified") { super(message2, { cause: { claim, reason, payload } }); this.claim = claim; this.reason = reason; this.payload = payload; } }; __name(JWTClaimValidationFailed, "JWTClaimValidationFailed"); __publicField(JWTClaimValidationFailed, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED"); JWTExpired = class extends JOSEError { code = "ERR_JWT_EXPIRED"; claim; reason; payload; constructor(message2, payload, claim = "unspecified", reason = "unspecified") { super(message2, { cause: { claim, reason, payload } }); this.claim = claim; this.reason = reason; this.payload = payload; } }; __name(JWTExpired, "JWTExpired"); __publicField(JWTExpired, "code", "ERR_JWT_EXPIRED"); JOSEAlgNotAllowed = class extends JOSEError { code = "ERR_JOSE_ALG_NOT_ALLOWED"; }; __name(JOSEAlgNotAllowed, "JOSEAlgNotAllowed"); __publicField(JOSEAlgNotAllowed, "code", "ERR_JOSE_ALG_NOT_ALLOWED"); JOSENotSupported = class extends JOSEError { code = "ERR_JOSE_NOT_SUPPORTED"; }; __name(JOSENotSupported, "JOSENotSupported"); __publicField(JOSENotSupported, "code", "ERR_JOSE_NOT_SUPPORTED"); JWSInvalid = class extends JOSEError { code = "ERR_JWS_INVALID"; }; __name(JWSInvalid, "JWSInvalid"); __publicField(JWSInvalid, "code", "ERR_JWS_INVALID"); JWTInvalid = class extends JOSEError { code = "ERR_JWT_INVALID"; }; __name(JWTInvalid, "JWTInvalid"); __publicField(JWTInvalid, "code", "ERR_JWT_INVALID"); JWKSMultipleMatchingKeys = class extends JOSEError { [Symbol.asyncIterator]; code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS"; constructor(message2 = "multiple matching keys found in the JSON Web Key Set", options) { super(message2, options); } }; __name(JWKSMultipleMatchingKeys, "JWKSMultipleMatchingKeys"); __publicField(JWKSMultipleMatchingKeys, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS"); JWSSignatureVerificationFailed = class extends JOSEError { code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED"; constructor(message2 = "signature verification failed", options) { super(message2, options); } }; __name(JWSSignatureVerificationFailed, "JWSSignatureVerificationFailed"); __publicField(JWSSignatureVerificationFailed, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED"); } }); // ../../node_modules/jose/dist/webapi/lib/is_key_like.js var isCryptoKey, isKeyObject, isKeyLike; var init_is_key_like = __esm({ "../../node_modules/jose/dist/webapi/lib/is_key_like.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isCryptoKey = /* @__PURE__ */ __name((key) => { if (key?.[Symbol.toStringTag] === "CryptoKey") return true; try { return key instanceof CryptoKey; } catch { return false; } }, "isCryptoKey"); isKeyObject = /* @__PURE__ */ __name((key) => key?.[Symbol.toStringTag] === "KeyObject", "isKeyObject"); isKeyLike = /* @__PURE__ */ __name((key) => isCryptoKey(key) || isKeyObject(key), "isKeyLike"); } }); // ../../node_modules/jose/dist/webapi/lib/helpers.js function assertNotSet(value, name) { if (value) { throw new TypeError(`${name} can only be called once`); } } function decodeBase64url(value, label, ErrorClass) { try { return decode(value); } catch { throw new ErrorClass(`Failed to base64url decode the ${label}`); } } var unprotected; var init_helpers = __esm({ "../../node_modules/jose/dist/webapi/lib/helpers.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_base64url(); unprotected = Symbol(); __name(assertNotSet, "assertNotSet"); __name(decodeBase64url, "decodeBase64url"); } }); // ../../node_modules/jose/dist/webapi/lib/type_checks.js function isObject2(input) { if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") { return false; } if (Object.getPrototypeOf(input) === null) { return true; } let proto = input; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } return Object.getPrototypeOf(input) === proto; } function isDisjoint(...headers) { const sources = headers.filter(Boolean); if (sources.length === 0 || sources.length === 1) { return true; } let acc; for (const header of sources) { const parameters = Object.keys(header); if (!acc || acc.size === 0) { acc = new Set(parameters); continue; } for (const parameter of parameters) { if (acc.has(parameter)) { return false; } acc.add(parameter); } } return true; } var isObjectLike, isJWK, isPrivateJWK, isPublicJWK, isSecretJWK; var init_type_checks = __esm({ "../../node_modules/jose/dist/webapi/lib/type_checks.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isObjectLike = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null, "isObjectLike"); __name(isObject2, "isObject"); __name(isDisjoint, "isDisjoint"); isJWK = /* @__PURE__ */ __name((key) => isObject2(key) && typeof key.kty === "string", "isJWK"); isPrivateJWK = /* @__PURE__ */ __name((key) => key.kty !== "oct" && (key.kty === "AKP" && typeof key.priv === "string" || typeof key.d === "string"), "isPrivateJWK"); isPublicJWK = /* @__PURE__ */ __name((key) => key.kty !== "oct" && key.d === void 0 && key.priv === void 0, "isPublicJWK"); isSecretJWK = /* @__PURE__ */ __name((key) => key.kty === "oct" && typeof key.k === "string", "isSecretJWK"); } }); // ../../node_modules/jose/dist/webapi/lib/signing.js function checkKeyLength(alg, key) { if (alg.startsWith("RS") || alg.startsWith("PS")) { const { modulusLength } = key.algorithm; if (typeof modulusLength !== "number" || modulusLength < 2048) { throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`); } } } function subtleAlgorithm(alg, algorithm) { const hash4 = `SHA-${alg.slice(-3)}`; switch (alg) { case "HS256": case "HS384": case "HS512": return { hash: hash4, name: "HMAC" }; case "PS256": case "PS384": case "PS512": return { hash: hash4, name: "RSA-PSS", saltLength: parseInt(alg.slice(-3), 10) >> 3 }; case "RS256": case "RS384": case "RS512": return { hash: hash4, name: "RSASSA-PKCS1-v1_5" }; case "ES256": case "ES384": case "ES512": return { hash: hash4, name: "ECDSA", namedCurve: algorithm.namedCurve }; case "Ed25519": case "EdDSA": return { name: "Ed25519" }; case "ML-DSA-44": case "ML-DSA-65": case "ML-DSA-87": return { name: alg }; default: throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`); } } async function getSigKey(alg, key, usage) { if (key instanceof Uint8Array) { if (!alg.startsWith("HS")) { throw new TypeError(invalidKeyInput(key, "CryptoKey", "KeyObject", "JSON Web Key")); } return crypto.subtle.importKey("raw", key, { hash: `SHA-${alg.slice(-3)}`, name: "HMAC" }, false, [usage]); } checkSigCryptoKey(key, alg, usage); return key; } async function sign(alg, key, data) { const cryptoKey = await getSigKey(alg, key, "sign"); checkKeyLength(alg, cryptoKey); const signature = await crypto.subtle.sign(subtleAlgorithm(alg, cryptoKey.algorithm), cryptoKey, data); return new Uint8Array(signature); } async function verify(alg, key, signature, data) { const cryptoKey = await getSigKey(alg, key, "verify"); checkKeyLength(alg, cryptoKey); const algorithm = subtleAlgorithm(alg, cryptoKey.algorithm); try { return await crypto.subtle.verify(algorithm, cryptoKey, signature, data); } catch { return false; } } var init_signing = __esm({ "../../node_modules/jose/dist/webapi/lib/signing.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_errors2(); init_crypto_key(); init_invalid_key_input(); __name(checkKeyLength, "checkKeyLength"); __name(subtleAlgorithm, "subtleAlgorithm"); __name(getSigKey, "getSigKey"); __name(sign, "sign"); __name(verify, "verify"); } }); // ../../node_modules/jose/dist/webapi/lib/jwk_to_key.js function subtleMapping(jwk) { let algorithm; let keyUsages; switch (jwk.kty) { case "AKP": { switch (jwk.alg) { case "ML-DSA-44": case "ML-DSA-65": case "ML-DSA-87": algorithm = { name: jwk.alg }; keyUsages = jwk.priv ? ["sign"] : ["verify"]; break; default: throw new JOSENotSupported(unsupportedAlg); } break; } case "RSA": { switch (jwk.alg) { case "PS256": case "PS384": case "PS512": algorithm = { name: "RSA-PSS", hash: `SHA-${jwk.alg.slice(-3)}` }; keyUsages = jwk.d ? ["sign"] : ["verify"]; break; case "RS256": case "RS384": case "RS512": algorithm = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${jwk.alg.slice(-3)}` }; keyUsages = jwk.d ? ["sign"] : ["verify"]; break; case "RSA-OAEP": case "RSA-OAEP-256": case "RSA-OAEP-384": case "RSA-OAEP-512": algorithm = { name: "RSA-OAEP", hash: `SHA-${parseInt(jwk.alg.slice(-3), 10) || 1}` }; keyUsages = jwk.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"]; break; default: throw new JOSENotSupported(unsupportedAlg); } break; } case "EC": { switch (jwk.alg) { case "ES256": case "ES384": case "ES512": algorithm = { name: "ECDSA", namedCurve: { ES256: "P-256", ES384: "P-384", ES512: "P-521" }[jwk.alg] }; keyUsages = jwk.d ? ["sign"] : ["verify"]; break; case "ECDH-ES": case "ECDH-ES+A128KW": case "ECDH-ES+A192KW": case "ECDH-ES+A256KW": algorithm = { name: "ECDH", namedCurve: jwk.crv }; keyUsages = jwk.d ? ["deriveBits"] : []; break; default: throw new JOSENotSupported(unsupportedAlg); } break; } case "OKP": { switch (jwk.alg) { case "Ed25519": case "EdDSA": algorithm = { name: "Ed25519" }; keyUsages = jwk.d ? ["sign"] : ["verify"]; break; case "ECDH-ES": case "ECDH-ES+A128KW": case "ECDH-ES+A192KW": case "ECDH-ES+A256KW": algorithm = { name: jwk.crv }; keyUsages = jwk.d ? ["deriveBits"] : []; break; default: throw new JOSENotSupported(unsupportedAlg); } break; } default: throw new JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value'); } return { algorithm, keyUsages }; } async function jwkToKey(jwk) { if (!jwk.alg) { throw new TypeError('"alg" argument is required when "jwk.alg" is not present'); } const { algorithm, keyUsages } = subtleMapping(jwk); const keyData = { ...jwk }; if (keyData.kty !== "AKP") { delete keyData.alg; } delete keyData.use; return crypto.subtle.importKey("jwk", keyData, algorithm, jwk.ext ?? (jwk.d || jwk.priv ? false : true), jwk.key_ops ?? keyUsages); } var unsupportedAlg; var init_jwk_to_key = __esm({ "../../node_modules/jose/dist/webapi/lib/jwk_to_key.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_errors2(); unsupportedAlg = 'Invalid or unsupported JWK "alg" (Algorithm) Parameter value'; __name(subtleMapping, "subtleMapping"); __name(jwkToKey, "jwkToKey"); } }); // ../../node_modules/jose/dist/webapi/lib/normalize_key.js async function normalizeKey(key, alg) { if (key instanceof Uint8Array) { return key; } if (isCryptoKey(key)) { return key; } if (isKeyObject(key)) { if (key.type === "secret") { return key.export(); } if ("toCryptoKey" in key && typeof key.toCryptoKey === "function") { try { return handleKeyObject(key, alg); } catch (err) { if (err instanceof TypeError) { throw err; } } } let jwk = key.export({ format: "jwk" }); return handleJWK(key, jwk, alg); } if (isJWK(key)) { if (key.k) { return decode(key.k); } return handleJWK(key, key, alg, true); } throw new Error("unreachable"); } var unusableForAlg, cache, handleJWK, handleKeyObject; var init_normalize_key = __esm({ "../../node_modules/jose/dist/webapi/lib/normalize_key.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_type_checks(); init_base64url(); init_jwk_to_key(); init_is_key_like(); unusableForAlg = "given KeyObject instance cannot be used for this algorithm"; handleJWK = /* @__PURE__ */ __name(async (key, jwk, alg, freeze = false) => { cache ||= /* @__PURE__ */ new WeakMap(); let cached2 = cache.get(key); if (cached2?.[alg]) { return cached2[alg]; } const cryptoKey = await jwkToKey({ ...jwk, alg }); if (freeze) Object.freeze(key); if (!cached2) { cache.set(key, { [alg]: cryptoKey }); } else { cached2[alg] = cryptoKey; } return cryptoKey; }, "handleJWK"); handleKeyObject = /* @__PURE__ */ __name((keyObject, alg) => { cache ||= /* @__PURE__ */ new WeakMap(); let cached2 = cache.get(keyObject); if (cached2?.[alg]) { return cached2[alg]; } const isPublic = keyObject.type === "public"; const extractable = isPublic ? true : false; let cryptoKey; if (keyObject.asymmetricKeyType === "x25519") { switch (alg) { case "ECDH-ES": case "ECDH-ES+A128KW": case "ECDH-ES+A192KW": case "ECDH-ES+A256KW": break; default: throw new TypeError(unusableForAlg); } cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, isPublic ? [] : ["deriveBits"]); } if (keyObject.asymmetricKeyType === "ed25519") { if (alg !== "EdDSA" && alg !== "Ed25519") { throw new TypeError(unusableForAlg); } cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [ isPublic ? "verify" : "sign" ]); } switch (keyObject.asymmetricKeyType) { case "ml-dsa-44": case "ml-dsa-65": case "ml-dsa-87": { if (alg !== keyObject.asymmetricKeyType.toUpperCase()) { throw new TypeError(unusableForAlg); } cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [ isPublic ? "verify" : "sign" ]); } } if (keyObject.asymmetricKeyType === "rsa") { let hash4; switch (alg) { case "RSA-OAEP": hash4 = "SHA-1"; break; case "RS256": case "PS256": case "RSA-OAEP-256": hash4 = "SHA-256"; break; case "RS384": case "PS384": case "RSA-OAEP-384": hash4 = "SHA-384"; break; case "RS512": case "PS512": case "RSA-OAEP-512": hash4 = "SHA-512"; break; default: throw new TypeError(unusableForAlg); } if (alg.startsWith("RSA-OAEP")) { return keyObject.toCryptoKey({ name: "RSA-OAEP", hash: hash4 }, extractable, isPublic ? ["encrypt"] : ["decrypt"]); } cryptoKey = keyObject.toCryptoKey({ name: alg.startsWith("PS") ? "RSA-PSS" : "RSASSA-PKCS1-v1_5", hash: hash4 }, extractable, [isPublic ? "verify" : "sign"]); } if (keyObject.asymmetricKeyType === "ec") { const nist = /* @__PURE__ */ new Map([ ["prime256v1", "P-256"], ["secp384r1", "P-384"], ["secp521r1", "P-521"] ]); const namedCurve = nist.get(keyObject.asymmetricKeyDetails?.namedCurve); if (!namedCurve) { throw new TypeError(unusableForAlg); } const expectedCurve = { ES256: "P-256", ES384: "P-384", ES512: "P-521" }; if (expectedCurve[alg] && namedCurve === expectedCurve[alg]) { cryptoKey = keyObject.toCryptoKey({ name: "ECDSA", namedCurve }, extractable, [isPublic ? "verify" : "sign"]); } if (alg.startsWith("ECDH-ES")) { cryptoKey = keyObject.toCryptoKey({ name: "ECDH", namedCurve }, extractable, isPublic ? [] : ["deriveBits"]); } } if (!cryptoKey) { throw new TypeError(unusableForAlg); } if (!cached2) { cache.set(keyObject, { [alg]: cryptoKey }); } else { cached2[alg] = cryptoKey; } return cryptoKey; }, "handleKeyObject"); __name(normalizeKey, "normalizeKey"); } }); // ../../node_modules/jose/dist/webapi/lib/validate_crit.js function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) { if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0) { throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected'); } if (!protectedHeader || protectedHeader.crit === void 0) { return /* @__PURE__ */ new Set(); } if (!Array.isArray(protectedHeader.crit) || protectedHeader.crit.length === 0 || protectedHeader.crit.some((input) => typeof input !== "string" || input.length === 0)) { throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present'); } let recognized; if (recognizedOption !== void 0) { recognized = new Map([...Object.entries(recognizedOption), ...recognizedDefault.entries()]); } else { recognized = recognizedDefault; } for (const parameter of protectedHeader.crit) { if (!recognized.has(parameter)) { throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`); } if (joseHeader[parameter] === void 0) { throw new Err(`Extension Header Parameter "${parameter}" is missing`); } if (recognized.get(parameter) && protectedHeader[parameter] === void 0) { throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`); } } return new Set(protectedHeader.crit); } var init_validate_crit = __esm({ "../../node_modules/jose/dist/webapi/lib/validate_crit.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_errors2(); __name(validateCrit, "validateCrit"); } }); // ../../node_modules/jose/dist/webapi/lib/validate_algorithms.js function validateAlgorithms(option, algorithms) { if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s2) => typeof s2 !== "string"))) { throw new TypeError(`"${option}" option must be an array of strings`); } if (!algorithms) { return void 0; } return new Set(algorithms); } var init_validate_algorithms = __esm({ "../../node_modules/jose/dist/webapi/lib/validate_algorithms.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(validateAlgorithms, "validateAlgorithms"); } }); // ../../node_modules/jose/dist/webapi/lib/check_key_type.js function checkKeyType(alg, key, usage) { switch (alg.substring(0, 2)) { case "A1": case "A2": case "di": case "HS": case "PB": symmetricTypeCheck(alg, key, usage); break; default: asymmetricTypeCheck(alg, key, usage); } } var tag, jwkMatchesOp, symmetricTypeCheck, asymmetricTypeCheck; var init_check_key_type = __esm({ "../../node_modules/jose/dist/webapi/lib/check_key_type.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_invalid_key_input(); init_is_key_like(); init_type_checks(); tag = /* @__PURE__ */ __name((key) => key?.[Symbol.toStringTag], "tag"); jwkMatchesOp = /* @__PURE__ */ __name((alg, key, usage) => { if (key.use !== void 0) { let expected; switch (usage) { case "sign": case "verify": expected = "sig"; break; case "encrypt": case "decrypt": expected = "enc"; break; } if (key.use !== expected) { throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`); } } if (key.alg !== void 0 && key.alg !== alg) { throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`); } if (Array.isArray(key.key_ops)) { let expectedKeyOp; switch (true) { case (usage === "sign" || usage === "verify"): case alg === "dir": case alg.includes("CBC-HS"): expectedKeyOp = usage; break; case alg.startsWith("PBES2"): expectedKeyOp = "deriveBits"; break; case /^A\d{3}(?:GCM)?(?:KW)?$/.test(alg): if (!alg.includes("GCM") && alg.endsWith("KW")) { expectedKeyOp = usage === "encrypt" ? "wrapKey" : "unwrapKey"; } else { expectedKeyOp = usage; } break; case (usage === "encrypt" && alg.startsWith("RSA")): expectedKeyOp = "wrapKey"; break; case usage === "decrypt": expectedKeyOp = alg.startsWith("RSA") ? "unwrapKey" : "deriveBits"; break; } if (expectedKeyOp && key.key_ops?.includes?.(expectedKeyOp) === false) { throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`); } } return true; }, "jwkMatchesOp"); symmetricTypeCheck = /* @__PURE__ */ __name((alg, key, usage) => { if (key instanceof Uint8Array) return; if (isJWK(key)) { if (isSecretJWK(key) && jwkMatchesOp(alg, key, usage)) return; throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`); } if (!isKeyLike(key)) { throw new TypeError(withAlg(alg, key, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array")); } if (key.type !== "secret") { throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`); } }, "symmetricTypeCheck"); asymmetricTypeCheck = /* @__PURE__ */ __name((alg, key, usage) => { if (isJWK(key)) { switch (usage) { case "decrypt": case "sign": if (isPrivateJWK(key) && jwkMatchesOp(alg, key, usage)) return; throw new TypeError(`JSON Web Key for this operation must be a private JWK`); case "encrypt": case "verify": if (isPublicJWK(key) && jwkMatchesOp(alg, key, usage)) return; throw new TypeError(`JSON Web Key for this operation must be a public JWK`); } } if (!isKeyLike(key)) { throw new TypeError(withAlg(alg, key, "CryptoKey", "KeyObject", "JSON Web Key")); } if (key.type === "secret") { throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`); } if (key.type === "public") { switch (usage) { case "sign": throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`); case "decrypt": throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`); } } if (key.type === "private") { switch (usage) { case "verify": throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`); case "encrypt": throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`); } } }, "asymmetricTypeCheck"); __name(checkKeyType, "checkKeyType"); } }); // ../../node_modules/jose/dist/webapi/jws/flattened/verify.js async function flattenedVerify(jws, key, options) { if (!isObject2(jws)) { throw new JWSInvalid("Flattened JWS must be an object"); } if (jws.protected === void 0 && jws.header === void 0) { throw new JWSInvalid('Flattened JWS must have either of the "protected" or "header" members'); } if (jws.protected !== void 0 && typeof jws.protected !== "string") { throw new JWSInvalid("JWS Protected Header incorrect type"); } if (jws.payload === void 0) { throw new JWSInvalid("JWS Payload missing"); } if (typeof jws.signature !== "string") { throw new JWSInvalid("JWS Signature missing or incorrect type"); } if (jws.header !== void 0 && !isObject2(jws.header)) { throw new JWSInvalid("JWS Unprotected Header incorrect type"); } let parsedProt = {}; if (jws.protected) { try { const protectedHeader = decode(jws.protected); parsedProt = JSON.parse(decoder.decode(protectedHeader)); } catch { throw new JWSInvalid("JWS Protected Header is invalid"); } } if (!isDisjoint(parsedProt, jws.header)) { throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint"); } const joseHeader = { ...parsedProt, ...jws.header }; const extensions = validateCrit(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, parsedProt, joseHeader); let b64 = true; if (extensions.has("b64")) { b64 = parsedProt.b64; if (typeof b64 !== "boolean") { throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean'); } } const { alg } = joseHeader; if (typeof alg !== "string" || !alg) { throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid'); } const algorithms = options && validateAlgorithms("algorithms", options.algorithms); if (algorithms && !algorithms.has(alg)) { throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed'); } if (b64) { if (typeof jws.payload !== "string") { throw new JWSInvalid("JWS Payload must be a string"); } } else if (typeof jws.payload !== "string" && !(jws.payload instanceof Uint8Array)) { throw new JWSInvalid("JWS Payload must be a string or an Uint8Array instance"); } let resolvedKey = false; if (typeof key === "function") { key = await key(parsedProt, jws); resolvedKey = true; } checkKeyType(alg, key, "verify"); const data = concat(jws.protected !== void 0 ? encode(jws.protected) : new Uint8Array(), encode("."), typeof jws.payload === "string" ? b64 ? encode(jws.payload) : encoder.encode(jws.payload) : jws.payload); const signature = decodeBase64url(jws.signature, "signature", JWSInvalid); const k2 = await normalizeKey(key, alg); const verified = await verify(alg, k2, signature, data); if (!verified) { throw new JWSSignatureVerificationFailed(); } let payload; if (b64) { payload = decodeBase64url(jws.payload, "payload", JWSInvalid); } else if (typeof jws.payload === "string") { payload = encoder.encode(jws.payload); } else { payload = jws.payload; } const result = { payload }; if (jws.protected !== void 0) { result.protectedHeader = parsedProt; } if (jws.header !== void 0) { result.unprotectedHeader = jws.header; } if (resolvedKey) { return { ...result, key: k2 }; } return result; } var init_verify = __esm({ "../../node_modules/jose/dist/webapi/jws/flattened/verify.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_base64url(); init_signing(); init_errors2(); init_buffer_utils(); init_helpers(); init_type_checks(); init_type_checks(); init_check_key_type(); init_validate_crit(); init_validate_algorithms(); init_normalize_key(); __name(flattenedVerify, "flattenedVerify"); } }); // ../../node_modules/jose/dist/webapi/jws/compact/verify.js async function compactVerify(jws, key, options) { if (jws instanceof Uint8Array) { jws = decoder.decode(jws); } if (typeof jws !== "string") { throw new JWSInvalid("Compact JWS must be a string or Uint8Array"); } const { 0: protectedHeader, 1: payload, 2: signature, length } = jws.split("."); if (length !== 3) { throw new JWSInvalid("Invalid Compact JWS"); } const verified = await flattenedVerify({ payload, protected: protectedHeader, signature }, key, options); const result = { payload: verified.payload, protectedHeader: verified.protectedHeader }; if (typeof key === "function") { return { ...result, key: verified.key }; } return result; } var init_verify2 = __esm({ "../../node_modules/jose/dist/webapi/jws/compact/verify.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_verify(); init_errors2(); init_buffer_utils(); __name(compactVerify, "compactVerify"); } }); // ../../node_modules/jose/dist/webapi/lib/jwt_claims_set.js function secs(str) { const matched = REGEX.exec(str); if (!matched || matched[4] && matched[1]) { throw new TypeError("Invalid time period format"); } const value = parseFloat(matched[2]); const unit = matched[3].toLowerCase(); let numericDate; switch (unit) { case "sec": case "secs": case "second": case "seconds": case "s": numericDate = Math.round(value); break; case "minute": case "minutes": case "min": case "mins": case "m": numericDate = Math.round(value * minute); break; case "hour": case "hours": case "hr": case "hrs": case "h": numericDate = Math.round(value * hour); break; case "day": case "days": case "d": numericDate = Math.round(value * day); break; case "week": case "weeks": case "w": numericDate = Math.round(value * week); break; default: numericDate = Math.round(value * year); break; } if (matched[1] === "-" || matched[4] === "ago") { return -numericDate; } return numericDate; } function validateInput(label, input) { if (!Number.isFinite(input)) { throw new TypeError(`Invalid ${label} input`); } return input; } function validateClaimsSet(protectedHeader, encodedPayload, options = {}) { let payload; try { payload = JSON.parse(decoder.decode(encodedPayload)); } catch { } if (!isObject2(payload)) { throw new JWTInvalid("JWT Claims Set must be a top-level JSON object"); } const { typ } = options; if (typ && (typeof protectedHeader.typ !== "string" || normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) { throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', payload, "typ", "check_failed"); } const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options; const presenceCheck = [...requiredClaims]; if (maxTokenAge !== void 0) presenceCheck.push("iat"); if (audience !== void 0) presenceCheck.push("aud"); if (subject !== void 0) presenceCheck.push("sub"); if (issuer !== void 0) presenceCheck.push("iss"); for (const claim of new Set(presenceCheck.reverse())) { if (!(claim in payload)) { throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, "missing"); } } if (issuer && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) { throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, "iss", "check_failed"); } if (subject && payload.sub !== subject) { throw new JWTClaimValidationFailed('unexpected "sub" claim value', payload, "sub", "check_failed"); } if (audience && !checkAudiencePresence(payload.aud, typeof audience === "string" ? [audience] : audience)) { throw new JWTClaimValidationFailed('unexpected "aud" claim value', payload, "aud", "check_failed"); } let tolerance; switch (typeof options.clockTolerance) { case "string": tolerance = secs(options.clockTolerance); break; case "number": tolerance = options.clockTolerance; break; case "undefined": tolerance = 0; break; default: throw new TypeError("Invalid clockTolerance option type"); } const { currentDate } = options; const now = epoch(currentDate || /* @__PURE__ */ new Date()); if ((payload.iat !== void 0 || maxTokenAge) && typeof payload.iat !== "number") { throw new JWTClaimValidationFailed('"iat" claim must be a number', payload, "iat", "invalid"); } if (payload.nbf !== void 0) { if (typeof payload.nbf !== "number") { throw new JWTClaimValidationFailed('"nbf" claim must be a number', payload, "nbf", "invalid"); } if (payload.nbf > now + tolerance) { throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload, "nbf", "check_failed"); } } if (payload.exp !== void 0) { if (typeof payload.exp !== "number") { throw new JWTClaimValidationFailed('"exp" claim must be a number', payload, "exp", "invalid"); } if (payload.exp <= now - tolerance) { throw new JWTExpired('"exp" claim timestamp check failed', payload, "exp", "check_failed"); } } if (maxTokenAge) { const age = now - payload.iat; const max2 = typeof maxTokenAge === "number" ? maxTokenAge : secs(maxTokenAge); if (age - tolerance > max2) { throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload, "iat", "check_failed"); } if (age < 0 - tolerance) { throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload, "iat", "check_failed"); } } return payload; } var epoch, minute, hour, day, week, year, REGEX, normalizeTyp, checkAudiencePresence, JWTClaimsBuilder; var init_jwt_claims_set = __esm({ "../../node_modules/jose/dist/webapi/lib/jwt_claims_set.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_errors2(); init_buffer_utils(); init_type_checks(); epoch = /* @__PURE__ */ __name((date6) => Math.floor(date6.getTime() / 1e3), "epoch"); minute = 60; hour = minute * 60; day = hour * 24; week = day * 7; year = day * 365.25; REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i; __name(secs, "secs"); __name(validateInput, "validateInput"); normalizeTyp = /* @__PURE__ */ __name((value) => { if (value.includes("/")) { return value.toLowerCase(); } return `application/${value.toLowerCase()}`; }, "normalizeTyp"); checkAudiencePresence = /* @__PURE__ */ __name((audPayload, audOption) => { if (typeof audPayload === "string") { return audOption.includes(audPayload); } if (Array.isArray(audPayload)) { return audOption.some(Set.prototype.has.bind(new Set(audPayload))); } return false; }, "checkAudiencePresence"); __name(validateClaimsSet, "validateClaimsSet"); JWTClaimsBuilder = class { #payload; constructor(payload) { if (!isObject2(payload)) { throw new TypeError("JWT Claims Set MUST be an object"); } this.#payload = structuredClone(payload); } data() { return encoder.encode(JSON.stringify(this.#payload)); } get iss() { return this.#payload.iss; } set iss(value) { this.#payload.iss = value; } get sub() { return this.#payload.sub; } set sub(value) { this.#payload.sub = value; } get aud() { return this.#payload.aud; } set aud(value) { this.#payload.aud = value; } set jti(value) { this.#payload.jti = value; } set nbf(value) { if (typeof value === "number") { this.#payload.nbf = validateInput("setNotBefore", value); } else if (value instanceof Date) { this.#payload.nbf = validateInput("setNotBefore", epoch(value)); } else { this.#payload.nbf = epoch(/* @__PURE__ */ new Date()) + secs(value); } } set exp(value) { if (typeof value === "number") { this.#payload.exp = validateInput("setExpirationTime", value); } else if (value instanceof Date) { this.#payload.exp = validateInput("setExpirationTime", epoch(value)); } else { this.#payload.exp = epoch(/* @__PURE__ */ new Date()) + secs(value); } } set iat(value) { if (value === void 0) { this.#payload.iat = epoch(/* @__PURE__ */ new Date()); } else if (value instanceof Date) { this.#payload.iat = validateInput("setIssuedAt", epoch(value)); } else if (typeof value === "string") { this.#payload.iat = validateInput("setIssuedAt", epoch(/* @__PURE__ */ new Date()) + secs(value)); } else { this.#payload.iat = validateInput("setIssuedAt", value); } } }; __name(JWTClaimsBuilder, "JWTClaimsBuilder"); } }); // ../../node_modules/jose/dist/webapi/jwt/verify.js async function jwtVerify(jwt2, key, options) { const verified = await compactVerify(jwt2, key, options); if (verified.protectedHeader.crit?.includes("b64") && verified.protectedHeader.b64 === false) { throw new JWTInvalid("JWTs MUST NOT use unencoded payload"); } const payload = validateClaimsSet(verified.protectedHeader, verified.payload, options); const result = { payload, protectedHeader: verified.protectedHeader }; if (typeof key === "function") { return { ...result, key: verified.key }; } return result; } var init_verify3 = __esm({ "../../node_modules/jose/dist/webapi/jwt/verify.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_verify2(); init_jwt_claims_set(); init_errors2(); __name(jwtVerify, "jwtVerify"); } }); // ../../node_modules/jose/dist/webapi/jws/flattened/sign.js var FlattenedSign; var init_sign = __esm({ "../../node_modules/jose/dist/webapi/jws/flattened/sign.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_base64url(); init_signing(); init_type_checks(); init_errors2(); init_buffer_utils(); init_check_key_type(); init_validate_crit(); init_normalize_key(); init_helpers(); FlattenedSign = class { #payload; #protectedHeader; #unprotectedHeader; constructor(payload) { if (!(payload instanceof Uint8Array)) { throw new TypeError("payload must be an instance of Uint8Array"); } this.#payload = payload; } setProtectedHeader(protectedHeader) { assertNotSet(this.#protectedHeader, "setProtectedHeader"); this.#protectedHeader = protectedHeader; return this; } setUnprotectedHeader(unprotectedHeader) { assertNotSet(this.#unprotectedHeader, "setUnprotectedHeader"); this.#unprotectedHeader = unprotectedHeader; return this; } async sign(key, options) { if (!this.#protectedHeader && !this.#unprotectedHeader) { throw new JWSInvalid("either setProtectedHeader or setUnprotectedHeader must be called before #sign()"); } if (!isDisjoint(this.#protectedHeader, this.#unprotectedHeader)) { throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint"); } const joseHeader = { ...this.#protectedHeader, ...this.#unprotectedHeader }; const extensions = validateCrit(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, this.#protectedHeader, joseHeader); let b64 = true; if (extensions.has("b64")) { b64 = this.#protectedHeader.b64; if (typeof b64 !== "boolean") { throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean'); } } const { alg } = joseHeader; if (typeof alg !== "string" || !alg) { throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid'); } checkKeyType(alg, key, "sign"); let payloadS; let payloadB; if (b64) { payloadS = encode2(this.#payload); payloadB = encode(payloadS); } else { payloadB = this.#payload; payloadS = ""; } let protectedHeaderString; let protectedHeaderBytes; if (this.#protectedHeader) { protectedHeaderString = encode2(JSON.stringify(this.#protectedHeader)); protectedHeaderBytes = encode(protectedHeaderString); } else { protectedHeaderString = ""; protectedHeaderBytes = new Uint8Array(); } const data = concat(protectedHeaderBytes, encode("."), payloadB); const k2 = await normalizeKey(key, alg); const signature = await sign(alg, k2, data); const jws = { signature: encode2(signature), payload: payloadS }; if (this.#unprotectedHeader) { jws.header = this.#unprotectedHeader; } if (this.#protectedHeader) { jws.protected = protectedHeaderString; } return jws; } }; __name(FlattenedSign, "FlattenedSign"); } }); // ../../node_modules/jose/dist/webapi/jws/compact/sign.js var CompactSign; var init_sign2 = __esm({ "../../node_modules/jose/dist/webapi/jws/compact/sign.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_sign(); CompactSign = class { #flattened; constructor(payload) { this.#flattened = new FlattenedSign(payload); } setProtectedHeader(protectedHeader) { this.#flattened.setProtectedHeader(protectedHeader); return this; } async sign(key, options) { const jws = await this.#flattened.sign(key, options); if (jws.payload === void 0) { throw new TypeError("use the flattened module for creating JWS with b64: false"); } return `${jws.protected}.${jws.payload}.${jws.signature}`; } }; __name(CompactSign, "CompactSign"); } }); // ../../node_modules/jose/dist/webapi/jwt/sign.js var SignJWT; var init_sign3 = __esm({ "../../node_modules/jose/dist/webapi/jwt/sign.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_sign2(); init_errors2(); init_jwt_claims_set(); SignJWT = class { #protectedHeader; #jwt; constructor(payload = {}) { this.#jwt = new JWTClaimsBuilder(payload); } setIssuer(issuer) { this.#jwt.iss = issuer; return this; } setSubject(subject) { this.#jwt.sub = subject; return this; } setAudience(audience) { this.#jwt.aud = audience; return this; } setJti(jwtId) { this.#jwt.jti = jwtId; return this; } setNotBefore(input) { this.#jwt.nbf = input; return this; } setExpirationTime(input) { this.#jwt.exp = input; return this; } setIssuedAt(input) { this.#jwt.iat = input; return this; } setProtectedHeader(protectedHeader) { this.#protectedHeader = protectedHeader; return this; } async sign(key, options) { const sig = new CompactSign(this.#jwt.data()); sig.setProtectedHeader(this.#protectedHeader); if (Array.isArray(this.#protectedHeader?.crit) && this.#protectedHeader.crit.includes("b64") && this.#protectedHeader.b64 === false) { throw new JWTInvalid("JWTs MUST NOT use unencoded payload"); } return sig.sign(key, options); } }; __name(SignJWT, "SignJWT"); } }); // ../../node_modules/jose/dist/webapi/index.js var init_webapi = __esm({ "../../node_modules/jose/dist/webapi/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_verify3(); init_sign3(); } }); // src/lib/api-error.ts var ApiError; var init_api_error = __esm({ "src/lib/api-error.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ApiError = class extends Error { statusCode; details; constructor(message2, statusCode = 500, details) { console.log(message2); super(message2); this.name = "ApiError"; this.statusCode = statusCode; this.details = details; } }; __name(ApiError, "ApiError"); } }); // src/lib/env-exporter.ts var getRuntimeEnv, runtimeEnv, appUrl, jwtSecret, getEncodedJwtSecret, s3AccessKeyId, s3SecretAccessKey, s3BucketName, s3Region, assetsDomain, apiCacheKey, cloudflareApiToken, cloudflareZoneId, s3Url, redisUrl, expoAccessToken, phonePeBaseUrl, phonePeClientId, phonePeClientVersion, phonePeClientSecret, phonePeMerchantId, razorpayId, razorpaySecret, otpSenderAuthToken, minOrderValue, deliveryCharge, telegramBotToken, telegramChatIds, isDevMode; var init_env_exporter = __esm({ "src/lib/env-exporter.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getRuntimeEnv = /* @__PURE__ */ __name(() => globalThis.ENV || globalThis.process?.env || {}, "getRuntimeEnv"); runtimeEnv = getRuntimeEnv(); appUrl = runtimeEnv.APP_URL; jwtSecret = runtimeEnv.JWT_SECRET; getEncodedJwtSecret = /* @__PURE__ */ __name(() => { const env2 = getRuntimeEnv(); const secret = env2.JWT_SECRET || ""; return new TextEncoder().encode(secret); }, "getEncodedJwtSecret"); s3AccessKeyId = runtimeEnv.S3_ACCESS_KEY_ID; s3SecretAccessKey = runtimeEnv.S3_SECRET_ACCESS_KEY; s3BucketName = runtimeEnv.S3_BUCKET_NAME; s3Region = runtimeEnv.S3_REGION; assetsDomain = runtimeEnv.ASSETS_DOMAIN; apiCacheKey = runtimeEnv.API_CACHE_KEY; cloudflareApiToken = runtimeEnv.CLOUDFLARE_API_TOKEN; cloudflareZoneId = runtimeEnv.CLOUDFLARE_ZONE_ID; s3Url = runtimeEnv.S3_URL; redisUrl = runtimeEnv.REDIS_URL; expoAccessToken = runtimeEnv.EXPO_ACCESS_TOKEN; phonePeBaseUrl = runtimeEnv.PHONE_PE_BASE_URL; phonePeClientId = runtimeEnv.PHONE_PE_CLIENT_ID; phonePeClientVersion = Number(runtimeEnv.PHONE_PE_CLIENT_VERSION); phonePeClientSecret = runtimeEnv.PHONE_PE_CLIENT_SECRET; phonePeMerchantId = runtimeEnv.PHONE_PE_MERCHANT_ID; razorpayId = runtimeEnv.RAZORPAY_KEY; razorpaySecret = runtimeEnv.RAZORPAY_SECRET; otpSenderAuthToken = runtimeEnv.OTP_SENDER_AUTH_TOKEN; minOrderValue = Number(runtimeEnv.MIN_ORDER_VALUE); deliveryCharge = Number(runtimeEnv.DELIVERY_CHARGE); telegramBotToken = runtimeEnv.TELEGRAM_BOT_TOKEN; telegramChatIds = runtimeEnv.TELEGRAM_CHAT_IDS?.split(",").map((id) => id.trim()) || []; isDevMode = runtimeEnv.ENV_MODE === "dev"; } }); // src/middleware/staff-auth.ts var verifyStaffToken, authenticateStaff; var init_staff_auth = __esm({ "src/middleware/staff-auth.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_webapi(); init_dbService(); init_api_error(); init_env_exporter(); verifyStaffToken = /* @__PURE__ */ __name(async (token) => { try { const { payload } = await jwtVerify(token, getEncodedJwtSecret()); return payload; } catch (error50) { throw new ApiError("Access denied. Invalid auth credentials", 401); } }, "verifyStaffToken"); authenticateStaff = /* @__PURE__ */ __name(async (c2, next) => { try { const authHeader = c2.req.header("authorization"); if (!authHeader || !authHeader.startsWith("Bearer ")) { throw new ApiError("Staff authentication required", 401); } const token = authHeader.split(" ")[1]; if (!token) { throw new ApiError("Staff authentication token missing", 401); } const decoded = await verifyStaffToken(token); if (!decoded.staffId) { throw new ApiError("Invalid staff token format", 401); } const staff = await getStaffUserById(decoded.staffId); if (!staff) { throw new ApiError("Staff user not found", 401); } c2.set("staffUser", { id: staff.id, name: staff.name }); await next(); } catch (error50) { throw error50; } }, "authenticateStaff"); } }); // src/apis/admin-apis/apis/av-router.ts var router, avRouter, av_router_default; var init_av_router = __esm({ "src/apis/admin-apis/apis/av-router.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist(); init_staff_auth(); router = new Hono2(); router.use("*", authenticateStaff); avRouter = router; av_router_default = avRouter; } }); // ../../node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js var getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig; var init_httpExtensionConfiguration = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { return { setHttpHandler(handler) { runtimeConfig.httpHandler = handler; }, httpHandler() { return runtimeConfig.httpHandler; }, updateHttpClientConfig(key, value) { runtimeConfig.httpHandler?.updateHttpClientConfig(key, value); }, httpHandlerConfigs() { return runtimeConfig.httpHandler.httpHandlerConfigs(); } }; }, "getHttpHandlerExtensionConfiguration"); resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { return { httpHandler: httpHandlerExtensionConfiguration.httpHandler() }; }, "resolveHttpHandlerRuntimeConfig"); } }); // ../../node_modules/@smithy/protocol-http/dist-es/extensions/index.js var init_extensions = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/extensions/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_httpExtensionConfiguration(); } }); // ../../node_modules/@smithy/types/dist-es/abort.js var init_abort = __esm({ "../../node_modules/@smithy/types/dist-es/abort.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/auth/auth.js var HttpAuthLocation; var init_auth2 = __esm({ "../../node_modules/@smithy/types/dist-es/auth/auth.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(HttpAuthLocation2) { HttpAuthLocation2["HEADER"] = "header"; HttpAuthLocation2["QUERY"] = "query"; })(HttpAuthLocation || (HttpAuthLocation = {})); } }); // ../../node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js var HttpApiKeyAuthLocation; var init_HttpApiKeyAuth = __esm({ "../../node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(HttpApiKeyAuthLocation2) { HttpApiKeyAuthLocation2["HEADER"] = "header"; HttpApiKeyAuthLocation2["QUERY"] = "query"; })(HttpApiKeyAuthLocation || (HttpApiKeyAuthLocation = {})); } }); // ../../node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js var init_HttpAuthScheme = __esm({ "../../node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js var init_HttpAuthSchemeProvider = __esm({ "../../node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/auth/HttpSigner.js var init_HttpSigner = __esm({ "../../node_modules/@smithy/types/dist-es/auth/HttpSigner.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js var init_IdentityProviderConfig = __esm({ "../../node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/auth/index.js var init_auth3 = __esm({ "../../node_modules/@smithy/types/dist-es/auth/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_auth2(); init_HttpApiKeyAuth(); init_HttpAuthScheme(); init_HttpAuthSchemeProvider(); init_HttpSigner(); init_IdentityProviderConfig(); } }); // ../../node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js var init_blob_payload_input_types = __esm({ "../../node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/checksum.js var init_checksum = __esm({ "../../node_modules/@smithy/types/dist-es/checksum.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/client.js var init_client = __esm({ "../../node_modules/@smithy/types/dist-es/client.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/command.js var init_command = __esm({ "../../node_modules/@smithy/types/dist-es/command.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/connection/config.js var init_config = __esm({ "../../node_modules/@smithy/types/dist-es/connection/config.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/connection/manager.js var init_manager = __esm({ "../../node_modules/@smithy/types/dist-es/connection/manager.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/connection/pool.js var init_pool = __esm({ "../../node_modules/@smithy/types/dist-es/connection/pool.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/connection/index.js var init_connection = __esm({ "../../node_modules/@smithy/types/dist-es/connection/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_config(); init_manager(); init_pool(); } }); // ../../node_modules/@smithy/types/dist-es/crypto.js var init_crypto = __esm({ "../../node_modules/@smithy/types/dist-es/crypto.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/encode.js var init_encode = __esm({ "../../node_modules/@smithy/types/dist-es/encode.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/endpoint.js var EndpointURLScheme; var init_endpoint = __esm({ "../../node_modules/@smithy/types/dist-es/endpoint.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(EndpointURLScheme2) { EndpointURLScheme2["HTTP"] = "http"; EndpointURLScheme2["HTTPS"] = "https"; })(EndpointURLScheme || (EndpointURLScheme = {})); } }); // ../../node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js var init_EndpointRuleObject = __esm({ "../../node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js var init_ErrorRuleObject = __esm({ "../../node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js var init_RuleSetObject = __esm({ "../../node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/endpoints/shared.js var init_shared = __esm({ "../../node_modules/@smithy/types/dist-es/endpoints/shared.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js var init_TreeRuleObject = __esm({ "../../node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/endpoints/index.js var init_endpoints = __esm({ "../../node_modules/@smithy/types/dist-es/endpoints/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EndpointRuleObject(); init_ErrorRuleObject(); init_RuleSetObject(); init_shared(); init_TreeRuleObject(); } }); // ../../node_modules/@smithy/types/dist-es/eventStream.js var init_eventStream = __esm({ "../../node_modules/@smithy/types/dist-es/eventStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/extensions/checksum.js var AlgorithmId; var init_checksum2 = __esm({ "../../node_modules/@smithy/types/dist-es/extensions/checksum.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(AlgorithmId2) { AlgorithmId2["MD5"] = "md5"; AlgorithmId2["CRC32"] = "crc32"; AlgorithmId2["CRC32C"] = "crc32c"; AlgorithmId2["SHA1"] = "sha1"; AlgorithmId2["SHA256"] = "sha256"; })(AlgorithmId || (AlgorithmId = {})); } }); // ../../node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js var init_defaultClientConfiguration = __esm({ "../../node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js var init_defaultExtensionConfiguration = __esm({ "../../node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/extensions/index.js var init_extensions2 = __esm({ "../../node_modules/@smithy/types/dist-es/extensions/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_defaultClientConfiguration(); init_defaultExtensionConfiguration(); init_checksum2(); } }); // ../../node_modules/@smithy/types/dist-es/feature-ids.js var init_feature_ids = __esm({ "../../node_modules/@smithy/types/dist-es/feature-ids.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/http.js var FieldPosition; var init_http = __esm({ "../../node_modules/@smithy/types/dist-es/http.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(FieldPosition2) { FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; })(FieldPosition || (FieldPosition = {})); } }); // ../../node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js var init_httpHandlerInitialization = __esm({ "../../node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js var init_apiKeyIdentity = __esm({ "../../node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js var init_awsCredentialIdentity = __esm({ "../../node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/identity/identity.js var init_identity = __esm({ "../../node_modules/@smithy/types/dist-es/identity/identity.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/identity/tokenIdentity.js var init_tokenIdentity = __esm({ "../../node_modules/@smithy/types/dist-es/identity/tokenIdentity.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/identity/index.js var init_identity2 = __esm({ "../../node_modules/@smithy/types/dist-es/identity/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_apiKeyIdentity(); init_awsCredentialIdentity(); init_identity(); init_tokenIdentity(); } }); // ../../node_modules/@smithy/types/dist-es/logger.js var init_logger3 = __esm({ "../../node_modules/@smithy/types/dist-es/logger.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/middleware.js var SMITHY_CONTEXT_KEY; var init_middleware = __esm({ "../../node_modules/@smithy/types/dist-es/middleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SMITHY_CONTEXT_KEY = "__smithy_context"; } }); // ../../node_modules/@smithy/types/dist-es/pagination.js var init_pagination = __esm({ "../../node_modules/@smithy/types/dist-es/pagination.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/profile.js var IniSectionType; var init_profile = __esm({ "../../node_modules/@smithy/types/dist-es/profile.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(IniSectionType2) { IniSectionType2["PROFILE"] = "profile"; IniSectionType2["SSO_SESSION"] = "sso-session"; IniSectionType2["SERVICES"] = "services"; })(IniSectionType || (IniSectionType = {})); } }); // ../../node_modules/@smithy/types/dist-es/response.js var init_response = __esm({ "../../node_modules/@smithy/types/dist-es/response.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/retry.js var init_retry = __esm({ "../../node_modules/@smithy/types/dist-es/retry.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/schema/schema.js var init_schema2 = __esm({ "../../node_modules/@smithy/types/dist-es/schema/schema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/schema/traits.js var init_traits = __esm({ "../../node_modules/@smithy/types/dist-es/schema/traits.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/schema/schema-deprecated.js var init_schema_deprecated = __esm({ "../../node_modules/@smithy/types/dist-es/schema/schema-deprecated.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/schema/sentinels.js var init_sentinels = __esm({ "../../node_modules/@smithy/types/dist-es/schema/sentinels.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/schema/static-schemas.js var init_static_schemas = __esm({ "../../node_modules/@smithy/types/dist-es/schema/static-schemas.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/serde.js var init_serde = __esm({ "../../node_modules/@smithy/types/dist-es/serde.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/shapes.js var init_shapes = __esm({ "../../node_modules/@smithy/types/dist-es/shapes.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/signature.js var init_signature = __esm({ "../../node_modules/@smithy/types/dist-es/signature.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/stream.js var init_stream = __esm({ "../../node_modules/@smithy/types/dist-es/stream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js var init_streaming_blob_common_types = __esm({ "../../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js var init_streaming_blob_payload_input_types = __esm({ "../../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js var init_streaming_blob_payload_output_types = __esm({ "../../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/transfer.js var RequestHandlerProtocol; var init_transfer = __esm({ "../../node_modules/@smithy/types/dist-es/transfer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(RequestHandlerProtocol2) { RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; })(RequestHandlerProtocol || (RequestHandlerProtocol = {})); } }); // ../../node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js var init_client_payload_blob_type_narrow = __esm({ "../../node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/transform/mutable.js var init_mutable = __esm({ "../../node_modules/@smithy/types/dist-es/transform/mutable.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/transform/no-undefined.js var init_no_undefined = __esm({ "../../node_modules/@smithy/types/dist-es/transform/no-undefined.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/transform/type-transform.js var init_type_transform = __esm({ "../../node_modules/@smithy/types/dist-es/transform/type-transform.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/uri.js var init_uri = __esm({ "../../node_modules/@smithy/types/dist-es/uri.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/util.js var init_util = __esm({ "../../node_modules/@smithy/types/dist-es/util.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/waiter.js var init_waiter = __esm({ "../../node_modules/@smithy/types/dist-es/waiter.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/types/dist-es/index.js var init_dist_es = __esm({ "../../node_modules/@smithy/types/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_abort(); init_auth3(); init_blob_payload_input_types(); init_checksum(); init_client(); init_command(); init_connection(); init_crypto(); init_encode(); init_endpoint(); init_endpoints(); init_eventStream(); init_extensions2(); init_feature_ids(); init_http(); init_httpHandlerInitialization(); init_identity2(); init_logger3(); init_middleware(); init_pagination(); init_profile(); init_response(); init_retry(); init_schema2(); init_traits(); init_schema_deprecated(); init_sentinels(); init_static_schemas(); init_serde(); init_shapes(); init_signature(); init_stream(); init_streaming_blob_common_types(); init_streaming_blob_payload_input_types(); init_streaming_blob_payload_output_types(); init_transfer(); init_client_payload_blob_type_narrow(); init_mutable(); init_no_undefined(); init_type_transform(); init_uri(); init_util(); init_waiter(); } }); // ../../node_modules/@smithy/protocol-http/dist-es/Field.js var init_Field = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/Field.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/protocol-http/dist-es/Fields.js var init_Fields = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/Fields.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/protocol-http/dist-es/httpHandler.js var init_httpHandler = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/httpHandler.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/protocol-http/dist-es/httpRequest.js function cloneQuery(query) { return Object.keys(query).reduce((carry, paramName) => { const param = query[paramName]; return { ...carry, [paramName]: Array.isArray(param) ? [...param] : param }; }, {}); } var HttpRequest; var init_httpRequest = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/httpRequest.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); HttpRequest = class { method; protocol; hostname; port; path; query; headers; username; password; fragment; body; constructor(options) { this.method = options.method || "GET"; this.hostname = options.hostname || "localhost"; this.port = options.port; this.query = options.query || {}; this.headers = options.headers || {}; this.body = options.body; this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:"; this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/"; this.username = options.username; this.password = options.password; this.fragment = options.fragment; } static clone(request) { const cloned = new HttpRequest({ ...request, headers: { ...request.headers } }); if (cloned.query) { cloned.query = cloneQuery(cloned.query); } return cloned; } static isInstance(request) { if (!request) { return false; } const req = request; return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; } clone() { return HttpRequest.clone(this); } }; __name(HttpRequest, "HttpRequest"); __name(cloneQuery, "cloneQuery"); } }); // ../../node_modules/@smithy/protocol-http/dist-es/httpResponse.js var HttpResponse; var init_httpResponse = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/httpResponse.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); HttpResponse = class { statusCode; reason; headers; body; constructor(options) { this.statusCode = options.statusCode; this.reason = options.reason; this.headers = options.headers || {}; this.body = options.body; } static isInstance(response) { if (!response) return false; const resp = response; return typeof resp.statusCode === "number" && typeof resp.headers === "object"; } }; __name(HttpResponse, "HttpResponse"); } }); // ../../node_modules/@smithy/protocol-http/dist-es/isValidHostname.js var init_isValidHostname = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/isValidHostname.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/protocol-http/dist-es/types.js var init_types = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/protocol-http/dist-es/index.js var init_dist_es2 = __esm({ "../../node_modules/@smithy/protocol-http/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_extensions(); init_Field(); init_Fields(); init_httpHandler(); init_httpRequest(); init_httpResponse(); init_isValidHostname(); init_types(); } }); // ../../node_modules/@aws-sdk/middleware-expect-continue/dist-es/index.js function addExpectContinueMiddleware(options) { return (next) => async (args) => { const { request } = args; if (options.expectContinueHeader !== false && HttpRequest.isInstance(request) && request.body && options.runtime === "node" && options.requestHandler?.constructor?.name !== "FetchHttpHandler") { let sendHeader = true; if (typeof options.expectContinueHeader === "number") { try { const bodyLength = Number(request.headers?.["content-length"]) ?? options.bodyLengthChecker?.(request.body) ?? Infinity; sendHeader = bodyLength >= options.expectContinueHeader; } catch (e2) { } } else { sendHeader = !!options.expectContinueHeader; } if (sendHeader) { request.headers.Expect = "100-continue"; } } return next({ ...args, request }); }; } var addExpectContinueMiddlewareOptions, getAddExpectContinuePlugin; var init_dist_es3 = __esm({ "../../node_modules/@aws-sdk/middleware-expect-continue/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); __name(addExpectContinueMiddleware, "addExpectContinueMiddleware"); addExpectContinueMiddlewareOptions = { step: "build", tags: ["SET_EXPECT_HEADER", "EXPECT_HEADER"], name: "addExpectContinueMiddleware", override: true }; getAddExpectContinuePlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(addExpectContinueMiddleware(options), addExpectContinueMiddlewareOptions); } }), "getAddExpectContinuePlugin"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js var RequestChecksumCalculation, DEFAULT_REQUEST_CHECKSUM_CALCULATION, ResponseChecksumValidation, DEFAULT_RESPONSE_CHECKSUM_VALIDATION, ChecksumAlgorithm, ChecksumLocation, DEFAULT_CHECKSUM_ALGORITHM; var init_constants3 = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); RequestChecksumCalculation = { WHEN_SUPPORTED: "WHEN_SUPPORTED", WHEN_REQUIRED: "WHEN_REQUIRED" }; DEFAULT_REQUEST_CHECKSUM_CALCULATION = RequestChecksumCalculation.WHEN_SUPPORTED; ResponseChecksumValidation = { WHEN_SUPPORTED: "WHEN_SUPPORTED", WHEN_REQUIRED: "WHEN_REQUIRED" }; DEFAULT_RESPONSE_CHECKSUM_VALIDATION = RequestChecksumCalculation.WHEN_SUPPORTED; (function(ChecksumAlgorithm2) { ChecksumAlgorithm2["MD5"] = "MD5"; ChecksumAlgorithm2["CRC32"] = "CRC32"; ChecksumAlgorithm2["CRC32C"] = "CRC32C"; ChecksumAlgorithm2["CRC64NVME"] = "CRC64NVME"; ChecksumAlgorithm2["SHA1"] = "SHA1"; ChecksumAlgorithm2["SHA256"] = "SHA256"; })(ChecksumAlgorithm || (ChecksumAlgorithm = {})); (function(ChecksumLocation2) { ChecksumLocation2["HEADER"] = "header"; ChecksumLocation2["TRAILER"] = "trailer"; })(ChecksumLocation || (ChecksumLocation = {})); DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.CRC32; } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js var init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.js var init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js var init_emitWarningIfUnsupportedVersion = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js function setCredentialFeature(credentials, feature2, value) { if (!credentials.$source) { credentials.$source = {}; } credentials.$source[feature2] = value; return credentials; } var init_setCredentialFeature = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(setCredentialFeature, "setCredentialFeature"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js function setFeature(context2, feature2, value) { if (!context2.__aws_sdk_context) { context2.__aws_sdk_context = { features: {} }; } else if (!context2.__aws_sdk_context.features) { context2.__aws_sdk_context.features = {}; } context2.__aws_sdk_context.features[feature2] = value; } var init_setFeature = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(setFeature, "setFeature"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js var init_setTokenFeature = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js var init_client2 = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_emitWarningIfUnsupportedVersion(); init_setCredentialFeature(); init_setFeature(); init_setTokenFeature(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js var getDateHeader; var init_getDateHeader = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); getDateHeader = /* @__PURE__ */ __name((response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js var getSkewCorrectedDate; var init_getSkewCorrectedDate = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js var isClockSkewed; var init_isClockSkewed = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getSkewCorrectedDate(); isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js var getUpdatedSystemClockOffset; var init_getUpdatedSystemClockOffset = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_isClockSkewed(); getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => { const clockTimeInMs = Date.parse(clockTime); if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { return clockTimeInMs - Date.now(); } return currentSystemClockOffset; }, "getUpdatedSystemClockOffset"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js var init_utils4 = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getDateHeader(); init_getSkewCorrectedDate(); init_getUpdatedSystemClockOffset(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js var throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer; var init_AwsSdkSigV4Signer = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_utils4(); throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => { if (!property) { throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); } return property; }, "throwSigningPropertyError"); validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => { const context2 = throwSigningPropertyError("context", signingProperties.context); const config3 = throwSigningPropertyError("config", signingProperties.config); const authScheme = context2.endpointV2?.properties?.authSchemes?.[0]; const signerFunction = throwSigningPropertyError("signer", config3.signer); const signer = await signerFunction(authScheme); const signingRegion = signingProperties?.signingRegion; const signingRegionSet = signingProperties?.signingRegionSet; const signingName = signingProperties?.signingName; return { config: config3, signer, signingRegion, signingRegionSet, signingName }; }, "validateSigningProperties"); AwsSdkSigV4Signer = class { async sign(httpRequest, identity2, signingProperties) { if (!HttpRequest.isInstance(httpRequest)) { throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); } const validatedProps = await validateSigningProperties(signingProperties); const { config: config3, signer } = validatedProps; let { signingRegion, signingName } = validatedProps; const handlerExecutionContext = signingProperties.context; if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { const [first, second] = handlerExecutionContext.authSchemes; if (first?.name === "sigv4a" && second?.name === "sigv4") { signingRegion = second?.signingRegion ?? signingRegion; signingName = second?.signingName ?? signingName; } } const signedRequest = await signer.sign(httpRequest, { signingDate: getSkewCorrectedDate(config3.systemClockOffset), signingRegion, signingService: signingName }); return signedRequest; } errorHandler(signingProperties) { return (error50) => { const serverTime = error50.ServerTime ?? getDateHeader(error50.$response); if (serverTime) { const config3 = throwSigningPropertyError("config", signingProperties.config); const initialSystemClockOffset = config3.systemClockOffset; config3.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config3.systemClockOffset); const clockSkewCorrected = config3.systemClockOffset !== initialSystemClockOffset; if (clockSkewCorrected && error50.$metadata) { error50.$metadata.clockSkewCorrected = true; } } throw error50; }; } successHandler(httpResponse, signingProperties) { const dateHeader = getDateHeader(httpResponse); if (dateHeader) { const config3 = throwSigningPropertyError("config", signingProperties.config); config3.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config3.systemClockOffset); } } }; __name(AwsSdkSigV4Signer, "AwsSdkSigV4Signer"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js var AwsSdkSigV4ASigner; var init_AwsSdkSigV4ASigner = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_utils4(); init_AwsSdkSigV4Signer(); AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { async sign(httpRequest, identity2, signingProperties) { if (!HttpRequest.isInstance(httpRequest)) { throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); } const { config: config3, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); const configResolvedSigningRegionSet = await config3.sigv4aSigningRegionSet?.(); const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); const signedRequest = await signer.sign(httpRequest, { signingDate: getSkewCorrectedDate(config3.systemClockOffset), signingRegion: multiRegionOverride, signingService: signingName }); return signedRequest; } }; __name(AwsSdkSigV4ASigner, "AwsSdkSigV4ASigner"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js var init_getBearerTokenEnvKey = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js var init_NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/getSmithyContext.js var init_getSmithyContext = __esm({ "../../node_modules/@smithy/core/dist-es/getSmithyContext.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js var getSmithyContext; var init_getSmithyContext2 = __esm({ "../../node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es(); getSmithyContext = /* @__PURE__ */ __name((context2) => context2[SMITHY_CONTEXT_KEY] || (context2[SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); } }); // ../../node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js var normalizeProvider; var init_normalizeProvider = __esm({ "../../node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); normalizeProvider = /* @__PURE__ */ __name((input) => { if (typeof input === "function") return input; const promisified = Promise.resolve(input); return () => promisified; }, "normalizeProvider"); } }); // ../../node_modules/@smithy/util-middleware/dist-es/index.js var init_dist_es4 = __esm({ "../../node_modules/@smithy/util-middleware/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getSmithyContext2(); init_normalizeProvider(); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js var resolveAuthOptions; var init_resolveAuthOptions = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); resolveAuthOptions = /* @__PURE__ */ __name((candidateAuthOptions, authSchemePreference) => { if (!authSchemePreference || authSchemePreference.length === 0) { return candidateAuthOptions; } const preferredAuthOptions = []; for (const preferredSchemeName of authSchemePreference) { for (const candidateAuthOption of candidateAuthOptions) { const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; if (candidateAuthSchemeName === preferredSchemeName) { preferredAuthOptions.push(candidateAuthOption); } } } for (const candidateAuthOption of candidateAuthOptions) { if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { preferredAuthOptions.push(candidateAuthOption); } } return preferredAuthOptions; }, "resolveAuthOptions"); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js function convertHttpAuthSchemesToMap(httpAuthSchemes) { const map2 = /* @__PURE__ */ new Map(); for (const scheme of httpAuthSchemes) { map2.set(scheme.schemeId, scheme); } return map2; } var httpAuthSchemeMiddleware; var init_httpAuthSchemeMiddleware = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es4(); init_resolveAuthOptions(); __name(convertHttpAuthSchemesToMap, "convertHttpAuthSchemesToMap"); httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config3, mwOptions) => (next, context2) => async (args) => { const options = config3.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config3, context2, args.input)); const authSchemePreference = config3.authSchemePreference ? await config3.authSchemePreference() : []; const resolvedOptions = resolveAuthOptions(options, authSchemePreference); const authSchemes = convertHttpAuthSchemesToMap(config3.httpAuthSchemes); const smithyContext = getSmithyContext(context2); const failureReasons = []; for (const option of resolvedOptions) { const scheme = authSchemes.get(option.schemeId); if (!scheme) { failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); continue; } const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config3)); if (!identityProvider) { failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); continue; } const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config3, context2) || {}; option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); smithyContext.selectedHttpAuthScheme = { httpAuthOption: option, identity: await identityProvider(option.identityProperties), signer: scheme.signer }; break; } if (!smithyContext.selectedHttpAuthScheme) { throw new Error(failureReasons.join("\n")); } return next(args); }, "httpAuthSchemeMiddleware"); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js var httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin; var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_httpAuthSchemeMiddleware(); httpAuthSchemeEndpointRuleSetMiddlewareOptions = { step: "serialize", tags: ["HTTP_AUTH_SCHEME"], name: "httpAuthSchemeMiddleware", override: true, relation: "before", toMiddleware: "endpointV2Middleware" }; getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config3, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(httpAuthSchemeMiddleware(config3, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); } }), "getHttpAuthSchemeEndpointRuleSetPlugin"); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js var init_getHttpAuthSchemePlugin = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js var init_middleware_http_auth_scheme = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_httpAuthSchemeMiddleware(); init_getHttpAuthSchemeEndpointRuleSetPlugin(); init_getHttpAuthSchemePlugin(); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js var defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; var init_httpSigningMiddleware = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_dist_es4(); defaultErrorHandler = /* @__PURE__ */ __name((signingProperties) => (error50) => { throw error50; }, "defaultErrorHandler"); defaultSuccessHandler = /* @__PURE__ */ __name((httpResponse, signingProperties) => { }, "defaultSuccessHandler"); httpSigningMiddleware = /* @__PURE__ */ __name((config3) => (next, context2) => async (args) => { if (!HttpRequest.isInstance(args.request)) { return next(args); } const smithyContext = getSmithyContext(context2); const scheme = smithyContext.selectedHttpAuthScheme; if (!scheme) { throw new Error(`No HttpAuthScheme was selected: unable to sign request`); } const { httpAuthOption: { signingProperties = {} }, identity: identity2, signer } = scheme; const output = await next({ ...args, request: await signer.sign(args.request, identity2, signingProperties) }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); return output; }, "httpSigningMiddleware"); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js var httpSigningMiddlewareOptions, getHttpSigningPlugin; var init_getHttpSigningMiddleware = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_httpSigningMiddleware(); httpSigningMiddlewareOptions = { step: "finalizeRequest", tags: ["HTTP_SIGNING"], name: "httpSigningMiddleware", aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], override: true, relation: "after", toMiddleware: "retryMiddleware" }; getHttpSigningPlugin = /* @__PURE__ */ __name((config3) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(httpSigningMiddleware(config3), httpSigningMiddlewareOptions); } }), "getHttpSigningPlugin"); } }); // ../../node_modules/@smithy/core/dist-es/middleware-http-signing/index.js var init_middleware_http_signing = __esm({ "../../node_modules/@smithy/core/dist-es/middleware-http-signing/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_httpSigningMiddleware(); init_getHttpSigningMiddleware(); } }); // ../../node_modules/@smithy/core/dist-es/normalizeProvider.js var normalizeProvider2; var init_normalizeProvider2 = __esm({ "../../node_modules/@smithy/core/dist-es/normalizeProvider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); normalizeProvider2 = /* @__PURE__ */ __name((input) => { if (typeof input === "function") return input; const promisified = Promise.resolve(input); return () => promisified; }, "normalizeProvider"); } }); // ../../node_modules/@smithy/core/dist-es/pagination/createPaginator.js function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { return /* @__PURE__ */ __name(async function* paginateOperation(config3, input, ...additionalArguments) { const _input = input; let token = config3.startingToken ?? _input[inputTokenName]; let hasNext = true; let page; while (hasNext) { _input[inputTokenName] = token; if (pageSizeTokenName) { _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config3.pageSize; } if (config3.client instanceof ClientCtor) { page = await makePagedClientRequest(CommandCtor, config3.client, input, config3.withCommand, ...additionalArguments); } else { throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); } yield page; const prevToken = token; token = get(page, outputTokenName); hasNext = !!(token && (!config3.stopOnSameToken || token !== prevToken)); } return void 0; }, "paginateOperation"); } var makePagedClientRequest, get; var init_createPaginator = __esm({ "../../node_modules/@smithy/core/dist-es/pagination/createPaginator.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); makePagedClientRequest = /* @__PURE__ */ __name(async (CommandCtor, client, input, withCommand = (_) => _, ...args) => { let command = new CommandCtor(input); command = withCommand(command) ?? command; return await client.send(command, ...args); }, "makePagedClientRequest"); __name(createPaginator, "createPaginator"); get = /* @__PURE__ */ __name((fromObject, path) => { let cursor = fromObject; const pathComponents = path.split("."); for (const step of pathComponents) { if (!cursor || typeof cursor !== "object") { return void 0; } cursor = cursor[step]; } return cursor; }, "get"); } }); // ../../node_modules/@smithy/util-base64/dist-es/constants.browser.js var chars, alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue; var init_constants_browser = __esm({ "../../node_modules/@smithy/util-base64/dist-es/constants.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`; alphabetByEncoding = Object.entries(chars).reduce((acc, [i2, c2]) => { acc[c2] = Number(i2); return acc; }, {}); alphabetByValue = chars.split(""); bitsPerLetter = 6; bitsPerByte = 8; maxLetterValue = 63; } }); // ../../node_modules/@smithy/util-base64/dist-es/fromBase64.browser.js var fromBase64; var init_fromBase64_browser = __esm({ "../../node_modules/@smithy/util-base64/dist-es/fromBase64.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants_browser(); fromBase64 = /* @__PURE__ */ __name((input) => { let totalByteLength = input.length / 4 * 3; if (input.slice(-2) === "==") { totalByteLength -= 2; } else if (input.slice(-1) === "=") { totalByteLength--; } const out = new ArrayBuffer(totalByteLength); const dataView = new DataView(out); for (let i2 = 0; i2 < input.length; i2 += 4) { let bits = 0; let bitLength = 0; for (let j2 = i2, limit = i2 + 3; j2 <= limit; j2++) { if (input[j2] !== "=") { if (!(input[j2] in alphabetByEncoding)) { throw new TypeError(`Invalid character ${input[j2]} in base64 string.`); } bits |= alphabetByEncoding[input[j2]] << (limit - j2) * bitsPerLetter; bitLength += bitsPerLetter; } else { bits >>= bitsPerLetter; } } const chunkOffset = i2 / 4 * 3; bits >>= bitLength % bitsPerByte; const byteLength = Math.floor(bitLength / bitsPerByte); for (let k2 = 0; k2 < byteLength; k2++) { const offset = (byteLength - k2 - 1) * bitsPerByte; dataView.setUint8(chunkOffset + k2, (bits & 255 << offset) >> offset); } } return new Uint8Array(out); }, "fromBase64"); } }); // ../../node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js var fromUtf8; var init_fromUtf8_browser = __esm({ "../../node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); fromUtf8 = /* @__PURE__ */ __name((input) => new TextEncoder().encode(input), "fromUtf8"); } }); // ../../node_modules/@smithy/util-utf8/dist-es/toUint8Array.js var toUint8Array; var init_toUint8Array = __esm({ "../../node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fromUtf8_browser(); toUint8Array = /* @__PURE__ */ __name((data) => { if (typeof data === "string") { return fromUtf8(data); } if (ArrayBuffer.isView(data)) { return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } return new Uint8Array(data); }, "toUint8Array"); } }); // ../../node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js var toUtf8; var init_toUtf8_browser = __esm({ "../../node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); toUtf8 = /* @__PURE__ */ __name((input) => { if (typeof input === "string") { return input; } if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); } return new TextDecoder("utf-8").decode(input); }, "toUtf8"); } }); // ../../node_modules/@smithy/util-utf8/dist-es/index.js var init_dist_es5 = __esm({ "../../node_modules/@smithy/util-utf8/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fromUtf8_browser(); init_toUint8Array(); init_toUtf8_browser(); } }); // ../../node_modules/@smithy/util-base64/dist-es/toBase64.browser.js function toBase64(_input) { let input; if (typeof _input === "string") { input = fromUtf8(_input); } else { input = _input; } const isArrayLike = typeof input === "object" && typeof input.length === "number"; const isUint8Array = typeof input === "object" && typeof input.byteOffset === "number" && typeof input.byteLength === "number"; if (!isArrayLike && !isUint8Array) { throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); } let str = ""; for (let i2 = 0; i2 < input.length; i2 += 3) { let bits = 0; let bitLength = 0; for (let j2 = i2, limit = Math.min(i2 + 3, input.length); j2 < limit; j2++) { bits |= input[j2] << (limit - j2 - 1) * bitsPerByte; bitLength += bitsPerByte; } const bitClusterCount = Math.ceil(bitLength / bitsPerLetter); bits <<= bitClusterCount * bitsPerLetter - bitLength; for (let k2 = 1; k2 <= bitClusterCount; k2++) { const offset = (bitClusterCount - k2) * bitsPerLetter; str += alphabetByValue[(bits & maxLetterValue << offset) >> offset]; } str += "==".slice(0, 4 - bitClusterCount); } return str; } var init_toBase64_browser = __esm({ "../../node_modules/@smithy/util-base64/dist-es/toBase64.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es5(); init_constants_browser(); __name(toBase64, "toBase64"); } }); // ../../node_modules/@smithy/util-base64/dist-es/index.js var init_dist_es6 = __esm({ "../../node_modules/@smithy/util-base64/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fromBase64_browser(); init_toBase64_browser(); } }); // ../../node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js var Uint8ArrayBlobAdapter; var init_Uint8ArrayBlobAdapter = __esm({ "../../node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es6(); init_dist_es5(); Uint8ArrayBlobAdapter = class extends Uint8Array { static fromString(source, encoding = "utf-8") { if (typeof source === "string") { if (encoding === "base64") { return Uint8ArrayBlobAdapter.mutate(fromBase64(source)); } return Uint8ArrayBlobAdapter.mutate(fromUtf8(source)); } throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); } static mutate(source) { Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); return source; } transformToString(encoding = "utf-8") { if (encoding === "base64") { return toBase64(this); } return toUtf8(this); } }; __name(Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter"); } }); // ../../node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js var ReadableStreamRef, ChecksumStream; var init_ChecksumStream_browser = __esm({ "../../node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() { }; ChecksumStream = class extends ReadableStreamRef { }; __name(ChecksumStream, "ChecksumStream"); } }); // ../../node_modules/@smithy/util-stream/dist-es/stream-type-check.js var isReadableStream; var init_stream_type_check = __esm({ "../../node_modules/@smithy/util-stream/dist-es/stream-type-check.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isReadableStream = /* @__PURE__ */ __name((stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream), "isReadableStream"); } }); // ../../node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js var createChecksumStream; var init_createChecksumStream_browser = __esm({ "../../node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es6(); init_stream_type_check(); init_ChecksumStream_browser(); createChecksumStream = /* @__PURE__ */ __name(({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => { if (!isReadableStream(source)) { throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); } const encoder2 = base64Encoder ?? toBase64; if (typeof TransformStream !== "function") { throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream."); } const transform2 = new TransformStream({ start() { }, async transform(chunk, controller) { checksum.update(chunk); controller.enqueue(chunk); }, async flush(controller) { const digest = await checksum.digest(); const received = encoder2(digest); if (expectedChecksum !== received) { const error50 = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`); controller.error(error50); } else { controller.terminate(); } } }); source.pipeThrough(transform2); const readable = transform2.readable; Object.setPrototypeOf(readable, ChecksumStream.prototype); return readable; }, "createChecksumStream"); } }); // ../../node_modules/@smithy/util-stream/dist-es/ByteArrayCollector.js var ByteArrayCollector; var init_ByteArrayCollector = __esm({ "../../node_modules/@smithy/util-stream/dist-es/ByteArrayCollector.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ByteArrayCollector = class { allocByteArray; byteLength = 0; byteArrays = []; constructor(allocByteArray) { this.allocByteArray = allocByteArray; } push(byteArray) { this.byteArrays.push(byteArray); this.byteLength += byteArray.byteLength; } flush() { if (this.byteArrays.length === 1) { const bytes = this.byteArrays[0]; this.reset(); return bytes; } const aggregation = this.allocByteArray(this.byteLength); let cursor = 0; for (let i2 = 0; i2 < this.byteArrays.length; ++i2) { const bytes = this.byteArrays[i2]; aggregation.set(bytes, cursor); cursor += bytes.byteLength; } this.reset(); return aggregation; } reset() { this.byteArrays = []; this.byteLength = 0; } }; __name(ByteArrayCollector, "ByteArrayCollector"); } }); // ../../node_modules/@smithy/util-stream/dist-es/createBufferedReadableStream.js function createBufferedReadableStream(upstream, size, logger3) { const reader = upstream.getReader(); let streamBufferingLoggedWarning = false; let bytesSeen = 0; const buffers = ["", new ByteArrayCollector((size2) => new Uint8Array(size2))]; let mode = -1; const pull = /* @__PURE__ */ __name(async (controller) => { const { value, done } = await reader.read(); const chunk = value; if (done) { if (mode !== -1) { const remainder = flush(buffers, mode); if (sizeOf(remainder) > 0) { controller.enqueue(remainder); } } controller.close(); } else { const chunkMode = modeOf(chunk, false); if (mode !== chunkMode) { if (mode >= 0) { controller.enqueue(flush(buffers, mode)); } mode = chunkMode; } if (mode === -1) { controller.enqueue(chunk); return; } const chunkSize = sizeOf(chunk); bytesSeen += chunkSize; const bufferSize = sizeOf(buffers[mode]); if (chunkSize >= size && bufferSize === 0) { controller.enqueue(chunk); } else { const newSize = merge(buffers, mode, chunk); if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { streamBufferingLoggedWarning = true; logger3?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); } if (newSize >= size) { controller.enqueue(flush(buffers, mode)); } else { await pull(controller); } } } }, "pull"); return new ReadableStream({ pull }); } function merge(buffers, mode, chunk) { switch (mode) { case 0: buffers[0] += chunk; return sizeOf(buffers[0]); case 1: case 2: buffers[mode].push(chunk); return sizeOf(buffers[mode]); } } function flush(buffers, mode) { switch (mode) { case 0: const s2 = buffers[0]; buffers[0] = ""; return s2; case 1: case 2: return buffers[mode].flush(); } throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`); } function sizeOf(chunk) { return chunk?.byteLength ?? chunk?.length ?? 0; } function modeOf(chunk, allowBuffer = true) { if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) { return 2; } if (chunk instanceof Uint8Array) { return 1; } if (typeof chunk === "string") { return 0; } return -1; } var createBufferedReadable; var init_createBufferedReadableStream = __esm({ "../../node_modules/@smithy/util-stream/dist-es/createBufferedReadableStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_ByteArrayCollector(); __name(createBufferedReadableStream, "createBufferedReadableStream"); createBufferedReadable = createBufferedReadableStream; __name(merge, "merge"); __name(flush, "flush"); __name(sizeOf, "sizeOf"); __name(modeOf, "modeOf"); } }); // ../../node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.browser.js var getAwsChunkedEncodingStream; var init_getAwsChunkedEncodingStream_browser = __esm({ "../../node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getAwsChunkedEncodingStream = /* @__PURE__ */ __name((readableStream, options) => { const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; const checksumRequired = base64Encoder !== void 0 && bodyLengthChecker !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0; const reader = readableStream.getReader(); return new ReadableStream({ async pull(controller) { const { value, done } = await reader.read(); if (done) { controller.enqueue(`0\r `); if (checksumRequired) { const checksum = base64Encoder(await digest); controller.enqueue(`${checksumLocationName}:${checksum}\r `); controller.enqueue(`\r `); } controller.close(); } else { controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r ${value}\r `); } } }); }, "getAwsChunkedEncodingStream"); } }); // ../../node_modules/@smithy/util-stream/dist-es/headStream.browser.js async function headStream(stream, bytes) { let byteLengthCounter = 0; const chunks = []; const reader = stream.getReader(); let isDone = false; while (!isDone) { const { done, value } = await reader.read(); if (value) { chunks.push(value); byteLengthCounter += value?.byteLength ?? 0; } if (byteLengthCounter >= bytes) { break; } isDone = done; } reader.releaseLock(); const collected = new Uint8Array(Math.min(bytes, byteLengthCounter)); let offset = 0; for (const chunk of chunks) { if (chunk.byteLength > collected.byteLength - offset) { collected.set(chunk.subarray(0, collected.byteLength - offset), offset); break; } else { collected.set(chunk, offset); } offset += chunk.length; } return collected; } var init_headStream_browser = __esm({ "../../node_modules/@smithy/util-stream/dist-es/headStream.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(headStream, "headStream"); } }); // ../../node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js var escapeUri, hexEncode; var init_escape_uri = __esm({ "../../node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); escapeUri = /* @__PURE__ */ __name((uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode), "escapeUri"); hexEncode = /* @__PURE__ */ __name((c2) => `%${c2.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); } }); // ../../node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js var init_escape_uri_path = __esm({ "../../node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-uri-escape/dist-es/index.js var init_dist_es7 = __esm({ "../../node_modules/@smithy/util-uri-escape/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_escape_uri(); init_escape_uri_path(); } }); // ../../node_modules/@smithy/querystring-builder/dist-es/index.js function buildQueryString(query) { const parts = []; for (let key of Object.keys(query).sort()) { const value = query[key]; key = escapeUri(key); if (Array.isArray(value)) { for (let i2 = 0, iLen = value.length; i2 < iLen; i2++) { parts.push(`${key}=${escapeUri(value[i2])}`); } } else { let qsEntry = key; if (value || typeof value === "string") { qsEntry += `=${escapeUri(value)}`; } parts.push(qsEntry); } } return parts.join("&"); } var init_dist_es8 = __esm({ "../../node_modules/@smithy/querystring-builder/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es7(); __name(buildQueryString, "buildQueryString"); } }); // ../../node_modules/@smithy/fetch-http-handler/dist-es/create-request.js function createRequest(url2, requestOptions) { return new Request(url2, requestOptions); } var init_create_request = __esm({ "../../node_modules/@smithy/fetch-http-handler/dist-es/create-request.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(createRequest, "createRequest"); } }); // ../../node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js function requestTimeout(timeoutInMs = 0) { return new Promise((resolve, reject) => { if (timeoutInMs) { setTimeout(() => { const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); timeoutError.name = "TimeoutError"; reject(timeoutError); }, timeoutInMs); } }); } var init_request_timeout = __esm({ "../../node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(requestTimeout, "requestTimeout"); } }); // ../../node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js function buildAbortError(abortSignal) { const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0; if (reason) { if (reason instanceof Error) { const abortError3 = new Error("Request aborted"); abortError3.name = "AbortError"; abortError3.cause = reason; return abortError3; } const abortError2 = new Error(String(reason)); abortError2.name = "AbortError"; return abortError2; } const abortError = new Error("Request aborted"); abortError.name = "AbortError"; return abortError; } var keepAliveSupport, FetchHttpHandler; var init_fetch_http_handler = __esm({ "../../node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_dist_es8(); init_create_request(); init_request_timeout(); keepAliveSupport = { supported: void 0 }; FetchHttpHandler = class { config; configProvider; static create(instanceOrOptions) { if (typeof instanceOrOptions?.handle === "function") { return instanceOrOptions; } return new FetchHttpHandler(instanceOrOptions); } constructor(options) { if (typeof options === "function") { this.configProvider = options().then((opts) => opts || {}); } else { this.config = options ?? {}; this.configProvider = Promise.resolve(this.config); } if (keepAliveSupport.supported === void 0) { keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]")); } } destroy() { } async handle(request, { abortSignal, requestTimeout: requestTimeout2 } = {}) { if (!this.config) { this.config = await this.configProvider; } const requestTimeoutInMs = requestTimeout2 ?? this.config.requestTimeout; const keepAlive = this.config.keepAlive === true; const credentials = this.config.credentials; if (abortSignal?.aborted) { const abortError = buildAbortError(abortSignal); return Promise.reject(abortError); } let path = request.path; const queryString = buildQueryString(request.query || {}); if (queryString) { path += `?${queryString}`; } if (request.fragment) { path += `#${request.fragment}`; } let auth = ""; if (request.username != null || request.password != null) { const username = request.username ?? ""; const password = request.password ?? ""; auth = `${username}:${password}@`; } const { port, method } = request; const url2 = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`; const body = method === "GET" || method === "HEAD" ? void 0 : request.body; const requestOptions = { body, headers: new Headers(request.headers), method, credentials }; if (this.config?.cache) { requestOptions.cache = this.config.cache; } if (body) { requestOptions.duplex = "half"; } if (typeof AbortController !== "undefined") { requestOptions.signal = abortSignal; } if (keepAliveSupport.supported) { requestOptions.keepalive = keepAlive; } if (typeof this.config.requestInit === "function") { Object.assign(requestOptions, this.config.requestInit(request)); } let removeSignalEventListener = /* @__PURE__ */ __name(() => { }, "removeSignalEventListener"); const fetchRequest = createRequest(url2, requestOptions); const raceOfPromises = [ fetch(fetchRequest).then((response) => { const fetchHeaders = response.headers; const transformedHeaders = {}; for (const pair of fetchHeaders.entries()) { transformedHeaders[pair[0]] = pair[1]; } const hasReadableStream = response.body != void 0; if (!hasReadableStream) { return response.blob().then((body2) => ({ response: new HttpResponse({ headers: transformedHeaders, reason: response.statusText, statusCode: response.status, body: body2 }) })); } return { response: new HttpResponse({ headers: transformedHeaders, reason: response.statusText, statusCode: response.status, body: response.body }) }; }), requestTimeout(requestTimeoutInMs) ]; if (abortSignal) { raceOfPromises.push(new Promise((resolve, reject) => { const onAbort = /* @__PURE__ */ __name(() => { const abortError = buildAbortError(abortSignal); reject(abortError); }, "onAbort"); if (typeof abortSignal.addEventListener === "function") { const signal = abortSignal; signal.addEventListener("abort", onAbort, { once: true }); removeSignalEventListener = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "removeSignalEventListener"); } else { abortSignal.onabort = onAbort; } })); } return Promise.race(raceOfPromises).finally(removeSignalEventListener); } updateHttpClientConfig(key, value) { this.config = void 0; this.configProvider = this.configProvider.then((config3) => { config3[key] = value; return config3; }); } httpHandlerConfigs() { return this.config ?? {}; } }; __name(FetchHttpHandler, "FetchHttpHandler"); __name(buildAbortError, "buildAbortError"); } }); // ../../node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js async function collectBlob(blob2) { const base643 = await readToBase64(blob2); const arrayBuffer = fromBase64(base643); return new Uint8Array(arrayBuffer); } async function collectStream(stream) { const chunks = []; const reader = stream.getReader(); let isDone = false; let length = 0; while (!isDone) { const { done, value } = await reader.read(); if (value) { chunks.push(value); length += value.length; } isDone = done; } const collected = new Uint8Array(length); let offset = 0; for (const chunk of chunks) { collected.set(chunk, offset); offset += chunk.length; } return collected; } function readToBase64(blob2) { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onloadend = () => { if (reader.readyState !== 2) { return reject(new Error("Reader aborted too early")); } const result = reader.result ?? ""; const commaIndex = result.indexOf(","); const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; resolve(result.substring(dataOffset)); }; reader.onabort = () => reject(new Error("Read aborted")); reader.onerror = () => reject(reader.error); reader.readAsDataURL(blob2); }); } var streamCollector; var init_stream_collector = __esm({ "../../node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es6(); streamCollector = /* @__PURE__ */ __name(async (stream) => { if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") { if (Blob.prototype.arrayBuffer !== void 0) { return new Uint8Array(await stream.arrayBuffer()); } return collectBlob(stream); } return collectStream(stream); }, "streamCollector"); __name(collectBlob, "collectBlob"); __name(collectStream, "collectStream"); __name(readToBase64, "readToBase64"); } }); // ../../node_modules/@smithy/fetch-http-handler/dist-es/index.js var init_dist_es9 = __esm({ "../../node_modules/@smithy/fetch-http-handler/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fetch_http_handler(); init_stream_collector(); } }); // ../../node_modules/@smithy/util-hex-encoding/dist-es/index.js function fromHex(encoded) { if (encoded.length % 2 !== 0) { throw new Error("Hex encoded strings must have an even number length"); } const out = new Uint8Array(encoded.length / 2); for (let i2 = 0; i2 < encoded.length; i2 += 2) { const encodedByte = encoded.slice(i2, i2 + 2).toLowerCase(); if (encodedByte in HEX_TO_SHORT) { out[i2 / 2] = HEX_TO_SHORT[encodedByte]; } else { throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); } } return out; } function toHex(bytes) { let out = ""; for (let i2 = 0; i2 < bytes.byteLength; i2++) { out += SHORT_TO_HEX[bytes[i2]]; } return out; } var SHORT_TO_HEX, HEX_TO_SHORT; var init_dist_es10 = __esm({ "../../node_modules/@smithy/util-hex-encoding/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SHORT_TO_HEX = {}; HEX_TO_SHORT = {}; for (let i2 = 0; i2 < 256; i2++) { let encodedByte = i2.toString(16).toLowerCase(); if (encodedByte.length === 1) { encodedByte = `0${encodedByte}`; } SHORT_TO_HEX[i2] = encodedByte; HEX_TO_SHORT[encodedByte] = i2; } __name(fromHex, "fromHex"); __name(toHex, "toHex"); } }); // ../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED, sdkStreamMixin, isBlobInstance; var init_sdk_stream_mixin_browser = __esm({ "../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es9(); init_dist_es6(); init_dist_es10(); init_dist_es5(); init_stream_type_check(); ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; sdkStreamMixin = /* @__PURE__ */ __name((stream) => { if (!isBlobInstance(stream) && !isReadableStream(stream)) { const name = stream?.__proto__?.constructor?.name || stream; throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); } let transformed = false; const transformToByteArray = /* @__PURE__ */ __name(async () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } transformed = true; return await streamCollector(stream); }, "transformToByteArray"); const blobToWebStream = /* @__PURE__ */ __name((blob2) => { if (typeof blob2.stream !== "function") { throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body"); } return blob2.stream(); }, "blobToWebStream"); return Object.assign(stream, { transformToByteArray, transformToString: async (encoding) => { const buf = await transformToByteArray(); if (encoding === "base64") { return toBase64(buf); } else if (encoding === "hex") { return toHex(buf); } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { return toUtf8(buf); } else if (typeof TextDecoder === "function") { return new TextDecoder(encoding).decode(buf); } else { throw new Error("TextDecoder is not available, please make sure polyfill is provided."); } }, transformToWebStream: () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } transformed = true; if (isBlobInstance(stream)) { return blobToWebStream(stream); } else if (isReadableStream(stream)) { return stream; } else { throw new Error(`Cannot transform payload to web stream, got ${stream}`); } } }); }, "sdkStreamMixin"); isBlobInstance = /* @__PURE__ */ __name((stream) => typeof Blob === "function" && stream instanceof Blob, "isBlobInstance"); } }); // ../../node_modules/@smithy/util-stream/dist-es/splitStream.browser.js async function splitStream(stream) { if (typeof stream.stream === "function") { stream = stream.stream(); } const readableStream = stream; return readableStream.tee(); } var init_splitStream_browser = __esm({ "../../node_modules/@smithy/util-stream/dist-es/splitStream.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(splitStream, "splitStream"); } }); // ../../node_modules/@smithy/util-stream/dist-es/index.js var init_dist_es11 = __esm({ "../../node_modules/@smithy/util-stream/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Uint8ArrayBlobAdapter(); init_ChecksumStream_browser(); init_createChecksumStream_browser(); init_createBufferedReadableStream(); init_getAwsChunkedEncodingStream_browser(); init_headStream_browser(); init_sdk_stream_mixin_browser(); init_splitStream_browser(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js var collectBody; var init_collect_stream_body = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es11(); collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context2) => { if (streamBody instanceof Uint8Array) { return Uint8ArrayBlobAdapter.mutate(streamBody); } if (!streamBody) { return Uint8ArrayBlobAdapter.mutate(new Uint8Array()); } const fromContext = context2.streamCollector(streamBody); return Uint8ArrayBlobAdapter.mutate(await fromContext); }, "collectBody"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js function extendedEncodeURIComponent(str) { return encodeURIComponent(str).replace(/[!'()*]/g, function(c2) { return "%" + c2.charCodeAt(0).toString(16).toUpperCase(); }); } var init_extended_encode_uri_component = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(extendedEncodeURIComponent, "extendedEncodeURIComponent"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/deref.js var deref; var init_deref = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/deref.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); deref = /* @__PURE__ */ __name((schemaRef) => { if (typeof schemaRef === "function") { return schemaRef(); } return schemaRef; }, "deref"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js var operation; var init_operation = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); operation = /* @__PURE__ */ __name((namespace, name, traits, input, output) => ({ name, namespace, traits, input, output }), "operation"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js var schemaDeserializationMiddleware, findHeader; var init_schemaDeserializationMiddleware = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_dist_es4(); init_operation(); schemaDeserializationMiddleware = /* @__PURE__ */ __name((config3) => (next, context2) => async (args) => { const { response } = await next(args); const { operationSchema } = getSmithyContext(context2); const [, ns, n2, t9, i2, o2] = operationSchema ?? []; try { const parsed = await config3.protocol.deserializeResponse(operation(ns, n2, t9, i2, o2), { ...config3, ...context2 }, response); return { response, output: parsed }; } catch (error50) { Object.defineProperty(error50, "$response", { value: response, enumerable: false, writable: false, configurable: false }); if (!("$metadata" in error50)) { const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; try { error50.message += "\n " + hint; } catch (e2) { if (!context2.logger || context2.logger?.constructor?.name === "NoOpLogger") { console.warn(hint); } else { context2.logger?.warn?.(hint); } } if (typeof error50.$responseBodyText !== "undefined") { if (error50.$response) { error50.$response.body = error50.$responseBodyText; } } try { if (HttpResponse.isInstance(response)) { const { headers = {} } = response; const headerEntries = Object.entries(headers); error50.$metadata = { httpStatusCode: response.statusCode, requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries) }; } } catch (e2) { } } throw error50; } }, "schemaDeserializationMiddleware"); findHeader = /* @__PURE__ */ __name((pattern, headers) => { return (headers.find(([k2]) => { return k2.match(pattern); }) || [void 0, void 0])[1]; }, "findHeader"); } }); // ../../node_modules/@smithy/querystring-parser/dist-es/index.js function parseQueryString(querystring) { const query = {}; querystring = querystring.replace(/^\?/, ""); if (querystring) { for (const pair of querystring.split("&")) { let [key, value = null] = pair.split("="); key = decodeURIComponent(key); if (value) { value = decodeURIComponent(value); } if (!(key in query)) { query[key] = value; } else if (Array.isArray(query[key])) { query[key].push(value); } else { query[key] = [query[key], value]; } } } return query; } var init_dist_es12 = __esm({ "../../node_modules/@smithy/querystring-parser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(parseQueryString, "parseQueryString"); } }); // ../../node_modules/@smithy/url-parser/dist-es/index.js var parseUrl; var init_dist_es13 = __esm({ "../../node_modules/@smithy/url-parser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es12(); parseUrl = /* @__PURE__ */ __name((url2) => { if (typeof url2 === "string") { return parseUrl(new URL(url2)); } const { hostname: hostname3, pathname, port, protocol, search } = url2; let query; if (search) { query = parseQueryString(search); } return { hostname: hostname3, port: port ? parseInt(port) : void 0, protocol, path: pathname, query }; }, "parseUrl"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js var toEndpointV1; var init_toEndpointV1 = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es13(); toEndpointV1 = /* @__PURE__ */ __name((endpoint) => { if (typeof endpoint === "object") { if ("url" in endpoint) { const v1Endpoint = parseUrl(endpoint.url); if (endpoint.headers) { v1Endpoint.headers = {}; for (const [name, values] of Object.entries(endpoint.headers)) { v1Endpoint.headers[name.toLowerCase()] = values.join(", "); } } return v1Endpoint; } return endpoint; } return parseUrl(endpoint); }, "toEndpointV1"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/endpoints/index.js var init_endpoints2 = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/endpoints/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_toEndpointV1(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js var schemaSerializationMiddleware; var init_schemaSerializationMiddleware = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_endpoints2(); init_dist_es4(); init_operation(); schemaSerializationMiddleware = /* @__PURE__ */ __name((config3) => (next, context2) => async (args) => { const { operationSchema } = getSmithyContext(context2); const [, ns, n2, t9, i2, o2] = operationSchema ?? []; const endpoint = context2.endpointV2 ? async () => toEndpointV1(context2.endpointV2) : config3.endpoint; const request = await config3.protocol.serializeRequest(operation(ns, n2, t9, i2, o2), args.input, { ...config3, ...context2, endpoint }); return next({ ...args, request }); }, "schemaSerializationMiddleware"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js function getSchemaSerdePlugin(config3) { return { applyToStack: (commandStack) => { commandStack.add(schemaSerializationMiddleware(config3), serializerMiddlewareOption); commandStack.add(schemaDeserializationMiddleware(config3), deserializerMiddlewareOption); config3.protocol.setSerdeContext(config3); } }; } var deserializerMiddlewareOption, serializerMiddlewareOption; var init_getSchemaSerdePlugin = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schemaDeserializationMiddleware(); init_schemaSerializationMiddleware(); deserializerMiddlewareOption = { name: "deserializerMiddleware", step: "deserialize", tags: ["DESERIALIZER"], override: true }; serializerMiddlewareOption = { name: "serializerMiddleware", step: "serialize", tags: ["SERIALIZER"], override: true }; __name(getSchemaSerdePlugin, "getSchemaSerdePlugin"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js var Schema2; var init_Schema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); Schema2 = class { name; namespace; traits; static assign(instance, values) { const schema = Object.assign(instance, values); return schema; } static [Symbol.hasInstance](lhs) { const isPrototype = this.prototype.isPrototypeOf(lhs); if (!isPrototype && typeof lhs === "object" && lhs !== null) { const list = lhs; return list.symbol === this.symbol; } return isPrototype; } getName() { return this.namespace + "#" + this.name; } }; __name(Schema2, "Schema"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js var _ListSchema, ListSchema; var init_ListSchema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Schema(); _ListSchema = class extends Schema2 { name; traits; valueSchema; symbol = _ListSchema.symbol; }; ListSchema = _ListSchema; __name(ListSchema, "ListSchema"); __publicField(ListSchema, "symbol", Symbol.for("@smithy/lis")); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js var _MapSchema, MapSchema; var init_MapSchema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Schema(); _MapSchema = class extends Schema2 { name; traits; keySchema; valueSchema; symbol = _MapSchema.symbol; }; MapSchema = _MapSchema; __name(MapSchema, "MapSchema"); __publicField(MapSchema, "symbol", Symbol.for("@smithy/map")); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js var _OperationSchema, OperationSchema; var init_OperationSchema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Schema(); _OperationSchema = class extends Schema2 { name; traits; input; output; symbol = _OperationSchema.symbol; }; OperationSchema = _OperationSchema; __name(OperationSchema, "OperationSchema"); __publicField(OperationSchema, "symbol", Symbol.for("@smithy/ope")); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js var _StructureSchema, StructureSchema; var init_StructureSchema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Schema(); _StructureSchema = class extends Schema2 { name; traits; memberNames; memberList; symbol = _StructureSchema.symbol; }; StructureSchema = _StructureSchema; __name(StructureSchema, "StructureSchema"); __publicField(StructureSchema, "symbol", Symbol.for("@smithy/str")); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js var _ErrorSchema, ErrorSchema; var init_ErrorSchema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_StructureSchema(); _ErrorSchema = class extends StructureSchema { ctor; symbol = _ErrorSchema.symbol; }; ErrorSchema = _ErrorSchema; __name(ErrorSchema, "ErrorSchema"); __publicField(ErrorSchema, "symbol", Symbol.for("@smithy/err")); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js function translateTraits(indicator) { if (typeof indicator === "object") { return indicator; } indicator = indicator | 0; if (traitsCache[indicator]) { return traitsCache[indicator]; } const traits = {}; let i2 = 0; for (const trait of [ "httpLabel", "idempotent", "idempotencyToken", "sensitive", "httpPayload", "httpResponseCode", "httpQueryParams" ]) { if ((indicator >> i2++ & 1) === 1) { traits[trait] = 1; } } return traitsCache[indicator] = traits; } var traitsCache; var init_translateTraits = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); traitsCache = []; __name(translateTraits, "translateTraits"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js function member(memberSchema, memberName) { if (memberSchema instanceof NormalizedSchema) { return Object.assign(memberSchema, { memberName, _isMemberSchema: true }); } const internalCtorAccess = NormalizedSchema; return new internalCtorAccess(memberSchema, memberName); } var anno, simpleSchemaCacheN, simpleSchemaCacheS, _NormalizedSchema, NormalizedSchema, isMemberSchema, isStaticSchema; var init_NormalizedSchema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_deref(); init_translateTraits(); anno = { it: Symbol.for("@smithy/nor-struct-it"), ns: Symbol.for("@smithy/ns") }; simpleSchemaCacheN = []; simpleSchemaCacheS = {}; _NormalizedSchema = class { ref; memberName; symbol = _NormalizedSchema.symbol; name; schema; _isMemberSchema; traits; memberTraits; normalizedTraits; constructor(ref, memberName) { this.ref = ref; this.memberName = memberName; const traitStack = []; let _ref = ref; let schema = ref; this._isMemberSchema = false; while (isMemberSchema(_ref)) { traitStack.push(_ref[1]); _ref = _ref[0]; schema = deref(_ref); this._isMemberSchema = true; } if (traitStack.length > 0) { this.memberTraits = {}; for (let i2 = traitStack.length - 1; i2 >= 0; --i2) { const traitSet = traitStack[i2]; Object.assign(this.memberTraits, translateTraits(traitSet)); } } else { this.memberTraits = 0; } if (schema instanceof _NormalizedSchema) { const computedMemberTraits = this.memberTraits; Object.assign(this, schema); this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits()); this.normalizedTraits = void 0; this.memberName = memberName ?? schema.memberName; return; } this.schema = deref(schema); if (isStaticSchema(this.schema)) { this.name = `${this.schema[1]}#${this.schema[2]}`; this.traits = this.schema[3]; } else { this.name = this.memberName ?? String(schema); this.traits = 0; } if (this._isMemberSchema && !memberName) { throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`); } } static [Symbol.hasInstance](lhs) { const isPrototype = this.prototype.isPrototypeOf(lhs); if (!isPrototype && typeof lhs === "object" && lhs !== null) { const ns = lhs; return ns.symbol === this.symbol; } return isPrototype; } static of(ref) { const keyAble = typeof ref === "function" || typeof ref === "object" && ref !== null; if (typeof ref === "number") { if (simpleSchemaCacheN[ref]) { return simpleSchemaCacheN[ref]; } } else if (typeof ref === "string") { if (simpleSchemaCacheS[ref]) { return simpleSchemaCacheS[ref]; } } else if (keyAble) { if (ref[anno.ns]) { return ref[anno.ns]; } } const sc = deref(ref); if (sc instanceof _NormalizedSchema) { return sc; } if (isMemberSchema(sc)) { const [ns2, traits] = sc; if (ns2 instanceof _NormalizedSchema) { Object.assign(ns2.getMergedTraits(), translateTraits(traits)); return ns2; } throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); } const ns = new _NormalizedSchema(sc); if (keyAble) { return ref[anno.ns] = ns; } if (typeof sc === "string") { return simpleSchemaCacheS[sc] = ns; } if (typeof sc === "number") { return simpleSchemaCacheN[sc] = ns; } return ns; } getSchema() { const sc = this.schema; if (Array.isArray(sc) && sc[0] === 0) { return sc[4]; } return sc; } getName(withNamespace = false) { const { name } = this; const short = !withNamespace && name && name.includes("#"); return short ? name.split("#")[1] : name || void 0; } getMemberName() { return this.memberName; } isMemberSchema() { return this._isMemberSchema; } isListSchema() { const sc = this.getSchema(); return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1; } isMapSchema() { const sc = this.getSchema(); return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2; } isStructSchema() { const sc = this.getSchema(); if (typeof sc !== "object") { return false; } const id = sc[0]; return id === 3 || id === -3 || id === 4; } isUnionSchema() { const sc = this.getSchema(); if (typeof sc !== "object") { return false; } return sc[0] === 4; } isBlobSchema() { const sc = this.getSchema(); return sc === 21 || sc === 42; } isTimestampSchema() { const sc = this.getSchema(); return typeof sc === "number" && sc >= 4 && sc <= 7; } isUnitSchema() { return this.getSchema() === "unit"; } isDocumentSchema() { return this.getSchema() === 15; } isStringSchema() { return this.getSchema() === 0; } isBooleanSchema() { return this.getSchema() === 2; } isNumericSchema() { return this.getSchema() === 1; } isBigIntegerSchema() { return this.getSchema() === 17; } isBigDecimalSchema() { return this.getSchema() === 19; } isStreaming() { const { streaming } = this.getMergedTraits(); return !!streaming || this.getSchema() === 42; } isIdempotencyToken() { return !!this.getMergedTraits().idempotencyToken; } getMergedTraits() { return this.normalizedTraits ?? (this.normalizedTraits = { ...this.getOwnTraits(), ...this.getMemberTraits() }); } getMemberTraits() { return translateTraits(this.memberTraits); } getOwnTraits() { return translateTraits(this.traits); } getKeySchema() { const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()]; if (!isDoc && !isMap) { throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`); } const schema = this.getSchema(); const memberSchema = isDoc ? 15 : schema[4] ?? 0; return member([memberSchema, 0], "key"); } getValueSchema() { const sc = this.getSchema(); const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()]; const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0; if (memberSchema != null) { return member([memberSchema, 0], isMap ? "value" : "member"); } throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`); } getMemberSchema(memberName) { const struct = this.getSchema(); if (this.isStructSchema() && struct[4].includes(memberName)) { const i2 = struct[4].indexOf(memberName); const memberSchema = struct[5][i2]; return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName); } if (this.isDocumentSchema()) { return member([15, 0], memberName); } throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`); } getMemberSchemas() { const buffer = {}; try { for (const [k2, v3] of this.structIterator()) { buffer[k2] = v3; } } catch (ignored) { } return buffer; } getEventStreamMember() { if (this.isStructSchema()) { for (const [memberName, memberSchema] of this.structIterator()) { if (memberSchema.isStreaming() && memberSchema.isStructSchema()) { return memberName; } } } return ""; } *structIterator() { if (this.isUnitSchema()) { return; } if (!this.isStructSchema()) { throw new Error("@smithy/core/schema - cannot iterate non-struct schema."); } const struct = this.getSchema(); const z3 = struct[4].length; let it = struct[anno.it]; if (it && z3 === it.length) { yield* it; return; } it = Array(z3); for (let i2 = 0; i2 < z3; ++i2) { const k2 = struct[4][i2]; const v3 = member([struct[5][i2], 0], k2); yield it[i2] = [k2, v3]; } struct[anno.it] = it; } }; NormalizedSchema = _NormalizedSchema; __name(NormalizedSchema, "NormalizedSchema"); __publicField(NormalizedSchema, "symbol", Symbol.for("@smithy/nor")); __name(member, "member"); isMemberSchema = /* @__PURE__ */ __name((sc) => Array.isArray(sc) && sc.length === 2, "isMemberSchema"); isStaticSchema = /* @__PURE__ */ __name((sc) => Array.isArray(sc) && sc.length >= 5, "isStaticSchema"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js var _SimpleSchema, SimpleSchema; var init_SimpleSchema = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Schema(); _SimpleSchema = class extends Schema2 { name; schemaRef; traits; symbol = _SimpleSchema.symbol; }; SimpleSchema = _SimpleSchema; __name(SimpleSchema, "SimpleSchema"); __publicField(SimpleSchema, "symbol", Symbol.for("@smithy/sim")); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js var init_sentinels2 = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js var _TypeRegistry, TypeRegistry; var init_TypeRegistry = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); _TypeRegistry = class { namespace; schemas; exceptions; constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) { this.namespace = namespace; this.schemas = schemas; this.exceptions = exceptions; } static for(namespace) { if (!_TypeRegistry.registries.has(namespace)) { _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace)); } return _TypeRegistry.registries.get(namespace); } copyFrom(other) { const { schemas, exceptions } = this; for (const [k2, v3] of other.schemas) { if (!schemas.has(k2)) { schemas.set(k2, v3); } } for (const [k2, v3] of other.exceptions) { if (!exceptions.has(k2)) { exceptions.set(k2, v3); } } } register(shapeId, schema) { const qualifiedName = this.normalizeShapeId(shapeId); for (const r2 of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) { r2.schemas.set(qualifiedName, schema); } } getSchema(shapeId) { const id = this.normalizeShapeId(shapeId); if (!this.schemas.has(id)) { throw new Error(`@smithy/core/schema - schema not found for ${id}`); } return this.schemas.get(id); } registerError(es, ctor) { const $error = es; const ns = $error[1]; for (const r2 of [this, _TypeRegistry.for(ns)]) { r2.schemas.set(ns + "#" + $error[2], $error); r2.exceptions.set($error, ctor); } } getErrorCtor(es) { const $error = es; if (this.exceptions.has($error)) { return this.exceptions.get($error); } const registry2 = _TypeRegistry.for($error[1]); return registry2.exceptions.get($error); } getBaseException() { for (const exceptionKey of this.exceptions.keys()) { if (Array.isArray(exceptionKey)) { const [, ns, name] = exceptionKey; const id = ns + "#" + name; if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) { return exceptionKey; } } } return void 0; } find(predicate) { return [...this.schemas.values()].find(predicate); } clear() { this.schemas.clear(); this.exceptions.clear(); } normalizeShapeId(shapeId) { if (shapeId.includes("#")) { return shapeId; } return this.namespace + "#" + shapeId; } }; TypeRegistry = _TypeRegistry; __name(TypeRegistry, "TypeRegistry"); __publicField(TypeRegistry, "registries", /* @__PURE__ */ new Map()); } }); // ../../node_modules/@smithy/core/dist-es/submodules/schema/index.js var init_schema3 = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/schema/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_deref(); init_getSchemaSerdePlugin(); init_ListSchema(); init_MapSchema(); init_OperationSchema(); init_operation(); init_ErrorSchema(); init_NormalizedSchema(); init_Schema(); init_SimpleSchema(); init_StructureSchema(); init_sentinels2(); init_translateTraits(); init_TypeRegistry(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js var init_copyDocumentWithTransform = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js var expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectShort, expectByte, expectSizedInt, castInt, strictParseFloat32, NUMBER_REGEX, parseNumber, strictParseShort, strictParseByte, stackTraceWarning, logger2; var init_parse_utils = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); expectNumber = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (typeof value === "string") { const parsed = parseFloat(value); if (!Number.isNaN(parsed)) { if (String(parsed) !== String(value)) { logger2.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); } return parsed; } } if (typeof value === "number") { return value; } throw new TypeError(`Expected number, got ${typeof value}: ${value}`); }, "expectNumber"); MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); expectFloat32 = /* @__PURE__ */ __name((value) => { const expected = expectNumber(value); if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { if (Math.abs(expected) > MAX_FLOAT) { throw new TypeError(`Expected 32-bit float, got ${value}`); } } return expected; }, "expectFloat32"); expectLong = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (Number.isInteger(value) && !Number.isNaN(value)) { return value; } throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); }, "expectLong"); expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort"); expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte"); expectSizedInt = /* @__PURE__ */ __name((value, size) => { const expected = expectLong(value); if (expected !== void 0 && castInt(expected, size) !== expected) { throw new TypeError(`Expected ${size}-bit integer, got ${value}`); } return expected; }, "expectSizedInt"); castInt = /* @__PURE__ */ __name((value, size) => { switch (size) { case 32: return Int32Array.of(value)[0]; case 16: return Int16Array.of(value)[0]; case 8: return Int8Array.of(value)[0]; } }, "castInt"); strictParseFloat32 = /* @__PURE__ */ __name((value) => { if (typeof value == "string") { return expectFloat32(parseNumber(value)); } return expectFloat32(value); }, "strictParseFloat32"); NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; parseNumber = /* @__PURE__ */ __name((value) => { const matches = value.match(NUMBER_REGEX); if (matches === null || matches[0].length !== value.length) { throw new TypeError(`Expected real number, got implicit NaN`); } return parseFloat(value); }, "parseNumber"); strictParseShort = /* @__PURE__ */ __name((value) => { if (typeof value === "string") { return expectShort(parseNumber(value)); } return expectShort(value); }, "strictParseShort"); strictParseByte = /* @__PURE__ */ __name((value) => { if (typeof value === "string") { return expectByte(parseNumber(value)); } return expectByte(value); }, "strictParseByte"); stackTraceWarning = /* @__PURE__ */ __name((message2) => { return String(new TypeError(message2).stack || message2).split("\n").slice(0, 5).filter((s2) => !s2.includes("stackTraceWarning")).join("\n"); }, "stackTraceWarning"); logger2 = { warn: console.warn }; } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js function dateToUtcString(date6) { const year3 = date6.getUTCFullYear(); const month = date6.getUTCMonth(); const dayOfWeek = date6.getUTCDay(); const dayOfMonthInt = date6.getUTCDate(); const hoursInt = date6.getUTCHours(); const minutesInt = date6.getUTCMinutes(); const secondsInt = date6.getUTCSeconds(); const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year3} ${hoursString}:${minutesString}:${secondsString} GMT`; } var DAYS, MONTHS, RFC3339, RFC3339_WITH_OFFSET, IMF_FIXDATE, RFC_850_DATE, ASC_TIME, parseRfc7231DateTime, buildDate, parseTwoDigitYear, FIFTY_YEARS_IN_MILLIS, adjustRfc850Year, parseMonthByShortName, DAYS_IN_MONTH, validateDayOfMonth, isLeapYear, parseDateValue, parseMilliseconds, stripLeadingZeroes; var init_date_utils = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_parse_utils(); DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; __name(dateToUtcString, "dateToUtcString"); RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); parseRfc7231DateTime = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC-7231 date-times must be expressed as strings"); } let match2 = IMF_FIXDATE.exec(value); if (match2) { const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match2; return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); } match2 = RFC_850_DATE.exec(value); if (match2) { const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match2; return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds })); } match2 = ASC_TIME.exec(value); if (match2) { const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match2; return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); } throw new TypeError("Invalid RFC-7231 date-time value"); }, "parseRfc7231DateTime"); buildDate = /* @__PURE__ */ __name((year3, month, day2, time7) => { const adjustedMonth = month - 1; validateDayOfMonth(year3, adjustedMonth, day2); return new Date(Date.UTC(year3, adjustedMonth, day2, parseDateValue(time7.hours, "hour", 0, 23), parseDateValue(time7.minutes, "minute", 0, 59), parseDateValue(time7.seconds, "seconds", 0, 60), parseMilliseconds(time7.fractionalMilliseconds))); }, "buildDate"); parseTwoDigitYear = /* @__PURE__ */ __name((value) => { const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear(); const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); if (valueInThisCentury < thisYear) { return valueInThisCentury + 100; } return valueInThisCentury; }, "parseTwoDigitYear"); FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3; adjustRfc850Year = /* @__PURE__ */ __name((input) => { if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) { return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds())); } return input; }, "adjustRfc850Year"); parseMonthByShortName = /* @__PURE__ */ __name((value) => { const monthIdx = MONTHS.indexOf(value); if (monthIdx < 0) { throw new TypeError(`Invalid month: ${value}`); } return monthIdx + 1; }, "parseMonthByShortName"); DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; validateDayOfMonth = /* @__PURE__ */ __name((year3, month, day2) => { let maxDays = DAYS_IN_MONTH[month]; if (month === 1 && isLeapYear(year3)) { maxDays = 29; } if (day2 > maxDays) { throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year3}: ${day2}`); } }, "validateDayOfMonth"); isLeapYear = /* @__PURE__ */ __name((year3) => { return year3 % 4 === 0 && (year3 % 100 !== 0 || year3 % 400 === 0); }, "isLeapYear"); parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => { const dateVal = strictParseByte(stripLeadingZeroes(value)); if (dateVal < lower || dateVal > upper) { throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); } return dateVal; }, "parseDateValue"); parseMilliseconds = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return 0; } return strictParseFloat32("0." + value) * 1e3; }, "parseMilliseconds"); stripLeadingZeroes = /* @__PURE__ */ __name((value) => { let idx = 0; while (idx < value.length - 1 && value.charAt(idx) === "0") { idx++; } if (idx === 0) { return value; } return value.slice(idx); }, "stripLeadingZeroes"); } }); // ../../node_modules/@smithy/uuid/dist-es/randomUUID.browser.js var randomUUID; var init_randomUUID_browser = __esm({ "../../node_modules/@smithy/uuid/dist-es/randomUUID.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); } }); // ../../node_modules/@smithy/uuid/dist-es/v4.js var decimalToHex, v4; var init_v4 = __esm({ "../../node_modules/@smithy/uuid/dist-es/v4.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_randomUUID_browser(); decimalToHex = Array.from({ length: 256 }, (_, i2) => i2.toString(16).padStart(2, "0")); v4 = /* @__PURE__ */ __name(() => { if (randomUUID) { return randomUUID(); } const rnds = new Uint8Array(16); crypto.getRandomValues(rnds); rnds[6] = rnds[6] & 15 | 64; rnds[8] = rnds[8] & 63 | 128; return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]]; }, "v4"); } }); // ../../node_modules/@smithy/uuid/dist-es/index.js var init_dist_es14 = __esm({ "../../node_modules/@smithy/uuid/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_v4(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js var init_generateIdempotencyToken = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es14(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js var LazyJsonString; var init_lazy_json = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); LazyJsonString = /* @__PURE__ */ __name(function LazyJsonString2(val) { const str = Object.assign(new String(val), { deserializeJSON() { return JSON.parse(String(val)); }, toString() { return String(val); }, toJSON() { return String(val); } }); return str; }, "LazyJsonString"); LazyJsonString.from = (object2) => { if (object2 && typeof object2 === "object" && (object2 instanceof LazyJsonString || "deserializeJSON" in object2)) { return object2; } else if (typeof object2 === "string" || Object.getPrototypeOf(object2) === String.prototype) { return LazyJsonString(String(object2)); } return LazyJsonString(JSON.stringify(object2)); }; LazyJsonString.fromObject = LazyJsonString.from; } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js function quoteHeader(part) { if (part.includes(",") || part.includes('"')) { part = `"${part.replace(/"/g, '\\"')}"`; } return part; } var init_quote_header = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(quoteHeader, "quoteHeader"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js function range(v3, min, max2) { const _v = Number(v3); if (_v < min || _v > max2) { throw new Error(`Value ${_v} out of range [${min}, ${max2}]`); } } var ddd, mmm, time4, date, year2, RFC3339_WITH_OFFSET2, IMF_FIXDATE2, RFC_850_DATE2, ASC_TIME2, months, _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime; var init_schema_date_utils = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`; mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`; time4 = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`; date = `(\\d?\\d)`; year2 = `(\\d{4})`; RFC3339_WITH_OFFSET2 = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/); IMF_FIXDATE2 = new RegExp(`^${ddd}, ${date} ${mmm} ${year2} ${time4} GMT$`); RFC_850_DATE2 = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time4} GMT$`); ASC_TIME2 = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time4} ${year2}$`); months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; _parseEpochTimestamp = /* @__PURE__ */ __name((value) => { if (value == null) { return void 0; } let num = NaN; if (typeof value === "number") { num = value; } else if (typeof value === "string") { if (!/^-?\d*\.?\d+$/.test(value)) { throw new TypeError(`parseEpochTimestamp - numeric string invalid.`); } num = Number.parseFloat(value); } else if (typeof value === "object" && value.tag === 1) { num = value.value; } if (isNaN(num) || Math.abs(num) === Infinity) { throw new TypeError("Epoch timestamps must be valid finite numbers."); } return new Date(Math.round(num * 1e3)); }, "_parseEpochTimestamp"); _parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => { if (value == null) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC3339 timestamps must be strings"); } const matches = RFC3339_WITH_OFFSET2.exec(value); if (!matches) { throw new TypeError(`Invalid RFC3339 timestamp format ${value}`); } const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches; range(monthStr, 1, 12); range(dayStr, 1, 31); range(hours, 0, 23); range(minutes, 0, 59); range(seconds, 0, 60); const date6 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1e3) : 0)); date6.setUTCFullYear(Number(yearStr)); if (offsetStr.toUpperCase() != "Z") { const [, sign3, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0]; const scalar = sign3 === "-" ? 1 : -1; date6.setTime(date6.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1e3 + Number(offsetM) * 60 * 1e3)); } return date6; }, "_parseRfc3339DateTimeWithOffset"); _parseRfc7231DateTime = /* @__PURE__ */ __name((value) => { if (value == null) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC7231 timestamps must be strings."); } let day2; let month; let year3; let hour2; let minute2; let second; let fraction; let matches; if (matches = IMF_FIXDATE2.exec(value)) { [, day2, month, year3, hour2, minute2, second, fraction] = matches; } else if (matches = RFC_850_DATE2.exec(value)) { [, day2, month, year3, hour2, minute2, second, fraction] = matches; year3 = (Number(year3) + 1900).toString(); } else if (matches = ASC_TIME2.exec(value)) { [, month, day2, hour2, minute2, second, fraction, year3] = matches; } if (year3 && second) { const timestamp = Date.UTC(Number(year3), months.indexOf(month), Number(day2), Number(hour2), Number(minute2), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1e3) : 0); range(day2, 1, 31); range(hour2, 0, 23); range(minute2, 0, 59); range(second, 0, 60); const date6 = new Date(timestamp); date6.setUTCFullYear(Number(year3)); return date6; } throw new TypeError(`Invalid RFC7231 date-time value ${value}.`); }, "_parseRfc7231DateTime"); __name(range, "range"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/split-every.js function splitEvery(value, delimiter, numDelimiters) { if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); } const segments = value.split(delimiter); if (numDelimiters === 1) { return segments; } const compoundSegments = []; let currentSegment = ""; for (let i2 = 0; i2 < segments.length; i2++) { if (currentSegment === "") { currentSegment = segments[i2]; } else { currentSegment += delimiter + segments[i2]; } if ((i2 + 1) % numDelimiters === 0) { compoundSegments.push(currentSegment); currentSegment = ""; } } if (currentSegment !== "") { compoundSegments.push(currentSegment); } return compoundSegments; } var init_split_every = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/split-every.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(splitEvery, "splitEvery"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js var splitHeader; var init_split_header = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); splitHeader = /* @__PURE__ */ __name((value) => { const z3 = value.length; const values = []; let withinQuotes = false; let prevChar = void 0; let anchor = 0; for (let i2 = 0; i2 < z3; ++i2) { const char = value[i2]; switch (char) { case `"`: if (prevChar !== "\\") { withinQuotes = !withinQuotes; } break; case ",": if (!withinQuotes) { values.push(value.slice(anchor, i2)); anchor = i2 + 1; } break; default: } prevChar = char; } values.push(value.slice(anchor)); return values.map((v3) => { v3 = v3.trim(); const z4 = v3.length; if (z4 < 2) { return v3; } if (v3[0] === `"` && v3[z4 - 1] === `"`) { v3 = v3.slice(1, z4 - 1); } return v3.replace(/\\"/g, '"'); }); }, "splitHeader"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js var format, NumericValue; var init_NumericValue = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); format = /^-?\d*(\.\d+)?$/; NumericValue = class { string; type; constructor(string4, type) { this.string = string4; this.type = type; if (!format.test(string4)) { throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`); } } toString() { return this.string; } static [Symbol.hasInstance](object2) { if (!object2 || typeof object2 !== "object") { return false; } const _nv = object2; return NumericValue.prototype.isPrototypeOf(object2) || _nv.type === "bigDecimal" && format.test(_nv.string); } }; __name(NumericValue, "NumericValue"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/serde/index.js var init_serde2 = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/serde/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_copyDocumentWithTransform(); init_date_utils(); init_generateIdempotencyToken(); init_lazy_json(); init_parse_utils(); init_quote_header(); init_schema_date_utils(); init_split_every(); init_split_header(); init_NumericValue(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js var SerdeContext; var init_SerdeContext = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SerdeContext = class { serdeContext; setSerdeContext(serdeContext) { this.serdeContext = serdeContext; } }; __name(SerdeContext, "SerdeContext"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js var EventStreamSerde; var init_EventStreamSerde = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es5(); EventStreamSerde = class { marshaller; serializer; deserializer; serdeContext; defaultContentType; constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) { this.marshaller = marshaller; this.serializer = serializer; this.deserializer = deserializer; this.serdeContext = serdeContext; this.defaultContentType = defaultContentType; } async serializeEventStream({ eventStream, requestSchema, initialRequest }) { const marshaller = this.marshaller; const eventStreamMember = requestSchema.getEventStreamMember(); const unionSchema = requestSchema.getMemberSchema(eventStreamMember); const serializer = this.serializer; const defaultContentType = this.defaultContentType; const initialRequestMarker = Symbol("initialRequestMarker"); const eventStreamIterable = { async *[Symbol.asyncIterator]() { if (initialRequest) { const headers = { ":event-type": { type: "string", value: "initial-request" }, ":message-type": { type: "string", value: "event" }, ":content-type": { type: "string", value: defaultContentType } }; serializer.write(requestSchema, initialRequest); const body = serializer.flush(); yield { [initialRequestMarker]: true, headers, body }; } for await (const page of eventStream) { yield page; } } }; return marshaller.serialize(eventStreamIterable, (event) => { if (event[initialRequestMarker]) { return { headers: event.headers, body: event.body }; } const unionMember = Object.keys(event).find((key) => { return key !== "__type"; }) ?? ""; const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event); const headers = { ":event-type": { type: "string", value: eventType }, ":message-type": { type: "string", value: "event" }, ":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType }, ...additionalHeaders }; return { headers, body }; }); } async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { const marshaller = this.marshaller; const eventStreamMember = responseSchema.getEventStreamMember(); const unionSchema = responseSchema.getMemberSchema(eventStreamMember); const memberSchemas = unionSchema.getMemberSchemas(); const initialResponseMarker = Symbol("initialResponseMarker"); const asyncIterable = marshaller.deserialize(response.body, async (event) => { const unionMember = Object.keys(event).find((key) => { return key !== "__type"; }) ?? ""; const body = event[unionMember].body; if (unionMember === "initial-response") { const dataObject = await this.deserializer.read(responseSchema, body); delete dataObject[eventStreamMember]; return { [initialResponseMarker]: true, ...dataObject }; } else if (unionMember in memberSchemas) { const eventStreamSchema = memberSchemas[unionMember]; if (eventStreamSchema.isStructSchema()) { const out = {}; let hasBindings = false; for (const [name, member2] of eventStreamSchema.structIterator()) { const { eventHeader, eventPayload } = member2.getMergedTraits(); hasBindings = hasBindings || Boolean(eventHeader || eventPayload); if (eventPayload) { if (member2.isBlobSchema()) { out[name] = body; } else if (member2.isStringSchema()) { out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body); } else if (member2.isStructSchema()) { out[name] = await this.deserializer.read(member2, body); } } else if (eventHeader) { const value = event[unionMember].headers[name]?.value; if (value != null) { if (member2.isNumericSchema()) { if (value && typeof value === "object" && "bytes" in value) { out[name] = BigInt(value.toString()); } else { out[name] = Number(value); } } else { out[name] = value; } } } } if (hasBindings) { return { [unionMember]: out }; } if (body.byteLength === 0) { return { [unionMember]: {} }; } } return { [unionMember]: await this.deserializer.read(eventStreamSchema, body) }; } else { return { $unknown: event }; } }); const asyncIterator = asyncIterable[Symbol.asyncIterator](); const firstEvent = await asyncIterator.next(); if (firstEvent.done) { return asyncIterable; } if (firstEvent.value?.[initialResponseMarker]) { if (!responseSchema) { throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given."); } for (const [key, value] of Object.entries(firstEvent.value)) { initialResponseContainer[key] = value; } } return { async *[Symbol.asyncIterator]() { if (!firstEvent?.value?.[initialResponseMarker]) { yield firstEvent.value; } while (true) { const { done, value } = await asyncIterator.next(); if (done) { break; } yield value; } } }; } writeEventBody(unionMember, unionSchema, event) { const serializer = this.serializer; let eventType = unionMember; let explicitPayloadMember = null; let explicitPayloadContentType; const isKnownSchema = (() => { const struct = unionSchema.getSchema(); return struct[4].includes(unionMember); })(); const additionalHeaders = {}; if (!isKnownSchema) { const [type, value] = event[unionMember]; eventType = type; serializer.write(15, value); } else { const eventSchema = unionSchema.getMemberSchema(unionMember); if (eventSchema.isStructSchema()) { for (const [memberName, memberSchema] of eventSchema.structIterator()) { const { eventHeader, eventPayload } = memberSchema.getMergedTraits(); if (eventPayload) { explicitPayloadMember = memberName; } else if (eventHeader) { const value = event[unionMember][memberName]; let type = "binary"; if (memberSchema.isNumericSchema()) { if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) { type = "integer"; } else { type = "long"; } } else if (memberSchema.isTimestampSchema()) { type = "timestamp"; } else if (memberSchema.isStringSchema()) { type = "string"; } else if (memberSchema.isBooleanSchema()) { type = "boolean"; } if (value != null) { additionalHeaders[memberName] = { type, value }; delete event[unionMember][memberName]; } } } if (explicitPayloadMember !== null) { const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember); if (payloadSchema.isBlobSchema()) { explicitPayloadContentType = "application/octet-stream"; } else if (payloadSchema.isStringSchema()) { explicitPayloadContentType = "text/plain"; } serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]); } else { serializer.write(eventSchema, event[unionMember]); } } else if (eventSchema.isUnitSchema()) { serializer.write(eventSchema, {}); } else { throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union."); } } const messageSerialization = serializer.flush() ?? new Uint8Array(); const body = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization) : messageSerialization; return { body, eventType, explicitPayloadContentType, additionalHeaders }; } }; __name(EventStreamSerde, "EventStreamSerde"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/event-streams/index.js var event_streams_exports = {}; __export(event_streams_exports, { EventStreamSerde: () => EventStreamSerde }); var init_event_streams = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/event-streams/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EventStreamSerde(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js var HttpProtocol; var init_HttpProtocol = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_dist_es2(); init_SerdeContext(); HttpProtocol = class extends SerdeContext { options; compositeErrorRegistry; constructor(options) { super(); this.options = options; this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace); for (const etr of options.errorTypeRegistries ?? []) { this.compositeErrorRegistry.copyFrom(etr); } } getRequestType() { return HttpRequest; } getResponseType() { return HttpResponse; } setSerdeContext(serdeContext) { this.serdeContext = serdeContext; this.serializer.setSerdeContext(serdeContext); this.deserializer.setSerdeContext(serdeContext); if (this.getPayloadCodec()) { this.getPayloadCodec().setSerdeContext(serdeContext); } } updateServiceEndpoint(request, endpoint) { if ("url" in endpoint) { request.protocol = endpoint.url.protocol; request.hostname = endpoint.url.hostname; request.port = endpoint.url.port ? Number(endpoint.url.port) : void 0; request.path = endpoint.url.pathname; request.fragment = endpoint.url.hash || void 0; request.username = endpoint.url.username || void 0; request.password = endpoint.url.password || void 0; if (!request.query) { request.query = {}; } for (const [k2, v3] of endpoint.url.searchParams.entries()) { request.query[k2] = v3; } if (endpoint.headers) { for (const [name, values] of Object.entries(endpoint.headers)) { request.headers[name] = values.join(", "); } } return request; } else { request.protocol = endpoint.protocol; request.hostname = endpoint.hostname; request.port = endpoint.port ? Number(endpoint.port) : void 0; request.path = endpoint.path; request.query = { ...endpoint.query }; if (endpoint.headers) { for (const [name, value] of Object.entries(endpoint.headers)) { request.headers[name] = value; } } return request; } } setHostPrefix(request, operationSchema, input) { if (this.serdeContext?.disableHostPrefix) { return; } const inputNs = NormalizedSchema.of(operationSchema.input); const opTraits = translateTraits(operationSchema.traits ?? {}); if (opTraits.endpoint) { let hostPrefix = opTraits.endpoint?.[0]; if (typeof hostPrefix === "string") { const hostLabelInputs = [...inputNs.structIterator()].filter(([, member2]) => member2.getMergedTraits().hostLabel); for (const [name] of hostLabelInputs) { const replacement = input[name]; if (typeof replacement !== "string") { throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`); } hostPrefix = hostPrefix.replace(`{${name}}`, replacement); } request.hostname = hostPrefix + request.hostname; } } } deserializeMetadata(output) { return { httpStatusCode: output.statusCode, requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], extendedRequestId: output.headers["x-amz-id-2"], cfId: output.headers["x-amz-cf-id"] }; } async serializeEventStream({ eventStream, requestSchema, initialRequest }) { const eventStreamSerde = await this.loadEventStreamCapability(); return eventStreamSerde.serializeEventStream({ eventStream, requestSchema, initialRequest }); } async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { const eventStreamSerde = await this.loadEventStreamCapability(); return eventStreamSerde.deserializeEventStream({ response, responseSchema, initialResponseContainer }); } async loadEventStreamCapability() { const { EventStreamSerde: EventStreamSerde2 } = await Promise.resolve().then(() => (init_event_streams(), event_streams_exports)); return new EventStreamSerde2({ marshaller: this.getEventStreamMarshaller(), serializer: this.serializer, deserializer: this.deserializer, serdeContext: this.serdeContext, defaultContentType: this.getDefaultContentType() }); } getDefaultContentType() { throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`); } async deserializeHttpMessage(schema, context2, response, arg4, arg5) { return []; } getEventStreamMarshaller() { const context2 = this.serdeContext; if (!context2.eventStreamMarshaller) { throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); } return context2.eventStreamMarshaller; } }; __name(HttpProtocol, "HttpProtocol"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js var HttpBindingProtocol; var init_HttpBindingProtocol = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_serde2(); init_dist_es2(); init_dist_es11(); init_collect_stream_body(); init_extended_encode_uri_component(); init_HttpProtocol(); HttpBindingProtocol = class extends HttpProtocol { async serializeRequest(operationSchema, _input, context2) { const input = { ..._input ?? {} }; const serializer = this.serializer; const query = {}; const headers = {}; const endpoint = await context2.endpoint(); const ns = NormalizedSchema.of(operationSchema?.input); const payloadMemberNames = []; const payloadMemberSchemas = []; let hasNonHttpBindingMember = false; let payload; const request = new HttpRequest({ protocol: "", hostname: "", port: void 0, path: "", fragment: void 0, query, headers, body: void 0 }); if (endpoint) { this.updateServiceEndpoint(request, endpoint); this.setHostPrefix(request, operationSchema, input); const opTraits = translateTraits(operationSchema.traits); if (opTraits.http) { request.method = opTraits.http[0]; const [path, search] = opTraits.http[1].split("?"); if (request.path == "/") { request.path = path; } else { request.path += path; } const traitSearchParams = new URLSearchParams(search ?? ""); Object.assign(query, Object.fromEntries(traitSearchParams)); } } for (const [memberName, memberNs] of ns.structIterator()) { const memberTraits = memberNs.getMergedTraits() ?? {}; const inputMemberValue = input[memberName]; if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { if (memberTraits.httpLabel) { if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) { throw new Error(`No value provided for input HTTP label: ${memberName}.`); } } continue; } if (memberTraits.httpPayload) { const isStreaming2 = memberNs.isStreaming(); if (isStreaming2) { const isEventStream = memberNs.isStructSchema(); if (isEventStream) { if (input[memberName]) { payload = await this.serializeEventStream({ eventStream: input[memberName], requestSchema: ns }); } } else { payload = inputMemberValue; } } else { serializer.write(memberNs, inputMemberValue); payload = serializer.flush(); } delete input[memberName]; } else if (memberTraits.httpLabel) { serializer.write(memberNs, inputMemberValue); const replacement = serializer.flush(); if (request.path.includes(`{${memberName}+}`)) { request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); } else if (request.path.includes(`{${memberName}}`)) { request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement)); } delete input[memberName]; } else if (memberTraits.httpHeader) { serializer.write(memberNs, inputMemberValue); headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush()); delete input[memberName]; } else if (typeof memberTraits.httpPrefixHeaders === "string") { for (const [key, val] of Object.entries(inputMemberValue)) { const amalgam = memberTraits.httpPrefixHeaders + key; serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val); headers[amalgam.toLowerCase()] = serializer.flush(); } delete input[memberName]; } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) { this.serializeQuery(memberNs, inputMemberValue, query); delete input[memberName]; } else { hasNonHttpBindingMember = true; payloadMemberNames.push(memberName); payloadMemberSchemas.push(memberNs); } } if (hasNonHttpBindingMember && input) { const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#"); const requiredMembers = ns.getSchema()[6]; const payloadSchema = [ 3, namespace, name, ns.getMergedTraits(), payloadMemberNames, payloadMemberSchemas, void 0 ]; if (requiredMembers) { payloadSchema[6] = requiredMembers; } else { payloadSchema.pop(); } serializer.write(payloadSchema, input); payload = serializer.flush(); } request.headers = headers; request.query = query; request.body = payload; return request; } serializeQuery(ns, data, query) { const serializer = this.serializer; const traits = ns.getMergedTraits(); if (traits.httpQueryParams) { for (const [key, val] of Object.entries(data)) { if (!(key in query)) { const valueSchema = ns.getValueSchema(); Object.assign(valueSchema.getMergedTraits(), { ...traits, httpQuery: key, httpQueryParams: void 0 }); this.serializeQuery(valueSchema, val, query); } } return; } if (ns.isListSchema()) { const sparse = !!ns.getMergedTraits().sparse; const buffer = []; for (const item of data) { serializer.write([ns.getValueSchema(), traits], item); const serializable = serializer.flush(); if (sparse || serializable !== void 0) { buffer.push(serializable); } } query[traits.httpQuery] = buffer; } else { serializer.write([ns, traits], data); query[traits.httpQuery] = serializer.flush(); } } async deserializeResponse(operationSchema, context2, response) { const deserializer = this.deserializer; const ns = NormalizedSchema.of(operationSchema.output); const dataObject = {}; if (response.statusCode >= 300) { const bytes = await collectBody(response.body, context2); if (bytes.byteLength > 0) { Object.assign(dataObject, await deserializer.read(15, bytes)); } await this.handleError(operationSchema, context2, response, dataObject, this.deserializeMetadata(response)); throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw."); } for (const header in response.headers) { const value = response.headers[header]; delete response.headers[header]; response.headers[header.toLowerCase()] = value; } const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context2, response, dataObject); if (nonHttpBindingMembers.length) { const bytes = await collectBody(response.body, context2); if (bytes.byteLength > 0) { const dataFromBody = await deserializer.read(ns, bytes); for (const member2 of nonHttpBindingMembers) { if (dataFromBody[member2] != null) { dataObject[member2] = dataFromBody[member2]; } } } } else if (nonHttpBindingMembers.discardResponseBody) { await collectBody(response.body, context2); } dataObject.$metadata = this.deserializeMetadata(response); return dataObject; } async deserializeHttpMessage(schema, context2, response, arg4, arg5) { let dataObject; if (arg4 instanceof Set) { dataObject = arg5; } else { dataObject = arg4; } let discardResponseBody = true; const deserializer = this.deserializer; const ns = NormalizedSchema.of(schema); const nonHttpBindingMembers = []; for (const [memberName, memberSchema] of ns.structIterator()) { const memberTraits = memberSchema.getMemberTraits(); if (memberTraits.httpPayload) { discardResponseBody = false; const isStreaming2 = memberSchema.isStreaming(); if (isStreaming2) { const isEventStream = memberSchema.isStructSchema(); if (isEventStream) { dataObject[memberName] = await this.deserializeEventStream({ response, responseSchema: ns }); } else { dataObject[memberName] = sdkStreamMixin(response.body); } } else if (response.body) { const bytes = await collectBody(response.body, context2); if (bytes.byteLength > 0) { dataObject[memberName] = await deserializer.read(memberSchema, bytes); } } } else if (memberTraits.httpHeader) { const key = String(memberTraits.httpHeader).toLowerCase(); const value = response.headers[key]; if (null != value) { if (memberSchema.isListSchema()) { const headerListValueSchema = memberSchema.getValueSchema(); headerListValueSchema.getMergedTraits().httpHeader = key; let sections; if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) { sections = splitEvery(value, ",", 2); } else { sections = splitHeader(value); } const list = []; for (const section of sections) { list.push(await deserializer.read(headerListValueSchema, section.trim())); } dataObject[memberName] = list; } else { dataObject[memberName] = await deserializer.read(memberSchema, value); } } } else if (memberTraits.httpPrefixHeaders !== void 0) { dataObject[memberName] = {}; for (const [header, value] of Object.entries(response.headers)) { if (header.startsWith(memberTraits.httpPrefixHeaders)) { const valueSchema = memberSchema.getValueSchema(); valueSchema.getMergedTraits().httpHeader = header; dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value); } } } else if (memberTraits.httpResponseCode) { dataObject[memberName] = response.statusCode; } else { nonHttpBindingMembers.push(memberName); } } nonHttpBindingMembers.discardResponseBody = discardResponseBody; return nonHttpBindingMembers; } }; __name(HttpBindingProtocol, "HttpBindingProtocol"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js var init_RpcProtocol = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js var init_resolve_path = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js var init_requestBuilder = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js function determineTimestampFormat(ns, settings) { if (settings.timestampFormat.useTrait) { if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) { return ns.getSchema(); } } const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits(); const bindingFormat = settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : void 0 : void 0; return bindingFormat ?? settings.timestampFormat.default; } var init_determineTimestampFormat = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(determineTimestampFormat, "determineTimestampFormat"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js var FromStringShapeDeserializer; var init_FromStringShapeDeserializer = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_serde2(); init_dist_es6(); init_dist_es5(); init_SerdeContext(); init_determineTimestampFormat(); FromStringShapeDeserializer = class extends SerdeContext { settings; constructor(settings) { super(); this.settings = settings; } read(_schema, data) { const ns = NormalizedSchema.of(_schema); if (ns.isListSchema()) { return splitHeader(data).map((item) => this.read(ns.getValueSchema(), item)); } if (ns.isBlobSchema()) { return (this.serdeContext?.base64Decoder ?? fromBase64)(data); } if (ns.isTimestampSchema()) { const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: return _parseRfc3339DateTimeWithOffset(data); case 6: return _parseRfc7231DateTime(data); case 7: return _parseEpochTimestamp(data); default: console.warn("Missing timestamp format, parsing value with Date constructor:", data); return new Date(data); } } if (ns.isStringSchema()) { const mediaType = ns.getMergedTraits().mediaType; let intermediateValue = data; if (mediaType) { if (ns.getMergedTraits().httpHeader) { intermediateValue = this.base64ToUtf8(intermediateValue); } const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); if (isJson) { intermediateValue = LazyJsonString.from(intermediateValue); } return intermediateValue; } } if (ns.isNumericSchema()) { return Number(data); } if (ns.isBigIntegerSchema()) { return BigInt(data); } if (ns.isBigDecimalSchema()) { return new NumericValue(data, "bigDecimal"); } if (ns.isBooleanSchema()) { return String(data).toLowerCase() === "true"; } return data; } base64ToUtf8(base64String) { return (this.serdeContext?.utf8Encoder ?? toUtf8)((this.serdeContext?.base64Decoder ?? fromBase64)(base64String)); } }; __name(FromStringShapeDeserializer, "FromStringShapeDeserializer"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js var HttpInterceptingShapeDeserializer; var init_HttpInterceptingShapeDeserializer = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_dist_es5(); init_SerdeContext(); init_FromStringShapeDeserializer(); HttpInterceptingShapeDeserializer = class extends SerdeContext { codecDeserializer; stringDeserializer; constructor(codecDeserializer, codecSettings) { super(); this.codecDeserializer = codecDeserializer; this.stringDeserializer = new FromStringShapeDeserializer(codecSettings); } setSerdeContext(serdeContext) { this.stringDeserializer.setSerdeContext(serdeContext); this.codecDeserializer.setSerdeContext(serdeContext); this.serdeContext = serdeContext; } read(schema, data) { const ns = NormalizedSchema.of(schema); const traits = ns.getMergedTraits(); const toString3 = this.serdeContext?.utf8Encoder ?? toUtf8; if (traits.httpHeader || traits.httpResponseCode) { return this.stringDeserializer.read(ns, toString3(data)); } if (traits.httpPayload) { if (ns.isBlobSchema()) { const toBytes = this.serdeContext?.utf8Decoder ?? fromUtf8; if (typeof data === "string") { return toBytes(data); } return data; } else if (ns.isStringSchema()) { if ("byteLength" in data) { return toString3(data); } return data; } } return this.codecDeserializer.read(ns, data); } }; __name(HttpInterceptingShapeDeserializer, "HttpInterceptingShapeDeserializer"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js var ToStringShapeSerializer; var init_ToStringShapeSerializer = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_serde2(); init_dist_es6(); init_SerdeContext(); init_determineTimestampFormat(); ToStringShapeSerializer = class extends SerdeContext { settings; stringBuffer = ""; constructor(settings) { super(); this.settings = settings; } write(schema, value) { const ns = NormalizedSchema.of(schema); switch (typeof value) { case "object": if (value === null) { this.stringBuffer = "null"; return; } if (ns.isTimestampSchema()) { if (!(value instanceof Date)) { throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`); } const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: this.stringBuffer = value.toISOString().replace(".000Z", "Z"); break; case 6: this.stringBuffer = dateToUtcString(value); break; case 7: this.stringBuffer = String(value.getTime() / 1e3); break; default: console.warn("Missing timestamp format, using epoch seconds", value); this.stringBuffer = String(value.getTime() / 1e3); } return; } if (ns.isBlobSchema() && "byteLength" in value) { this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value); return; } if (ns.isListSchema() && Array.isArray(value)) { let buffer = ""; for (const item of value) { this.write([ns.getValueSchema(), ns.getMergedTraits()], item); const headerItem = this.flush(); const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem); if (buffer !== "") { buffer += ", "; } buffer += serialized; } this.stringBuffer = buffer; return; } this.stringBuffer = JSON.stringify(value, null, 2); break; case "string": const mediaType = ns.getMergedTraits().mediaType; let intermediateValue = value; if (mediaType) { const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); if (isJson) { intermediateValue = LazyJsonString.from(intermediateValue); } if (ns.getMergedTraits().httpHeader) { this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString()); return; } } this.stringBuffer = value; break; default: if (ns.isIdempotencyToken()) { this.stringBuffer = v4(); } else { this.stringBuffer = String(value); } } } flush() { const buffer = this.stringBuffer; this.stringBuffer = ""; return buffer; } }; __name(ToStringShapeSerializer, "ToStringShapeSerializer"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js var HttpInterceptingShapeSerializer; var init_HttpInterceptingShapeSerializer = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_ToStringShapeSerializer(); HttpInterceptingShapeSerializer = class { codecSerializer; stringSerializer; buffer; constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) { this.codecSerializer = codecSerializer; this.stringSerializer = stringSerializer; } setSerdeContext(serdeContext) { this.codecSerializer.setSerdeContext(serdeContext); this.stringSerializer.setSerdeContext(serdeContext); } write(schema, value) { const ns = NormalizedSchema.of(schema); const traits = ns.getMergedTraits(); if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { this.stringSerializer.write(ns, value); this.buffer = this.stringSerializer.flush(); return; } return this.codecSerializer.write(ns, value); } flush() { if (this.buffer !== void 0) { const buffer = this.buffer; this.buffer = void 0; return buffer; } return this.codecSerializer.flush(); } }; __name(HttpInterceptingShapeSerializer, "HttpInterceptingShapeSerializer"); } }); // ../../node_modules/@smithy/core/dist-es/submodules/protocols/index.js var init_protocols = __esm({ "../../node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_collect_stream_body(); init_extended_encode_uri_component(); init_HttpBindingProtocol(); init_HttpProtocol(); init_RpcProtocol(); init_requestBuilder(); init_resolve_path(); init_FromStringShapeDeserializer(); init_HttpInterceptingShapeDeserializer(); init_HttpInterceptingShapeSerializer(); init_ToStringShapeSerializer(); init_determineTimestampFormat(); init_SerdeContext(); } }); // ../../node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js var init_requestBuilder2 = __esm({ "../../node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/setFeature.js function setFeature2(context2, feature2, value) { if (!context2.__smithy_context) { context2.__smithy_context = { features: {} }; } else if (!context2.__smithy_context.features) { context2.__smithy_context.features = {}; } context2.__smithy_context.features[feature2] = value; } var init_setFeature2 = __esm({ "../../node_modules/@smithy/core/dist-es/setFeature.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(setFeature2, "setFeature"); } }); // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js var DefaultIdentityProviderConfig; var init_DefaultIdentityProviderConfig = __esm({ "../../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); DefaultIdentityProviderConfig = class { authSchemes = /* @__PURE__ */ new Map(); constructor(config3) { for (const [key, value] of Object.entries(config3)) { if (value !== void 0) { this.authSchemes.set(key, value); } } } getIdentityProvider(schemeId) { return this.authSchemes.get(schemeId); } }; __name(DefaultIdentityProviderConfig, "DefaultIdentityProviderConfig"); } }); // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js var init_httpApiKeyAuth = __esm({ "../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js var init_httpBearerAuth = __esm({ "../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js var init_noAuth = __esm({ "../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js var init_httpAuthSchemes = __esm({ "../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_httpApiKeyAuth(); init_httpBearerAuth(); init_noAuth(); } }); // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js var createIsIdentityExpiredFunction, EXPIRATION_MS, isIdentityExpired, doesIdentityRequireRefresh, memoizeIdentityProvider; var init_memoizeIdentityProvider = __esm({ "../../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); createIsIdentityExpiredFunction = /* @__PURE__ */ __name((expirationMs) => /* @__PURE__ */ __name(function isIdentityExpired2(identity2) { return doesIdentityRequireRefresh(identity2) && identity2.expiration.getTime() - Date.now() < expirationMs; }, "isIdentityExpired"), "createIsIdentityExpiredFunction"); EXPIRATION_MS = 3e5; isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); doesIdentityRequireRefresh = /* @__PURE__ */ __name((identity2) => identity2.expiration !== void 0, "doesIdentityRequireRefresh"); memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { if (provider === void 0) { return void 0; } const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; let resolved; let pending; let hasResult; let isConstant = false; const coalesceProvider = /* @__PURE__ */ __name(async (options) => { if (!pending) { pending = normalizedProvider(options); } try { resolved = await pending; hasResult = true; isConstant = false; } finally { pending = void 0; } return resolved; }, "coalesceProvider"); if (isExpired === void 0) { return async (options) => { if (!hasResult || options?.forceRefresh) { resolved = await coalesceProvider(options); } return resolved; }; } return async (options) => { if (!hasResult || options?.forceRefresh) { resolved = await coalesceProvider(options); } if (isConstant) { return resolved; } if (!requiresRefresh(resolved)) { isConstant = true; return resolved; } if (isExpired(resolved)) { await coalesceProvider(options); return resolved; } return resolved; }; }, "memoizeIdentityProvider"); } }); // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js var init_util_identity_and_auth = __esm({ "../../node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_DefaultIdentityProviderConfig(); init_httpAuthSchemes(); init_memoizeIdentityProvider(); } }); // ../../node_modules/@smithy/core/dist-es/index.js var init_dist_es15 = __esm({ "../../node_modules/@smithy/core/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getSmithyContext(); init_middleware_http_auth_scheme(); init_middleware_http_signing(); init_normalizeProvider2(); init_createPaginator(); init_requestBuilder2(); init_setFeature2(); init_util_identity_and_auth(); } }); // ../../node_modules/@smithy/property-provider/dist-es/ProviderError.js var init_ProviderError = __esm({ "../../node_modules/@smithy/property-provider/dist-es/ProviderError.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js var init_CredentialsProviderError = __esm({ "../../node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/property-provider/dist-es/TokenProviderError.js var init_TokenProviderError = __esm({ "../../node_modules/@smithy/property-provider/dist-es/TokenProviderError.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/property-provider/dist-es/chain.js var init_chain = __esm({ "../../node_modules/@smithy/property-provider/dist-es/chain.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/property-provider/dist-es/fromStatic.js var init_fromStatic = __esm({ "../../node_modules/@smithy/property-provider/dist-es/fromStatic.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/property-provider/dist-es/memoize.js var memoize; var init_memoize = __esm({ "../../node_modules/@smithy/property-provider/dist-es/memoize.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { let resolved; let pending; let hasResult; let isConstant = false; const coalesceProvider = /* @__PURE__ */ __name(async () => { if (!pending) { pending = provider(); } try { resolved = await pending; hasResult = true; isConstant = false; } finally { pending = void 0; } return resolved; }, "coalesceProvider"); if (isExpired === void 0) { return async (options) => { if (!hasResult || options?.forceRefresh) { resolved = await coalesceProvider(); } return resolved; }; } return async (options) => { if (!hasResult || options?.forceRefresh) { resolved = await coalesceProvider(); } if (isConstant) { return resolved; } if (requiresRefresh && !requiresRefresh(resolved)) { isConstant = true; return resolved; } if (isExpired(resolved)) { await coalesceProvider(); return resolved; } return resolved; }; }, "memoize"); } }); // ../../node_modules/@smithy/property-provider/dist-es/index.js var init_dist_es16 = __esm({ "../../node_modules/@smithy/property-provider/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_CredentialsProviderError(); init_ProviderError(); init_TokenProviderError(); init_chain(); init_fromStatic(); init_memoize(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js var resolveAwsSdkSigV4AConfig; var init_resolveAwsSdkSigV4AConfig = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); resolveAwsSdkSigV4AConfig = /* @__PURE__ */ __name((config3) => { config3.sigv4aSigningRegionSet = normalizeProvider2(config3.sigv4aSigningRegionSet); return config3; }, "resolveAwsSdkSigV4AConfig"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/constants.js var ALGORITHM_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, EXPIRES_QUERY_PARAM, SIGNATURE_QUERY_PARAM, TOKEN_QUERY_PARAM, AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER, GENERATED_HEADERS, SIGNATURE_HEADER, SHA256_HEADER, TOKEN_HEADER, ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN, ALGORITHM_IDENTIFIER, EVENT_ALGORITHM_IDENTIFIER, UNSIGNED_PAYLOAD, MAX_CACHE_SIZE, KEY_TYPE_IDENTIFIER, MAX_PRESIGNED_TTL; var init_constants4 = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; EXPIRES_QUERY_PARAM = "X-Amz-Expires"; SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; AUTH_HEADER = "authorization"; AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); DATE_HEADER = "date"; GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); SHA256_HEADER = "x-amz-content-sha256"; TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); ALWAYS_UNSIGNABLE_HEADERS = { authorization: true, "cache-control": true, connection: true, expect: true, from: true, "keep-alive": true, "max-forwards": true, pragma: true, referer: true, te: true, trailer: true, "transfer-encoding": true, upgrade: true, "user-agent": true, "x-amzn-trace-id": true }; PROXY_HEADER_PATTERN = /^proxy-/; SEC_HEADER_PATTERN = /^sec-/; ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; MAX_CACHE_SIZE = 50; KEY_TYPE_IDENTIFIER = "aws4_request"; MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; } }); // ../../node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js var signingKeyCache, cacheQueue, createScope, getSigningKey, hmac; var init_credentialDerivation = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es10(); init_dist_es5(); init_constants4(); signingKeyCache = {}; cacheQueue = []; createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope"); getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => { const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`; if (cacheKey in signingKeyCache) { return signingKeyCache[cacheKey]; } cacheQueue.push(cacheKey); while (cacheQueue.length > MAX_CACHE_SIZE) { delete signingKeyCache[cacheQueue.shift()]; } let key = `AWS4${credentials.secretAccessKey}`; for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { key = await hmac(sha256Constructor, key, signable); } return signingKeyCache[cacheKey] = key; }, "getSigningKey"); hmac = /* @__PURE__ */ __name((ctor, secret, data) => { const hash4 = new ctor(secret); hash4.update(toUint8Array(data)); return hash4.digest(); }, "hmac"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js var getCanonicalHeaders; var init_getCanonicalHeaders = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants4(); getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => { const canonical = {}; for (const headerName of Object.keys(headers).sort()) { if (headers[headerName] == void 0) { continue; } const canonicalHeaderName = headerName.toLowerCase(); if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders?.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) { if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) { continue; } } canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); } return canonical; }, "getCanonicalHeaders"); } }); // ../../node_modules/@smithy/is-array-buffer/dist-es/index.js var isArrayBuffer; var init_dist_es17 = __esm({ "../../node_modules/@smithy/is-array-buffer/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js var getPayloadHash; var init_getPayloadHash = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es17(); init_dist_es10(); init_dist_es5(); init_constants4(); getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => { for (const headerName of Object.keys(headers)) { if (headerName.toLowerCase() === SHA256_HEADER) { return headers[headerName]; } } if (body == void 0) { return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; } else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) { const hashCtor = new hashConstructor(); hashCtor.update(toUint8Array(body)); return toHex(await hashCtor.digest()); } return UNSIGNED_PAYLOAD; }, "getPayloadHash"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js function negate(bytes) { for (let i2 = 0; i2 < 8; i2++) { bytes[i2] ^= 255; } for (let i2 = 7; i2 > -1; i2--) { bytes[i2]++; if (bytes[i2] !== 0) break; } } var HeaderFormatter, HEADER_VALUE_TYPE, UUID_PATTERN, Int64; var init_HeaderFormatter = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es10(); init_dist_es5(); HeaderFormatter = class { format(headers) { const chunks = []; for (const headerName of Object.keys(headers)) { const bytes = fromUtf8(headerName); chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); } const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); let position = 0; for (const chunk of chunks) { out.set(chunk, position); position += chunk.byteLength; } return out; } formatHeaderValue(header) { switch (header.type) { case "boolean": return Uint8Array.from([header.value ? 0 : 1]); case "byte": return Uint8Array.from([2, header.value]); case "short": const shortView = new DataView(new ArrayBuffer(3)); shortView.setUint8(0, 3); shortView.setInt16(1, header.value, false); return new Uint8Array(shortView.buffer); case "integer": const intView = new DataView(new ArrayBuffer(5)); intView.setUint8(0, 4); intView.setInt32(1, header.value, false); return new Uint8Array(intView.buffer); case "long": const longBytes = new Uint8Array(9); longBytes[0] = 5; longBytes.set(header.value.bytes, 1); return longBytes; case "binary": const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); binView.setUint8(0, 6); binView.setUint16(1, header.value.byteLength, false); const binBytes = new Uint8Array(binView.buffer); binBytes.set(header.value, 3); return binBytes; case "string": const utf8Bytes = fromUtf8(header.value); const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); strView.setUint8(0, 7); strView.setUint16(1, utf8Bytes.byteLength, false); const strBytes = new Uint8Array(strView.buffer); strBytes.set(utf8Bytes, 3); return strBytes; case "timestamp": const tsBytes = new Uint8Array(9); tsBytes[0] = 8; tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); return tsBytes; case "uuid": if (!UUID_PATTERN.test(header.value)) { throw new Error(`Invalid UUID received: ${header.value}`); } const uuidBytes = new Uint8Array(17); uuidBytes[0] = 9; uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1); return uuidBytes; } } }; __name(HeaderFormatter, "HeaderFormatter"); (function(HEADER_VALUE_TYPE3) { HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid"; })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; Int64 = class { bytes; constructor(bytes) { this.bytes = bytes; if (bytes.byteLength !== 8) { throw new Error("Int64 buffers must be exactly 8 bytes"); } } static fromNumber(number4) { if (number4 > 9223372036854776e3 || number4 < -9223372036854776e3) { throw new Error(`${number4} is too large (or, if negative, too small) to represent as an Int64`); } const bytes = new Uint8Array(8); for (let i2 = 7, remaining = Math.abs(Math.round(number4)); i2 > -1 && remaining > 0; i2--, remaining /= 256) { bytes[i2] = remaining; } if (number4 < 0) { negate(bytes); } return new Int64(bytes); } valueOf() { const bytes = this.bytes.slice(0); const negative = bytes[0] & 128; if (negative) { negate(bytes); } return parseInt(toHex(bytes), 16) * (negative ? -1 : 1); } toString() { return String(this.valueOf()); } }; __name(Int64, "Int64"); __name(negate, "negate"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/headerUtil.js var hasHeader; var init_headerUtil = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/headerUtil.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => { soughtHeader = soughtHeader.toLowerCase(); for (const headerName of Object.keys(headers)) { if (soughtHeader === headerName.toLowerCase()) { return true; } } return false; }, "hasHeader"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js var moveHeadersToQuery; var init_moveHeadersToQuery = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); moveHeadersToQuery = /* @__PURE__ */ __name((request, options = {}) => { const { headers, query = {} } = HttpRequest.clone(request); for (const name of Object.keys(headers)) { const lname = name.toLowerCase(); if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) { query[name] = headers[name]; delete headers[name]; } } return { ...request, headers, query }; }, "moveHeadersToQuery"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/prepareRequest.js var prepareRequest; var init_prepareRequest = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/prepareRequest.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_constants4(); prepareRequest = /* @__PURE__ */ __name((request) => { request = HttpRequest.clone(request); for (const headerName of Object.keys(request.headers)) { if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { delete request.headers[headerName]; } } return request; }, "prepareRequest"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js var getCanonicalQuery; var init_getCanonicalQuery = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es7(); init_constants4(); getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { const keys = []; const serialized = {}; for (const key of Object.keys(query)) { if (key.toLowerCase() === SIGNATURE_HEADER) { continue; } const encodedKey = escapeUri(key); keys.push(encodedKey); const value = query[key]; if (typeof value === "string") { serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`; } else if (Array.isArray(value)) { serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${escapeUri(value2)}`]), []).sort().join("&"); } } return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); }, "getCanonicalQuery"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/utilDate.js var iso8601, toDate; var init_utilDate = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/utilDate.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); iso8601 = /* @__PURE__ */ __name((time7) => toDate(time7).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601"); toDate = /* @__PURE__ */ __name((time7) => { if (typeof time7 === "number") { return new Date(time7 * 1e3); } if (typeof time7 === "string") { if (Number(time7)) { return new Date(Number(time7) * 1e3); } return new Date(time7); } return time7; }, "toDate"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js var SignatureV4Base; var init_SignatureV4Base = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es10(); init_dist_es4(); init_dist_es7(); init_dist_es5(); init_getCanonicalQuery(); init_utilDate(); SignatureV4Base = class { service; regionProvider; credentialProvider; sha256; uriEscapePath; applyChecksum; constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) { this.service = service; this.sha256 = sha256; this.uriEscapePath = uriEscapePath; this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; this.regionProvider = normalizeProvider(region); this.credentialProvider = normalizeProvider(credentials); } createCanonicalRequest(request, canonicalHeaders, payloadHash) { const sortedHeaders = Object.keys(canonicalHeaders).sort(); return `${request.method} ${this.getCanonicalPath(request)} ${getCanonicalQuery(request)} ${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} ${sortedHeaders.join(";")} ${payloadHash}`; } async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { const hash4 = new this.sha256(); hash4.update(toUint8Array(canonicalRequest)); const hashedRequest = await hash4.digest(); return `${algorithmIdentifier} ${longDate} ${credentialScope} ${toHex(hashedRequest)}`; } getCanonicalPath({ path }) { if (this.uriEscapePath) { const normalizedPathSegments = []; for (const pathSegment of path.split("/")) { if (pathSegment?.length === 0) continue; if (pathSegment === ".") continue; if (pathSegment === "..") { normalizedPathSegments.pop(); } else { normalizedPathSegments.push(pathSegment); } } const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`; const doubleEncoded = escapeUri(normalizedPath); return doubleEncoded.replace(/%2F/g, "/"); } return path; } validateResolvedCredentials(credentials) { if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") { throw new Error("Resolved credential object is not valid"); } } formatDate(now) { const longDate = iso8601(now).replace(/[\-:]/g, ""); return { longDate, shortDate: longDate.slice(0, 8) }; } getCanonicalHeaderList(headers) { return Object.keys(headers).sort().join(";"); } }; __name(SignatureV4Base, "SignatureV4Base"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/SignatureV4.js var SignatureV4; var init_SignatureV4 = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/SignatureV4.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es10(); init_dist_es5(); init_constants4(); init_credentialDerivation(); init_getCanonicalHeaders(); init_getPayloadHash(); init_HeaderFormatter(); init_headerUtil(); init_moveHeadersToQuery(); init_prepareRequest(); init_SignatureV4Base(); SignatureV4 = class extends SignatureV4Base { headerFormatter = new HeaderFormatter(); constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) { super({ applyChecksum, credentials, region, service, sha256, uriEscapePath }); } async presign(originalRequest, options = {}) { const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options; const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const { longDate, shortDate } = this.formatDate(signingDate); if (expiresIn > MAX_PRESIGNED_TTL) { return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future"); } const scope = createScope(shortDate, region, signingService ?? this.service); const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); if (credentials.sessionToken) { request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; } request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; request.query[AMZ_DATE_QUERY_PARAM] = longDate; request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); return request; } async sign(toSign, options) { if (typeof toSign === "string") { return this.signString(toSign, options); } else if (toSign.headers && toSign.payload) { return this.signEvent(toSign, options); } else if (toSign.message) { return this.signMessage(toSign, options); } else { return this.signRequest(toSign, options); } } async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { const region = signingRegion ?? await this.regionProvider(); const { shortDate, longDate } = this.formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); const hash4 = new this.sha256(); hash4.update(headers); const hashedHeaders = toHex(await hash4.digest()); const stringToSign = [ EVENT_ALGORITHM_IDENTIFIER, longDate, scope, priorSignature, hashedHeaders, hashedPayload ].join("\n"); return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); } async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) { const promise2 = this.signEvent({ headers: this.headerFormatter.format(signableMessage.message.headers), payload: signableMessage.message.body }, { signingDate, signingRegion, signingService, priorSignature: signableMessage.priorSignature }); return promise2.then((signature) => { return { message: signableMessage.message, signature }; }); } async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) { const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const { shortDate } = this.formatDate(signingDate); const hash4 = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); hash4.update(toUint8Array(stringToSign)); return toHex(await hash4.digest()); } async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) { const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const request = prepareRequest(requestToSign); const { longDate, shortDate } = this.formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); request.headers[AMZ_DATE_HEADER] = longDate; if (credentials.sessionToken) { request.headers[TOKEN_HEADER] = credentials.sessionToken; } const payloadHash = await getPayloadHash(request, this.sha256); if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) { request.headers[SHA256_HEADER] = payloadHash; } const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; return request; } async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER); const hash4 = new this.sha256(await keyPromise); hash4.update(toUint8Array(stringToSign)); return toHex(await hash4.digest()); } getSigningKey(credentials, region, shortDate, service) { return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); } }; __name(SignatureV4, "SignatureV4"); } }); // ../../node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js var signatureV4aContainer; var init_signature_v4a_container = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); signatureV4aContainer = { SignatureV4a: null }; } }); // ../../node_modules/@smithy/signature-v4/dist-es/index.js var init_dist_es18 = __esm({ "../../node_modules/@smithy/signature-v4/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_SignatureV4(); init_constants4(); init_credentialDerivation(); init_signature_v4a_container(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js function normalizeCredentialProvider(config3, { credentials, credentialDefaultProvider }) { let credentialsProvider; if (credentials) { if (!credentials?.memoized) { credentialsProvider = memoizeIdentityProvider(credentials, isIdentityExpired, doesIdentityRequireRefresh); } else { credentialsProvider = credentials; } } else { if (credentialDefaultProvider) { credentialsProvider = normalizeProvider2(credentialDefaultProvider(Object.assign({}, config3, { parentClientConfig: config3 }))); } else { credentialsProvider = /* @__PURE__ */ __name(async () => { throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); }, "credentialsProvider"); } } credentialsProvider.memoized = true; return credentialsProvider; } function bindCallerConfig(config3, credentialsProvider) { if (credentialsProvider.configBound) { return credentialsProvider; } const fn = /* @__PURE__ */ __name(async (options) => credentialsProvider({ ...options, callerClientConfig: config3 }), "fn"); fn.memoized = credentialsProvider.memoized; fn.configBound = true; return fn; } var resolveAwsSdkSigV4Config; var init_resolveAwsSdkSigV4Config = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_client2(); init_dist_es15(); init_dist_es18(); resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config3) => { let inputCredentials = config3.credentials; let isUserSupplied = !!config3.credentials; let resolvedCredentials = void 0; Object.defineProperty(config3, "credentials", { set(credentials) { if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { isUserSupplied = true; } inputCredentials = credentials; const memoizedProvider = normalizeCredentialProvider(config3, { credentials: inputCredentials, credentialDefaultProvider: config3.credentialDefaultProvider }); const boundProvider = bindCallerConfig(config3, memoizedProvider); if (isUserSupplied && !boundProvider.attributed) { const isCredentialObject = typeof inputCredentials === "object" && inputCredentials !== null; resolvedCredentials = /* @__PURE__ */ __name(async (options) => { const creds = await boundProvider(options); const attributedCreds = creds; if (isCredentialObject && (!attributedCreds.$source || Object.keys(attributedCreds.$source).length === 0)) { return setCredentialFeature(attributedCreds, "CREDENTIALS_CODE", "e"); } return attributedCreds; }, "resolvedCredentials"); resolvedCredentials.memoized = boundProvider.memoized; resolvedCredentials.configBound = boundProvider.configBound; resolvedCredentials.attributed = true; } else { resolvedCredentials = boundProvider; } }, get() { return resolvedCredentials; }, enumerable: true, configurable: true }); config3.credentials = inputCredentials; const { signingEscapePath = true, systemClockOffset = config3.systemClockOffset || 0, sha256 } = config3; let signer; if (config3.signer) { signer = normalizeProvider2(config3.signer); } else if (config3.regionInfoProvider) { signer = /* @__PURE__ */ __name(() => normalizeProvider2(config3.region)().then(async (region) => [ await config3.regionInfoProvider(region, { useFipsEndpoint: await config3.useFipsEndpoint(), useDualstackEndpoint: await config3.useDualstackEndpoint() }) || {}, region ]).then(([regionInfo, region]) => { const { signingRegion, signingService } = regionInfo; config3.signingRegion = config3.signingRegion || signingRegion || region; config3.signingName = config3.signingName || signingService || config3.serviceId; const params = { ...config3, credentials: config3.credentials, region: config3.signingRegion, service: config3.signingName, sha256, uriEscapePath: signingEscapePath }; const SignerCtor = config3.signerConstructor || SignatureV4; return new SignerCtor(params); }), "signer"); } else { signer = /* @__PURE__ */ __name(async (authScheme) => { authScheme = Object.assign({}, { name: "sigv4", signingName: config3.signingName || config3.defaultSigningName, signingRegion: await normalizeProvider2(config3.region)(), properties: {} }, authScheme); const signingRegion = authScheme.signingRegion; const signingService = authScheme.signingName; config3.signingRegion = config3.signingRegion || signingRegion; config3.signingName = config3.signingName || signingService || config3.serviceId; const params = { ...config3, credentials: config3.credentials, region: config3.signingRegion, service: config3.signingName, sha256, uriEscapePath: signingEscapePath }; const SignerCtor = config3.signerConstructor || SignatureV4; return new SignerCtor(params); }, "signer"); } const resolvedConfig = Object.assign(config3, { systemClockOffset, signingEscapePath, signer }); return resolvedConfig; }, "resolveAwsSdkSigV4Config"); __name(normalizeCredentialProvider, "normalizeCredentialProvider"); __name(bindCallerConfig, "bindCallerConfig"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js var init_aws_sdk = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AwsSdkSigV4Signer(); init_AwsSdkSigV4ASigner(); init_NODE_AUTH_SCHEME_PREFERENCE_OPTIONS(); init_resolveAwsSdkSigV4AConfig(); init_resolveAwsSdkSigV4Config(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js var init_httpAuthSchemes2 = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_aws_sdk(); init_getBearerTokenEnvKey(); } }); // ../../node_modules/@smithy/util-body-length-browser/dist-es/calculateBodyLength.js var TEXT_ENCODER, calculateBodyLength; var init_calculateBodyLength = __esm({ "../../node_modules/@smithy/util-body-length-browser/dist-es/calculateBodyLength.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); TEXT_ENCODER = typeof TextEncoder == "function" ? new TextEncoder() : null; calculateBodyLength = /* @__PURE__ */ __name((body) => { if (typeof body === "string") { if (TEXT_ENCODER) { return TEXT_ENCODER.encode(body).byteLength; } let len = body.length; for (let i2 = len - 1; i2 >= 0; i2--) { const code = body.charCodeAt(i2); if (code > 127 && code <= 2047) len++; else if (code > 2047 && code <= 65535) len += 2; if (code >= 56320 && code <= 57343) i2--; } return len; } else if (typeof body.byteLength === "number") { return body.byteLength; } else if (typeof body.size === "number") { return body.size; } throw new Error(`Body Length computation failed for ${body}`); }, "calculateBodyLength"); } }); // ../../node_modules/@smithy/util-body-length-browser/dist-es/index.js var init_dist_es19 = __esm({ "../../node_modules/@smithy/util-body-length-browser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_calculateBodyLength(); } }); // ../../node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js var getAllAliases, getMiddlewareNameWithAliases, constructStack, stepWeights, priorityWeights; var init_MiddlewareStack = __esm({ "../../node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getAllAliases = /* @__PURE__ */ __name((name, aliases) => { const _aliases = []; if (name) { _aliases.push(name); } if (aliases) { for (const alias of aliases) { _aliases.push(alias); } } return _aliases; }, "getAllAliases"); getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => { return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; }, "getMiddlewareNameWithAliases"); constructStack = /* @__PURE__ */ __name(() => { let absoluteEntries = []; let relativeEntries = []; let identifyOnResolve = false; const entriesNameSet = /* @__PURE__ */ new Set(); const sort = /* @__PURE__ */ __name((entries) => entries.sort((a2, b2) => stepWeights[b2.step] - stepWeights[a2.step] || priorityWeights[b2.priority || "normal"] - priorityWeights[a2.priority || "normal"]), "sort"); const removeByName = /* @__PURE__ */ __name((toRemove) => { let isRemoved = false; const filterCb = /* @__PURE__ */ __name((entry) => { const aliases = getAllAliases(entry.name, entry.aliases); if (aliases.includes(toRemove)) { isRemoved = true; for (const alias of aliases) { entriesNameSet.delete(alias); } return false; } return true; }, "filterCb"); absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }, "removeByName"); const removeByReference = /* @__PURE__ */ __name((toRemove) => { let isRemoved = false; const filterCb = /* @__PURE__ */ __name((entry) => { if (entry.middleware === toRemove) { isRemoved = true; for (const alias of getAllAliases(entry.name, entry.aliases)) { entriesNameSet.delete(alias); } return false; } return true; }, "filterCb"); absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }, "removeByReference"); const cloneTo = /* @__PURE__ */ __name((toStack) => { absoluteEntries.forEach((entry) => { toStack.add(entry.middleware, { ...entry }); }); relativeEntries.forEach((entry) => { toStack.addRelativeTo(entry.middleware, { ...entry }); }); toStack.identifyOnResolve?.(stack.identifyOnResolve()); return toStack; }, "cloneTo"); const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => { const expandedMiddlewareList = []; from.before.forEach((entry) => { if (entry.before.length === 0 && entry.after.length === 0) { expandedMiddlewareList.push(entry); } else { expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); } }); expandedMiddlewareList.push(from); from.after.reverse().forEach((entry) => { if (entry.before.length === 0 && entry.after.length === 0) { expandedMiddlewareList.push(entry); } else { expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); } }); return expandedMiddlewareList; }, "expandRelativeMiddlewareList"); const getMiddlewareList = /* @__PURE__ */ __name((debug3 = false) => { const normalizedAbsoluteEntries = []; const normalizedRelativeEntries = []; const normalizedEntriesNameMap = {}; absoluteEntries.forEach((entry) => { const normalizedEntry = { ...entry, before: [], after: [] }; for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { normalizedEntriesNameMap[alias] = normalizedEntry; } normalizedAbsoluteEntries.push(normalizedEntry); }); relativeEntries.forEach((entry) => { const normalizedEntry = { ...entry, before: [], after: [] }; for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { normalizedEntriesNameMap[alias] = normalizedEntry; } normalizedRelativeEntries.push(normalizedEntry); }); normalizedRelativeEntries.forEach((entry) => { if (entry.toMiddleware) { const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; if (toMiddleware === void 0) { if (debug3) { return; } throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`); } if (entry.relation === "after") { toMiddleware.after.push(entry); } if (entry.relation === "before") { toMiddleware.before.push(entry); } } }); const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => { wholeList.push(...expandedMiddlewareList); return wholeList; }, []); return mainChain; }, "getMiddlewareList"); const stack = { add: (middleware2, options = {}) => { const { name, override, aliases: _aliases } = options; const entry = { step: "initialize", priority: "normal", middleware: middleware2, ...options }; const aliases = getAllAliases(name, _aliases); if (aliases.length > 0) { if (aliases.some((alias) => entriesNameSet.has(alias))) { if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); for (const alias of aliases) { const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a2) => a2 === alias)); if (toOverrideIndex === -1) { continue; } const toOverride = absoluteEntries[toOverrideIndex]; if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`); } absoluteEntries.splice(toOverrideIndex, 1); } } for (const alias of aliases) { entriesNameSet.add(alias); } } absoluteEntries.push(entry); }, addRelativeTo: (middleware2, options) => { const { name, override, aliases: _aliases } = options; const entry = { middleware: middleware2, ...options }; const aliases = getAllAliases(name, _aliases); if (aliases.length > 0) { if (aliases.some((alias) => entriesNameSet.has(alias))) { if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); for (const alias of aliases) { const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a2) => a2 === alias)); if (toOverrideIndex === -1) { continue; } const toOverride = relativeEntries[toOverrideIndex]; if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); } relativeEntries.splice(toOverrideIndex, 1); } } for (const alias of aliases) { entriesNameSet.add(alias); } } relativeEntries.push(entry); }, clone: () => cloneTo(constructStack()), use: (plugin) => { plugin.applyToStack(stack); }, remove: (toRemove) => { if (typeof toRemove === "string") return removeByName(toRemove); else return removeByReference(toRemove); }, removeByTag: (toRemove) => { let isRemoved = false; const filterCb = /* @__PURE__ */ __name((entry) => { const { tags, name, aliases: _aliases } = entry; if (tags && tags.includes(toRemove)) { const aliases = getAllAliases(name, _aliases); for (const alias of aliases) { entriesNameSet.delete(alias); } isRemoved = true; return false; } return true; }, "filterCb"); absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }, concat: (from) => { const cloned = cloneTo(constructStack()); cloned.use(from); cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false)); return cloned; }, applyToStack: cloneTo, identify: () => { return getMiddlewareList(true).map((mw) => { const step = mw.step ?? mw.relation + " " + mw.toMiddleware; return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; }); }, identifyOnResolve(toggle) { if (typeof toggle === "boolean") identifyOnResolve = toggle; return identifyOnResolve; }, resolve: (handler, context2) => { for (const middleware2 of getMiddlewareList().map((entry) => entry.middleware).reverse()) { handler = middleware2(handler, context2); } if (identifyOnResolve) { console.log(stack.identify()); } return handler; } }; return stack; }, "constructStack"); stepWeights = { initialize: 5, serialize: 4, build: 3, finalizeRequest: 2, deserialize: 1 }; priorityWeights = { high: 3, normal: 2, low: 1 }; } }); // ../../node_modules/@smithy/middleware-stack/dist-es/index.js var init_dist_es20 = __esm({ "../../node_modules/@smithy/middleware-stack/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_MiddlewareStack(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/client.js var Client; var init_client3 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/client.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es20(); Client = class { config; middlewareStack = constructStack(); initConfig; handlers; constructor(config3) { this.config = config3; const { protocol, protocolSettings } = config3; if (protocolSettings) { if (typeof protocol === "function") { config3.protocol = new protocol(protocolSettings); } } } send(command, optionsOrCb, cb2) { const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0; const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb2; const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true; let handler; if (useHandlerCache) { if (!this.handlers) { this.handlers = /* @__PURE__ */ new WeakMap(); } const handlers2 = this.handlers; if (handlers2.has(command.constructor)) { handler = handlers2.get(command.constructor); } else { handler = command.resolveMiddleware(this.middlewareStack, this.config, options); handlers2.set(command.constructor, handler); } } else { delete this.handlers; handler = command.resolveMiddleware(this.middlewareStack, this.config, options); } if (callback) { handler(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => { }); } else { return handler(command).then((result) => result.output); } } destroy() { this.config?.requestHandler?.destroy?.(); delete this.handlers; } }; __name(Client, "Client"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js var init_collect_stream_body2 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js function schemaLogFilter(schema, data) { if (data == null) { return data; } const ns = NormalizedSchema.of(schema); if (ns.getMergedTraits().sensitive) { return SENSITIVE_STRING; } if (ns.isListSchema()) { const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive; if (isSensitive) { return SENSITIVE_STRING; } } else if (ns.isMapSchema()) { const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive; if (isSensitive) { return SENSITIVE_STRING; } } else if (ns.isStructSchema() && typeof data === "object") { const object2 = data; const newObject = {}; for (const [member2, memberNs] of ns.structIterator()) { if (object2[member2] != null) { newObject[member2] = schemaLogFilter(memberNs, object2[member2]); } } return newObject; } return data; } var SENSITIVE_STRING; var init_schemaLogFilter = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); SENSITIVE_STRING = "***SensitiveInformation***"; __name(schemaLogFilter, "schemaLogFilter"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/command.js var Command, ClassBuilder; var init_command2 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/command.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es20(); init_dist_es(); init_schemaLogFilter(); Command = class { middlewareStack = constructStack(); schema; static classBuilder() { return new ClassBuilder(); } resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) { for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { this.middlewareStack.use(mw); } const stack = clientStack.concat(this.middlewareStack); const { logger: logger3 } = configuration; const handlerExecutionContext = { logger: logger3, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, [SMITHY_CONTEXT_KEY]: { commandInstance: this, ...smithyContext }, ...additionalContext }; const { requestHandler } = configuration; return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); } }; __name(Command, "Command"); ClassBuilder = class { _init = () => { }; _ep = {}; _middlewareFn = () => []; _commandName = ""; _clientName = ""; _additionalContext = {}; _smithyContext = {}; _inputFilterSensitiveLog = void 0; _outputFilterSensitiveLog = void 0; _serializer = null; _deserializer = null; _operationSchema; init(cb2) { this._init = cb2; } ep(endpointParameterInstructions) { this._ep = endpointParameterInstructions; return this; } m(middlewareSupplier) { this._middlewareFn = middlewareSupplier; return this; } s(service, operation2, smithyContext = {}) { this._smithyContext = { service, operation: operation2, ...smithyContext }; return this; } c(additionalContext = {}) { this._additionalContext = additionalContext; return this; } n(clientName, commandName) { this._clientName = clientName; this._commandName = commandName; return this; } f(inputFilter = (_) => _, outputFilter = (_) => _) { this._inputFilterSensitiveLog = inputFilter; this._outputFilterSensitiveLog = outputFilter; return this; } ser(serializer) { this._serializer = serializer; return this; } de(deserializer) { this._deserializer = deserializer; return this; } sc(operation2) { this._operationSchema = operation2; this._smithyContext.operationSchema = operation2; return this; } build() { const closure = this; let CommandRef; return CommandRef = /* @__PURE__ */ __name(class extends Command { input; static getEndpointParameterInstructions() { return closure._ep; } constructor(...[input]) { super(); this.input = input ?? {}; closure._init(this); this.schema = closure._operationSchema; } resolveMiddleware(stack, configuration, options) { const op = closure._operationSchema; const input = op?.[4] ?? op?.input; const output = op?.[5] ?? op?.output; return this.resolveMiddlewareWithContext(stack, configuration, options, { CommandCtor: CommandRef, middlewareFn: closure._middlewareFn, clientName: closure._clientName, commandName: closure._commandName, inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_) => _), outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_) => _), smithyContext: closure._smithyContext, additionalContext: closure._additionalContext }); } serialize = closure._serializer; deserialize = closure._deserializer; }, "CommandRef"); } }; __name(ClassBuilder, "ClassBuilder"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/constants.js var init_constants5 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js var createAggregatedClient; var init_create_aggregated_client = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); createAggregatedClient = /* @__PURE__ */ __name((commands2, Client2, options) => { for (const [command, CommandCtor] of Object.entries(commands2)) { const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb2) { const command2 = new CommandCtor(args); if (typeof optionsOrCb === "function") { this.send(command2, optionsOrCb); } else if (typeof cb2 === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expected http options but got ${typeof optionsOrCb}`); this.send(command2, optionsOrCb || {}, cb2); } else { return this.send(command2, optionsOrCb); } }, "methodImpl"); const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); Client2.prototype[methodName] = methodImpl; } const { paginators: paginators2 = {}, waiters: waiters2 = {} } = options ?? {}; for (const [paginatorName, paginatorFn] of Object.entries(paginators2)) { if (Client2.prototype[paginatorName] === void 0) { Client2.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) { return paginatorFn({ ...paginationConfiguration, client: this }, commandInput, ...rest); }; } } for (const [waiterName, waiterFn] of Object.entries(waiters2)) { if (Client2.prototype[waiterName] === void 0) { Client2.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) { let config3 = waiterConfiguration; if (typeof waiterConfiguration === "number") { config3 = { maxWaitTime: waiterConfiguration }; } return waiterFn({ ...config3, client: this }, commandInput, ...rest); }; } } }, "createAggregatedClient"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/exceptions.js var ServiceException, decorateServiceException; var init_exceptions = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/exceptions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ServiceException = class extends Error { $fault; $response; $retryable; $metadata; constructor(options) { super(options.message); Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype); this.name = options.name; this.$fault = options.$fault; this.$metadata = options.$metadata; } static isInstance(value) { if (!value) return false; const candidate = value; return ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server"); } static [Symbol.hasInstance](instance) { if (!instance) return false; const candidate = instance; if (this === ServiceException) { return ServiceException.isInstance(instance); } if (ServiceException.isInstance(instance)) { if (candidate.name && this.name) { return this.prototype.isPrototypeOf(instance) || candidate.name === this.name; } return this.prototype.isPrototypeOf(instance); } return false; } }; __name(ServiceException, "ServiceException"); decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => { Object.entries(additions).filter(([, v3]) => v3 !== void 0).forEach(([k2, v3]) => { if (exception[k2] == void 0 || exception[k2] === "") { exception[k2] = v3; } }); const message2 = exception.message || exception.Message || "UnknownError"; exception.message = message2; delete exception.Message; return exception; }, "decorateServiceException"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/default-error-handler.js var init_default_error_handler = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/default-error-handler.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/defaults-mode.js var loadConfigsForDefaultMode; var init_defaults_mode = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/defaults-mode.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => { switch (mode) { case "standard": return { retryMode: "standard", connectionTimeout: 3100 }; case "in-region": return { retryMode: "standard", connectionTimeout: 1100 }; case "cross-region": return { retryMode: "standard", connectionTimeout: 3100 }; case "mobile": return { retryMode: "standard", connectionTimeout: 3e4 }; default: return {}; } }, "loadConfigsForDefaultMode"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js var init_emitWarningIfUnsupportedVersion2 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js var init_extended_encode_uri_component2 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js var knownAlgorithms, getChecksumConfiguration, resolveChecksumRuntimeConfig; var init_checksum3 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es(); knownAlgorithms = Object.values(AlgorithmId); getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { const checksumAlgorithms = []; for (const id in AlgorithmId) { const algorithmId = AlgorithmId[id]; if (runtimeConfig[algorithmId] === void 0) { continue; } checksumAlgorithms.push({ algorithmId: () => algorithmId, checksumConstructor: () => runtimeConfig[algorithmId] }); } for (const [id, ChecksumCtor] of Object.entries(runtimeConfig.checksumAlgorithms ?? {})) { checksumAlgorithms.push({ algorithmId: () => id, checksumConstructor: () => ChecksumCtor }); } return { addChecksumAlgorithm(algo) { runtimeConfig.checksumAlgorithms = runtimeConfig.checksumAlgorithms ?? {}; const id = algo.algorithmId(); const ctor = algo.checksumConstructor(); if (knownAlgorithms.includes(id)) { runtimeConfig.checksumAlgorithms[id.toUpperCase()] = ctor; } else { runtimeConfig.checksumAlgorithms[id] = ctor; } checksumAlgorithms.push(algo); }, checksumAlgorithms() { return checksumAlgorithms; } }; }, "getChecksumConfiguration"); resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { const runtimeConfig = {}; clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { const id = checksumAlgorithm.algorithmId(); if (knownAlgorithms.includes(id)) { runtimeConfig[id] = checksumAlgorithm.checksumConstructor(); } }); return runtimeConfig; }, "resolveChecksumRuntimeConfig"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/extensions/retry.js var getRetryConfiguration, resolveRetryRuntimeConfig; var init_retry2 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/extensions/retry.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { return { setRetryStrategy(retryStrategy) { runtimeConfig.retryStrategy = retryStrategy; }, retryStrategy() { return runtimeConfig.retryStrategy; } }; }, "getRetryConfiguration"); resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => { const runtimeConfig = {}; runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); return runtimeConfig; }, "resolveRetryRuntimeConfig"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js var getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig; var init_defaultExtensionConfiguration2 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_checksum3(); init_retry2(); getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig)); }, "getDefaultExtensionConfiguration"); resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config3) => { return Object.assign(resolveChecksumRuntimeConfig(config3), resolveRetryRuntimeConfig(config3)); }, "resolveDefaultRuntimeConfig"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/extensions/index.js var init_extensions3 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/extensions/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_defaultExtensionConfiguration2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js var init_get_array_if_single_item = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js var getValueFromTextNode; var init_get_value_from_text_node = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getValueFromTextNode = /* @__PURE__ */ __name((obj) => { const textNodeName = "#text"; for (const key in obj) { if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { obj[key] = obj[key][textNodeName]; } else if (typeof obj[key] === "object" && obj[key] !== null) { obj[key] = getValueFromTextNode(obj[key]); } } return obj; }, "getValueFromTextNode"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js var init_is_serializable_header_value = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js var NoOpLogger; var init_NoOpLogger = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); NoOpLogger = class { trace() { } debug() { } info() { } warn() { } error() { } }; __name(NoOpLogger, "NoOpLogger"); } }); // ../../node_modules/@smithy/smithy-client/dist-es/object-mapping.js var init_object_mapping = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/object-mapping.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/resolve-path.js var init_resolve_path2 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/resolve-path.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/ser-utils.js var init_ser_utils = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/ser-utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/serde-json.js var init_serde_json = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/serde-json.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/smithy-client/dist-es/index.js var init_dist_es21 = __esm({ "../../node_modules/@smithy/smithy-client/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_client3(); init_collect_stream_body2(); init_command2(); init_constants5(); init_create_aggregated_client(); init_default_error_handler(); init_defaults_mode(); init_emitWarningIfUnsupportedVersion2(); init_exceptions(); init_extended_encode_uri_component2(); init_extensions3(); init_get_array_if_single_item(); init_get_value_from_text_node(); init_is_serializable_header_value(); init_NoOpLogger(); init_object_mapping(); init_resolve_path2(); init_ser_utils(); init_serde_json(); init_serde2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js var ProtocolLib; var init_ProtocolLib = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_dist_es21(); ProtocolLib = class { queryCompat; constructor(queryCompat = false) { this.queryCompat = queryCompat; } resolveRestContentType(defaultContentType, inputSchema) { const members = inputSchema.getMemberSchemas(); const httpPayloadMember = Object.values(members).find((m2) => { return !!m2.getMergedTraits().httpPayload; }); if (httpPayloadMember) { const mediaType = httpPayloadMember.getMergedTraits().mediaType; if (mediaType) { return mediaType; } else if (httpPayloadMember.isStringSchema()) { return "text/plain"; } else if (httpPayloadMember.isBlobSchema()) { return "application/octet-stream"; } else { return defaultContentType; } } else if (!inputSchema.isUnitSchema()) { const hasBody = Object.values(members).find((m2) => { const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m2.getMergedTraits(); const noPrefixHeaders = httpPrefixHeaders === void 0; return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; }); if (hasBody) { return defaultContentType; } } } async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) { let namespace = defaultNamespace; let errorName = errorIdentifier; if (errorIdentifier.includes("#")) { [namespace, errorName] = errorIdentifier.split("#"); } const errorMetadata = { $metadata: metadata, $fault: response.statusCode < 500 ? "client" : "server" }; const registry2 = TypeRegistry.for(namespace); try { const errorSchema = getErrorSchema?.(registry2, errorName) ?? registry2.getSchema(errorIdentifier); return { errorSchema, errorMetadata }; } catch (e2) { dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; const synthetic = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); const baseExceptionSchema = synthetic.getBaseException(); if (baseExceptionSchema) { const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error; throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject); } throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject); } } decorateServiceException(exception, additions = {}) { if (this.queryCompat) { const msg = exception.Message ?? additions.Message; const error50 = decorateServiceException(exception, additions); if (msg) { error50.message = msg; } error50.Error = { ...error50.Error, Type: error50.Error?.Type, Code: error50.Error?.Code, Message: error50.Error?.message ?? error50.Error?.Message ?? msg }; const reqId = error50.$metadata.requestId; if (reqId) { error50.RequestId = reqId; } return error50; } return decorateServiceException(exception, additions); } setQueryCompatError(output, response) { const queryErrorHeader = response.headers?.["x-amzn-query-error"]; if (output !== void 0 && queryErrorHeader != null) { const [Code, Type] = queryErrorHeader.split(";"); const entries = Object.entries(output); const Error2 = { Code, Type }; Object.assign(output, Error2); for (const [k2, v3] of entries) { Error2[k2 === "message" ? "Message" : k2] = v3; } delete Error2.__type; output.Error = Error2; } } queryCompatOutput(queryCompatErrorData, errorData) { if (queryCompatErrorData.Error) { errorData.Error = queryCompatErrorData.Error; } if (queryCompatErrorData.Type) { errorData.Type = queryCompatErrorData.Type; } if (queryCompatErrorData.Code) { errorData.Code = queryCompatErrorData.Code; } } findQueryCompatibleError(registry2, errorName) { try { return registry2.getSchema(errorName); } catch (e2) { return registry2.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName); } } }; __name(ProtocolLib, "ProtocolLib"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js var init_AwsSmithyRpcV2CborProtocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js var init_coercing_serializers = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js var SerdeContextConfig; var init_ConfigurableSerdeContext = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SerdeContextConfig = class { serdeContext; setSerdeContext(serdeContext) { this.serdeContext = serdeContext; } }; __name(SerdeContextConfig, "SerdeContextConfig"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js var UnionSerde; var init_UnionSerde = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); UnionSerde = class { from; to; keys; constructor(from, to) { this.from = from; this.to = to; this.keys = new Set(Object.keys(this.from).filter((k2) => k2 !== "__type")); } mark(key) { this.keys.delete(key); } hasUnknown() { return this.keys.size === 1 && Object.keys(this.to).length === 0; } writeUnknown() { if (this.hasUnknown()) { const k2 = this.keys.values().next().value; const v3 = this.from[k2]; this.to.$unknown = [k2, v3]; } } }; __name(UnionSerde, "UnionSerde"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js var init_parseJsonBody = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js var init_JsonShapeDeserializer = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js var init_JsonShapeSerializer = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js var init_JsonCodec = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js var init_AwsJsonRpcProtocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js var init_AwsJson1_0Protocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js var init_AwsJson1_1Protocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js var init_AwsRestJsonProtocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js var init_awsExpectUnion = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js function escapeAttribute(value) { return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); } var init_escape_attribute = __esm({ "../../node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(escapeAttribute, "escapeAttribute"); } }); // ../../node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js function escapeElement(value) { return value.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">").replace(/\r/g, " ").replace(/\n/g, " ").replace(/\u0085/g, "…").replace(/\u2028/, "
"); } var init_escape_element = __esm({ "../../node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(escapeElement, "escapeElement"); } }); // ../../node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js var XmlText; var init_XmlText = __esm({ "../../node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_escape_element(); XmlText = class { value; constructor(value) { this.value = value; } toString() { return escapeElement("" + this.value); } }; __name(XmlText, "XmlText"); } }); // ../../node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js var XmlNode; var init_XmlNode = __esm({ "../../node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_escape_attribute(); init_XmlText(); XmlNode = class { name; children; attributes = {}; static of(name, childText, withName) { const node = new XmlNode(name); if (childText !== void 0) { node.addChildNode(new XmlText(childText)); } if (withName !== void 0) { node.withName(withName); } return node; } constructor(name, children = []) { this.name = name; this.children = children; } withName(name) { this.name = name; return this; } addAttribute(name, value) { this.attributes[name] = value; return this; } addChildNode(child) { this.children.push(child); return this; } removeAttribute(name) { delete this.attributes[name]; return this; } n(name) { this.name = name; return this; } c(child) { this.children.push(child); return this; } a(name, value) { if (value != null) { this.attributes[name] = value; } return this; } cc(input, field, withName = field) { if (input[field] != null) { const node = XmlNode.of(field, input[field]).withName(withName); this.c(node); } } l(input, listName, memberName, valueProvider) { if (input[listName] != null) { const nodes = valueProvider(); nodes.map((node) => { node.withName(memberName); this.c(node); }); } } lc(input, listName, memberName, valueProvider) { if (input[listName] != null) { const nodes = valueProvider(); const containerNode = new XmlNode(memberName); nodes.map((node) => { containerNode.c(node); }); this.c(containerNode); } } toString() { const hasChildren2 = Boolean(this.children.length); let xmlText = `<${this.name}`; const attributes = this.attributes; for (const attributeName of Object.keys(attributes)) { const attribute = attributes[attributeName]; if (attribute != null) { xmlText += ` ${attributeName}="${escapeAttribute("" + attribute)}"`; } } return xmlText += !hasChildren2 ? "/>" : `>${this.children.map((c2) => c2.toString()).join("")}`; } }; __name(XmlNode, "XmlNode"); } }); // ../../node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.browser.js function parseXML(xmlString) { if (!parser) { parser = new DOMParser(); } const xmlDocument = parser.parseFromString(xmlString, "application/xml"); if (xmlDocument.getElementsByTagName("parsererror").length > 0) { throw new Error("DOMParser XML parsing error."); } const xmlToObj = /* @__PURE__ */ __name((node) => { if (node.nodeType === Node.TEXT_NODE) { if (node.textContent?.trim()) { return node.textContent; } } if (node.nodeType === Node.ELEMENT_NODE) { const element = node; if (element.attributes.length === 0 && element.childNodes.length === 0) { return ""; } const obj = {}; const attributes = Array.from(element.attributes); for (const attr of attributes) { obj[`${attr.name}`] = attr.value; } const childNodes = Array.from(element.childNodes); for (const child of childNodes) { const childResult = xmlToObj(child); if (childResult != null) { const childName = child.nodeName; if (childNodes.length === 1 && attributes.length === 0 && childName === "#text") { return childResult; } if (obj[childName]) { if (Array.isArray(obj[childName])) { obj[childName].push(childResult); } else { obj[childName] = [obj[childName], childResult]; } } else { obj[childName] = childResult; } } else if (childNodes.length === 1 && attributes.length === 0) { return element.textContent; } } return obj; } return null; }, "xmlToObj"); return { [xmlDocument.documentElement.nodeName]: xmlToObj(xmlDocument.documentElement) }; } var parser; var init_xml_parser_browser = __esm({ "../../node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(parseXML, "parseXML"); } }); // ../../node_modules/@aws-sdk/xml-builder/dist-es/index.js var init_dist_es22 = __esm({ "../../node_modules/@aws-sdk/xml-builder/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_XmlNode(); init_XmlText(); init_xml_parser_browser(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js var XmlShapeDeserializer; var init_XmlShapeDeserializer = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es22(); init_protocols(); init_schema3(); init_dist_es21(); init_dist_es5(); init_ConfigurableSerdeContext(); init_UnionSerde(); XmlShapeDeserializer = class extends SerdeContextConfig { settings; stringDeserializer; constructor(settings) { super(); this.settings = settings; this.stringDeserializer = new FromStringShapeDeserializer(settings); } setSerdeContext(serdeContext) { this.serdeContext = serdeContext; this.stringDeserializer.setSerdeContext(serdeContext); } read(schema, bytes, key) { const ns = NormalizedSchema.of(schema); const memberSchemas = ns.getMemberSchemas(); const isEventPayload = ns.isStructSchema() && ns.isMemberSchema() && !!Object.values(memberSchemas).find((memberNs) => { return !!memberNs.getMemberTraits().eventPayload; }); if (isEventPayload) { const output = {}; const memberName = Object.keys(memberSchemas)[0]; const eventMemberSchema = memberSchemas[memberName]; if (eventMemberSchema.isBlobSchema()) { output[memberName] = bytes; } else { output[memberName] = this.read(memberSchemas[memberName], bytes); } return output; } const xmlString = (this.serdeContext?.utf8Encoder ?? toUtf8)(bytes); const parsedObject = this.parseXml(xmlString); return this.readSchema(schema, key ? parsedObject[key] : parsedObject); } readSchema(_schema, value) { const ns = NormalizedSchema.of(_schema); if (ns.isUnitSchema()) { return; } const traits = ns.getMergedTraits(); if (ns.isListSchema() && !Array.isArray(value)) { return this.readSchema(ns, [value]); } if (value == null) { return value; } if (typeof value === "object") { const flat = !!traits.xmlFlattened; if (ns.isListSchema()) { const listValue = ns.getValueSchema(); const buffer2 = []; const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; const source = flat ? value : (value[0] ?? value)[sourceKey]; if (source == null) { return buffer2; } const sourceArray = Array.isArray(source) ? source : [source]; for (const v3 of sourceArray) { buffer2.push(this.readSchema(listValue, v3)); } return buffer2; } const buffer = {}; if (ns.isMapSchema()) { const keyNs = ns.getKeySchema(); const memberNs = ns.getValueSchema(); let entries; if (flat) { entries = Array.isArray(value) ? value : [value]; } else { entries = Array.isArray(value.entry) ? value.entry : [value.entry]; } const keyProperty = keyNs.getMergedTraits().xmlName ?? "key"; const valueProperty = memberNs.getMergedTraits().xmlName ?? "value"; for (const entry of entries) { const key = entry[keyProperty]; const value2 = entry[valueProperty]; buffer[key] = this.readSchema(memberNs, value2); } return buffer; } if (ns.isStructSchema()) { const union3 = ns.isUnionSchema(); let unionSerde; if (union3) { unionSerde = new UnionSerde(value, buffer); } for (const [memberName, memberSchema] of ns.structIterator()) { const memberTraits = memberSchema.getMergedTraits(); const xmlObjectKey = !memberTraits.httpPayload ? memberSchema.getMemberTraits().xmlName ?? memberName : memberTraits.xmlName ?? memberSchema.getName(); if (union3) { unionSerde.mark(xmlObjectKey); } if (value[xmlObjectKey] != null) { buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); } } if (union3) { unionSerde.writeUnknown(); } return buffer; } if (ns.isDocumentSchema()) { return value; } throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`); } if (ns.isListSchema()) { return []; } if (ns.isMapSchema() || ns.isStructSchema()) { return {}; } return this.stringDeserializer.read(ns, value); } parseXml(xml) { if (xml.length) { let parsedObj; try { parsedObj = parseXML(xml); } catch (e2) { if (e2 && typeof e2 === "object") { Object.defineProperty(e2, "$responseBodyText", { value: xml }); } throw e2; } const textNodeName = "#text"; const key = Object.keys(parsedObj)[0]; const parsedObjToReturn = parsedObj[key]; if (parsedObjToReturn[textNodeName]) { parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; delete parsedObjToReturn[textNodeName]; } return getValueFromTextNode(parsedObjToReturn); } return {}; } }; __name(XmlShapeDeserializer, "XmlShapeDeserializer"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js var init_QueryShapeSerializer = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js var init_AwsQueryProtocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js var init_AwsEc2QueryProtocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QuerySerializerSettings.js var init_QuerySerializerSettings = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QuerySerializerSettings.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js var loadRestXmlErrorCode; var init_parseXmlBody = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => { if (data?.Error?.Code !== void 0) { return data.Error.Code; } if (data?.Code !== void 0) { return data.Code; } if (output.statusCode == 404) { return "NotFound"; } }, "loadRestXmlErrorCode"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js var XmlShapeSerializer; var init_XmlShapeSerializer = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es22(); init_protocols(); init_schema3(); init_serde2(); init_dist_es21(); init_dist_es6(); init_ConfigurableSerdeContext(); XmlShapeSerializer = class extends SerdeContextConfig { settings; stringBuffer; byteBuffer; buffer; constructor(settings) { super(); this.settings = settings; } write(schema, value) { const ns = NormalizedSchema.of(schema); if (ns.isStringSchema() && typeof value === "string") { this.stringBuffer = value; } else if (ns.isBlobSchema()) { this.byteBuffer = "byteLength" in value ? value : (this.serdeContext?.base64Decoder ?? fromBase64)(value); } else { this.buffer = this.writeStruct(ns, value, void 0); const traits = ns.getMergedTraits(); if (traits.httpPayload && !traits.xmlName) { this.buffer.withName(ns.getName()); } } } flush() { if (this.byteBuffer !== void 0) { const bytes = this.byteBuffer; delete this.byteBuffer; return bytes; } if (this.stringBuffer !== void 0) { const str = this.stringBuffer; delete this.stringBuffer; return str; } const buffer = this.buffer; if (this.settings.xmlNamespace) { if (!buffer?.attributes?.["xmlns"]) { buffer.addAttribute("xmlns", this.settings.xmlNamespace); } } delete this.buffer; return buffer.toString(); } writeStruct(ns, value, parentXmlns) { const traits = ns.getMergedTraits(); const name = ns.isMemberSchema() && !traits.httpPayload ? ns.getMemberTraits().xmlName ?? ns.getMemberName() : traits.xmlName ?? ns.getName(); if (!name || !ns.isStructSchema()) { throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`); } const structXmlNode = XmlNode.of(name); const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); for (const [memberName, memberSchema] of ns.structIterator()) { const val = value[memberName]; if (val != null || memberSchema.isIdempotencyToken()) { if (memberSchema.getMergedTraits().xmlAttribute) { structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val)); continue; } if (memberSchema.isListSchema()) { this.writeList(memberSchema, val, structXmlNode, xmlns); } else if (memberSchema.isMapSchema()) { this.writeMap(memberSchema, val, structXmlNode, xmlns); } else if (memberSchema.isStructSchema()) { structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns)); } else { const memberNode = XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName()); this.writeSimpleInto(memberSchema, val, memberNode, xmlns); structXmlNode.addChildNode(memberNode); } } } const { $unknown } = value; if ($unknown && ns.isUnionSchema() && Array.isArray($unknown) && Object.keys(value).length === 1) { const [k2, v3] = $unknown; const node = XmlNode.of(k2); if (typeof v3 !== "string") { if (value instanceof XmlNode || value instanceof XmlText) { structXmlNode.addChildNode(value); } else { throw new Error(`@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`); } } this.writeSimpleInto(0, v3, node, xmlns); structXmlNode.addChildNode(node); } if (xmlns) { structXmlNode.addAttribute(xmlnsAttr, xmlns); } return structXmlNode; } writeList(listMember, array2, container, parentXmlns) { if (!listMember.isMemberSchema()) { throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`); } const listTraits = listMember.getMergedTraits(); const listValueSchema = listMember.getValueSchema(); const listValueTraits = listValueSchema.getMergedTraits(); const sparse = !!listValueTraits.sparse; const flat = !!listTraits.xmlFlattened; const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns); const writeItem = /* @__PURE__ */ __name((container2, value) => { if (listValueSchema.isListSchema()) { this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container2, xmlns); } else if (listValueSchema.isMapSchema()) { this.writeMap(listValueSchema, value, container2, xmlns); } else if (listValueSchema.isStructSchema()) { const struct = this.writeStruct(listValueSchema, value, xmlns); container2.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member")); } else { const listItemNode = XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"); this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns); container2.addChildNode(listItemNode); } }, "writeItem"); if (flat) { for (const value of array2) { if (sparse || value != null) { writeItem(container, value); } } } else { const listNode = XmlNode.of(listTraits.xmlName ?? listMember.getMemberName()); if (xmlns) { listNode.addAttribute(xmlnsAttr, xmlns); } for (const value of array2) { if (sparse || value != null) { writeItem(listNode, value); } } container.addChildNode(listNode); } } writeMap(mapMember, map2, container, parentXmlns, containerIsMap = false) { if (!mapMember.isMemberSchema()) { throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`); } const mapTraits = mapMember.getMergedTraits(); const mapKeySchema = mapMember.getKeySchema(); const mapKeyTraits = mapKeySchema.getMergedTraits(); const keyTag = mapKeyTraits.xmlName ?? "key"; const mapValueSchema = mapMember.getValueSchema(); const mapValueTraits = mapValueSchema.getMergedTraits(); const valueTag = mapValueTraits.xmlName ?? "value"; const sparse = !!mapValueTraits.sparse; const flat = !!mapTraits.xmlFlattened; const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns); const addKeyValue = /* @__PURE__ */ __name((entry, key, val) => { const keyNode = XmlNode.of(keyTag, key); const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns); if (keyXmlns) { keyNode.addAttribute(keyXmlnsAttr, keyXmlns); } entry.addChildNode(keyNode); let valueNode = XmlNode.of(valueTag); if (mapValueSchema.isListSchema()) { this.writeList(mapValueSchema, val, valueNode, xmlns); } else if (mapValueSchema.isMapSchema()) { this.writeMap(mapValueSchema, val, valueNode, xmlns, true); } else if (mapValueSchema.isStructSchema()) { valueNode = this.writeStruct(mapValueSchema, val, xmlns); } else { this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns); } entry.addChildNode(valueNode); }, "addKeyValue"); if (flat) { for (const [key, val] of Object.entries(map2)) { if (sparse || val != null) { const entry = XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); addKeyValue(entry, key, val); container.addChildNode(entry); } } } else { let mapNode; if (!containerIsMap) { mapNode = XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); if (xmlns) { mapNode.addAttribute(xmlnsAttr, xmlns); } container.addChildNode(mapNode); } for (const [key, val] of Object.entries(map2)) { if (sparse || val != null) { const entry = XmlNode.of("entry"); addKeyValue(entry, key, val); (containerIsMap ? container : mapNode).addChildNode(entry); } } } } writeSimple(_schema, value) { if (null === value) { throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value."); } const ns = NormalizedSchema.of(_schema); let nodeContents = null; if (value && typeof value === "object") { if (ns.isBlobSchema()) { nodeContents = (this.serdeContext?.base64Encoder ?? toBase64)(value); } else if (ns.isTimestampSchema() && value instanceof Date) { const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: nodeContents = value.toISOString().replace(".000Z", "Z"); break; case 6: nodeContents = dateToUtcString(value); break; case 7: nodeContents = String(value.getTime() / 1e3); break; default: console.warn("Missing timestamp format, using http date", value); nodeContents = dateToUtcString(value); break; } } else if (ns.isBigDecimalSchema() && value) { if (value instanceof NumericValue) { return value.string; } return String(value); } else if (ns.isMapSchema() || ns.isListSchema()) { throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."); } else { throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`); } } if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) { nodeContents = String(value); } if (ns.isStringSchema()) { if (value === void 0 && ns.isIdempotencyToken()) { nodeContents = v4(); } else { nodeContents = String(value); } } if (nodeContents === null) { throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`); } return nodeContents; } writeSimpleInto(_schema, value, into, parentXmlns) { const nodeContents = this.writeSimple(_schema, value); const ns = NormalizedSchema.of(_schema); const content = new XmlText(nodeContents); const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); if (xmlns) { into.addAttribute(xmlnsAttr, xmlns); } into.addChildNode(content); } getXmlnsAttribute(ns, parentXmlns) { const traits = ns.getMergedTraits(); const [prefix, xmlns] = traits.xmlNamespace ?? []; if (xmlns && xmlns !== parentXmlns) { return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns]; } return [void 0, void 0]; } }; __name(XmlShapeSerializer, "XmlShapeSerializer"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js var XmlCodec; var init_XmlCodec = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_ConfigurableSerdeContext(); init_XmlShapeDeserializer(); init_XmlShapeSerializer(); XmlCodec = class extends SerdeContextConfig { settings; constructor(settings) { super(); this.settings = settings; } createSerializer() { const serializer = new XmlShapeSerializer(this.settings); serializer.setSerdeContext(this.serdeContext); return serializer; } createDeserializer() { const deserializer = new XmlShapeDeserializer(this.settings); deserializer.setSerdeContext(this.serdeContext); return deserializer; } }; __name(XmlCodec, "XmlCodec"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js var AwsRestXmlProtocol; var init_AwsRestXmlProtocol = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_protocols(); init_schema3(); init_ProtocolLib(); init_parseXmlBody(); init_XmlCodec(); AwsRestXmlProtocol = class extends HttpBindingProtocol { codec; serializer; deserializer; mixin = new ProtocolLib(); constructor(options) { super(options); const settings = { timestampFormat: { useTrait: true, default: 5 }, httpBindings: true, xmlNamespace: options.xmlNamespace, serviceNamespace: options.defaultNamespace }; this.codec = new XmlCodec(settings); this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); } getPayloadCodec() { return this.codec; } getShapeId() { return "aws.protocols#restXml"; } async serializeRequest(operationSchema, input, context2) { const request = await super.serializeRequest(operationSchema, input, context2); const inputSchema = NormalizedSchema.of(operationSchema.input); if (!request.headers["content-type"]) { const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); if (contentType) { request.headers["content-type"] = contentType; } } if (typeof request.body === "string" && request.headers["content-type"] === this.getDefaultContentType() && !request.body.startsWith("' + request.body; } return request; } async deserializeResponse(operationSchema, context2, response) { return super.deserializeResponse(operationSchema, context2, response); } async handleError(operationSchema, context2, response, dataObject, metadata) { const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; if (dataObject.Error && typeof dataObject.Error === "object") { for (const key of Object.keys(dataObject.Error)) { dataObject[key] = dataObject.Error[key]; if (key.toLowerCase() === "message") { dataObject.message = dataObject.Error[key]; } } } if (dataObject.RequestId && !metadata.requestId) { metadata.requestId = dataObject.RequestId; } const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); const ns = NormalizedSchema.of(errorSchema); const message2 = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message2); await this.deserializeHttpMessage(errorSchema, context2, response, dataObject); const output = {}; for (const [name, member2] of ns.structIterator()) { const target = member2.getMergedTraits().xmlName ?? name; const value = dataObject.Error?.[target] ?? dataObject[target]; output[name] = this.codec.createDeserializer().readSchema(member2, value); } throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message: message2 }, output), dataObject); } getDefaultContentType() { return "application/xml"; } hasUnstructuredPayloadBinding(ns) { for (const [, member2] of ns.structIterator()) { if (member2.getMergedTraits().httpPayload) { return !(member2.isStructSchema() || member2.isMapSchema() || member2.isListSchema()); } } return false; } }; __name(AwsRestXmlProtocol, "AwsRestXmlProtocol"); } }); // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js var init_protocols2 = __esm({ "../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AwsSmithyRpcV2CborProtocol(); init_coercing_serializers(); init_AwsJson1_0Protocol(); init_AwsJson1_1Protocol(); init_AwsJsonRpcProtocol(); init_AwsRestJsonProtocol(); init_JsonCodec(); init_JsonShapeDeserializer(); init_JsonShapeSerializer(); init_awsExpectUnion(); init_parseJsonBody(); init_AwsEc2QueryProtocol(); init_AwsQueryProtocol(); init_QuerySerializerSettings(); init_QueryShapeSerializer(); init_AwsRestXmlProtocol(); init_XmlCodec(); init_XmlShapeDeserializer(); init_XmlShapeSerializer(); init_parseXmlBody(); } }); // ../../node_modules/@aws-sdk/core/dist-es/index.js var init_dist_es23 = __esm({ "../../node_modules/@aws-sdk/core/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_client2(); init_httpAuthSchemes2(); init_protocols2(); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmForRequest.js var getChecksumAlgorithmForRequest; var init_getChecksumAlgorithmForRequest = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmForRequest.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants3(); getChecksumAlgorithmForRequest = /* @__PURE__ */ __name((input, { requestChecksumRequired, requestAlgorithmMember, requestChecksumCalculation }) => { if (!requestAlgorithmMember) { return requestChecksumCalculation === RequestChecksumCalculation.WHEN_SUPPORTED || requestChecksumRequired ? DEFAULT_CHECKSUM_ALGORITHM : void 0; } if (!input[requestAlgorithmMember]) { return void 0; } const checksumAlgorithm = input[requestAlgorithmMember]; return checksumAlgorithm; }, "getChecksumAlgorithmForRequest"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumLocationName.js var getChecksumLocationName; var init_getChecksumLocationName = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumLocationName.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants3(); getChecksumLocationName = /* @__PURE__ */ __name((algorithm) => algorithm === ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`, "getChecksumLocationName"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeader.js var hasHeader2; var init_hasHeader = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeader.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); hasHeader2 = /* @__PURE__ */ __name((header, headers) => { const soughtHeader = header.toLowerCase(); for (const headerName of Object.keys(headers)) { if (soughtHeader === headerName.toLowerCase()) { return true; } } return false; }, "hasHeader"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeaderWithPrefix.js var hasHeaderWithPrefix; var init_hasHeaderWithPrefix = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeaderWithPrefix.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); hasHeaderWithPrefix = /* @__PURE__ */ __name((headerPrefix, headers) => { const soughtHeaderPrefix = headerPrefix.toLowerCase(); for (const headerName of Object.keys(headers)) { if (headerName.toLowerCase().startsWith(soughtHeaderPrefix)) { return true; } } return false; }, "hasHeaderWithPrefix"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isStreaming.js var isStreaming; var init_isStreaming = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isStreaming.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es17(); isStreaming = /* @__PURE__ */ __name((body) => body !== void 0 && typeof body !== "string" && !ArrayBuffer.isView(body) && !isArrayBuffer(body), "isStreaming"); } }); // ../../node_modules/tslib/tslib.es6.mjs function __awaiter(thisArg, _arguments, P2, generator) { function adopt(value) { return value instanceof P2 ? value : new P2(function(resolve) { resolve(value); }); } __name(adopt, "adopt"); return new (P2 || (P2 = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e2) { reject(e2); } } __name(fulfilled, "fulfilled"); function rejected(value) { try { step(generator["throw"](value)); } catch (e2) { reject(e2); } } __name(rejected, "rejected"); function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } __name(step, "step"); step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t9[0] & 1) throw t9[1]; return t9[1]; }, trys: [], ops: [] }, f2, y2, t9, g2 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g2.next = verb(0), g2["throw"] = verb(1), g2["return"] = verb(2), typeof Symbol === "function" && (g2[Symbol.iterator] = function() { return this; }), g2; function verb(n2) { return function(v3) { return step([n2, v3]); }; } __name(verb, "verb"); function step(op) { if (f2) throw new TypeError("Generator is already executing."); while (g2 && (g2 = 0, op[0] && (_ = 0)), _) try { if (f2 = 1, y2 && (t9 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t9 = y2["return"]) && t9.call(y2), 0) : y2.next) && !(t9 = t9.call(y2, op[1])).done) return t9; if (y2 = 0, t9) op = [op[0] & 2, t9.value]; switch (op[0]) { case 0: case 1: t9 = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y2 = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t9 = _.trys, t9 = t9.length > 0 && t9[t9.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t9 || op[1] > t9[0] && op[1] < t9[3])) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t9[1]) { _.label = t9[1]; t9 = op; break; } if (t9 && _.label < t9[2]) { _.label = t9[2]; _.ops.push(op); break; } if (t9[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e2) { op = [6, e2]; y2 = 0; } finally { f2 = t9 = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } __name(step, "step"); } function __values(o2) { var s2 = typeof Symbol === "function" && Symbol.iterator, m2 = s2 && o2[s2], i2 = 0; if (m2) return m2.call(o2); if (o2 && typeof o2.length === "number") return { next: function() { if (o2 && i2 >= o2.length) o2 = void 0; return { value: o2 && o2[i2++], done: !o2 }; } }; throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); } var init_tslib_es6 = __esm({ "../../node_modules/tslib/tslib.es6.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(__awaiter, "__awaiter"); __name(__generator, "__generator"); __name(__values, "__values"); } }); // ../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js var fromUtf82; var init_fromUtf8_browser2 = __esm({ "../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); fromUtf82 = /* @__PURE__ */ __name((input) => new TextEncoder().encode(input), "fromUtf8"); } }); // ../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js var init_toUint8Array2 = __esm({ "../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fromUtf8_browser2(); } }); // ../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js var init_toUtf8_browser2 = __esm({ "../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js var init_dist_es24 = __esm({ "../../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fromUtf8_browser2(); init_toUint8Array2(); init_toUtf8_browser2(); } }); // ../../node_modules/@aws-crypto/util/build/module/convertToBuffer.js function convertToBuffer(data) { if (data instanceof Uint8Array) return data; if (typeof data === "string") { return fromUtf83(data); } if (ArrayBuffer.isView(data)) { return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } return new Uint8Array(data); } var fromUtf83; var init_convertToBuffer = __esm({ "../../node_modules/@aws-crypto/util/build/module/convertToBuffer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es24(); fromUtf83 = typeof Buffer !== "undefined" && Buffer.from ? function(input) { return Buffer.from(input, "utf8"); } : fromUtf82; __name(convertToBuffer, "convertToBuffer"); } }); // ../../node_modules/@aws-crypto/util/build/module/isEmptyData.js function isEmptyData(data) { if (typeof data === "string") { return data.length === 0; } return data.byteLength === 0; } var init_isEmptyData = __esm({ "../../node_modules/@aws-crypto/util/build/module/isEmptyData.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(isEmptyData, "isEmptyData"); } }); // ../../node_modules/@aws-crypto/util/build/module/numToUint8.js function numToUint8(num) { return new Uint8Array([ (num & 4278190080) >> 24, (num & 16711680) >> 16, (num & 65280) >> 8, num & 255 ]); } var init_numToUint8 = __esm({ "../../node_modules/@aws-crypto/util/build/module/numToUint8.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(numToUint8, "numToUint8"); } }); // ../../node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js function uint32ArrayFrom(a_lookUpTable2) { if (!Uint32Array.from) { var return_array = new Uint32Array(a_lookUpTable2.length); var a_index = 0; while (a_index < a_lookUpTable2.length) { return_array[a_index] = a_lookUpTable2[a_index]; a_index += 1; } return return_array; } return Uint32Array.from(a_lookUpTable2); } var init_uint32ArrayFrom = __esm({ "../../node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(uint32ArrayFrom, "uint32ArrayFrom"); } }); // ../../node_modules/@aws-crypto/util/build/module/index.js var init_module = __esm({ "../../node_modules/@aws-crypto/util/build/module/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_convertToBuffer(); init_isEmptyData(); init_numToUint8(); init_uint32ArrayFrom(); } }); // ../../node_modules/@aws-crypto/crc32c/build/module/aws_crc32c.js var AwsCrc32c; var init_aws_crc32c = __esm({ "../../node_modules/@aws-crypto/crc32c/build/module/aws_crc32c.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tslib_es6(); init_module(); init_module2(); AwsCrc32c = /** @class */ function() { function AwsCrc32c2() { this.crc32c = new Crc32c(); } __name(AwsCrc32c2, "AwsCrc32c"); AwsCrc32c2.prototype.update = function(toHash) { if (isEmptyData(toHash)) return; this.crc32c.update(convertToBuffer(toHash)); }; AwsCrc32c2.prototype.digest = function() { return __awaiter(this, void 0, void 0, function() { return __generator(this, function(_a124) { return [2, numToUint8(this.crc32c.digest())]; }); }); }; AwsCrc32c2.prototype.reset = function() { this.crc32c = new Crc32c(); }; return AwsCrc32c2; }(); } }); // ../../node_modules/@aws-crypto/crc32c/build/module/index.js var Crc32c, a_lookupTable, lookupTable; var init_module2 = __esm({ "../../node_modules/@aws-crypto/crc32c/build/module/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tslib_es6(); init_module(); init_aws_crc32c(); Crc32c = /** @class */ function() { function Crc32c2() { this.checksum = 4294967295; } __name(Crc32c2, "Crc32c"); Crc32c2.prototype.update = function(data) { var e_1, _a124; try { for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) { var byte = data_1_1.value; this.checksum = this.checksum >>> 8 ^ lookupTable[(this.checksum ^ byte) & 255]; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (data_1_1 && !data_1_1.done && (_a124 = data_1.return)) _a124.call(data_1); } finally { if (e_1) throw e_1.error; } } return this; }; Crc32c2.prototype.digest = function() { return (this.checksum ^ 4294967295) >>> 0; }; return Crc32c2; }(); a_lookupTable = [ 0, 4067132163, 3778769143, 324072436, 3348797215, 904991772, 648144872, 3570033899, 2329499855, 2024987596, 1809983544, 2575936315, 1296289744, 3207089363, 2893594407, 1578318884, 274646895, 3795141740, 4049975192, 51262619, 3619967088, 632279923, 922689671, 3298075524, 2592579488, 1760304291, 2075979607, 2312596564, 1562183871, 2943781820, 3156637768, 1313733451, 549293790, 3537243613, 3246849577, 871202090, 3878099393, 357341890, 102525238, 4101499445, 2858735121, 1477399826, 1264559846, 3107202533, 1845379342, 2677391885, 2361733625, 2125378298, 820201905, 3263744690, 3520608582, 598981189, 4151959214, 85089709, 373468761, 3827903834, 3124367742, 1213305469, 1526817161, 2842354314, 2107672161, 2412447074, 2627466902, 1861252501, 1098587580, 3004210879, 2688576843, 1378610760, 2262928035, 1955203488, 1742404180, 2511436119, 3416409459, 969524848, 714683780, 3639785095, 205050476, 4266873199, 3976438427, 526918040, 1361435347, 2739821008, 2954799652, 1114974503, 2529119692, 1691668175, 2005155131, 2247081528, 3690758684, 697762079, 986182379, 3366744552, 476452099, 3993867776, 4250756596, 255256311, 1640403810, 2477592673, 2164122517, 1922457750, 2791048317, 1412925310, 1197962378, 3037525897, 3944729517, 427051182, 170179418, 4165941337, 746937522, 3740196785, 3451792453, 1070968646, 1905808397, 2213795598, 2426610938, 1657317369, 3053634322, 1147748369, 1463399397, 2773627110, 4215344322, 153784257, 444234805, 3893493558, 1021025245, 3467647198, 3722505002, 797665321, 2197175160, 1889384571, 1674398607, 2443626636, 1164749927, 3070701412, 2757221520, 1446797203, 137323447, 4198817972, 3910406976, 461344835, 3484808360, 1037989803, 781091935, 3705997148, 2460548119, 1623424788, 1939049696, 2180517859, 1429367560, 2807687179, 3020495871, 1180866812, 410100952, 3927582683, 4182430767, 186734380, 3756733383, 763408580, 1053836080, 3434856499, 2722870694, 1344288421, 1131464017, 2971354706, 1708204729, 2545590714, 2229949006, 1988219213, 680717673, 3673779818, 3383336350, 1002577565, 4010310262, 493091189, 238226049, 4233660802, 2987750089, 1082061258, 1395524158, 2705686845, 1972364758, 2279892693, 2494862625, 1725896226, 952904198, 3399985413, 3656866545, 731699698, 4283874585, 222117402, 510512622, 3959836397, 3280807620, 837199303, 582374963, 3504198960, 68661723, 4135334616, 3844915500, 390545967, 1230274059, 3141532936, 2825850620, 1510247935, 2395924756, 2091215383, 1878366691, 2644384480, 3553878443, 565732008, 854102364, 3229815391, 340358836, 3861050807, 4117890627, 119113024, 1493875044, 2875275879, 3090270611, 1247431312, 2660249211, 1828433272, 2141937292, 2378227087, 3811616794, 291187481, 34330861, 4032846830, 615137029, 3603020806, 3314634738, 939183345, 1776939221, 2609017814, 2295496738, 2058945313, 2926798794, 1545135305, 1330124605, 3173225534, 4084100981, 17165430, 307568514, 3762199681, 888469610, 3332340585, 3587147933, 665062302, 2042050490, 2346497209, 2559330125, 1793573966, 3190661285, 1279665062, 1595330642, 2910671697 ]; lookupTable = uint32ArrayFrom(a_lookupTable); } }); // ../../node_modules/@aws-sdk/crc64-nvme/dist-es/Crc64Nvme.js var generateCRC64NVMETable, CRC64_NVME_REVERSED_TABLE, t0, t1, t2, t3, t4, t5, t6, t7, ensureTablesInitialized, Crc64Nvme; var init_Crc64Nvme = __esm({ "../../node_modules/@aws-sdk/crc64-nvme/dist-es/Crc64Nvme.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); generateCRC64NVMETable = /* @__PURE__ */ __name(() => { const sliceLength = 8; const tables = new Array(sliceLength); for (let slice = 0; slice < sliceLength; slice++) { const table3 = new Array(512); for (let i2 = 0; i2 < 256; i2++) { let crc = BigInt(i2); for (let j2 = 0; j2 < 8 * (slice + 1); j2++) { if (crc & 1n) { crc = crc >> 1n ^ 0x9a6c9329ac4bc9b5n; } else { crc = crc >> 1n; } } table3[i2 * 2] = Number(crc >> 32n & 0xffffffffn); table3[i2 * 2 + 1] = Number(crc & 0xffffffffn); } tables[slice] = new Uint32Array(table3); } return tables; }, "generateCRC64NVMETable"); ensureTablesInitialized = /* @__PURE__ */ __name(() => { if (!CRC64_NVME_REVERSED_TABLE) { CRC64_NVME_REVERSED_TABLE = generateCRC64NVMETable(); [t0, t1, t2, t3, t4, t5, t6, t7] = CRC64_NVME_REVERSED_TABLE; } }, "ensureTablesInitialized"); Crc64Nvme = class { c1 = 0; c2 = 0; constructor() { ensureTablesInitialized(); this.reset(); } update(data) { const len = data.length; let i2 = 0; let crc1 = this.c1; let crc2 = this.c2; while (i2 + 8 <= len) { const idx0 = ((crc2 ^ data[i2++]) & 255) << 1; const idx1 = ((crc2 >>> 8 ^ data[i2++]) & 255) << 1; const idx2 = ((crc2 >>> 16 ^ data[i2++]) & 255) << 1; const idx3 = ((crc2 >>> 24 ^ data[i2++]) & 255) << 1; const idx4 = ((crc1 ^ data[i2++]) & 255) << 1; const idx5 = ((crc1 >>> 8 ^ data[i2++]) & 255) << 1; const idx6 = ((crc1 >>> 16 ^ data[i2++]) & 255) << 1; const idx7 = ((crc1 >>> 24 ^ data[i2++]) & 255) << 1; crc1 = t7[idx0] ^ t6[idx1] ^ t5[idx2] ^ t4[idx3] ^ t3[idx4] ^ t2[idx5] ^ t1[idx6] ^ t0[idx7]; crc2 = t7[idx0 + 1] ^ t6[idx1 + 1] ^ t5[idx2 + 1] ^ t4[idx3 + 1] ^ t3[idx4 + 1] ^ t2[idx5 + 1] ^ t1[idx6 + 1] ^ t0[idx7 + 1]; } while (i2 < len) { const idx = ((crc2 ^ data[i2]) & 255) << 1; crc2 = (crc2 >>> 8 | (crc1 & 255) << 24) >>> 0; crc1 = crc1 >>> 8 ^ t0[idx]; crc2 ^= t0[idx + 1]; i2++; } this.c1 = crc1; this.c2 = crc2; } async digest() { const c1 = this.c1 ^ 4294967295; const c2 = this.c2 ^ 4294967295; return new Uint8Array([ c1 >>> 24, c1 >>> 16 & 255, c1 >>> 8 & 255, c1 & 255, c2 >>> 24, c2 >>> 16 & 255, c2 >>> 8 & 255, c2 & 255 ]); } reset() { this.c1 = 4294967295; this.c2 = 4294967295; } }; __name(Crc64Nvme, "Crc64Nvme"); } }); // ../../node_modules/@aws-sdk/crc64-nvme/dist-es/crc64-nvme-crt-container.js var crc64NvmeCrtContainer; var init_crc64_nvme_crt_container = __esm({ "../../node_modules/@aws-sdk/crc64-nvme/dist-es/crc64-nvme-crt-container.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); crc64NvmeCrtContainer = { CrtCrc64Nvme: null }; } }); // ../../node_modules/@aws-sdk/crc64-nvme/dist-es/index.js var init_dist_es25 = __esm({ "../../node_modules/@aws-sdk/crc64-nvme/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Crc64Nvme(); init_crc64_nvme_crt_container(); } }); // ../../node_modules/@aws-crypto/crc32/build/module/aws_crc32.js var AwsCrc32; var init_aws_crc32 = __esm({ "../../node_modules/@aws-crypto/crc32/build/module/aws_crc32.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tslib_es6(); init_module(); init_module3(); AwsCrc32 = /** @class */ function() { function AwsCrc322() { this.crc32 = new Crc32(); } __name(AwsCrc322, "AwsCrc32"); AwsCrc322.prototype.update = function(toHash) { if (isEmptyData(toHash)) return; this.crc32.update(convertToBuffer(toHash)); }; AwsCrc322.prototype.digest = function() { return __awaiter(this, void 0, void 0, function() { return __generator(this, function(_a124) { return [2, numToUint8(this.crc32.digest())]; }); }); }; AwsCrc322.prototype.reset = function() { this.crc32 = new Crc32(); }; return AwsCrc322; }(); } }); // ../../node_modules/@aws-crypto/crc32/build/module/index.js var Crc32, a_lookUpTable, lookupTable2; var init_module3 = __esm({ "../../node_modules/@aws-crypto/crc32/build/module/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tslib_es6(); init_module(); init_aws_crc32(); Crc32 = /** @class */ function() { function Crc322() { this.checksum = 4294967295; } __name(Crc322, "Crc32"); Crc322.prototype.update = function(data) { var e_1, _a124; try { for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) { var byte = data_1_1.value; this.checksum = this.checksum >>> 8 ^ lookupTable2[(this.checksum ^ byte) & 255]; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (data_1_1 && !data_1_1.done && (_a124 = data_1.return)) _a124.call(data_1); } finally { if (e_1) throw e_1.error; } } return this; }; Crc322.prototype.digest = function() { return (this.checksum ^ 4294967295) >>> 0; }; return Crc322; }(); a_lookUpTable = [ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ]; lookupTable2 = uint32ArrayFrom(a_lookUpTable); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getCrc32ChecksumAlgorithmFunction.browser.js var getCrc32ChecksumAlgorithmFunction; var init_getCrc32ChecksumAlgorithmFunction_browser = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getCrc32ChecksumAlgorithmFunction.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_module3(); getCrc32ChecksumAlgorithmFunction = /* @__PURE__ */ __name(() => AwsCrc32, "getCrc32ChecksumAlgorithmFunction"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/types.js var CLIENT_SUPPORTED_ALGORITHMS, PRIORITY_ORDER_ALGORITHMS; var init_types2 = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants3(); CLIENT_SUPPORTED_ALGORITHMS = [ ChecksumAlgorithm.CRC32, ChecksumAlgorithm.CRC32C, ChecksumAlgorithm.CRC64NVME, ChecksumAlgorithm.SHA1, ChecksumAlgorithm.SHA256 ]; PRIORITY_ORDER_ALGORITHMS = [ ChecksumAlgorithm.SHA256, ChecksumAlgorithm.SHA1, ChecksumAlgorithm.CRC32, ChecksumAlgorithm.CRC32C, ChecksumAlgorithm.CRC64NVME ]; } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/selectChecksumAlgorithmFunction.js var selectChecksumAlgorithmFunction; var init_selectChecksumAlgorithmFunction = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/selectChecksumAlgorithmFunction.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_module2(); init_dist_es25(); init_constants3(); init_getCrc32ChecksumAlgorithmFunction_browser(); init_types2(); selectChecksumAlgorithmFunction = /* @__PURE__ */ __name((checksumAlgorithm, config3) => { const { checksumAlgorithms = {} } = config3; switch (checksumAlgorithm) { case ChecksumAlgorithm.MD5: return checksumAlgorithms?.MD5 ?? config3.md5; case ChecksumAlgorithm.CRC32: return checksumAlgorithms?.CRC32 ?? getCrc32ChecksumAlgorithmFunction(); case ChecksumAlgorithm.CRC32C: return checksumAlgorithms?.CRC32C ?? AwsCrc32c; case ChecksumAlgorithm.CRC64NVME: if (typeof crc64NvmeCrtContainer.CrtCrc64Nvme !== "function") { return checksumAlgorithms?.CRC64NVME ?? Crc64Nvme; } return checksumAlgorithms?.CRC64NVME ?? crc64NvmeCrtContainer.CrtCrc64Nvme; case ChecksumAlgorithm.SHA1: return checksumAlgorithms?.SHA1 ?? config3.sha1; case ChecksumAlgorithm.SHA256: return checksumAlgorithms?.SHA256 ?? config3.sha256; default: if (checksumAlgorithms?.[checksumAlgorithm]) { return checksumAlgorithms[checksumAlgorithm]; } throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client. Select one of ${CLIENT_SUPPORTED_ALGORITHMS}, or provide an implementation to the client constructor checksums field.`); } }, "selectChecksumAlgorithmFunction"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/stringHasher.js var stringHasher; var init_stringHasher = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/stringHasher.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es5(); stringHasher = /* @__PURE__ */ __name((checksumAlgorithmFn, body) => { const hash4 = new checksumAlgorithmFn(); hash4.update(toUint8Array(body || "")); return hash4.digest(); }, "stringHasher"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsMiddleware.js var flexibleChecksumsMiddlewareOptions, flexibleChecksumsMiddleware; var init_flexibleChecksumsMiddleware = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es23(); init_dist_es2(); init_dist_es11(); init_constants3(); init_getChecksumAlgorithmForRequest(); init_getChecksumLocationName(); init_hasHeader(); init_hasHeaderWithPrefix(); init_isStreaming(); init_selectChecksumAlgorithmFunction(); init_stringHasher(); flexibleChecksumsMiddlewareOptions = { name: "flexibleChecksumsMiddleware", step: "build", tags: ["BODY_CHECKSUM"], override: true }; flexibleChecksumsMiddleware = /* @__PURE__ */ __name((config3, middlewareConfig) => (next, context2) => async (args) => { if (!HttpRequest.isInstance(args.request)) { return next(args); } if (hasHeaderWithPrefix("x-amz-checksum-", args.request.headers)) { return next(args); } const { request, input } = args; const { body: requestBody, headers } = request; const { base64Encoder, streamHasher } = config3; const { requestChecksumRequired, requestAlgorithmMember } = middlewareConfig; const requestChecksumCalculation = await config3.requestChecksumCalculation(); const requestAlgorithmMemberName = requestAlgorithmMember?.name; const requestAlgorithmMemberHttpHeader = requestAlgorithmMember?.httpHeader; if (requestAlgorithmMemberName && !input[requestAlgorithmMemberName]) { if (requestChecksumCalculation === RequestChecksumCalculation.WHEN_SUPPORTED || requestChecksumRequired) { input[requestAlgorithmMemberName] = DEFAULT_CHECKSUM_ALGORITHM; if (requestAlgorithmMemberHttpHeader) { headers[requestAlgorithmMemberHttpHeader] = DEFAULT_CHECKSUM_ALGORITHM; } } } const checksumAlgorithm = getChecksumAlgorithmForRequest(input, { requestChecksumRequired, requestAlgorithmMember: requestAlgorithmMember?.name, requestChecksumCalculation }); let updatedBody = requestBody; let updatedHeaders = headers; if (checksumAlgorithm) { switch (checksumAlgorithm) { case ChecksumAlgorithm.CRC32: setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_CRC32", "U"); break; case ChecksumAlgorithm.CRC32C: setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_CRC32C", "V"); break; case ChecksumAlgorithm.CRC64NVME: setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_CRC64", "W"); break; case ChecksumAlgorithm.SHA1: setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_SHA1", "X"); break; case ChecksumAlgorithm.SHA256: setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_SHA256", "Y"); break; } const checksumLocationName = getChecksumLocationName(checksumAlgorithm); const checksumAlgorithmFn = selectChecksumAlgorithmFunction(checksumAlgorithm, config3); if (isStreaming(requestBody)) { const { getAwsChunkedEncodingStream: getAwsChunkedEncodingStream2, bodyLengthChecker } = config3; updatedBody = getAwsChunkedEncodingStream2(typeof config3.requestStreamBufferSize === "number" && config3.requestStreamBufferSize >= 8 * 1024 ? createBufferedReadable(requestBody, config3.requestStreamBufferSize, context2.logger) : requestBody, { base64Encoder, bodyLengthChecker, checksumLocationName, checksumAlgorithmFn, streamHasher }); updatedHeaders = { ...headers, "content-encoding": headers["content-encoding"] ? `${headers["content-encoding"]},aws-chunked` : "aws-chunked", "transfer-encoding": "chunked", "x-amz-decoded-content-length": headers["content-length"], "x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER", "x-amz-trailer": checksumLocationName }; delete updatedHeaders["content-length"]; } else if (!hasHeader2(checksumLocationName, headers)) { const rawChecksum = await stringHasher(checksumAlgorithmFn, requestBody); updatedHeaders = { ...headers, [checksumLocationName]: base64Encoder(rawChecksum) }; } } try { const result = await next({ ...args, request: { ...request, headers: updatedHeaders, body: updatedBody } }); return result; } catch (e2) { if (e2 instanceof Error && e2.name === "InvalidChunkSizeError") { try { if (!e2.message.endsWith(".")) { e2.message += "."; } e2.message += " Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."; } catch (ignored) { } } throw e2; } }, "flexibleChecksumsMiddleware"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsInputMiddleware.js var flexibleChecksumsInputMiddlewareOptions, flexibleChecksumsInputMiddleware; var init_flexibleChecksumsInputMiddleware = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsInputMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es23(); init_constants3(); flexibleChecksumsInputMiddlewareOptions = { name: "flexibleChecksumsInputMiddleware", toMiddleware: "serializerMiddleware", relation: "before", tags: ["BODY_CHECKSUM"], override: true }; flexibleChecksumsInputMiddleware = /* @__PURE__ */ __name((config3, middlewareConfig) => (next, context2) => async (args) => { const input = args.input; const { requestValidationModeMember } = middlewareConfig; const requestChecksumCalculation = await config3.requestChecksumCalculation(); const responseChecksumValidation = await config3.responseChecksumValidation(); switch (requestChecksumCalculation) { case RequestChecksumCalculation.WHEN_REQUIRED: setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED", "a"); break; case RequestChecksumCalculation.WHEN_SUPPORTED: setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED", "Z"); break; } switch (responseChecksumValidation) { case ResponseChecksumValidation.WHEN_REQUIRED: setFeature(context2, "FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED", "c"); break; case ResponseChecksumValidation.WHEN_SUPPORTED: setFeature(context2, "FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED", "b"); break; } if (requestValidationModeMember && !input[requestValidationModeMember]) { if (responseChecksumValidation === ResponseChecksumValidation.WHEN_SUPPORTED) { input[requestValidationModeMember] = "ENABLED"; } } return next(args); }, "flexibleChecksumsInputMiddleware"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmListForResponse.js var getChecksumAlgorithmListForResponse; var init_getChecksumAlgorithmListForResponse = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmListForResponse.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types2(); getChecksumAlgorithmListForResponse = /* @__PURE__ */ __name((responseAlgorithms = []) => { const validChecksumAlgorithms = []; for (const algorithm of PRIORITY_ORDER_ALGORITHMS) { if (!responseAlgorithms.includes(algorithm) || !CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) { continue; } validChecksumAlgorithms.push(algorithm); } return validChecksumAlgorithms; }, "getChecksumAlgorithmListForResponse"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isChecksumWithPartNumber.js var isChecksumWithPartNumber; var init_isChecksumWithPartNumber = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isChecksumWithPartNumber.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isChecksumWithPartNumber = /* @__PURE__ */ __name((checksum) => { const lastHyphenIndex = checksum.lastIndexOf("-"); if (lastHyphenIndex !== -1) { const numberPart = checksum.slice(lastHyphenIndex + 1); if (!numberPart.startsWith("0")) { const number4 = parseInt(numberPart, 10); if (!isNaN(number4) && number4 >= 1 && number4 <= 1e4) { return true; } } } return false; }, "isChecksumWithPartNumber"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksum.js var getChecksum; var init_getChecksum = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksum.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_stringHasher(); getChecksum = /* @__PURE__ */ __name(async (body, { checksumAlgorithmFn, base64Encoder }) => base64Encoder(await stringHasher(checksumAlgorithmFn, body)), "getChecksum"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js var validateChecksumFromResponse; var init_validateChecksumFromResponse = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es11(); init_constants3(); init_getChecksum(); init_getChecksumAlgorithmListForResponse(); init_getChecksumLocationName(); init_isStreaming(); init_selectChecksumAlgorithmFunction(); validateChecksumFromResponse = /* @__PURE__ */ __name(async (response, { config: config3, responseAlgorithms, logger: logger3 }) => { const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms); const { body: responseBody, headers: responseHeaders } = response; for (const algorithm of checksumAlgorithms) { const responseHeader = getChecksumLocationName(algorithm); const checksumFromResponse = responseHeaders[responseHeader]; if (checksumFromResponse) { let checksumAlgorithmFn; try { checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config3); } catch (error50) { if (algorithm === ChecksumAlgorithm.CRC64NVME) { logger3?.warn(`Skipping ${ChecksumAlgorithm.CRC64NVME} checksum validation: ${error50.message}`); continue; } throw error50; } const { base64Encoder } = config3; if (isStreaming(responseBody)) { response.body = createChecksumStream({ expectedChecksum: checksumFromResponse, checksumSourceLocation: responseHeader, checksum: new checksumAlgorithmFn(), source: responseBody, base64Encoder }); return; } const checksum = await getChecksum(responseBody, { checksumAlgorithmFn, base64Encoder }); if (checksum === checksumFromResponse) { break; } throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}" in response header "${responseHeader}".`); } } }, "validateChecksumFromResponse"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsResponseMiddleware.js var flexibleChecksumsResponseMiddlewareOptions, flexibleChecksumsResponseMiddleware; var init_flexibleChecksumsResponseMiddleware = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsResponseMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_getChecksumAlgorithmListForResponse(); init_getChecksumLocationName(); init_isChecksumWithPartNumber(); init_validateChecksumFromResponse(); flexibleChecksumsResponseMiddlewareOptions = { name: "flexibleChecksumsResponseMiddleware", toMiddleware: "deserializerMiddleware", relation: "after", tags: ["BODY_CHECKSUM"], override: true }; flexibleChecksumsResponseMiddleware = /* @__PURE__ */ __name((config3, middlewareConfig) => (next, context2) => async (args) => { if (!HttpRequest.isInstance(args.request)) { return next(args); } const input = args.input; const result = await next(args); const response = result.response; const { requestValidationModeMember, responseAlgorithms } = middlewareConfig; if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") { const { clientName, commandName } = context2; const isS3WholeObjectMultipartGetResponseChecksum = clientName === "S3Client" && commandName === "GetObjectCommand" && getChecksumAlgorithmListForResponse(responseAlgorithms).every((algorithm) => { const responseHeader = getChecksumLocationName(algorithm); const checksumFromResponse = response.headers[responseHeader]; return !checksumFromResponse || isChecksumWithPartNumber(checksumFromResponse); }); if (isS3WholeObjectMultipartGetResponseChecksum) { return result; } await validateChecksumFromResponse(response, { config: config3, responseAlgorithms, logger: context2.logger }); } return result; }, "flexibleChecksumsResponseMiddleware"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getFlexibleChecksumsPlugin.js var getFlexibleChecksumsPlugin; var init_getFlexibleChecksumsPlugin = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getFlexibleChecksumsPlugin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_flexibleChecksumsInputMiddleware(); init_flexibleChecksumsMiddleware(); init_flexibleChecksumsResponseMiddleware(); getFlexibleChecksumsPlugin = /* @__PURE__ */ __name((config3, middlewareConfig) => ({ applyToStack: (clientStack) => { clientStack.add(flexibleChecksumsMiddleware(config3, middlewareConfig), flexibleChecksumsMiddlewareOptions); clientStack.addRelativeTo(flexibleChecksumsInputMiddleware(config3, middlewareConfig), flexibleChecksumsInputMiddlewareOptions); clientStack.addRelativeTo(flexibleChecksumsResponseMiddleware(config3, middlewareConfig), flexibleChecksumsResponseMiddlewareOptions); } }), "getFlexibleChecksumsPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/resolveFlexibleChecksumsConfig.js var resolveFlexibleChecksumsConfig; var init_resolveFlexibleChecksumsConfig = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/resolveFlexibleChecksumsConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es4(); init_constants3(); resolveFlexibleChecksumsConfig = /* @__PURE__ */ __name((input) => { const { requestChecksumCalculation, responseChecksumValidation, requestStreamBufferSize } = input; return Object.assign(input, { requestChecksumCalculation: normalizeProvider(requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION), responseChecksumValidation: normalizeProvider(responseChecksumValidation ?? DEFAULT_RESPONSE_CHECKSUM_VALIDATION), requestStreamBufferSize: Number(requestStreamBufferSize ?? 0), checksumAlgorithms: input.checksumAlgorithms ?? {} }); }, "resolveFlexibleChecksumsConfig"); } }); // ../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/index.js var init_dist_es26 = __esm({ "../../node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS(); init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS(); init_constants3(); init_flexibleChecksumsMiddleware(); init_getFlexibleChecksumsPlugin(); init_resolveFlexibleChecksumsConfig(); } }); // ../../node_modules/@aws-sdk/middleware-host-header/dist-es/index.js function resolveHostHeaderConfig(input) { return input; } var hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin; var init_dist_es27 = __esm({ "../../node_modules/@aws-sdk/middleware-host-header/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); __name(resolveHostHeaderConfig, "resolveHostHeaderConfig"); hostHeaderMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => { if (!HttpRequest.isInstance(args.request)) return next(args); const { request } = args; const { handlerProtocol = "" } = options.requestHandler.metadata || {}; if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { delete request.headers["host"]; request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); } else if (!request.headers["host"]) { let host = request.hostname; if (request.port != null) host += `:${request.port}`; request.headers["host"] = host; } return next(args); }, "hostHeaderMiddleware"); hostHeaderMiddlewareOptions = { name: "hostHeaderMiddleware", step: "build", priority: "low", tags: ["HOST"], override: true }; getHostHeaderPlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); } }), "getHostHeaderPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js var loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin; var init_loggerMiddleware = __esm({ "../../node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); loggerMiddleware = /* @__PURE__ */ __name(() => (next, context2) => async (args) => { try { const response = await next(args); const { clientName, commandName, logger: logger3, dynamoDbDocumentClientOptions = {} } = context2; const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context2.inputFilterSensitiveLog; const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context2.outputFilterSensitiveLog; const { $metadata, ...outputWithoutMetadata } = response.output; logger3?.info?.({ clientName, commandName, input: inputFilterSensitiveLog(args.input), output: outputFilterSensitiveLog(outputWithoutMetadata), metadata: $metadata }); return response; } catch (error50) { const { clientName, commandName, logger: logger3, dynamoDbDocumentClientOptions = {} } = context2; const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context2.inputFilterSensitiveLog; logger3?.error?.({ clientName, commandName, input: inputFilterSensitiveLog(args.input), error: error50, metadata: error50.$metadata }); throw error50; } }, "loggerMiddleware"); loggerMiddlewareOptions = { name: "loggerMiddleware", tags: ["LOGGER"], step: "initialize", override: true }; getLoggerPlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); } }), "getLoggerPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-logger/dist-es/index.js var init_dist_es28 = __esm({ "../../node_modules/@aws-sdk/middleware-logger/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_loggerMiddleware(); } }); // ../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/configuration.js var recursionDetectionMiddlewareOptions; var init_configuration = __esm({ "../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/configuration.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); recursionDetectionMiddlewareOptions = { step: "build", tags: ["RECURSION_DETECTION"], name: "recursionDetectionMiddleware", override: true, priority: "low" }; } }); // ../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/recursionDetectionMiddleware.browser.js var recursionDetectionMiddleware; var init_recursionDetectionMiddleware_browser = __esm({ "../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/recursionDetectionMiddleware.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); recursionDetectionMiddleware = /* @__PURE__ */ __name(() => (next) => async (args) => next(args), "recursionDetectionMiddleware"); } }); // ../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/getRecursionDetectionPlugin.js var getRecursionDetectionPlugin; var init_getRecursionDetectionPlugin = __esm({ "../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/getRecursionDetectionPlugin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_configuration(); init_recursionDetectionMiddleware_browser(); getRecursionDetectionPlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); } }), "getRecursionDetectionPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js var init_dist_es29 = __esm({ "../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getRecursionDetectionPlugin(); init_recursionDetectionMiddleware_browser(); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/check-content-length-header.js function checkContentLengthHeader() { return (next, context2) => async (args) => { const { request } = args; if (HttpRequest.isInstance(request)) { if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) { const message2 = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`; if (typeof context2?.logger?.warn === "function" && !(context2.logger instanceof NoOpLogger)) { context2.logger.warn(message2); } else { console.warn(message2); } } } return next({ ...args }); }; } var CONTENT_LENGTH_HEADER, DECODED_CONTENT_LENGTH_HEADER, checkContentLengthHeaderMiddlewareOptions, getCheckContentLengthHeaderPlugin; var init_check_content_length_header = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/check-content-length-header.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_dist_es21(); CONTENT_LENGTH_HEADER = "content-length"; DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length"; __name(checkContentLengthHeader, "checkContentLengthHeader"); checkContentLengthHeaderMiddlewareOptions = { step: "finalizeRequest", tags: ["CHECK_CONTENT_LENGTH_HEADER"], name: "getCheckContentLengthHeaderPlugin", override: true }; getCheckContentLengthHeaderPlugin = /* @__PURE__ */ __name((unused) => ({ applyToStack: (clientStack) => { clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions); } }), "getCheckContentLengthHeaderPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js var regionRedirectEndpointMiddleware, regionRedirectEndpointMiddlewareOptions; var init_region_redirect_endpoint_middleware = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); regionRedirectEndpointMiddleware = /* @__PURE__ */ __name((config3) => { return (next, context2) => async (args) => { const originalRegion = await config3.region(); const regionProviderRef = config3.region; let unlock = /* @__PURE__ */ __name(() => { }, "unlock"); if (context2.__s3RegionRedirect) { Object.defineProperty(config3, "region", { writable: false, value: async () => { return context2.__s3RegionRedirect; } }); unlock = /* @__PURE__ */ __name(() => Object.defineProperty(config3, "region", { writable: true, value: regionProviderRef }), "unlock"); } try { const result = await next(args); if (context2.__s3RegionRedirect) { unlock(); const region = await config3.region(); if (originalRegion !== region) { throw new Error("Region was not restored following S3 region redirect."); } } return result; } catch (e2) { unlock(); throw e2; } }; }, "regionRedirectEndpointMiddleware"); regionRedirectEndpointMiddlewareOptions = { tags: ["REGION_REDIRECT", "S3"], name: "regionRedirectEndpointMiddleware", override: true, relation: "before", toMiddleware: "endpointV2Middleware" }; } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-middleware.js function regionRedirectMiddleware(clientConfig) { return (next, context2) => async (args) => { try { return await next(args); } catch (err) { if (clientConfig.followRegionRedirects) { const statusCode = err?.$metadata?.httpStatusCode; const isHeadBucket = context2.commandName === "HeadBucketCommand"; const bucketRegionHeader = err?.$response?.headers?.["x-amz-bucket-region"]; if (bucketRegionHeader) { if (statusCode === 301 || statusCode === 400 && (err?.name === "IllegalLocationConstraintException" || isHeadBucket)) { try { const actualRegion = bucketRegionHeader; context2.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`); context2.__s3RegionRedirect = actualRegion; } catch (e2) { throw new Error("Region redirect failed: " + e2); } return next(args); } } } throw err; } }; } var regionRedirectMiddlewareOptions, getRegionRedirectMiddlewarePlugin; var init_region_redirect_middleware = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-middleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_region_redirect_endpoint_middleware(); __name(regionRedirectMiddleware, "regionRedirectMiddleware"); regionRedirectMiddlewareOptions = { step: "initialize", tags: ["REGION_REDIRECT", "S3"], name: "regionRedirectMiddleware", override: true }; getRegionRedirectMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) => ({ applyToStack: (clientStack) => { clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions); clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions); } }), "getRegionRedirectMiddlewarePlugin"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-expires-middleware.js var s3ExpiresMiddleware, s3ExpiresMiddlewareOptions, getS3ExpiresMiddlewarePlugin; var init_s3_expires_middleware = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-expires-middleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_dist_es21(); s3ExpiresMiddleware = /* @__PURE__ */ __name((config3) => { return (next, context2) => async (args) => { const result = await next(args); const { response } = result; if (HttpResponse.isInstance(response)) { if (response.headers.expires) { response.headers.expiresstring = response.headers.expires; try { parseRfc7231DateTime(response.headers.expires); } catch (e2) { context2.logger?.warn(`AWS SDK Warning for ${context2.clientName}::${context2.commandName} response parsing (${response.headers.expires}): ${e2}`); delete response.headers.expires; } } } return result; }; }, "s3ExpiresMiddleware"); s3ExpiresMiddlewareOptions = { tags: ["S3"], name: "s3ExpiresMiddleware", override: true, relation: "after", toMiddleware: "deserializerMiddleware" }; getS3ExpiresMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(s3ExpiresMiddleware(clientConfig), s3ExpiresMiddlewareOptions); } }), "getS3ExpiresMiddlewarePlugin"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCache.js var _S3ExpressIdentityCache, S3ExpressIdentityCache; var init_S3ExpressIdentityCache = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCache.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); _S3ExpressIdentityCache = class { data; lastPurgeTime = Date.now(); constructor(data = {}) { this.data = data; } get(key) { const entry = this.data[key]; if (!entry) { return; } return entry; } set(key, entry) { this.data[key] = entry; return entry; } delete(key) { delete this.data[key]; } async purgeExpired() { const now = Date.now(); if (this.lastPurgeTime + _S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) { return; } for (const key in this.data) { const entry = this.data[key]; if (!entry.isRefreshing) { const credential = await entry.identity; if (credential.expiration) { if (credential.expiration.getTime() < now) { delete this.data[key]; } } } } } }; S3ExpressIdentityCache = _S3ExpressIdentityCache; __name(S3ExpressIdentityCache, "S3ExpressIdentityCache"); __publicField(S3ExpressIdentityCache, "EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS", 3e4); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCacheEntry.js var S3ExpressIdentityCacheEntry; var init_S3ExpressIdentityCacheEntry = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCacheEntry.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); S3ExpressIdentityCacheEntry = class { _identity; isRefreshing; accessed; constructor(_identity, isRefreshing = false, accessed = Date.now()) { this._identity = _identity; this.isRefreshing = isRefreshing; this.accessed = accessed; } get identity() { this.accessed = Date.now(); return this._identity; } }; __name(S3ExpressIdentityCacheEntry, "S3ExpressIdentityCacheEntry"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityProviderImpl.js var _S3ExpressIdentityProviderImpl, S3ExpressIdentityProviderImpl; var init_S3ExpressIdentityProviderImpl = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityProviderImpl.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_S3ExpressIdentityCache(); init_S3ExpressIdentityCacheEntry(); _S3ExpressIdentityProviderImpl = class { createSessionFn; cache; constructor(createSessionFn, cache3 = new S3ExpressIdentityCache()) { this.createSessionFn = createSessionFn; this.cache = cache3; } async getS3ExpressIdentity(awsIdentity, identityProperties) { const key = identityProperties.Bucket; const { cache: cache3 } = this; const entry = cache3.get(key); if (entry) { return entry.identity.then((identity2) => { const isExpired = (identity2.expiration?.getTime() ?? 0) < Date.now(); if (isExpired) { return cache3.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; } const isExpiringSoon = (identity2.expiration?.getTime() ?? 0) < Date.now() + _S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS; if (isExpiringSoon && !entry.isRefreshing) { entry.isRefreshing = true; this.getIdentity(key).then((id) => { cache3.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id))); }); } return identity2; }); } return cache3.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; } async getIdentity(key) { await this.cache.purgeExpired().catch((error50) => { console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error50); }); const session = await this.createSessionFn(key); if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) { throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey."); } const identity2 = { accessKeyId: session.Credentials.AccessKeyId, secretAccessKey: session.Credentials.SecretAccessKey, sessionToken: session.Credentials.SessionToken, expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : void 0 }; return identity2; } }; S3ExpressIdentityProviderImpl = _S3ExpressIdentityProviderImpl; __name(S3ExpressIdentityProviderImpl, "S3ExpressIdentityProviderImpl"); __publicField(S3ExpressIdentityProviderImpl, "REFRESH_WINDOW_MS", 6e4); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js var S3_EXPRESS_BUCKET_TYPE, S3_EXPRESS_BACKEND, S3_EXPRESS_AUTH_SCHEME, SESSION_TOKEN_QUERY_PARAM, SESSION_TOKEN_HEADER; var init_constants6 = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); S3_EXPRESS_BUCKET_TYPE = "Directory"; S3_EXPRESS_BACKEND = "S3Express"; S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express"; SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token"; SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase(); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js function getCredentialsWithoutSessionToken(credentials) { const credentialsWithoutSessionToken = { accessKeyId: credentials.accessKeyId, secretAccessKey: credentials.secretAccessKey, expiration: credentials.expiration }; return credentialsWithoutSessionToken; } function setSingleOverride(privateAccess, credentialsWithoutSessionToken) { const id = setTimeout(() => { throw new Error("SignatureV4S3Express credential override was created but not called."); }, 10); const currentCredentialProvider = privateAccess.credentialProvider; const overrideCredentialsProviderOnce = /* @__PURE__ */ __name(() => { clearTimeout(id); privateAccess.credentialProvider = currentCredentialProvider; return Promise.resolve(credentialsWithoutSessionToken); }, "overrideCredentialsProviderOnce"); privateAccess.credentialProvider = overrideCredentialsProviderOnce; } var SignatureV4S3Express; var init_SignatureV4S3Express = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es18(); init_constants6(); SignatureV4S3Express = class extends SignatureV4 { async signWithCredentials(requestToSign, credentials, options) { const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken; const privateAccess = this; setSingleOverride(privateAccess, credentialsWithoutSessionToken); return privateAccess.signRequest(requestToSign, options ?? {}); } async presignWithCredentials(requestToSign, credentials, options) { const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); delete requestToSign.headers[SESSION_TOKEN_HEADER]; requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; requestToSign.query = requestToSign.query ?? {}; requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; const privateAccess = this; setSingleOverride(privateAccess, credentialsWithoutSessionToken); return this.presign(requestToSign, options); } }; __name(SignatureV4S3Express, "SignatureV4S3Express"); __name(getCredentialsWithoutSessionToken, "getCredentialsWithoutSessionToken"); __name(setSingleOverride, "setSingleOverride"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressMiddleware.js var s3ExpressMiddleware, s3ExpressMiddlewareOptions, getS3ExpressPlugin; var init_s3ExpressMiddleware = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es23(); init_dist_es2(); init_constants6(); s3ExpressMiddleware = /* @__PURE__ */ __name((options) => { return (next, context2) => async (args) => { if (context2.endpointV2) { const endpoint = context2.endpointV2; const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME; const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND || endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE; if (isS3ExpressBucket) { setFeature(context2, "S3_EXPRESS_BUCKET", "J"); context2.isS3ExpressBucket = true; } if (isS3ExpressAuth) { const requestBucket = args.input.Bucket; if (requestBucket) { const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), { Bucket: requestBucket }); context2.s3ExpressIdentity = s3ExpressIdentity; if (HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) { args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken; } } } } return next(args); }; }, "s3ExpressMiddleware"); s3ExpressMiddlewareOptions = { name: "s3ExpressMiddleware", step: "build", tags: ["S3", "S3_EXPRESS"], override: true }; getS3ExpressPlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions); } }), "getS3ExpressPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js var signS3Express; var init_signS3Express = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); signS3Express = /* @__PURE__ */ __name(async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => { const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {}); if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) { throw new Error("X-Amz-Security-Token must not be set for s3-express requests."); } return signedRequest; }, "signS3Express"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js var defaultErrorHandler2, defaultSuccessHandler2, s3ExpressHttpSigningMiddleware, getS3ExpressHttpSigningPlugin; var init_s3ExpressHttpSigningMiddleware = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); init_dist_es2(); init_dist_es4(); init_signS3Express(); defaultErrorHandler2 = /* @__PURE__ */ __name((signingProperties) => (error50) => { throw error50; }, "defaultErrorHandler"); defaultSuccessHandler2 = /* @__PURE__ */ __name((httpResponse, signingProperties) => { }, "defaultSuccessHandler"); s3ExpressHttpSigningMiddleware = /* @__PURE__ */ __name((config3) => (next, context2) => async (args) => { if (!HttpRequest.isInstance(args.request)) { return next(args); } const smithyContext = getSmithyContext(context2); const scheme = smithyContext.selectedHttpAuthScheme; if (!scheme) { throw new Error(`No HttpAuthScheme was selected: unable to sign request`); } const { httpAuthOption: { signingProperties = {} }, identity: identity2, signer } = scheme; let request; if (context2.s3ExpressIdentity) { request = await signS3Express(context2.s3ExpressIdentity, signingProperties, args.request, await config3.signer()); } else { request = await signer.sign(args.request, identity2, signingProperties); } const output = await next({ ...args, request }).catch((signer.errorHandler || defaultErrorHandler2)(signingProperties)); (signer.successHandler || defaultSuccessHandler2)(output.response, signingProperties); return output; }, "s3ExpressHttpSigningMiddleware"); getS3ExpressHttpSigningPlugin = /* @__PURE__ */ __name((config3) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config3), httpSigningMiddlewareOptions); } }), "getS3ExpressHttpSigningPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/index.js var init_s3_express = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_S3ExpressIdentityProviderImpl(); init_SignatureV4S3Express(); init_s3ExpressMiddleware(); init_s3ExpressHttpSigningMiddleware(); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3Configuration.js var resolveS3Config; var init_s3Configuration = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3Configuration.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_s3_express(); resolveS3Config = /* @__PURE__ */ __name((input, { session }) => { const [s3ClientProvider, CreateSessionCommandCtor] = session; const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, expectContinueHeader } = input; return Object.assign(input, { forcePathStyle: forcePathStyle ?? false, useAccelerateEndpoint: useAccelerateEndpoint ?? false, disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false, followRegionRedirects: followRegionRedirects ?? false, s3ExpressIdentityProvider: s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({ Bucket: key }))), bucketEndpoint: bucketEndpoint ?? false, expectContinueHeader: expectContinueHeader ?? 2097152 }); }, "resolveS3Config"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/throw-200-exceptions.js var THROW_IF_EMPTY_BODY, MAX_BYTES_TO_INSPECT, throw200ExceptionsMiddleware, collectBody2, throw200ExceptionsMiddlewareOptions, getThrow200ExceptionsPlugin; var init_throw_200_exceptions = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/throw-200-exceptions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_dist_es11(); THROW_IF_EMPTY_BODY = { CopyObjectCommand: true, UploadPartCopyCommand: true, CompleteMultipartUploadCommand: true }; MAX_BYTES_TO_INSPECT = 3e3; throw200ExceptionsMiddleware = /* @__PURE__ */ __name((config3) => (next, context2) => async (args) => { const result = await next(args); const { response } = result; if (!HttpResponse.isInstance(response)) { return result; } const { statusCode, body: sourceBody } = response; if (statusCode < 200 || statusCode >= 300) { return result; } const isSplittableStream = typeof sourceBody?.stream === "function" || typeof sourceBody?.pipe === "function" || typeof sourceBody?.tee === "function"; if (!isSplittableStream) { return result; } let bodyCopy = sourceBody; let body = sourceBody; if (sourceBody && typeof sourceBody === "object" && !(sourceBody instanceof Uint8Array)) { [bodyCopy, body] = await splitStream(sourceBody); } response.body = body; const bodyBytes = await collectBody2(bodyCopy, { streamCollector: async (stream) => { return headStream(stream, MAX_BYTES_TO_INSPECT); } }); if (typeof bodyCopy?.destroy === "function") { bodyCopy.destroy(); } const bodyStringTail = config3.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16)); if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context2.commandName]) { const err = new Error("S3 aborted request"); err.name = "InternalError"; throw err; } if (bodyStringTail && bodyStringTail.endsWith("")) { response.statusCode = 400; } return result; }, "throw200ExceptionsMiddleware"); collectBody2 = /* @__PURE__ */ __name((streamBody = new Uint8Array(), context2) => { if (streamBody instanceof Uint8Array) { return Promise.resolve(streamBody); } return context2.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); }, "collectBody"); throw200ExceptionsMiddlewareOptions = { relation: "after", toMiddleware: "deserializerMiddleware", tags: ["THROW_200_EXCEPTIONS", "S3"], name: "throw200ExceptionsMiddleware", override: true }; getThrow200ExceptionsPlugin = /* @__PURE__ */ __name((config3) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(throw200ExceptionsMiddleware(config3), throw200ExceptionsMiddlewareOptions); } }), "getThrow200ExceptionsPlugin"); } }); // ../../node_modules/@aws-sdk/util-arn-parser/dist-es/index.js var validate; var init_dist_es30 = __esm({ "../../node_modules/@aws-sdk/util-arn-parser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); validate = /* @__PURE__ */ __name((str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6, "validate"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/bucket-endpoint-middleware.js function bucketEndpointMiddleware(options) { return (next, context2) => async (args) => { if (options.bucketEndpoint) { const endpoint = context2.endpointV2; if (endpoint) { const bucket = args.input.Bucket; if (typeof bucket === "string") { try { const bucketEndpointUrl = new URL(bucket); context2.endpointV2 = { ...endpoint, url: bucketEndpointUrl }; } catch (e2) { const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`; if (context2.logger?.constructor?.name === "NoOpLogger") { console.warn(warning); } else { context2.logger?.warn?.(warning); } throw e2; } } } } return next(args); }; } var bucketEndpointMiddlewareOptions; var init_bucket_endpoint_middleware = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/bucket-endpoint-middleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(bucketEndpointMiddleware, "bucketEndpointMiddleware"); bucketEndpointMiddlewareOptions = { name: "bucketEndpointMiddleware", override: true, relation: "after", toMiddleware: "endpointV2Middleware" }; } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/validate-bucket-name.js function validateBucketNameMiddleware({ bucketEndpoint }) { return (next) => async (args) => { const { input: { Bucket } } = args; if (!bucketEndpoint && typeof Bucket === "string" && !validate(Bucket) && Bucket.indexOf("/") >= 0) { const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`); err.name = "InvalidBucketName"; throw err; } return next({ ...args }); }; } var validateBucketNameMiddlewareOptions, getValidateBucketNamePlugin; var init_validate_bucket_name = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/validate-bucket-name.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es30(); init_bucket_endpoint_middleware(); __name(validateBucketNameMiddleware, "validateBucketNameMiddleware"); validateBucketNameMiddlewareOptions = { step: "initialize", tags: ["VALIDATE_BUCKET_NAME"], name: "validateBucketNameMiddleware", override: true }; getValidateBucketNamePlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions); clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions); } }), "getValidateBucketNamePlugin"); } }); // ../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/index.js var init_dist_es31 = __esm({ "../../node_modules/@aws-sdk/middleware-sdk-s3/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_check_content_length_header(); init_region_redirect_endpoint_middleware(); init_region_redirect_middleware(); init_s3_expires_middleware(); init_s3_express(); init_s3Configuration(); init_throw_200_exceptions(); init_validate_bucket_name(); } }); // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js function isValidUserAgentAppId(appId) { if (appId === void 0) { return true; } return typeof appId === "string" && appId.length <= 50; } function resolveUserAgentConfig(input) { const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID); const { customUserAgent } = input; return Object.assign(input, { customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, userAgentAppId: async () => { const appId = await normalizedAppIdProvider(); if (!isValidUserAgentAppId(appId)) { const logger3 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; if (typeof appId !== "string") { logger3?.warn("userAgentAppId must be a string or undefined."); } else if (appId.length > 50) { logger3?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); } } return appId; } }); } var DEFAULT_UA_APP_ID; var init_configurations = __esm({ "../../node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); DEFAULT_UA_APP_ID = void 0; __name(isValidUserAgentAppId, "isValidUserAgentAppId"); __name(resolveUserAgentConfig, "resolveUserAgentConfig"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js var EndpointCache; var init_EndpointCache = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); EndpointCache = class { capacity; data = /* @__PURE__ */ new Map(); parameters = []; constructor({ size, params }) { this.capacity = size ?? 50; if (params) { this.parameters = params; } } get(endpointParams, resolver) { const key = this.hash(endpointParams); if (key === false) { return resolver(); } if (!this.data.has(key)) { if (this.data.size > this.capacity + 10) { const keys = this.data.keys(); let i2 = 0; while (true) { const { value, done } = keys.next(); this.data.delete(value); if (done || ++i2 > 10) { break; } } } this.data.set(key, resolver()); } return this.data.get(key); } size() { return this.data.size; } hash(endpointParams) { let buffer = ""; const { parameters } = this; if (parameters.length === 0) { return false; } for (const param of parameters) { const val = String(endpointParams[param] ?? ""); if (val.includes("|;")) { return false; } buffer += val + "|;"; } return buffer; } }; __name(EndpointCache, "EndpointCache"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js var IP_V4_REGEX, isIpAddress; var init_isIpAddress = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); isIpAddress = /* @__PURE__ */ __name((value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"), "isIpAddress"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js var VALID_HOST_LABEL_REGEX, isValidHostLabel; var init_isValidHostLabel = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); isValidHostLabel = /* @__PURE__ */ __name((value, allowSubDomains = false) => { if (!allowSubDomains) { return VALID_HOST_LABEL_REGEX.test(value); } const labels = value.split("."); for (const label of labels) { if (!isValidHostLabel(label)) { return false; } } return true; }, "isValidHostLabel"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js var customEndpointFunctions; var init_customEndpointFunctions = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); customEndpointFunctions = {}; } }); // ../../node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js var debugId; var init_debugId = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); debugId = "endpoints"; } }); // ../../node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js function toDebugString(input) { if (typeof input !== "object" || input == null) { return input; } if ("ref" in input) { return `$${toDebugString(input.ref)}`; } if ("fn" in input) { return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; } return JSON.stringify(input, null, 2); } var init_toDebugString = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(toDebugString, "toDebugString"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/debug/index.js var init_debug = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/debug/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_debugId(); init_toDebugString(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js var EndpointError; var init_EndpointError = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); EndpointError = class extends Error { constructor(message2) { super(message2); this.name = "EndpointError"; } }; __name(EndpointError, "EndpointError"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js var init_EndpointFunctions = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js var init_EndpointRuleObject2 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js var init_ErrorRuleObject2 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js var init_RuleSetObject2 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js var init_TreeRuleObject2 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/shared.js var init_shared2 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/shared.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/types/index.js var init_types3 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/types/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EndpointError(); init_EndpointFunctions(); init_EndpointRuleObject2(); init_ErrorRuleObject2(); init_RuleSetObject2(); init_TreeRuleObject2(); init_shared2(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js var booleanEquals; var init_booleanEquals = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); booleanEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "booleanEquals"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js var getAttrPathList; var init_getAttrPathList = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); getAttrPathList = /* @__PURE__ */ __name((path) => { const parts = path.split("."); const pathList = []; for (const part of parts) { const squareBracketIndex = part.indexOf("["); if (squareBracketIndex !== -1) { if (part.indexOf("]") !== part.length - 1) { throw new EndpointError(`Path: '${path}' does not end with ']'`); } const arrayIndex = part.slice(squareBracketIndex + 1, -1); if (Number.isNaN(parseInt(arrayIndex))) { throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); } if (squareBracketIndex !== 0) { pathList.push(part.slice(0, squareBracketIndex)); } pathList.push(arrayIndex); } else { pathList.push(part); } } return pathList; }, "getAttrPathList"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js var getAttr; var init_getAttr = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); init_getAttrPathList(); getAttr = /* @__PURE__ */ __name((value, path) => getAttrPathList(path).reduce((acc, index) => { if (typeof acc !== "object") { throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); } else if (Array.isArray(acc)) { return acc[parseInt(index)]; } return acc[index]; }, value), "getAttr"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js var isSet; var init_isSet = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isSet = /* @__PURE__ */ __name((value) => value != null, "isSet"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/not.js var not2; var init_not = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/not.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); not2 = /* @__PURE__ */ __name((value) => !value, "not"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js var DEFAULT_PORTS, parseURL; var init_parseURL = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es(); init_isIpAddress(); DEFAULT_PORTS = { [EndpointURLScheme.HTTP]: 80, [EndpointURLScheme.HTTPS]: 443 }; parseURL = /* @__PURE__ */ __name((value) => { const whatwgURL = (() => { try { if (value instanceof URL) { return value; } if (typeof value === "object" && "hostname" in value) { const { hostname: hostname4, port, protocol: protocol2 = "", path = "", query = {} } = value; const url2 = new URL(`${protocol2}//${hostname4}${port ? `:${port}` : ""}${path}`); url2.search = Object.entries(query).map(([k2, v3]) => `${k2}=${v3}`).join("&"); return url2; } return new URL(value); } catch (error50) { return null; } })(); if (!whatwgURL) { console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); return null; } const urlString = whatwgURL.href; const { host, hostname: hostname3, pathname, protocol, search } = whatwgURL; if (search) { return null; } const scheme = protocol.slice(0, -1); if (!Object.values(EndpointURLScheme).includes(scheme)) { return null; } const isIp = isIpAddress(hostname3); const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`); const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; return { scheme, authority, path: pathname, normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, isIp }; }, "parseURL"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js var stringEquals; var init_stringEquals = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); stringEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "stringEquals"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/substring.js var substring; var init_substring = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/substring.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); substring = /* @__PURE__ */ __name((input, start, stop, reverse) => { if (start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) { return null; } if (!reverse) { return input.substring(start, stop); } return input.substring(input.length - stop, input.length - start); }, "substring"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js var uriEncode; var init_uriEncode = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); uriEncode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/[!*'()]/g, (c2) => `%${c2.charCodeAt(0).toString(16).toUpperCase()}`), "uriEncode"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/lib/index.js var init_lib = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/lib/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_booleanEquals(); init_getAttr(); init_isSet(); init_isValidHostLabel(); init_not(); init_parseURL(); init_stringEquals(); init_substring(); init_uriEncode(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js var endpointFunctions; var init_endpointFunctions = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_lib(); endpointFunctions = { booleanEquals, getAttr, isSet, isValidHostLabel, not: not2, parseURL, stringEquals, substring, uriEncode }; } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js var evaluateTemplate; var init_evaluateTemplate = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_lib(); evaluateTemplate = /* @__PURE__ */ __name((template, options) => { const evaluatedTemplateArr = []; const templateContext = { ...options.endpointParams, ...options.referenceRecord }; let currentIndex = 0; while (currentIndex < template.length) { const openingBraceIndex = template.indexOf("{", currentIndex); if (openingBraceIndex === -1) { evaluatedTemplateArr.push(template.slice(currentIndex)); break; } evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); const closingBraceIndex = template.indexOf("}", openingBraceIndex); if (closingBraceIndex === -1) { evaluatedTemplateArr.push(template.slice(openingBraceIndex)); break; } if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); currentIndex = closingBraceIndex + 2; } const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); if (parameterName.includes("#")) { const [refName, attrName] = parameterName.split("#"); evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); } else { evaluatedTemplateArr.push(templateContext[parameterName]); } currentIndex = closingBraceIndex + 1; } return evaluatedTemplateArr.join(""); }, "evaluateTemplate"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js var getReferenceValue; var init_getReferenceValue = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getReferenceValue = /* @__PURE__ */ __name(({ ref }, options) => { const referenceRecord = { ...options.endpointParams, ...options.referenceRecord }; return referenceRecord[ref]; }, "getReferenceValue"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js var evaluateExpression, callFunction, group3; var init_evaluateExpression = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); init_customEndpointFunctions(); init_endpointFunctions(); init_evaluateTemplate(); init_getReferenceValue(); evaluateExpression = /* @__PURE__ */ __name((obj, keyName, options) => { if (typeof obj === "string") { return evaluateTemplate(obj, options); } else if (obj["fn"]) { return group3.callFunction(obj, options); } else if (obj["ref"]) { return getReferenceValue(obj, options); } throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); }, "evaluateExpression"); callFunction = /* @__PURE__ */ __name(({ fn, argv: argv2 }, options) => { const evaluatedArgs = argv2.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : group3.evaluateExpression(arg, "arg", options)); const fnSegments = fn.split("."); if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) { return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); } return endpointFunctions[fn](...evaluatedArgs); }, "callFunction"); group3 = { evaluateExpression, callFunction }; } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js var init_callFunction = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_evaluateExpression(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js var evaluateCondition; var init_evaluateCondition = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_debug(); init_types3(); init_callFunction(); evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => { if (assign && assign in options.referenceRecord) { throw new EndpointError(`'${assign}' is already defined in Reference Record.`); } const value = callFunction(fnArgs, options); options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); return { result: value === "" ? true : !!value, ...assign != null && { toAssign: { name: assign, value } } }; }, "evaluateCondition"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js var evaluateConditions; var init_evaluateConditions = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_debug(); init_evaluateCondition(); evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => { const conditionsReferenceRecord = {}; for (const condition of conditions) { const { result, toAssign } = evaluateCondition(condition, { ...options, referenceRecord: { ...options.referenceRecord, ...conditionsReferenceRecord } }); if (!result) { return { result }; } if (toAssign) { conditionsReferenceRecord[toAssign.name] = toAssign.value; options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); } } return { result: true, referenceRecord: conditionsReferenceRecord }; }, "evaluateConditions"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js var getEndpointHeaders; var init_getEndpointHeaders = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); init_evaluateExpression(); getEndpointHeaders = /* @__PURE__ */ __name((headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ ...acc, [headerKey]: headerVal.map((headerValEntry) => { const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options); if (typeof processedExpr !== "string") { throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); } return processedExpr; }) }), {}), "getEndpointHeaders"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js var getEndpointProperties, getEndpointProperty, group4; var init_getEndpointProperties = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); init_evaluateTemplate(); getEndpointProperties = /* @__PURE__ */ __name((properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ ...acc, [propertyKey]: group4.getEndpointProperty(propertyVal, options) }), {}), "getEndpointProperties"); getEndpointProperty = /* @__PURE__ */ __name((property, options) => { if (Array.isArray(property)) { return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); } switch (typeof property) { case "string": return evaluateTemplate(property, options); case "object": if (property === null) { throw new EndpointError(`Unexpected endpoint property: ${property}`); } return group4.getEndpointProperties(property, options); case "boolean": return property; default: throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); } }, "getEndpointProperty"); group4 = { getEndpointProperty, getEndpointProperties }; } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js var getEndpointUrl; var init_getEndpointUrl = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); init_evaluateExpression(); getEndpointUrl = /* @__PURE__ */ __name((endpointUrl, options) => { const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); if (typeof expression === "string") { try { return new URL(expression); } catch (error50) { console.error(`Failed to construct URL with ${expression}`, error50); throw error50; } } throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); }, "getEndpointUrl"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js var evaluateEndpointRule; var init_evaluateEndpointRule = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_debug(); init_evaluateConditions(); init_getEndpointHeaders(); init_getEndpointProperties(); init_getEndpointUrl(); evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => { const { conditions, endpoint } = endpointRule; const { result, referenceRecord } = evaluateConditions(conditions, options); if (!result) { return; } const endpointRuleOptions = { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } }; const { url: url2, properties, headers } = endpoint; options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); return { ...headers != void 0 && { headers: getEndpointHeaders(headers, endpointRuleOptions) }, ...properties != void 0 && { properties: getEndpointProperties(properties, endpointRuleOptions) }, url: getEndpointUrl(url2, endpointRuleOptions) }; }, "evaluateEndpointRule"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js var evaluateErrorRule; var init_evaluateErrorRule = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); init_evaluateConditions(); init_evaluateExpression(); evaluateErrorRule = /* @__PURE__ */ __name((errorRule, options) => { const { conditions, error: error50 } = errorRule; const { result, referenceRecord } = evaluateConditions(conditions, options); if (!result) { return; } throw new EndpointError(evaluateExpression(error50, "Error", { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } })); }, "evaluateErrorRule"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js var evaluateRules, evaluateTreeRule, group5; var init_evaluateRules = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types3(); init_evaluateConditions(); init_evaluateEndpointRule(); init_evaluateErrorRule(); evaluateRules = /* @__PURE__ */ __name((rules, options) => { for (const rule of rules) { if (rule.type === "endpoint") { const endpointOrUndefined = evaluateEndpointRule(rule, options); if (endpointOrUndefined) { return endpointOrUndefined; } } else if (rule.type === "error") { evaluateErrorRule(rule, options); } else if (rule.type === "tree") { const endpointOrUndefined = group5.evaluateTreeRule(rule, options); if (endpointOrUndefined) { return endpointOrUndefined; } } else { throw new EndpointError(`Unknown endpoint rule: ${rule}`); } } throw new EndpointError(`Rules evaluation failed`); }, "evaluateRules"); evaluateTreeRule = /* @__PURE__ */ __name((treeRule, options) => { const { conditions, rules } = treeRule; const { result, referenceRecord } = evaluateConditions(conditions, options); if (!result) { return; } return group5.evaluateRules(rules, { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } }); }, "evaluateTreeRule"); group5 = { evaluateRules, evaluateTreeRule }; } }); // ../../node_modules/@smithy/util-endpoints/dist-es/utils/index.js var init_utils5 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/utils/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_customEndpointFunctions(); init_evaluateRules(); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js var resolveEndpoint; var init_resolveEndpoint = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_debug(); init_types3(); init_utils5(); resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options) => { const { endpointParams, logger: logger3 } = options; const { parameters, rules } = ruleSetObject; options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); const paramsWithDefault = Object.entries(parameters).filter(([, v3]) => v3.default != null).map(([k2, v3]) => [k2, v3.default]); if (paramsWithDefault.length > 0) { for (const [paramKey, paramDefaultValue] of paramsWithDefault) { endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; } } const requiredParams = Object.entries(parameters).filter(([, v3]) => v3.required).map(([k2]) => k2); for (const requiredParam of requiredParams) { if (endpointParams[requiredParam] == null) { throw new EndpointError(`Missing required parameter: '${requiredParam}'`); } } const endpoint = evaluateRules(rules, { endpointParams, logger: logger3, referenceRecord: {} }); options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); return endpoint; }, "resolveEndpoint"); } }); // ../../node_modules/@smithy/util-endpoints/dist-es/index.js var init_dist_es32 = __esm({ "../../node_modules/@smithy/util-endpoints/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EndpointCache(); init_isIpAddress(); init_isValidHostLabel(); init_customEndpointFunctions(); init_resolveEndpoint(); init_types3(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js var init_isIpAddress2 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es32(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js var isVirtualHostableS3Bucket; var init_isVirtualHostableS3Bucket = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es32(); init_isIpAddress2(); isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => { if (allowSubDomains) { for (const label of value.split(".")) { if (!isVirtualHostableS3Bucket(label)) { return false; } } return true; } if (!isValidHostLabel(value)) { return false; } if (value.length < 3 || value.length > 63) { return false; } if (value !== value.toLowerCase()) { return false; } if (isIpAddress(value)) { return false; } return true; }, "isVirtualHostableS3Bucket"); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js var ARN_DELIMITER, RESOURCE_DELIMITER, parseArn; var init_parseArn = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ARN_DELIMITER = ":"; RESOURCE_DELIMITER = "/"; parseArn = /* @__PURE__ */ __name((value) => { const segments = value.split(ARN_DELIMITER); if (segments.length < 6) return null; const [arn, partition2, service, region, accountId, ...resourcePath] = segments; if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") return null; const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); return { partition: partition2, service, region, accountId, resourceId }; }, "parseArn"); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json var partitions_default; var init_partitions = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json"() { partitions_default = { partitions: [{ id: "aws", outputs: { dnsSuffix: "amazonaws.com", dualStackDnsSuffix: "api.aws", implicitGlobalRegion: "us-east-1", name: "aws", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", regions: { "af-south-1": { description: "Africa (Cape Town)" }, "ap-east-1": { description: "Asia Pacific (Hong Kong)" }, "ap-east-2": { description: "Asia Pacific (Taipei)" }, "ap-northeast-1": { description: "Asia Pacific (Tokyo)" }, "ap-northeast-2": { description: "Asia Pacific (Seoul)" }, "ap-northeast-3": { description: "Asia Pacific (Osaka)" }, "ap-south-1": { description: "Asia Pacific (Mumbai)" }, "ap-south-2": { description: "Asia Pacific (Hyderabad)" }, "ap-southeast-1": { description: "Asia Pacific (Singapore)" }, "ap-southeast-2": { description: "Asia Pacific (Sydney)" }, "ap-southeast-3": { description: "Asia Pacific (Jakarta)" }, "ap-southeast-4": { description: "Asia Pacific (Melbourne)" }, "ap-southeast-5": { description: "Asia Pacific (Malaysia)" }, "ap-southeast-6": { description: "Asia Pacific (New Zealand)" }, "ap-southeast-7": { description: "Asia Pacific (Thailand)" }, "aws-global": { description: "aws global region" }, "ca-central-1": { description: "Canada (Central)" }, "ca-west-1": { description: "Canada West (Calgary)" }, "eu-central-1": { description: "Europe (Frankfurt)" }, "eu-central-2": { description: "Europe (Zurich)" }, "eu-north-1": { description: "Europe (Stockholm)" }, "eu-south-1": { description: "Europe (Milan)" }, "eu-south-2": { description: "Europe (Spain)" }, "eu-west-1": { description: "Europe (Ireland)" }, "eu-west-2": { description: "Europe (London)" }, "eu-west-3": { description: "Europe (Paris)" }, "il-central-1": { description: "Israel (Tel Aviv)" }, "me-central-1": { description: "Middle East (UAE)" }, "me-south-1": { description: "Middle East (Bahrain)" }, "mx-central-1": { description: "Mexico (Central)" }, "sa-east-1": { description: "South America (Sao Paulo)" }, "us-east-1": { description: "US East (N. Virginia)" }, "us-east-2": { description: "US East (Ohio)" }, "us-west-1": { description: "US West (N. California)" }, "us-west-2": { description: "US West (Oregon)" } } }, { id: "aws-cn", outputs: { dnsSuffix: "amazonaws.com.cn", dualStackDnsSuffix: "api.amazonwebservices.com.cn", implicitGlobalRegion: "cn-northwest-1", name: "aws-cn", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^cn\\-\\w+\\-\\d+$", regions: { "aws-cn-global": { description: "aws-cn global region" }, "cn-north-1": { description: "China (Beijing)" }, "cn-northwest-1": { description: "China (Ningxia)" } } }, { id: "aws-eusc", outputs: { dnsSuffix: "amazonaws.eu", dualStackDnsSuffix: "api.amazonwebservices.eu", implicitGlobalRegion: "eusc-de-east-1", name: "aws-eusc", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", regions: { "eusc-de-east-1": { description: "AWS European Sovereign Cloud (Germany)" } } }, { id: "aws-iso", outputs: { dnsSuffix: "c2s.ic.gov", dualStackDnsSuffix: "api.aws.ic.gov", implicitGlobalRegion: "us-iso-east-1", name: "aws-iso", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", regions: { "aws-iso-global": { description: "aws-iso global region" }, "us-iso-east-1": { description: "US ISO East" }, "us-iso-west-1": { description: "US ISO WEST" } } }, { id: "aws-iso-b", outputs: { dnsSuffix: "sc2s.sgov.gov", dualStackDnsSuffix: "api.aws.scloud", implicitGlobalRegion: "us-isob-east-1", name: "aws-iso-b", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", regions: { "aws-iso-b-global": { description: "aws-iso-b global region" }, "us-isob-east-1": { description: "US ISOB East (Ohio)" }, "us-isob-west-1": { description: "US ISOB West" } } }, { id: "aws-iso-e", outputs: { dnsSuffix: "cloud.adc-e.uk", dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", implicitGlobalRegion: "eu-isoe-west-1", name: "aws-iso-e", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", regions: { "aws-iso-e-global": { description: "aws-iso-e global region" }, "eu-isoe-west-1": { description: "EU ISOE West" } } }, { id: "aws-iso-f", outputs: { dnsSuffix: "csp.hci.ic.gov", dualStackDnsSuffix: "api.aws.hci.ic.gov", implicitGlobalRegion: "us-isof-south-1", name: "aws-iso-f", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", regions: { "aws-iso-f-global": { description: "aws-iso-f global region" }, "us-isof-east-1": { description: "US ISOF EAST" }, "us-isof-south-1": { description: "US ISOF SOUTH" } } }, { id: "aws-us-gov", outputs: { dnsSuffix: "amazonaws.com", dualStackDnsSuffix: "api.aws", implicitGlobalRegion: "us-gov-west-1", name: "aws-us-gov", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", regions: { "aws-us-gov-global": { description: "aws-us-gov global region" }, "us-gov-east-1": { description: "AWS GovCloud (US-East)" }, "us-gov-west-1": { description: "AWS GovCloud (US-West)" } } }], version: "1.1" }; } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js var selectedPartitionsInfo, selectedUserAgentPrefix, partition, getUserAgentPrefix; var init_partition = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_partitions(); selectedPartitionsInfo = partitions_default; selectedUserAgentPrefix = ""; partition = /* @__PURE__ */ __name((value) => { const { partitions } = selectedPartitionsInfo; for (const partition2 of partitions) { const { regions, outputs } = partition2; for (const [region, regionData] of Object.entries(regions)) { if (region === value) { return { ...outputs, ...regionData }; } } } for (const partition2 of partitions) { const { regionRegex, outputs } = partition2; if (new RegExp(regionRegex).test(value)) { return { ...outputs }; } } const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws"); if (!DEFAULT_PARTITION) { throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); } return { ...DEFAULT_PARTITION.outputs }; }, "partition"); getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix"); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/aws.js var awsEndpointFunctions; var init_aws = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/aws.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es32(); init_isVirtualHostableS3Bucket(); init_parseArn(); init_partition(); awsEndpointFunctions = { isVirtualHostableS3Bucket, parseArn, partition }; customEndpointFunctions.aws = awsEndpointFunctions; } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js var init_resolveDefaultAwsRegionalEndpointsConfig = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js var init_resolveEndpoint2 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js var init_EndpointError2 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js var init_EndpointRuleObject3 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js var init_ErrorRuleObject3 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js var init_RuleSetObject3 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js var init_TreeRuleObject3 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js var init_shared3 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js var init_types4 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EndpointError2(); init_EndpointRuleObject3(); init_ErrorRuleObject3(); init_RuleSetObject3(); init_TreeRuleObject3(); init_shared3(); } }); // ../../node_modules/@aws-sdk/util-endpoints/dist-es/index.js var init_dist_es33 = __esm({ "../../node_modules/@aws-sdk/util-endpoints/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_aws(); init_partition(); init_isIpAddress2(); init_resolveDefaultAwsRegionalEndpointsConfig(); init_resolveEndpoint2(); init_types4(); } }); // ../../node_modules/@smithy/util-retry/dist-es/config.js var RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE; var init_config2 = __esm({ "../../node_modules/@smithy/util-retry/dist-es/config.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); (function(RETRY_MODES2) { RETRY_MODES2["STANDARD"] = "standard"; RETRY_MODES2["ADAPTIVE"] = "adaptive"; })(RETRY_MODES || (RETRY_MODES = {})); DEFAULT_MAX_ATTEMPTS = 3; DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; } }); // ../../node_modules/@smithy/service-error-classification/dist-es/constants.js var THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, NODEJS_TIMEOUT_ERROR_CODES, NODEJS_NETWORK_ERROR_CODES; var init_constants7 = __esm({ "../../node_modules/@smithy/service-error-classification/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); THROTTLING_ERROR_CODES = [ "BandwidthLimitExceeded", "EC2ThrottledException", "LimitExceededException", "PriorRequestNotComplete", "ProvisionedThroughputExceededException", "RequestLimitExceeded", "RequestThrottled", "RequestThrottledException", "SlowDown", "ThrottledException", "Throttling", "ThrottlingException", "TooManyRequestsException", "TransactionInProgressException" ]; TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; } }); // ../../node_modules/@smithy/service-error-classification/dist-es/index.js var isRetryableByTrait, isClockSkewCorrectedError, isBrowserNetworkError, isThrottlingError, isTransientError, isServerError; var init_dist_es34 = __esm({ "../../node_modules/@smithy/service-error-classification/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants7(); isRetryableByTrait = /* @__PURE__ */ __name((error50) => error50?.$retryable !== void 0, "isRetryableByTrait"); isClockSkewCorrectedError = /* @__PURE__ */ __name((error50) => error50.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError"); isBrowserNetworkError = /* @__PURE__ */ __name((error50) => { const errorMessages = /* @__PURE__ */ new Set([ "Failed to fetch", "NetworkError when attempting to fetch resource", "The Internet connection appears to be offline", "Load failed", "Network request failed" ]); const isValid = error50 && error50 instanceof TypeError; if (!isValid) { return false; } return errorMessages.has(error50.message); }, "isBrowserNetworkError"); isThrottlingError = /* @__PURE__ */ __name((error50) => error50.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error50.name) || error50.$retryable?.throttling == true, "isThrottlingError"); isTransientError = /* @__PURE__ */ __name((error50, depth = 0) => isRetryableByTrait(error50) || isClockSkewCorrectedError(error50) || TRANSIENT_ERROR_CODES.includes(error50.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error50?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error50?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error50.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error50) || error50.cause !== void 0 && depth <= 10 && isTransientError(error50.cause, depth + 1), "isTransientError"); isServerError = /* @__PURE__ */ __name((error50) => { if (error50.$metadata?.httpStatusCode !== void 0) { const statusCode = error50.$metadata.httpStatusCode; if (500 <= statusCode && statusCode <= 599 && !isTransientError(error50)) { return true; } return false; } return false; }, "isServerError"); } }); // ../../node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js var _DefaultRateLimiter, DefaultRateLimiter; var init_DefaultRateLimiter = __esm({ "../../node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es34(); _DefaultRateLimiter = class { beta; minCapacity; minFillRate; scaleConstant; smooth; currentCapacity = 0; enabled = false; lastMaxRate = 0; measuredTxRate = 0; requestCount = 0; fillRate; lastThrottleTime; lastTimestamp = 0; lastTxRateBucket; maxCapacity; timeWindow = 0; constructor(options) { this.beta = options?.beta ?? 0.7; this.minCapacity = options?.minCapacity ?? 1; this.minFillRate = options?.minFillRate ?? 0.5; this.scaleConstant = options?.scaleConstant ?? 0.4; this.smooth = options?.smooth ?? 0.8; const currentTimeInSeconds = this.getCurrentTimeInSeconds(); this.lastThrottleTime = currentTimeInSeconds; this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); this.fillRate = this.minFillRate; this.maxCapacity = this.minCapacity; } getCurrentTimeInSeconds() { return Date.now() / 1e3; } async getSendToken() { return this.acquireTokenBucket(1); } async acquireTokenBucket(amount) { if (!this.enabled) { return; } this.refillTokenBucket(); if (amount > this.currentCapacity) { const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay)); } this.currentCapacity = this.currentCapacity - amount; } refillTokenBucket() { const timestamp = this.getCurrentTimeInSeconds(); if (!this.lastTimestamp) { this.lastTimestamp = timestamp; return; } const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); this.lastTimestamp = timestamp; } updateClientSendingRate(response) { let calculatedRate; this.updateMeasuredRate(); if (isThrottlingError(response)) { const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); this.lastMaxRate = rateToUse; this.calculateTimeWindow(); this.lastThrottleTime = this.getCurrentTimeInSeconds(); calculatedRate = this.cubicThrottle(rateToUse); this.enableTokenBucket(); } else { this.calculateTimeWindow(); calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); } const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); this.updateTokenBucketRate(newRate); } calculateTimeWindow() { this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); } cubicThrottle(rateToUse) { return this.getPrecise(rateToUse * this.beta); } cubicSuccess(timestamp) { return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); } enableTokenBucket() { this.enabled = true; } updateTokenBucketRate(newRate) { this.refillTokenBucket(); this.fillRate = Math.max(newRate, this.minFillRate); this.maxCapacity = Math.max(newRate, this.minCapacity); this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); } updateMeasuredRate() { const t9 = this.getCurrentTimeInSeconds(); const timeBucket = Math.floor(t9 * 2) / 2; this.requestCount++; if (timeBucket > this.lastTxRateBucket) { const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); this.requestCount = 0; this.lastTxRateBucket = timeBucket; } } getPrecise(num) { return parseFloat(num.toFixed(8)); } }; DefaultRateLimiter = _DefaultRateLimiter; __name(DefaultRateLimiter, "DefaultRateLimiter"); __publicField(DefaultRateLimiter, "setTimeoutFn", setTimeout); } }); // ../../node_modules/@smithy/util-retry/dist-es/constants.js var DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, THROTTLING_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, RETRY_COST, TIMEOUT_RETRY_COST, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER; var init_constants8 = __esm({ "../../node_modules/@smithy/util-retry/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); DEFAULT_RETRY_DELAY_BASE = 100; MAXIMUM_RETRY_DELAY = 20 * 1e3; THROTTLING_RETRY_DELAY_BASE = 500; INITIAL_RETRY_TOKENS = 500; RETRY_COST = 5; TIMEOUT_RETRY_COST = 10; NO_RETRY_INCREMENT = 1; INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; REQUEST_HEADER = "amz-sdk-request"; } }); // ../../node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js var getDefaultRetryBackoffStrategy; var init_defaultRetryBackoffStrategy = __esm({ "../../node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants8(); getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => { let delayBase = DEFAULT_RETRY_DELAY_BASE; const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => { return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); }, "computeNextBackoffDelay"); const setDelayBase = /* @__PURE__ */ __name((delay) => { delayBase = delay; }, "setDelayBase"); return { computeNextBackoffDelay, setDelayBase }; }, "getDefaultRetryBackoffStrategy"); } }); // ../../node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js var createDefaultRetryToken; var init_defaultRetryToken = __esm({ "../../node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants8(); createDefaultRetryToken = /* @__PURE__ */ __name(({ retryDelay, retryCount, retryCost }) => { const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount"); const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay"); const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost"); return { getRetryCount, getRetryDelay, getRetryCost }; }, "createDefaultRetryToken"); } }); // ../../node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js var StandardRetryStrategy; var init_StandardRetryStrategy = __esm({ "../../node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_config2(); init_constants8(); init_defaultRetryBackoffStrategy(); init_defaultRetryToken(); StandardRetryStrategy = class { maxAttempts; mode = RETRY_MODES.STANDARD; capacity = INITIAL_RETRY_TOKENS; retryBackoffStrategy = getDefaultRetryBackoffStrategy(); maxAttemptsProvider; constructor(maxAttempts) { this.maxAttempts = maxAttempts; this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; } async acquireInitialRetryToken(retryTokenScope) { return createDefaultRetryToken({ retryDelay: DEFAULT_RETRY_DELAY_BASE, retryCount: 0 }); } async refreshRetryTokenForRetry(token, errorInfo) { const maxAttempts = await this.getMaxAttempts(); if (this.shouldRetry(token, errorInfo, maxAttempts)) { const errorType = errorInfo.errorType; this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE); const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; const capacityCost = this.getCapacityCost(errorType); this.capacity -= capacityCost; return createDefaultRetryToken({ retryDelay, retryCount: token.getRetryCount() + 1, retryCost: capacityCost }); } throw new Error("No retry token available"); } recordSuccess(token) { this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); } getCapacity() { return this.capacity; } async getMaxAttempts() { try { return await this.maxAttemptsProvider(); } catch (error50) { console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); return DEFAULT_MAX_ATTEMPTS; } } shouldRetry(tokenToRenew, errorInfo, maxAttempts) { const attempts = tokenToRenew.getRetryCount() + 1; return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); } getCapacityCost(errorType) { return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; } isRetryableError(errorType) { return errorType === "THROTTLING" || errorType === "TRANSIENT"; } }; __name(StandardRetryStrategy, "StandardRetryStrategy"); } }); // ../../node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js var AdaptiveRetryStrategy; var init_AdaptiveRetryStrategy = __esm({ "../../node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_config2(); init_DefaultRateLimiter(); init_StandardRetryStrategy(); AdaptiveRetryStrategy = class { maxAttemptsProvider; rateLimiter; standardRetryStrategy; mode = RETRY_MODES.ADAPTIVE; constructor(maxAttemptsProvider, options) { this.maxAttemptsProvider = maxAttemptsProvider; const { rateLimiter } = options ?? {}; this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); } async acquireInitialRetryToken(retryTokenScope) { await this.rateLimiter.getSendToken(); return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); } async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { this.rateLimiter.updateClientSendingRate(errorInfo); return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); } recordSuccess(token) { this.rateLimiter.updateClientSendingRate({}); this.standardRetryStrategy.recordSuccess(token); } }; __name(AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); } }); // ../../node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js var init_ConfiguredRetryStrategy = __esm({ "../../node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-retry/dist-es/types.js var init_types5 = __esm({ "../../node_modules/@smithy/util-retry/dist-es/types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/util-retry/dist-es/index.js var init_dist_es35 = __esm({ "../../node_modules/@smithy/util-retry/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AdaptiveRetryStrategy(); init_ConfiguredRetryStrategy(); init_DefaultRateLimiter(); init_StandardRetryStrategy(); init_config2(); init_constants8(); init_types5(); } }); // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js async function checkFeatures(context2, config3, args) { const request = args.request; if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { setFeature(context2, "PROTOCOL_RPC_V2_CBOR", "M"); } if (typeof config3.retryStrategy === "function") { const retryStrategy = await config3.retryStrategy(); if (typeof retryStrategy.mode === "string") { switch (retryStrategy.mode) { case RETRY_MODES.ADAPTIVE: setFeature(context2, "RETRY_MODE_ADAPTIVE", "F"); break; case RETRY_MODES.STANDARD: setFeature(context2, "RETRY_MODE_STANDARD", "E"); break; } } } if (typeof config3.accountIdEndpointMode === "function") { const endpointV2 = context2.endpointV2; if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { setFeature(context2, "ACCOUNT_ID_ENDPOINT", "O"); } switch (await config3.accountIdEndpointMode?.()) { case "disabled": setFeature(context2, "ACCOUNT_ID_MODE_DISABLED", "Q"); break; case "preferred": setFeature(context2, "ACCOUNT_ID_MODE_PREFERRED", "P"); break; case "required": setFeature(context2, "ACCOUNT_ID_MODE_REQUIRED", "R"); break; } } const identity2 = context2.__smithy_context?.selectedHttpAuthScheme?.identity; if (identity2?.$source) { const credentials = identity2; if (credentials.accountId) { setFeature(context2, "RESOLVED_ACCOUNT_ID", "T"); } for (const [key, value] of Object.entries(credentials.$source ?? {})) { setFeature(context2, key, value); } } } var ACCOUNT_ID_ENDPOINT_REGEX; var init_check_features = __esm({ "../../node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es23(); init_dist_es35(); ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; __name(checkFeatures, "checkFeatures"); } }); // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js var USER_AGENT, X_AMZ_USER_AGENT, SPACE, UA_NAME_SEPARATOR, UA_NAME_ESCAPE_REGEX, UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR; var init_constants9 = __esm({ "../../node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); USER_AGENT = "user-agent"; X_AMZ_USER_AGENT = "x-amz-user-agent"; SPACE = " "; UA_NAME_SEPARATOR = "/"; UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; UA_ESCAPE_CHAR = "-"; } }); // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js function encodeFeatures(features2) { let buffer = ""; for (const key in features2) { const val = features2[key]; if (buffer.length + val.length + 1 <= BYTE_LIMIT) { if (buffer.length) { buffer += "," + val; } else { buffer += val; } continue; } break; } return buffer; } var BYTE_LIMIT; var init_encode_features = __esm({ "../../node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); BYTE_LIMIT = 1024; __name(encodeFeatures, "encodeFeatures"); } }); // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js var userAgentMiddleware, escapeUserAgent, getUserAgentMiddlewareOptions, getUserAgentPlugin; var init_user_agent_middleware = __esm({ "../../node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es33(); init_dist_es2(); init_check_features(); init_constants9(); init_encode_features(); userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context2) => async (args) => { const { request } = args; if (!HttpRequest.isInstance(request)) { return next(args); } const { headers } = request; const userAgent = context2?.userAgent?.map(escapeUserAgent) || []; const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); await checkFeatures(context2, options, args); const awsContext = context2; defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context2.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; const appId = await options.userAgentAppId(); if (appId) { defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`])); } const prefix = getUserAgentPrefix(); const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE); const normalUAValue = [ ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), ...customUserAgent ].join(SPACE); if (options.runtime !== "browser") { if (normalUAValue) { headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue; } headers[USER_AGENT] = sdkUserAgentValue; } else { headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; } return next({ ...args, request }); }, "userAgentMiddleware"); escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => { const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR); const version4 = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); const prefix = name.substring(0, prefixSeparatorIndex); let uaName = name.substring(prefixSeparatorIndex + 1); if (prefix === "api") { uaName = uaName.toLowerCase(); } return [prefix, uaName, version4].filter((item) => item && item.length > 0).reduce((acc, item, index) => { switch (index) { case 0: return item; case 1: return `${acc}/${item}`; default: return `${acc}#${item}`; } }, ""); }, "escapeUserAgent"); getUserAgentMiddlewareOptions = { name: "getUserAgentMiddleware", step: "build", priority: "low", tags: ["SET_USER_AGENT", "USER_AGENT"], override: true }; getUserAgentPlugin = /* @__PURE__ */ __name((config3) => ({ applyToStack: (clientStack) => { clientStack.add(userAgentMiddleware(config3), getUserAgentMiddlewareOptions); } }), "getUserAgentPlugin"); } }); // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js var init_dist_es36 = __esm({ "../../node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_configurations(); init_user_agent_middleware(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js var DEFAULT_USE_DUALSTACK_ENDPOINT; var init_NodeUseDualstackEndpointConfigOptions = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); DEFAULT_USE_DUALSTACK_ENDPOINT = false; } }); // ../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js var DEFAULT_USE_FIPS_ENDPOINT; var init_NodeUseFipsEndpointConfigOptions = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); DEFAULT_USE_FIPS_ENDPOINT = false; } }); // ../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js var init_resolveCustomEndpointsConfig = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js var init_resolveEndpointsConfig = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js var init_endpointsConfig = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_NodeUseDualstackEndpointConfigOptions(); init_NodeUseFipsEndpointConfigOptions(); init_resolveCustomEndpointsConfig(); init_resolveEndpointsConfig(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js var init_config3 = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionConfig/checkRegion.js var validRegions, checkRegion; var init_checkRegion = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionConfig/checkRegion.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es32(); validRegions = /* @__PURE__ */ new Set(); checkRegion = /* @__PURE__ */ __name((region, check3 = isValidHostLabel) => { if (!validRegions.has(region) && !check3(region)) { if (region === "*") { console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`); } else { throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`); } } else { validRegions.add(region); } }, "checkRegion"); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js var isFipsRegion; var init_isFipsRegion = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion"); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js var getRealRegion; var init_getRealRegion = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_isFipsRegion(); getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion"); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js var resolveRegionConfig; var init_resolveRegionConfig = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_checkRegion(); init_getRealRegion(); init_isFipsRegion(); resolveRegionConfig = /* @__PURE__ */ __name((input) => { const { region, useFipsEndpoint } = input; if (!region) { throw new Error("Region is missing"); } return Object.assign(input, { region: async () => { const providedRegion = typeof region === "function" ? await region() : region; const realRegion = getRealRegion(providedRegion); checkRegion(realRegion); return realRegion; }, useFipsEndpoint: async () => { const providedRegion = typeof region === "string" ? region : await region(); if (isFipsRegion(providedRegion)) { return true; } return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); } }); }, "resolveRegionConfig"); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js var init_regionConfig = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_config3(); init_resolveRegionConfig(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js var init_PartitionHash = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js var init_RegionHash = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js var init_getRegionInfo = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js var init_regionInfo = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_PartitionHash(); init_RegionHash(); init_getRegionInfo(); } }); // ../../node_modules/@smithy/config-resolver/dist-es/index.js var init_dist_es37 = __esm({ "../../node_modules/@smithy/config-resolver/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_endpointsConfig(); init_regionConfig(); init_regionInfo(); } }); // ../../node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js var resolveEventStreamSerdeConfig; var init_EventStreamSerdeConfig = __esm({ "../../node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); resolveEventStreamSerdeConfig = /* @__PURE__ */ __name((input) => Object.assign(input, { eventStreamMarshaller: input.eventStreamSerdeProvider(input) }), "resolveEventStreamSerdeConfig"); } }); // ../../node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js var init_dist_es38 = __esm({ "../../node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EventStreamSerdeConfig(); } }); // ../../node_modules/@smithy/middleware-content-length/dist-es/index.js function contentLengthMiddleware(bodyLengthChecker) { return (next) => async (args) => { const request = args.request; if (HttpRequest.isInstance(request)) { const { body, headers } = request; if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER2) === -1) { try { const length = bodyLengthChecker(body); request.headers = { ...request.headers, [CONTENT_LENGTH_HEADER2]: String(length) }; } catch (error50) { } } } return next({ ...args, request }); }; } var CONTENT_LENGTH_HEADER2, contentLengthMiddlewareOptions, getContentLengthPlugin; var init_dist_es39 = __esm({ "../../node_modules/@smithy/middleware-content-length/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); CONTENT_LENGTH_HEADER2 = "content-length"; __name(contentLengthMiddleware, "contentLengthMiddleware"); contentLengthMiddlewareOptions = { step: "build", tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], name: "contentLengthMiddleware", override: true }; getContentLengthPlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); } }), "getContentLengthPlugin"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js var resolveParamsForS3, DOMAIN_PATTERN, IP_ADDRESS_PATTERN, DOTS_PATTERN, isDnsCompatibleBucketName, isArnBucketName; var init_s3 = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => { const bucket = endpointParams?.Bucket || ""; if (typeof endpointParams.Bucket === "string") { endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); } if (isArnBucketName(bucket)) { if (endpointParams.ForcePathStyle === true) { throw new Error("Path-style addressing cannot be used with ARN buckets"); } } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { endpointParams.ForcePathStyle = true; } if (endpointParams.DisableMultiRegionAccessPoints) { endpointParams.disableMultiRegionAccessPoints = true; endpointParams.DisableMRAP = true; } return endpointParams; }, "resolveParamsForS3"); DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; DOTS_PATTERN = /\.\./; isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName"); isArnBucketName = /* @__PURE__ */ __name((bucketName) => { const [arn, partition2, service, , , bucket] = bucketName.split(":"); const isArn = arn === "arn" && bucketName.split(":").length >= 6; const isValidArn = Boolean(isArn && partition2 && service && bucket); if (isArn && !isValidArn) { throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); } return isValidArn; }, "isArnBucketName"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js var init_service_customizations = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_s3(); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js var createConfigValueProvider; var init_createConfigValueProvider = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config3, isClientContextParam = false) => { const configProvider = /* @__PURE__ */ __name(async () => { let configValue; if (isClientContextParam) { const clientContextParams = config3.clientContextParams; const nestedValue = clientContextParams?.[configKey]; configValue = nestedValue ?? config3[configKey] ?? config3[canonicalEndpointParamKey]; } else { configValue = config3[configKey] ?? config3[canonicalEndpointParamKey]; } if (typeof configValue === "function") { return configValue(); } return configValue; }, "configProvider"); if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { return async () => { const credentials = typeof config3.credentials === "function" ? await config3.credentials() : config3.credentials; const configValue = credentials?.credentialScope ?? credentials?.CredentialScope; return configValue; }; } if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { return async () => { const credentials = typeof config3.credentials === "function" ? await config3.credentials() : config3.credentials; const configValue = credentials?.accountId ?? credentials?.AccountId; return configValue; }; } if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { return async () => { if (config3.isCustomEndpoint === false) { return void 0; } const endpoint = await configProvider(); if (endpoint && typeof endpoint === "object") { if ("url" in endpoint) { return endpoint.url.href; } if ("hostname" in endpoint) { const { protocol, hostname: hostname3, port, path } = endpoint; return `${protocol}//${hostname3}${port ? ":" + port : ""}${path}`; } } return endpoint; }; } return configProvider; }, "createConfigValueProvider"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.browser.js var getEndpointFromConfig; var init_getEndpointFromConfig_browser = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getEndpointFromConfig = /* @__PURE__ */ __name(async (serviceId) => void 0, "getEndpointFromConfig"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js var toEndpointV12; var init_toEndpointV12 = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es13(); toEndpointV12 = /* @__PURE__ */ __name((endpoint) => { if (typeof endpoint === "object") { if ("url" in endpoint) { const v1Endpoint = parseUrl(endpoint.url); if (endpoint.headers) { v1Endpoint.headers = {}; for (const [name, values] of Object.entries(endpoint.headers)) { v1Endpoint.headers[name.toLowerCase()] = values.join(", "); } } return v1Endpoint; } return endpoint; } return parseUrl(endpoint); }, "toEndpointV1"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js var getEndpointFromInstructions, resolveParams; var init_getEndpointFromInstructions = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_service_customizations(); init_createConfigValueProvider(); init_getEndpointFromConfig_browser(); init_toEndpointV12(); getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context2) => { if (!clientConfig.isCustomEndpoint) { let endpointFromConfig; if (clientConfig.serviceConfiguredEndpoint) { endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); } else { endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId); } if (endpointFromConfig) { clientConfig.endpoint = () => Promise.resolve(toEndpointV12(endpointFromConfig)); clientConfig.isCustomEndpoint = true; } } const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); if (typeof clientConfig.endpointProvider !== "function") { throw new Error("config.endpointProvider is not set."); } const endpoint = clientConfig.endpointProvider(endpointParams, context2); if (clientConfig.isCustomEndpoint && clientConfig.endpoint) { const customEndpoint = await clientConfig.endpoint(); if (customEndpoint?.headers) { endpoint.headers ??= {}; for (const [name, value] of Object.entries(customEndpoint.headers)) { endpoint.headers[name] = Array.isArray(value) ? value : [value]; } } } return endpoint; }, "getEndpointFromInstructions"); resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => { const endpointParams = {}; const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {}; for (const [name, instruction] of Object.entries(instructions)) { switch (instruction.type) { case "staticContextParams": endpointParams[name] = instruction.value; break; case "contextParams": endpointParams[name] = commandInput[instruction.name]; break; case "clientContextParams": case "builtInParams": endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig, instruction.type !== "builtInParams")(); break; case "operationContextParams": endpointParams[name] = instruction.get(commandInput); break; default: throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); } } if (Object.keys(instructions).length === 0) { Object.assign(endpointParams, clientConfig); } if (String(clientConfig.serviceId).toLowerCase() === "s3") { await resolveParamsForS3(endpointParams); } return endpointParams; }, "resolveParams"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js var init_adaptors = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getEndpointFromInstructions(); init_toEndpointV12(); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js var endpointMiddleware; var init_endpointMiddleware = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); init_dist_es4(); init_getEndpointFromInstructions(); endpointMiddleware = /* @__PURE__ */ __name(({ config: config3, instructions }) => { return (next, context2) => async (args) => { if (config3.isCustomEndpoint) { setFeature2(context2, "ENDPOINT_OVERRIDE", "N"); } const endpoint = await getEndpointFromInstructions(args.input, { getEndpointParameterInstructions() { return instructions; } }, { ...config3 }, context2); context2.endpointV2 = endpoint; context2.authSchemes = endpoint.properties?.authSchemes; const authScheme = context2.authSchemes?.[0]; if (authScheme) { context2["signing_region"] = authScheme.signingRegion; context2["signing_service"] = authScheme.signingName; const smithyContext = getSmithyContext(context2); const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption; if (httpAuthOption) { httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, { signing_region: authScheme.signingRegion, signingRegion: authScheme.signingRegion, signing_service: authScheme.signingName, signingName: authScheme.signingName, signingRegionSet: authScheme.signingRegionSet }, authScheme.properties); } } return next({ ...args }); }; }, "endpointMiddleware"); } }); // ../../node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js var init_deserializerMiddleware = __esm({ "../../node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js var init_serializerMiddleware = __esm({ "../../node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js var serializerMiddlewareOption2; var init_serdePlugin = __esm({ "../../node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); serializerMiddlewareOption2 = { name: "serializerMiddleware", step: "serialize", tags: ["SERIALIZER"], override: true }; } }); // ../../node_modules/@smithy/middleware-serde/dist-es/index.js var init_dist_es40 = __esm({ "../../node_modules/@smithy/middleware-serde/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_deserializerMiddleware(); init_serdePlugin(); init_serializerMiddleware(); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js var endpointMiddlewareOptions, getEndpointPlugin; var init_getEndpointPlugin = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es40(); init_endpointMiddleware(); endpointMiddlewareOptions = { step: "serialize", tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], name: "endpointV2Middleware", override: true, relation: "before", toMiddleware: serializerMiddlewareOption2.name }; getEndpointPlugin = /* @__PURE__ */ __name((config3, instructions) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(endpointMiddleware({ config: config3, instructions }), endpointMiddlewareOptions); } }), "getEndpointPlugin"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js var resolveEndpointConfig; var init_resolveEndpointConfig = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es4(); init_getEndpointFromConfig_browser(); init_toEndpointV12(); resolveEndpointConfig = /* @__PURE__ */ __name((input) => { const tls = input.tls ?? true; const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input; const customEndpointProvider = endpoint != null ? async () => toEndpointV12(await normalizeProvider(endpoint)()) : void 0; const isCustomEndpoint = !!endpoint; const resolvedConfig = Object.assign(input, { endpoint: customEndpointProvider, tls, isCustomEndpoint, useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false), useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false) }); let configuredEndpointPromise = void 0; resolvedConfig.serviceConfiguredEndpoint = async () => { if (input.serviceId && !configuredEndpointPromise) { configuredEndpointPromise = getEndpointFromConfig(input.serviceId); } return configuredEndpointPromise; }; return resolvedConfig; }, "resolveEndpointConfig"); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointRequiredConfig.js var init_resolveEndpointRequiredConfig = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointRequiredConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/types.js var init_types6 = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/types.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-endpoint/dist-es/index.js var init_dist_es41 = __esm({ "../../node_modules/@smithy/middleware-endpoint/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_adaptors(); init_endpointMiddleware(); init_getEndpointPlugin(); init_resolveEndpointConfig(); init_resolveEndpointRequiredConfig(); init_types6(); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/delayDecider.js var init_delayDecider = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/delayDecider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/retryDecider.js var init_retryDecider = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/retryDecider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/util.js var asSdkError; var init_util2 = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/util.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); asSdkError = /* @__PURE__ */ __name((error50) => { if (error50 instanceof Error) return error50; if (error50 instanceof Object) return Object.assign(new Error(), error50); if (typeof error50 === "string") return new Error(error50); return new Error(`AWS SDK error wrapper for ${error50}`); }, "asSdkError"); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js var init_StandardRetryStrategy2 = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js var init_AdaptiveRetryStrategy2 = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/configurations.js var resolveRetryConfig; var init_configurations2 = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/configurations.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es4(); init_dist_es35(); resolveRetryConfig = /* @__PURE__ */ __name((input) => { const { retryStrategy, retryMode } = input; const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS); let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0; const getDefault = /* @__PURE__ */ __name(async () => await normalizeProvider(retryMode)() === RETRY_MODES.ADAPTIVE ? new AdaptiveRetryStrategy(maxAttempts) : new StandardRetryStrategy(maxAttempts), "getDefault"); return Object.assign(input, { maxAttempts, retryStrategy: () => controller ??= getDefault() }); }, "resolveRetryConfig"); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js var init_omitRetryHeadersMiddleware = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.browser.js var isStreamingPayload; var init_isStreamingPayload_browser = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); isStreamingPayload = /* @__PURE__ */ __name((request) => request?.body instanceof ReadableStream, "isStreamingPayload"); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js var retryMiddleware, isRetryStrategyV2, getRetryErrorInfo, getRetryErrorType, retryMiddlewareOptions, getRetryPlugin, getRetryAfterHint; var init_retryMiddleware = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es2(); init_dist_es34(); init_dist_es21(); init_dist_es35(); init_dist_es14(); init_isStreamingPayload_browser(); init_util2(); retryMiddleware = /* @__PURE__ */ __name((options) => (next, context2) => async (args) => { let retryStrategy = await options.retryStrategy(); const maxAttempts = await options.maxAttempts(); if (isRetryStrategyV2(retryStrategy)) { retryStrategy = retryStrategy; let retryToken = await retryStrategy.acquireInitialRetryToken(context2["partition_id"]); let lastError = new Error(); let attempts = 0; let totalRetryDelay = 0; const { request } = args; const isRequest2 = HttpRequest.isInstance(request); if (isRequest2) { request.headers[INVOCATION_ID_HEADER] = v4(); } while (true) { try { if (isRequest2) { request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; } const { response, output } = await next(args); retryStrategy.recordSuccess(retryToken); output.$metadata.attempts = attempts + 1; output.$metadata.totalRetryDelay = totalRetryDelay; return { response, output }; } catch (e2) { const retryErrorInfo = getRetryErrorInfo(e2); lastError = asSdkError(e2); if (isRequest2 && isStreamingPayload(request)) { (context2.logger instanceof NoOpLogger ? console : context2.logger)?.warn("An error was encountered in a non-retryable streaming request."); throw lastError; } try { retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); } catch (refreshError) { if (!lastError.$metadata) { lastError.$metadata = {}; } lastError.$metadata.attempts = attempts + 1; lastError.$metadata.totalRetryDelay = totalRetryDelay; throw lastError; } attempts = retryToken.getRetryCount(); const delay = retryToken.getRetryDelay(); totalRetryDelay += delay; await new Promise((resolve) => setTimeout(resolve, delay)); } } } else { retryStrategy = retryStrategy; if (retryStrategy?.mode) context2.userAgent = [...context2.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; return retryStrategy.retry(next, args); } }, "retryMiddleware"); isRetryStrategyV2 = /* @__PURE__ */ __name((retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined", "isRetryStrategyV2"); getRetryErrorInfo = /* @__PURE__ */ __name((error50) => { const errorInfo = { error: error50, errorType: getRetryErrorType(error50) }; const retryAfterHint = getRetryAfterHint(error50.$response); if (retryAfterHint) { errorInfo.retryAfterHint = retryAfterHint; } return errorInfo; }, "getRetryErrorInfo"); getRetryErrorType = /* @__PURE__ */ __name((error50) => { if (isThrottlingError(error50)) return "THROTTLING"; if (isTransientError(error50)) return "TRANSIENT"; if (isServerError(error50)) return "SERVER_ERROR"; return "CLIENT_ERROR"; }, "getRetryErrorType"); retryMiddlewareOptions = { name: "retryMiddleware", tags: ["RETRY"], step: "finalizeRequest", priority: "high", override: true }; getRetryPlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { clientStack.add(retryMiddleware(options), retryMiddlewareOptions); } }), "getRetryPlugin"); getRetryAfterHint = /* @__PURE__ */ __name((response) => { if (!HttpResponse.isInstance(response)) return; const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); if (!retryAfterHeaderName) return; const retryAfter = response.headers[retryAfterHeaderName]; const retryAfterSeconds = Number(retryAfter); if (!Number.isNaN(retryAfterSeconds)) return new Date(retryAfterSeconds * 1e3); const retryAfterDate = new Date(retryAfter); return retryAfterDate; }, "getRetryAfterHint"); } }); // ../../node_modules/@smithy/middleware-retry/dist-es/index.js var init_dist_es42 = __esm({ "../../node_modules/@smithy/middleware-retry/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AdaptiveRetryStrategy2(); init_StandardRetryStrategy2(); init_configurations2(); init_delayDecider(); init_omitRetryHeadersMiddleware(); init_retryDecider(); init_retryMiddleware(); } }); // ../../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js var signatureV4CrtContainer; var init_signature_v4_crt_container = __esm({ "../../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); signatureV4CrtContainer = { CrtSignerV4: null }; } }); // ../../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js var SignatureV4MultiRegion; var init_SignatureV4MultiRegion = __esm({ "../../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es18(); init_signature_v4_crt_container(); SignatureV4MultiRegion = class { sigv4aSigner; sigv4Signer; signerOptions; static sigv4aDependency() { if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") { return "crt"; } else if (typeof signatureV4aContainer.SignatureV4a === "function") { return "js"; } return "none"; } constructor(options) { this.sigv4Signer = new SignatureV4S3Express(options); this.signerOptions = options; } async sign(requestToSign, options = {}) { if (options.signingRegion === "*") { return this.getSigv4aSigner().sign(requestToSign, options); } return this.sigv4Signer.sign(requestToSign, options); } async signWithCredentials(requestToSign, credentials, options = {}) { if (options.signingRegion === "*") { const signer = this.getSigv4aSigner(); const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; if (CrtSignerV4 && signer instanceof CrtSignerV4) { return signer.signWithCredentials(requestToSign, credentials, options); } else { throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`); } } return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options); } async presign(originalRequest, options = {}) { if (options.signingRegion === "*") { const signer = this.getSigv4aSigner(); const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; if (CrtSignerV4 && signer instanceof CrtSignerV4) { return signer.presign(originalRequest, options); } else { throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`); } } return this.sigv4Signer.presign(originalRequest, options); } async presignWithCredentials(originalRequest, credentials, options = {}) { if (options.signingRegion === "*") { throw new Error("Method presignWithCredentials is not supported for [signingRegion=*]."); } return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options); } getSigv4aSigner() { if (!this.sigv4aSigner) { const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; const JsSigV4aSigner = signatureV4aContainer.SignatureV4a; if (this.signerOptions.runtime === "node") { if (!CrtSignerV4 && !JsSigV4aSigner) { throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"); } if (CrtSignerV4 && typeof CrtSignerV4 === "function") { this.sigv4aSigner = new CrtSignerV4({ ...this.signerOptions, signingAlgorithm: 1 }); } else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") { this.sigv4aSigner = new JsSigV4aSigner({ ...this.signerOptions }); } else { throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"); } } else { if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") { throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a"); } this.sigv4aSigner = new JsSigV4aSigner({ ...this.signerOptions }); } } return this.sigv4aSigner; } }; __name(SignatureV4MultiRegion, "SignatureV4MultiRegion"); } }); // ../../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js var init_dist_es43 = __esm({ "../../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_SignatureV4MultiRegion(); init_signature_v4_crt_container(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js var cs, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, _data, ruleSet; var init_ruleset = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); cs = "required"; ct = "type"; cu = "rules"; cv = "conditions"; cw = "fn"; cx = "argv"; cy = "ref"; cz = "assign"; cA = "url"; cB = "properties"; cC = "backend"; cD = "authSchemes"; cE = "disableDoubleEncoding"; cF = "signingName"; cG = "signingRegion"; cH = "headers"; cI = "signingRegionSet"; a = 6; b = false; c = true; d = "isSet"; e = "booleanEquals"; f = "error"; g = "aws.partition"; h = "stringEquals"; i = "getAttr"; j = "name"; k = "substring"; l = "bucketSuffix"; m = "parseURL"; n = "endpoint"; o = "tree"; p = "aws.isVirtualHostableS3Bucket"; q = "{url#scheme}://{Bucket}.{url#authority}{url#path}"; r = "not"; s = "accessPointSuffix"; t = "{url#scheme}://{url#authority}{url#path}"; u = "hardwareType"; v = "regionPrefix"; w = "bucketAliasSuffix"; x = "outpostId"; y = "isValidHostLabel"; z = "sigv4a"; A = "s3-outposts"; B = "s3"; C = "{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}"; D = "https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}"; E = "https://{Bucket}.s3.{partitionResult#dnsSuffix}"; F = "aws.parseArn"; G = "bucketArn"; H = "arnType"; I = ""; J = "s3-object-lambda"; K = "accesspoint"; L = "accessPointName"; M = "{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}"; N = "mrapPartition"; O = "outpostType"; P = "arnPrefix"; Q = "{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}"; R = "https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}"; S = "https://s3.{partitionResult#dnsSuffix}"; T = { [cs]: false, [ct]: "string" }; U = { [cs]: true, "default": false, [ct]: "boolean" }; V = { [cs]: false, [ct]: "boolean" }; W = { [cw]: e, [cx]: [{ [cy]: "Accelerate" }, true] }; X = { [cw]: e, [cx]: [{ [cy]: "UseFIPS" }, true] }; Y = { [cw]: e, [cx]: [{ [cy]: "UseDualStack" }, true] }; Z = { [cw]: d, [cx]: [{ [cy]: "Endpoint" }] }; aa = { [cw]: g, [cx]: [{ [cy]: "Region" }], [cz]: "partitionResult" }; ab = { [cw]: h, [cx]: [{ [cw]: i, [cx]: [{ [cy]: "partitionResult" }, j] }, "aws-cn"] }; ac = { [cw]: d, [cx]: [{ [cy]: "Bucket" }] }; ad = { [cy]: "Bucket" }; ae = { [cv]: [W], [f]: "S3Express does not support S3 Accelerate.", [ct]: f }; af = { [cv]: [Z, { [cw]: m, [cx]: [{ [cy]: "Endpoint" }], [cz]: "url" }], [cu]: [{ [cv]: [{ [cw]: d, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }] }, { [cw]: e, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }, true] }], [cu]: [{ [cv]: [{ [cw]: e, [cx]: [{ [cw]: i, [cx]: [{ [cy]: "url" }, "isIp"] }, true] }], [cu]: [{ [cv]: [{ [cw]: "uriEncode", [cx]: [ad], [cz]: "uri_encoded_bucket" }], [cu]: [{ [n]: { [cA]: "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }], [ct]: o }], [ct]: o }, { [cv]: [{ [cw]: p, [cx]: [ad, false] }], [cu]: [{ [n]: { [cA]: q, [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }], [ct]: o }, { [f]: "S3Express bucket name is not a valid virtual hostable name.", [ct]: f }], [ct]: o }, { [cv]: [{ [cw]: e, [cx]: [{ [cw]: i, [cx]: [{ [cy]: "url" }, "isIp"] }, true] }], [cu]: [{ [cv]: [{ [cw]: "uriEncode", [cx]: [ad], [cz]: "uri_encoded_bucket" }], [cu]: [{ [n]: { [cA]: "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }], [ct]: o }], [ct]: o }, { [cv]: [{ [cw]: p, [cx]: [ad, false] }], [cu]: [{ [n]: { [cA]: q, [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }], [ct]: o }, { [f]: "S3Express bucket name is not a valid virtual hostable name.", [ct]: f }], [ct]: o }; ag = { [cw]: m, [cx]: [{ [cy]: "Endpoint" }], [cz]: "url" }; ah = { [cw]: e, [cx]: [{ [cw]: i, [cx]: [{ [cy]: "url" }, "isIp"] }, true] }; ai = { [cy]: "url" }; aj = { [cw]: "uriEncode", [cx]: [ad], [cz]: "uri_encoded_bucket" }; ak = { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: "s3express", [cG]: "{Region}" }] }; al = {}; am = { [cw]: p, [cx]: [ad, false] }; an = { [f]: "S3Express bucket name is not a valid virtual hostable name.", [ct]: f }; ao = { [cw]: d, [cx]: [{ [cy]: "UseS3ExpressControlEndpoint" }] }; ap = { [cw]: e, [cx]: [{ [cy]: "UseS3ExpressControlEndpoint" }, true] }; aq = { [cw]: r, [cx]: [Z] }; ar = { [cw]: e, [cx]: [{ [cy]: "UseDualStack" }, false] }; as = { [cw]: e, [cx]: [{ [cy]: "UseFIPS" }, false] }; at = { [f]: "Unrecognized S3Express bucket name format.", [ct]: f }; au = { [cw]: r, [cx]: [ac] }; av = { [cy]: u }; aw = { [cv]: [aq], [f]: "Expected a endpoint to be specified but no endpoint was found", [ct]: f }; ax = { [cD]: [{ [cE]: true, [j]: z, [cF]: A, [cI]: ["*"] }, { [cE]: true, [j]: "sigv4", [cF]: A, [cG]: "{Region}" }] }; ay = { [cw]: e, [cx]: [{ [cy]: "ForcePathStyle" }, false] }; az = { [cy]: "ForcePathStyle" }; aA = { [cw]: e, [cx]: [{ [cy]: "Accelerate" }, false] }; aB = { [cw]: h, [cx]: [{ [cy]: "Region" }, "aws-global"] }; aC = { [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: B, [cG]: "us-east-1" }] }; aD = { [cw]: r, [cx]: [aB] }; aE = { [cw]: e, [cx]: [{ [cy]: "UseGlobalEndpoint" }, true] }; aF = { [cA]: "https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: B, [cG]: "{Region}" }] }, [cH]: {} }; aG = { [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: B, [cG]: "{Region}" }] }; aH = { [cw]: e, [cx]: [{ [cy]: "UseGlobalEndpoint" }, false] }; aI = { [cA]: "https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; aJ = { [cA]: "https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; aK = { [cA]: "https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; aL = { [cw]: e, [cx]: [{ [cw]: i, [cx]: [ai, "isIp"] }, false] }; aM = { [cA]: C, [cB]: aG, [cH]: {} }; aN = { [cA]: q, [cB]: aG, [cH]: {} }; aO = { [n]: aN, [ct]: n }; aP = { [cA]: D, [cB]: aG, [cH]: {} }; aQ = { [cA]: "https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; aR = { [f]: "Invalid region: region was not a valid DNS name.", [ct]: f }; aS = { [cy]: G }; aT = { [cy]: H }; aU = { [cw]: i, [cx]: [aS, "service"] }; aV = { [cy]: L }; aW = { [cv]: [Y], [f]: "S3 Object Lambda does not support Dual-stack", [ct]: f }; aX = { [cv]: [W], [f]: "S3 Object Lambda does not support S3 Accelerate", [ct]: f }; aY = { [cv]: [{ [cw]: d, [cx]: [{ [cy]: "DisableAccessPoints" }] }, { [cw]: e, [cx]: [{ [cy]: "DisableAccessPoints" }, true] }], [f]: "Access points are not supported for this operation", [ct]: f }; aZ = { [cv]: [{ [cw]: d, [cx]: [{ [cy]: "UseArnRegion" }] }, { [cw]: e, [cx]: [{ [cy]: "UseArnRegion" }, false] }, { [cw]: r, [cx]: [{ [cw]: h, [cx]: [{ [cw]: i, [cx]: [aS, "region"] }, "{Region}"] }] }], [f]: "Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`", [ct]: f }; ba = { [cw]: i, [cx]: [{ [cy]: "bucketPartition" }, j] }; bb = { [cw]: i, [cx]: [aS, "accountId"] }; bc = { [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: J, [cG]: "{bucketArn#region}" }] }; bd = { [f]: "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`", [ct]: f }; be = { [f]: "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`", [ct]: f }; bf = { [f]: "Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)", [ct]: f }; bg = { [f]: "Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`", [ct]: f }; bh = { [f]: "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.", [ct]: f }; bi = { [f]: "Invalid ARN: Expected a resource of the format `accesspoint:` but no name was provided", [ct]: f }; bj = { [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: B, [cG]: "{bucketArn#region}" }] }; bk = { [cD]: [{ [cE]: true, [j]: z, [cF]: A, [cI]: ["*"] }, { [cE]: true, [j]: "sigv4", [cF]: A, [cG]: "{bucketArn#region}" }] }; bl = { [cw]: F, [cx]: [ad] }; bm = { [cA]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; bn = { [cA]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; bo = { [cA]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; bp = { [cA]: Q, [cB]: aG, [cH]: {} }; bq = { [cA]: "https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; br = { [cy]: "UseObjectLambdaEndpoint" }; bs = { [cD]: [{ [cE]: true, [j]: "sigv4", [cF]: J, [cG]: "{Region}" }] }; bt = { [cA]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; bu = { [cA]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; bv = { [cA]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; bw = { [cA]: t, [cB]: aG, [cH]: {} }; bx = { [cA]: "https://s3.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; by = [{ [cy]: "Region" }]; bz = [{ [cy]: "Endpoint" }]; bA = [ad]; bB = [W]; bC = [Z, ag]; bD = [{ [cw]: d, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }] }, { [cw]: e, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }, true] }]; bE = [aj]; bF = [am]; bG = [aa]; bH = [X, Y]; bI = [X, ar]; bJ = [as, Y]; bK = [as, ar]; bL = [{ [cw]: k, [cx]: [ad, 6, 14, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 14, 16, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bM = [{ [cv]: [X, Y], [n]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n }, { [cv]: bI, [n]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n }, { [cv]: bJ, [n]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n }, { [cv]: bK, [n]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n }]; bN = [{ [cw]: k, [cx]: [ad, 6, 15, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 15, 17, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bO = [{ [cw]: k, [cx]: [ad, 6, 19, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 19, 21, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bP = [{ [cw]: k, [cx]: [ad, 6, 20, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 20, 22, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bQ = [{ [cw]: k, [cx]: [ad, 6, 26, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 26, 28, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bR = [{ [cv]: [X, Y], [n]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }, { [cv]: bI, [n]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }, { [cv]: bJ, [n]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }, { [cv]: bK, [n]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n }]; bS = [ad, 0, 7, true]; bT = [{ [cw]: k, [cx]: [ad, 7, 15, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 15, 17, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bU = [{ [cw]: k, [cx]: [ad, 7, 16, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 16, 18, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bV = [{ [cw]: k, [cx]: [ad, 7, 20, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 20, 22, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bW = [{ [cw]: k, [cx]: [ad, 7, 21, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 21, 23, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bX = [{ [cw]: k, [cx]: [ad, 7, 27, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k, [cx]: [ad, 27, 29, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; bY = [ac]; bZ = [{ [cw]: y, [cx]: [{ [cy]: x }, false] }]; ca = [{ [cw]: h, [cx]: [{ [cy]: v }, "beta"] }]; cb = ["*"]; cc = [{ [cw]: y, [cx]: [{ [cy]: "Region" }, false] }]; cd = [{ [cw]: h, [cx]: [{ [cy]: "Region" }, "us-east-1"] }]; ce = [{ [cw]: h, [cx]: [aT, K] }]; cf = [{ [cw]: i, [cx]: [aS, "resourceId[1]"], [cz]: L }, { [cw]: r, [cx]: [{ [cw]: h, [cx]: [aV, I] }] }]; cg = [aS, "resourceId[1]"]; ch = [Y]; ci = [{ [cw]: r, [cx]: [{ [cw]: h, [cx]: [{ [cw]: i, [cx]: [aS, "region"] }, I] }] }]; cj = [{ [cw]: r, [cx]: [{ [cw]: d, [cx]: [{ [cw]: i, [cx]: [aS, "resourceId[2]"] }] }] }]; ck = [aS, "resourceId[2]"]; cl = [{ [cw]: g, [cx]: [{ [cw]: i, [cx]: [aS, "region"] }], [cz]: "bucketPartition" }]; cm = [{ [cw]: h, [cx]: [ba, { [cw]: i, [cx]: [{ [cy]: "partitionResult" }, j] }] }]; cn = [{ [cw]: y, [cx]: [{ [cw]: i, [cx]: [aS, "region"] }, true] }]; co = [{ [cw]: y, [cx]: [bb, false] }]; cp = [{ [cw]: y, [cx]: [aV, false] }]; cq = [X]; cr = [{ [cw]: y, [cx]: [{ [cy]: "Region" }, true] }]; _data = { version: "1.0", parameters: { Bucket: T, Region: T, UseFIPS: U, UseDualStack: U, Endpoint: T, ForcePathStyle: U, Accelerate: U, UseGlobalEndpoint: U, UseObjectLambdaEndpoint: V, Key: T, Prefix: T, CopySource: T, DisableAccessPoints: V, DisableMultiRegionAccessPoints: U, UseArnRegion: V, UseS3ExpressControlEndpoint: V, DisableS3ExpressSessionAuth: V }, [cu]: [{ [cv]: [{ [cw]: d, [cx]: by }], [cu]: [{ [cv]: [W, X], error: "Accelerate cannot be used with FIPS", [ct]: f }, { [cv]: [Y, Z], error: "Cannot set dual-stack in combination with a custom endpoint.", [ct]: f }, { [cv]: [Z, X], error: "A custom endpoint cannot be combined with FIPS", [ct]: f }, { [cv]: [Z, W], error: "A custom endpoint cannot be combined with S3 Accelerate", [ct]: f }, { [cv]: [X, aa, ab], error: "Partition does not support FIPS", [ct]: f }, { [cv]: [ac, { [cw]: k, [cx]: [ad, 0, a, c], [cz]: l }, { [cw]: h, [cx]: [{ [cy]: l }, "--x-s3"] }], [cu]: [ae, af, { [cv]: [ao, ap], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: [aj, aq], [cu]: [{ [cv]: bH, endpoint: { [cA]: "https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n }, { [cv]: bI, endpoint: { [cA]: "https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n }, { [cv]: bJ, endpoint: { [cA]: "https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n }, { [cv]: bK, endpoint: { [cA]: "https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n }], [ct]: o }], [ct]: o }], [ct]: o }, { [cv]: bF, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: bD, [cu]: [{ [cv]: bL, [cu]: bM, [ct]: o }, { [cv]: bN, [cu]: bM, [ct]: o }, { [cv]: bO, [cu]: bM, [ct]: o }, { [cv]: bP, [cu]: bM, [ct]: o }, { [cv]: bQ, [cu]: bM, [ct]: o }, at], [ct]: o }, { [cv]: bL, [cu]: bR, [ct]: o }, { [cv]: bN, [cu]: bR, [ct]: o }, { [cv]: bO, [cu]: bR, [ct]: o }, { [cv]: bP, [cu]: bR, [ct]: o }, { [cv]: bQ, [cu]: bR, [ct]: o }, at], [ct]: o }], [ct]: o }, an], [ct]: o }, { [cv]: [ac, { [cw]: k, [cx]: bS, [cz]: s }, { [cw]: h, [cx]: [{ [cy]: s }, "--xa-s3"] }], [cu]: [ae, af, { [cv]: bF, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: bD, [cu]: [{ [cv]: bT, [cu]: bM, [ct]: o }, { [cv]: bU, [cu]: bM, [ct]: o }, { [cv]: bV, [cu]: bM, [ct]: o }, { [cv]: bW, [cu]: bM, [ct]: o }, { [cv]: bX, [cu]: bM, [ct]: o }, at], [ct]: o }, { [cv]: bT, [cu]: bR, [ct]: o }, { [cv]: bU, [cu]: bR, [ct]: o }, { [cv]: bV, [cu]: bR, [ct]: o }, { [cv]: bW, [cu]: bR, [ct]: o }, { [cv]: bX, [cu]: bR, [ct]: o }, at], [ct]: o }], [ct]: o }, an], [ct]: o }, { [cv]: [au, ao, ap], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: bC, endpoint: { [cA]: t, [cB]: ak, [cH]: al }, [ct]: n }, { [cv]: bH, endpoint: { [cA]: "https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n }, { [cv]: bI, endpoint: { [cA]: "https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n }, { [cv]: bJ, endpoint: { [cA]: "https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n }, { [cv]: bK, endpoint: { [cA]: "https://s3express-control.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n }], [ct]: o }], [ct]: o }, { [cv]: [ac, { [cw]: k, [cx]: [ad, 49, 50, c], [cz]: u }, { [cw]: k, [cx]: [ad, 8, 12, c], [cz]: v }, { [cw]: k, [cx]: bS, [cz]: w }, { [cw]: k, [cx]: [ad, 32, 49, c], [cz]: x }, { [cw]: g, [cx]: by, [cz]: "regionPartition" }, { [cw]: h, [cx]: [{ [cy]: w }, "--op-s3"] }], [cu]: [{ [cv]: bZ, [cu]: [{ [cv]: bF, [cu]: [{ [cv]: [{ [cw]: h, [cx]: [av, "e"] }], [cu]: [{ [cv]: ca, [cu]: [aw, { [cv]: bC, endpoint: { [cA]: "https://{Bucket}.ec2.{url#authority}", [cB]: ax, [cH]: al }, [ct]: n }], [ct]: o }, { endpoint: { [cA]: "https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cB]: ax, [cH]: al }, [ct]: n }], [ct]: o }, { [cv]: [{ [cw]: h, [cx]: [av, "o"] }], [cu]: [{ [cv]: ca, [cu]: [aw, { [cv]: bC, endpoint: { [cA]: "https://{Bucket}.op-{outpostId}.{url#authority}", [cB]: ax, [cH]: al }, [ct]: n }], [ct]: o }, { endpoint: { [cA]: "https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cB]: ax, [cH]: al }, [ct]: n }], [ct]: o }, { error: 'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"', [ct]: f }], [ct]: o }, { error: "Invalid Outposts Bucket alias - it must be a valid bucket name.", [ct]: f }], [ct]: o }, { error: "Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.", [ct]: f }], [ct]: o }, { [cv]: bY, [cu]: [{ [cv]: [Z, { [cw]: r, [cx]: [{ [cw]: d, [cx]: [{ [cw]: m, [cx]: bz }] }] }], error: "Custom endpoint `{Endpoint}` was not a valid URI", [ct]: f }, { [cv]: [ay, am], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cc, [cu]: [{ [cv]: [W, ab], error: "S3 Accelerate cannot be used in this region", [ct]: f }, { [cv]: [Y, X, aA, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [Y, X, aA, aq, aD, aE], [cu]: [{ endpoint: aF, [ct]: n }], [ct]: o }, { [cv]: [Y, X, aA, aq, aD, aH], endpoint: aF, [ct]: n }, { [cv]: [ar, X, aA, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, X, aA, aq, aD, aE], [cu]: [{ endpoint: aI, [ct]: n }], [ct]: o }, { [cv]: [ar, X, aA, aq, aD, aH], endpoint: aI, [ct]: n }, { [cv]: [Y, as, W, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [Y, as, W, aq, aD, aE], [cu]: [{ endpoint: aJ, [ct]: n }], [ct]: o }, { [cv]: [Y, as, W, aq, aD, aH], endpoint: aJ, [ct]: n }, { [cv]: [Y, as, aA, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [Y, as, aA, aq, aD, aE], [cu]: [{ endpoint: aK, [ct]: n }], [ct]: o }, { [cv]: [Y, as, aA, aq, aD, aH], endpoint: aK, [ct]: n }, { [cv]: [ar, as, aA, Z, ag, ah, aB], endpoint: { [cA]: C, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, as, aA, Z, ag, aL, aB], endpoint: { [cA]: q, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, as, aA, Z, ag, ah, aD, aE], [cu]: [{ [cv]: cd, endpoint: aM, [ct]: n }, { endpoint: aM, [ct]: n }], [ct]: o }, { [cv]: [ar, as, aA, Z, ag, aL, aD, aE], [cu]: [{ [cv]: cd, endpoint: aN, [ct]: n }, aO], [ct]: o }, { [cv]: [ar, as, aA, Z, ag, ah, aD, aH], endpoint: aM, [ct]: n }, { [cv]: [ar, as, aA, Z, ag, aL, aD, aH], endpoint: aN, [ct]: n }, { [cv]: [ar, as, W, aq, aB], endpoint: { [cA]: D, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, as, W, aq, aD, aE], [cu]: [{ [cv]: cd, endpoint: aP, [ct]: n }, { endpoint: aP, [ct]: n }], [ct]: o }, { [cv]: [ar, as, W, aq, aD, aH], endpoint: aP, [ct]: n }, { [cv]: [ar, as, aA, aq, aB], endpoint: { [cA]: E, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, as, aA, aq, aD, aE], [cu]: [{ [cv]: cd, endpoint: { [cA]: E, [cB]: aG, [cH]: al }, [ct]: n }, { endpoint: aQ, [ct]: n }], [ct]: o }, { [cv]: [ar, as, aA, aq, aD, aH], endpoint: aQ, [ct]: n }], [ct]: o }, aR], [ct]: o }], [ct]: o }, { [cv]: [Z, ag, { [cw]: h, [cx]: [{ [cw]: i, [cx]: [ai, "scheme"] }, "http"] }, { [cw]: p, [cx]: [ad, c] }, ay, as, ar, aA], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cc, [cu]: [aO], [ct]: o }, aR], [ct]: o }], [ct]: o }, { [cv]: [ay, { [cw]: F, [cx]: bA, [cz]: G }], [cu]: [{ [cv]: [{ [cw]: i, [cx]: [aS, "resourceId[0]"], [cz]: H }, { [cw]: r, [cx]: [{ [cw]: h, [cx]: [aT, I] }] }], [cu]: [{ [cv]: [{ [cw]: h, [cx]: [aU, J] }], [cu]: [{ [cv]: ce, [cu]: [{ [cv]: cf, [cu]: [aW, aX, { [cv]: ci, [cu]: [aY, { [cv]: cj, [cu]: [aZ, { [cv]: cl, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cm, [cu]: [{ [cv]: cn, [cu]: [{ [cv]: [{ [cw]: h, [cx]: [bb, I] }], error: "Invalid ARN: Missing account id", [ct]: f }, { [cv]: co, [cu]: [{ [cv]: cp, [cu]: [{ [cv]: bC, endpoint: { [cA]: M, [cB]: bc, [cH]: al }, [ct]: n }, { [cv]: cq, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bc, [cH]: al }, [ct]: n }, { endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bc, [cH]: al }, [ct]: n }], [ct]: o }, bd], [ct]: o }, be], [ct]: o }, bf], [ct]: o }, bg], [ct]: o }], [ct]: o }], [ct]: o }, bh], [ct]: o }, { error: "Invalid ARN: bucket ARN is missing a region", [ct]: f }], [ct]: o }, bi], [ct]: o }, { error: "Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`", [ct]: f }], [ct]: o }, { [cv]: ce, [cu]: [{ [cv]: cf, [cu]: [{ [cv]: ci, [cu]: [{ [cv]: ce, [cu]: [{ [cv]: ci, [cu]: [aY, { [cv]: cj, [cu]: [aZ, { [cv]: cl, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: [{ [cw]: h, [cx]: [ba, "{partitionResult#name}"] }], [cu]: [{ [cv]: cn, [cu]: [{ [cv]: [{ [cw]: h, [cx]: [aU, B] }], [cu]: [{ [cv]: co, [cu]: [{ [cv]: cp, [cu]: [{ [cv]: bB, error: "Access Points do not support S3 Accelerate", [ct]: f }, { [cv]: bH, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n }, { [cv]: bI, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n }, { [cv]: bJ, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n }, { [cv]: [as, ar, Z, ag], endpoint: { [cA]: M, [cB]: bj, [cH]: al }, [ct]: n }, { [cv]: bK, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n }], [ct]: o }, bd], [ct]: o }, be], [ct]: o }, { error: "Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}", [ct]: f }], [ct]: o }, bf], [ct]: o }, bg], [ct]: o }], [ct]: o }], [ct]: o }, bh], [ct]: o }], [ct]: o }], [ct]: o }, { [cv]: [{ [cw]: y, [cx]: [aV, c] }], [cu]: [{ [cv]: ch, error: "S3 MRAP does not support dual-stack", [ct]: f }, { [cv]: cq, error: "S3 MRAP does not support FIPS", [ct]: f }, { [cv]: bB, error: "S3 MRAP does not support S3 Accelerate", [ct]: f }, { [cv]: [{ [cw]: e, [cx]: [{ [cy]: "DisableMultiRegionAccessPoints" }, c] }], error: "Invalid configuration: Multi-Region Access Point ARNs are disabled.", [ct]: f }, { [cv]: [{ [cw]: g, [cx]: by, [cz]: N }], [cu]: [{ [cv]: [{ [cw]: h, [cx]: [{ [cw]: i, [cx]: [{ [cy]: N }, j] }, { [cw]: i, [cx]: [aS, "partition"] }] }], [cu]: [{ endpoint: { [cA]: "https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}", [cB]: { [cD]: [{ [cE]: c, name: z, [cF]: B, [cI]: cb }] }, [cH]: al }, [ct]: n }], [ct]: o }, { error: "Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`", [ct]: f }], [ct]: o }], [ct]: o }, { error: "Invalid Access Point Name", [ct]: f }], [ct]: o }, bi], [ct]: o }, { [cv]: [{ [cw]: h, [cx]: [aU, A] }], [cu]: [{ [cv]: ch, error: "S3 Outposts does not support Dual-stack", [ct]: f }, { [cv]: cq, error: "S3 Outposts does not support FIPS", [ct]: f }, { [cv]: bB, error: "S3 Outposts does not support S3 Accelerate", [ct]: f }, { [cv]: [{ [cw]: d, [cx]: [{ [cw]: i, [cx]: [aS, "resourceId[4]"] }] }], error: "Invalid Arn: Outpost Access Point ARN contains sub resources", [ct]: f }, { [cv]: [{ [cw]: i, [cx]: cg, [cz]: x }], [cu]: [{ [cv]: bZ, [cu]: [aZ, { [cv]: cl, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cm, [cu]: [{ [cv]: cn, [cu]: [{ [cv]: co, [cu]: [{ [cv]: [{ [cw]: i, [cx]: ck, [cz]: O }], [cu]: [{ [cv]: [{ [cw]: i, [cx]: [aS, "resourceId[3]"], [cz]: L }], [cu]: [{ [cv]: [{ [cw]: h, [cx]: [{ [cy]: O }, K] }], [cu]: [{ [cv]: bC, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}", [cB]: bk, [cH]: al }, [ct]: n }, { endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bk, [cH]: al }, [ct]: n }], [ct]: o }, { error: "Expected an outpost type `accesspoint`, found {outpostType}", [ct]: f }], [ct]: o }, { error: "Invalid ARN: expected an access point name", [ct]: f }], [ct]: o }, { error: "Invalid ARN: Expected a 4-component resource", [ct]: f }], [ct]: o }, be], [ct]: o }, bf], [ct]: o }, bg], [ct]: o }], [ct]: o }], [ct]: o }, { error: "Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`", [ct]: f }], [ct]: o }, { error: "Invalid ARN: The Outpost Id was not set", [ct]: f }], [ct]: o }, { error: "Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})", [ct]: f }], [ct]: o }, { error: "Invalid ARN: No ARN type specified", [ct]: f }], [ct]: o }, { [cv]: [{ [cw]: k, [cx]: [ad, 0, 4, b], [cz]: P }, { [cw]: h, [cx]: [{ [cy]: P }, "arn:"] }, { [cw]: r, [cx]: [{ [cw]: d, [cx]: [bl] }] }], error: "Invalid ARN: `{Bucket}` was not a valid ARN", [ct]: f }, { [cv]: [{ [cw]: e, [cx]: [az, c] }, bl], error: "Path-style addressing cannot be used with ARN buckets", [ct]: f }, { [cv]: bE, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: [aA], [cu]: [{ [cv]: [Y, aq, X, aB], endpoint: { [cA]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [Y, aq, X, aD, aE], [cu]: [{ endpoint: bm, [ct]: n }], [ct]: o }, { [cv]: [Y, aq, X, aD, aH], endpoint: bm, [ct]: n }, { [cv]: [ar, aq, X, aB], endpoint: { [cA]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, aq, X, aD, aE], [cu]: [{ endpoint: bn, [ct]: n }], [ct]: o }, { [cv]: [ar, aq, X, aD, aH], endpoint: bn, [ct]: n }, { [cv]: [Y, aq, as, aB], endpoint: { [cA]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [Y, aq, as, aD, aE], [cu]: [{ endpoint: bo, [ct]: n }], [ct]: o }, { [cv]: [Y, aq, as, aD, aH], endpoint: bo, [ct]: n }, { [cv]: [ar, Z, ag, as, aB], endpoint: { [cA]: Q, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, Z, ag, as, aD, aE], [cu]: [{ [cv]: cd, endpoint: bp, [ct]: n }, { endpoint: bp, [ct]: n }], [ct]: o }, { [cv]: [ar, Z, ag, as, aD, aH], endpoint: bp, [ct]: n }, { [cv]: [ar, aq, as, aB], endpoint: { [cA]: R, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [ar, aq, as, aD, aE], [cu]: [{ [cv]: cd, endpoint: { [cA]: R, [cB]: aG, [cH]: al }, [ct]: n }, { endpoint: bq, [ct]: n }], [ct]: o }, { [cv]: [ar, aq, as, aD, aH], endpoint: bq, [ct]: n }], [ct]: o }, { error: "Path-style addressing cannot be used with S3 Accelerate", [ct]: f }], [ct]: o }], [ct]: o }], [ct]: o }, { [cv]: [{ [cw]: d, [cx]: [br] }, { [cw]: e, [cx]: [br, c] }], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cr, [cu]: [aW, aX, { [cv]: bC, endpoint: { [cA]: t, [cB]: bs, [cH]: al }, [ct]: n }, { [cv]: cq, endpoint: { [cA]: "https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: bs, [cH]: al }, [ct]: n }, { endpoint: { [cA]: "https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}", [cB]: bs, [cH]: al }, [ct]: n }], [ct]: o }, aR], [ct]: o }], [ct]: o }, { [cv]: [au], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cr, [cu]: [{ [cv]: [X, Y, aq, aB], endpoint: { [cA]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [X, Y, aq, aD, aE], [cu]: [{ endpoint: bt, [ct]: n }], [ct]: o }, { [cv]: [X, Y, aq, aD, aH], endpoint: bt, [ct]: n }, { [cv]: [X, ar, aq, aB], endpoint: { [cA]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [X, ar, aq, aD, aE], [cu]: [{ endpoint: bu, [ct]: n }], [ct]: o }, { [cv]: [X, ar, aq, aD, aH], endpoint: bu, [ct]: n }, { [cv]: [as, Y, aq, aB], endpoint: { [cA]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [as, Y, aq, aD, aE], [cu]: [{ endpoint: bv, [ct]: n }], [ct]: o }, { [cv]: [as, Y, aq, aD, aH], endpoint: bv, [ct]: n }, { [cv]: [as, ar, Z, ag, aB], endpoint: { [cA]: t, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [as, ar, Z, ag, aD, aE], [cu]: [{ [cv]: cd, endpoint: bw, [ct]: n }, { endpoint: bw, [ct]: n }], [ct]: o }, { [cv]: [as, ar, Z, ag, aD, aH], endpoint: bw, [ct]: n }, { [cv]: [as, ar, aq, aB], endpoint: { [cA]: S, [cB]: aC, [cH]: al }, [ct]: n }, { [cv]: [as, ar, aq, aD, aE], [cu]: [{ [cv]: cd, endpoint: { [cA]: S, [cB]: aG, [cH]: al }, [ct]: n }, { endpoint: bx, [ct]: n }], [ct]: o }, { [cv]: [as, ar, aq, aD, aH], endpoint: bx, [ct]: n }], [ct]: o }, aR], [ct]: o }], [ct]: o }], [ct]: o }, { error: "A region must be set when sending requests to S3.", [ct]: f }] }; ruleSet = _data; } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js var cache2, defaultEndpointResolver; var init_endpointResolver = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es33(); init_dist_es32(); init_ruleset(); cache2 = new EndpointCache({ size: 50, params: [ "Accelerate", "Bucket", "DisableAccessPoints", "DisableMultiRegionAccessPoints", "DisableS3ExpressSessionAuth", "Endpoint", "ForcePathStyle", "Region", "UseArnRegion", "UseDualStack", "UseFIPS", "UseGlobalEndpoint", "UseObjectLambdaEndpoint", "UseS3ExpressControlEndpoint" ] }); defaultEndpointResolver = /* @__PURE__ */ __name((endpointParams, context2 = {}) => { return cache2.get(endpointParams, () => resolveEndpoint(ruleSet, { endpointParams, logger: context2.logger })); }, "defaultEndpointResolver"); customEndpointFunctions.aws = awsEndpointFunctions; } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "s3", region: authParameters.region }, propertiesExtractor: (config3, context2) => ({ signingProperties: { config: config3, context: context2 } }) }; } function createAwsAuthSigv4aHttpAuthOption(authParameters) { return { schemeId: "aws.auth#sigv4a", signingProperties: { name: "s3", region: authParameters.region }, propertiesExtractor: (config3, context2) => ({ signingProperties: { config: config3, context: context2 } }) }; } var createEndpointRuleSetHttpAuthSchemeParametersProvider, _defaultS3HttpAuthSchemeParametersProvider, defaultS3HttpAuthSchemeParametersProvider, createEndpointRuleSetHttpAuthSchemeProvider, _defaultS3HttpAuthSchemeProvider, defaultS3HttpAuthSchemeProvider, resolveHttpAuthSchemeConfig; var init_httpAuthSchemeProvider = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es23(); init_dist_es43(); init_dist_es41(); init_dist_es4(); init_endpointResolver(); createEndpointRuleSetHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name((defaultHttpAuthSchemeParametersProvider) => async (config3, context2, input) => { if (!input) { throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`"); } const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config3, context2, input); const instructionsFn = getSmithyContext(context2)?.commandInstance?.constructor?.getEndpointParameterInstructions; if (!instructionsFn) { throw new Error(`getEndpointParameterInstructions() is not defined on '${context2.commandName}'`); } const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config3); return Object.assign(defaultParameters, endpointParameters); }, "createEndpointRuleSetHttpAuthSchemeParametersProvider"); _defaultS3HttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config3, context2, input) => { return { operation: getSmithyContext(context2).operation, region: await normalizeProvider(config3.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }, "_defaultS3HttpAuthSchemeParametersProvider"); defaultS3HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultS3HttpAuthSchemeParametersProvider); __name(createAwsAuthSigv4HttpAuthOption, "createAwsAuthSigv4HttpAuthOption"); __name(createAwsAuthSigv4aHttpAuthOption, "createAwsAuthSigv4aHttpAuthOption"); createEndpointRuleSetHttpAuthSchemeProvider = /* @__PURE__ */ __name((defaultEndpointResolver2, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => { const endpointRuleSetHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => { const endpoint = defaultEndpointResolver2(authParameters); const authSchemes = endpoint.properties?.authSchemes; if (!authSchemes) { return defaultHttpAuthSchemeResolver(authParameters); } const options = []; for (const scheme of authSchemes) { const { name: resolvedName, properties = {}, ...rest } = scheme; const name = resolvedName.toLowerCase(); if (resolvedName !== name) { console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`); } let schemeId; if (name === "sigv4a") { schemeId = "aws.auth#sigv4a"; const sigv4Present = authSchemes.find((s2) => { const name2 = s2.name.toLowerCase(); return name2 !== "sigv4a" && name2.startsWith("sigv4"); }); if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) { continue; } } else if (name.startsWith("sigv4")) { schemeId = "aws.auth#sigv4"; } else { throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`); } const createOption = createHttpAuthOptionFunctions[schemeId]; if (!createOption) { throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`); } const option = createOption(authParameters); option.schemeId = schemeId; option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties }; options.push(option); } return options; }, "endpointRuleSetHttpAuthSchemeProvider"); return endpointRuleSetHttpAuthSchemeProvider; }, "createEndpointRuleSetHttpAuthSchemeProvider"); _defaultS3HttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => { const options = []; switch (authParameters.operation) { default: { options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); options.push(createAwsAuthSigv4aHttpAuthOption(authParameters)); } } return options; }, "_defaultS3HttpAuthSchemeProvider"); defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultS3HttpAuthSchemeProvider, { "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption, "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption }); resolveHttpAuthSchemeConfig = /* @__PURE__ */ __name((config3) => { const config_0 = resolveAwsSdkSigV4Config(config3); const config_1 = resolveAwsSdkSigV4AConfig(config_0); return Object.assign(config_1, { authSchemePreference: normalizeProvider(config3.authSchemePreference ?? []) }); }, "resolveHttpAuthSchemeConfig"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js var resolveClientEndpointParameters, commonParams; var init_EndpointParameters = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { return Object.assign(options, { useFipsEndpoint: options.useFipsEndpoint ?? false, useDualstackEndpoint: options.useDualstackEndpoint ?? false, forcePathStyle: options.forcePathStyle ?? false, useAccelerateEndpoint: options.useAccelerateEndpoint ?? false, useGlobalEndpoint: options.useGlobalEndpoint ?? false, disableMultiregionAccessPoints: options.disableMultiregionAccessPoints ?? false, defaultSigningName: "s3", clientContextParams: options.clientContextParams ?? {} }); }, "resolveClientEndpointParameters"); commonParams = { ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" }, UseArnRegion: { type: "clientContextParams", name: "useArnRegion" }, DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" }, Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" }, DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" }, UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js var S3ServiceException; var init_S3ServiceException = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es21(); S3ServiceException = class extends ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, S3ServiceException.prototype); } }; __name(S3ServiceException, "S3ServiceException"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/models/errors.js var NoSuchUpload, AccessDenied, ObjectNotInActiveTierError, BucketAlreadyExists, BucketAlreadyOwnedByYou, NoSuchBucket, InvalidObjectState, NoSuchKey, NotFound, EncryptionTypeMismatch, InvalidRequest, InvalidWriteOffset, TooManyParts, IdempotencyParameterMismatch, ObjectAlreadyInActiveTierError; var init_errors3 = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/models/errors.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_S3ServiceException(); NoSuchUpload = class extends S3ServiceException { name = "NoSuchUpload"; $fault = "client"; constructor(opts) { super({ name: "NoSuchUpload", $fault: "client", ...opts }); Object.setPrototypeOf(this, NoSuchUpload.prototype); } }; __name(NoSuchUpload, "NoSuchUpload"); AccessDenied = class extends S3ServiceException { name = "AccessDenied"; $fault = "client"; constructor(opts) { super({ name: "AccessDenied", $fault: "client", ...opts }); Object.setPrototypeOf(this, AccessDenied.prototype); } }; __name(AccessDenied, "AccessDenied"); ObjectNotInActiveTierError = class extends S3ServiceException { name = "ObjectNotInActiveTierError"; $fault = "client"; constructor(opts) { super({ name: "ObjectNotInActiveTierError", $fault: "client", ...opts }); Object.setPrototypeOf(this, ObjectNotInActiveTierError.prototype); } }; __name(ObjectNotInActiveTierError, "ObjectNotInActiveTierError"); BucketAlreadyExists = class extends S3ServiceException { name = "BucketAlreadyExists"; $fault = "client"; constructor(opts) { super({ name: "BucketAlreadyExists", $fault: "client", ...opts }); Object.setPrototypeOf(this, BucketAlreadyExists.prototype); } }; __name(BucketAlreadyExists, "BucketAlreadyExists"); BucketAlreadyOwnedByYou = class extends S3ServiceException { name = "BucketAlreadyOwnedByYou"; $fault = "client"; constructor(opts) { super({ name: "BucketAlreadyOwnedByYou", $fault: "client", ...opts }); Object.setPrototypeOf(this, BucketAlreadyOwnedByYou.prototype); } }; __name(BucketAlreadyOwnedByYou, "BucketAlreadyOwnedByYou"); NoSuchBucket = class extends S3ServiceException { name = "NoSuchBucket"; $fault = "client"; constructor(opts) { super({ name: "NoSuchBucket", $fault: "client", ...opts }); Object.setPrototypeOf(this, NoSuchBucket.prototype); } }; __name(NoSuchBucket, "NoSuchBucket"); InvalidObjectState = class extends S3ServiceException { name = "InvalidObjectState"; $fault = "client"; StorageClass; AccessTier; constructor(opts) { super({ name: "InvalidObjectState", $fault: "client", ...opts }); Object.setPrototypeOf(this, InvalidObjectState.prototype); this.StorageClass = opts.StorageClass; this.AccessTier = opts.AccessTier; } }; __name(InvalidObjectState, "InvalidObjectState"); NoSuchKey = class extends S3ServiceException { name = "NoSuchKey"; $fault = "client"; constructor(opts) { super({ name: "NoSuchKey", $fault: "client", ...opts }); Object.setPrototypeOf(this, NoSuchKey.prototype); } }; __name(NoSuchKey, "NoSuchKey"); NotFound = class extends S3ServiceException { name = "NotFound"; $fault = "client"; constructor(opts) { super({ name: "NotFound", $fault: "client", ...opts }); Object.setPrototypeOf(this, NotFound.prototype); } }; __name(NotFound, "NotFound"); EncryptionTypeMismatch = class extends S3ServiceException { name = "EncryptionTypeMismatch"; $fault = "client"; constructor(opts) { super({ name: "EncryptionTypeMismatch", $fault: "client", ...opts }); Object.setPrototypeOf(this, EncryptionTypeMismatch.prototype); } }; __name(EncryptionTypeMismatch, "EncryptionTypeMismatch"); InvalidRequest = class extends S3ServiceException { name = "InvalidRequest"; $fault = "client"; constructor(opts) { super({ name: "InvalidRequest", $fault: "client", ...opts }); Object.setPrototypeOf(this, InvalidRequest.prototype); } }; __name(InvalidRequest, "InvalidRequest"); InvalidWriteOffset = class extends S3ServiceException { name = "InvalidWriteOffset"; $fault = "client"; constructor(opts) { super({ name: "InvalidWriteOffset", $fault: "client", ...opts }); Object.setPrototypeOf(this, InvalidWriteOffset.prototype); } }; __name(InvalidWriteOffset, "InvalidWriteOffset"); TooManyParts = class extends S3ServiceException { name = "TooManyParts"; $fault = "client"; constructor(opts) { super({ name: "TooManyParts", $fault: "client", ...opts }); Object.setPrototypeOf(this, TooManyParts.prototype); } }; __name(TooManyParts, "TooManyParts"); IdempotencyParameterMismatch = class extends S3ServiceException { name = "IdempotencyParameterMismatch"; $fault = "client"; constructor(opts) { super({ name: "IdempotencyParameterMismatch", $fault: "client", ...opts }); Object.setPrototypeOf(this, IdempotencyParameterMismatch.prototype); } }; __name(IdempotencyParameterMismatch, "IdempotencyParameterMismatch"); ObjectAlreadyInActiveTierError = class extends S3ServiceException { name = "ObjectAlreadyInActiveTierError"; $fault = "client"; constructor(opts) { super({ name: "ObjectAlreadyInActiveTierError", $fault: "client", ...opts }); Object.setPrototypeOf(this, ObjectAlreadyInActiveTierError.prototype); } }; __name(ObjectAlreadyInActiveTierError, "ObjectAlreadyInActiveTierError"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js var _A, _AAO, _AC, _ACL, _ACL_, _ACLn, _ACP, _ACT, _ACn, _AD, _ADb, _AED, _AF, _AH, _AHl, _AI, _AIMU, _AKI, _AM, _AMU, _AMUO, _AMUR, _AMl, _AO, _AOl, _APA, _APAc, _AQRD, _AR, _ARI, _AS, _ASBD, _ASSEBD, _ASr, _AT, _An, _B, _BA, _BAE, _BAI, _BAOBY, _BET, _BGR, _BI, _BKE, _BLC, _BLN, _BLS, _BLT, _BN, _BNu, _BP, _BPA, _BPP, _BR, _BRy, _BS, _Bo, _Bu, _C, _CA, _CACL, _CB, _CBC, _CBMC, _CBMCR, _CBMTC, _CBMTCR, _CBO, _CBR, _CC, _CCRC, _CCRCC, _CCRCNVME, _CC_, _CD, _CD_, _CDo, _CE, _CE_, _CEo, _CF, _CFC, _CL, _CL_, _CL__, _CLo, _CM, _CMD, _CMU, _CMUO, _CMUOr, _CMUR, _CMURo, _CMURr, _CMUo, _CMUr, _CMh, _CO, _COO, _COR, _CORSC, _CORSR, _CORSRu, _CORo, _CP, _CPL, _CPLo, _CPR, _CPo, _CPom, _CR, _CRSBA, _CR_, _CS, _CSHA, _CSHAh, _CSIM, _CSIMS, _CSINM, _CSIUS, _CSO, _CSR, _CSRo, _CSRr, _CSSSECA, _CSSSECK, _CSSSECKMD, _CSV, _CSVI, _CSVIn, _CSVO, _CSo, _CSr, _CT, _CT_, _CTl, _CTo, _CTom, _CTon, _Co, _Cod, _Com, _Con, _Cont, _Cr, _D, _DAI, _DB, _DBAC, _DBACR, _DBC, _DBCR, _DBE, _DBER, _DBIC, _DBICR, _DBITC, _DBITCR, _DBL, _DBLR, _DBMC, _DBMCR, _DBMCRe, _DBMCe, _DBMTC, _DBMTCR, _DBOC, _DBOCR, _DBP, _DBPR, _DBR, _DBRR, _DBRe, _DBT, _DBTR, _DBW, _DBWR, _DE, _DIM, _DIMS, _DINM, _DIUS, _DM, _DME, _DMR, _DMVI, _DMe, _DN, _DO, _DOO, _DOOe, _DOR, _DORe, _DOT, _DOTO, _DOTR, _DOe, _DOel, _DOele, _DPAB, _DPABR, _DR, _DRe, _DRel, _DRes, _Da, _De, _Del, _Deli, _Des, _Desc, _Det, _E, _EA, _EBC, _EBO, _EC, _ECr, _ED, _EDr, _EE, _EH, _EHx, _EM, _EODM, _EOR, _ES, _ESBO, _ET, _ETL, _ETM, _ETa, _ETn, _ETv, _ETx, _En, _Ena, _End, _Er, _Err, _Ev, _Eve, _Ex, _Exp, _F, _FD, _FHI, _FO, _FR, _FRL, _FRi, _Fi, _Fo, _Fr, _G, _GBA, _GBAC, _GBACO, _GBACOe, _GBACR, _GBACRe, _GBACe, _GBAO, _GBAOe, _GBAR, _GBARe, _GBAe, _GBC, _GBCO, _GBCR, _GBE, _GBEO, _GBER, _GBIC, _GBICO, _GBICR, _GBITC, _GBITCO, _GBITCR, _GBL, _GBLC, _GBLCO, _GBLCR, _GBLO, _GBLOe, _GBLR, _GBLRe, _GBLe, _GBMC, _GBMCO, _GBMCOe, _GBMCR, _GBMCRe, _GBMCRet, _GBMCe, _GBMTC, _GBMTCO, _GBMTCR, _GBMTCRe, _GBNC, _GBNCR, _GBOC, _GBOCO, _GBOCR, _GBP, _GBPO, _GBPR, _GBPS, _GBPSO, _GBPSR, _GBR, _GBRO, _GBRP, _GBRPO, _GBRPR, _GBRR, _GBT, _GBTO, _GBTR, _GBV, _GBVO, _GBVR, _GBW, _GBWO, _GBWR, _GFC, _GJP, _GO, _GOA, _GOAO, _GOAOe, _GOAP, _GOAR, _GOARe, _GOARet, _GOAe, _GOLC, _GOLCO, _GOLCR, _GOLH, _GOLHO, _GOLHR, _GOO, _GOR, _GORO, _GORR, _GORe, _GOT, _GOTO, _GOTOe, _GOTR, _GOTRe, _GOTe, _GPAB, _GPABO, _GPABR, _GR, _GRACP, _GW, _GWACP, _Gr, _Gra, _HB, _HBO, _HBR, _HECRE, _HN, _HO, _HOO, _HOR, _HRC, _I, _IC, _ICL, _ID, _IDn, _IDnv, _IE, _IEn, _IF, _IL, _IM, _IMIT, _IMLMT, _IMS, _IMS_, _IMSf, _IMUR, _IM_, _INM, _INM_, _IOF, _IOS, _IOV, _IP, _IPA, _IPM, _IR, _IRIP, _IS, _ISBD, _ISn, _IT, _ITAO, _ITC, _ITCL, _ITCR, _ITCU, _ITCn, _ITF, _IUS, _IUS_, _IWO, _In, _Ini, _JSON, _JSONI, _JSONO, _JTC, _JTCR, _JTCU, _K, _KC, _KI, _KKA, _KM, _KMSC, _KMSKA, _KMSKI, _KMSMKID, _KPE, _L, _LAMBR, _LAMDBR, _LB, _LBAC, _LBACO, _LBACR, _LBACRi, _LBIC, _LBICO, _LBICR, _LBITC, _LBITCO, _LBITCR, _LBMC, _LBMCO, _LBMCR, _LBO, _LBR, _LBRi, _LC, _LCi, _LDB, _LDBO, _LDBR, _LE, _LEi, _LFA, _LFC, _LFCL, _LFCa, _LH, _LI, _LICR, _LM, _LMCR, _LMT, _LMU, _LMUO, _LMUR, _LMURi, _LM_, _LO, _LOO, _LOR, _LOV, _LOVO, _LOVOi, _LOVR, _LOVRi, _LOVi, _LP, _LPO, _LPR, _LPRi, _LR, _LRAO, _LRF, _LRi, _LVR, _M, _MAO, _MAS, _MB, _MC, _MCL, _MCR, _MCe, _MD, _MDB, _MDf, _ME, _MF, _MFA, _MFAD, _MK, _MM, _MOS, _MP, _MTC, _MTCR, _MTEC, _MU, _MUL, _MUa, _Ma, _Me, _Mes, _Mi, _Mo, _N, _NC, _NCF, _NCT, _ND, _NEKKAS, _NF, _NKM, _NM, _NNV, _NPNM, _NSB, _NSK, _NSU, _NUIM, _NVE, _NVIM, _NVT, _NVTL, _NVTo, _O, _OA, _OAIATE, _OC, _OCR, _OCRw, _OE, _OF, _OI, _OIL, _OL, _OLC, _OLE, _OLEFB, _OLLH, _OLLHS, _OLM, _OLR, _OLRUD, _OLRb, _OLb, _ONIATE, _OO, _OOA, _OP, _OPb, _OS, _OSGT, _OSLT, _OSV, _OSu, _OV, _OVL, _Ob, _Obj, _P, _PABC, _PBA, _PBAC, _PBACR, _PBACRu, _PBACu, _PBAR, _PBARu, _PBAu, _PBC, _PBCR, _PBE, _PBER, _PBIC, _PBICR, _PBITC, _PBITCR, _PBL, _PBLC, _PBLCO, _PBLCR, _PBLR, _PBMC, _PBMCR, _PBNC, _PBNCR, _PBOC, _PBOCR, _PBP, _PBPR, _PBR, _PBRP, _PBRPR, _PBRR, _PBT, _PBTR, _PBV, _PBVR, _PBW, _PBWR, _PC, _PDS, _PE, _PI, _PL, _PN, _PNM, _PO, _POA, _POAO, _POAR, _POLC, _POLCO, _POLCR, _POLH, _POLHO, _POLHR, _POO, _POR, _PORO, _PORR, _PORu, _POT, _POTO, _POTR, _PP, _PPAB, _PPABR, _PS, _Pa, _Par, _Parq, _Pay, _Payl, _Pe, _Po, _Pr, _Pri, _Pro, _Q, _QA, _QC, _QCL, _QCu, _QCue, _QEC, _QF, _Qu, _R, _RART, _RC, _RCC, _RCD, _RCE, _RCL, _RCT, _RCe, _RD, _RE, _RED, _REe, _REec, _RKKID, _RKPW, _RKW, _RM, _RO, _ROO, _ROOe, _ROP, _ROR, _RORe, _ROe, _RP, _RPB, _RPC, _RPe, _RR, _RRAO, _RRF, _RRe, _RRep, _RReq, _RRes, _RRo, _RS, _RSe, _RSen, _RT, _RTV, _RTe, _RUD, _Ra, _Re, _Rec, _Red, _Ret, _Ro, _Ru, _S, _SA, _SAK, _SAs, _SB, _SBD, _SC, _SCA, _SCADE, _SCV, _SCe, _SCt, _SDV, _SE, _SIM, _SIMS, _SINM, _SIUS, _SK, _SKEO, _SKF, _SKe, _SL, _SM, _SOC, _SOCES, _SOCO, _SOCR, _SP, _SPi, _SR, _SS, _SSC, _SSE, _SSEA, _SSEBD, _SSEC, _SSECA, _SSECK, _SSECKMD, _SSEKMS, _SSEKMSE, _SSEKMSEC, _SSEKMSKI, _SSER, _SSERe, _SSES, _ST, _STD, _STDR, _S_, _Sc, _Si, _St, _Sta, _Su, _T, _TA, _TAo, _TB, _TBA, _TBT, _TC, _TCL, _TCo, _TCop, _TD, _TDMOS, _TG, _TGa, _TL, _TLr, _TMP, _TN, _TNa, _TOKF, _TP, _TPC, _TS, _TSa, _Ta, _Tag, _Ti, _Tie, _Tier, _Tim, _To, _Top, _Tr, _Tra, _Ty, _U, _UBMITC, _UBMITCR, _UBMJTC, _UBMJTCR, _UI, _UIM, _UM, _UOE, _UOER, _UOERp, _UP, _UPC, _UPCO, _UPCR, _UPO, _UPR, _URI, _Up, _V, _VC, _VI, _VIM, _Ve, _Ver, _WC, _WGOR, _WGORR, _WOB, _WRL, _Y, _ar, _br, _c, _ct, _d, _e, _eP, _en, _et, _fo, _h, _hC, _hE, _hH, _hL, _hP, _hPH, _hQ, _hi, _i, _iT, _km, _m, _mb, _mdb, _mk, _mp, _mu, _p, _pN, _pnm, _rcc, _rcd, _rce, _rcl, _rct, _re, _s, _sa, _st, _uI, _uim, _vI, _vim, _x, _xA, _xF, _xN, _xNm, _xaa, _xaad, _xaapa, _xaari, _xaas, _xaba, _xabgr, _xabln, _xablt, _xabn, _xabole, _xabolt, _xabr, _xaca, _xacc, _xacc_, _xacc__, _xacm, _xacrsba, _xacs, _xacs_, _xacs__, _xacsim, _xacsims, _xacsinm, _xacsius, _xacsm, _xacsr, _xacssseca, _xacssseck, _xacssseckM, _xacsvi, _xact, _xact_, _xadm, _xae, _xaebo, _xafec, _xafem, _xafhCC, _xafhCD, _xafhCE, _xafhCL, _xafhCR, _xafhCT, _xafhE, _xafhE_, _xafhLM, _xafhar, _xafhxacc, _xafhxacc_, _xafhxacc__, _xafhxacs, _xafhxacs_, _xafhxadm, _xafhxae, _xafhxamm, _xafhxampc, _xafhxaollh, _xafhxaolm, _xafhxaolrud, _xafhxar, _xafhxarc, _xafhxars, _xafhxasc, _xafhxasse, _xafhxasseakki, _xafhxassebke, _xafhxasseca, _xafhxasseckM, _xafhxatc, _xafhxavi, _xafs, _xagfc, _xagr, _xagra, _xagw, _xagwa, _xaimit, _xaimlmt, _xaims, _xam, _xam_, _xamd, _xamm, _xamos, _xamp, _xampc, _xaoa, _xaollh, _xaolm, _xaolrud, _xaoo, _xaooa, _xaos, _xapnm, _xar, _xarc, _xarop, _xarp, _xarr, _xars, _xars_, _xarsim, _xarsims, _xarsinm, _xarsius, _xart, _xasc, _xasca, _xasdv, _xasebo, _xasse, _xasseakki, _xassebke, _xassec, _xasseca, _xasseck, _xasseckM, _xat, _xatc, _xatd, _xatdmos, _xavi, _xawob, _xawrl, _xs, n0, _s_registry, S3ServiceException$, n0_registry, AccessDenied$, BucketAlreadyExists$, BucketAlreadyOwnedByYou$, EncryptionTypeMismatch$, IdempotencyParameterMismatch$, InvalidObjectState$, InvalidRequest$, InvalidWriteOffset$, NoSuchBucket$, NoSuchKey$, NoSuchUpload$, NotFound$, ObjectAlreadyInActiveTierError$, ObjectNotInActiveTierError$, TooManyParts$, errorTypeRegistries, CopySourceSSECustomerKey, NonEmptyKmsKeyArnString, SessionCredentialValue, SSECustomerKey, SSEKMSEncryptionContext, SSEKMSKeyId, StreamingBlob, AbacStatus$, AbortIncompleteMultipartUpload$, AbortMultipartUploadOutput$, AbortMultipartUploadRequest$, AccelerateConfiguration$, AccessControlPolicy$, AccessControlTranslation$, AnalyticsAndOperator$, AnalyticsConfiguration$, AnalyticsExportDestination$, AnalyticsS3BucketDestination$, BlockedEncryptionTypes$, Bucket$, BucketInfo$, BucketLifecycleConfiguration$, BucketLoggingStatus$, Checksum$, CommonPrefix$, CompletedMultipartUpload$, CompletedPart$, CompleteMultipartUploadOutput$, CompleteMultipartUploadRequest$, Condition$, ContinuationEvent$, CopyObjectOutput$, CopyObjectRequest$, CopyObjectResult$, CopyPartResult$, CORSConfiguration$, CORSRule$, CreateBucketConfiguration$, CreateBucketMetadataConfigurationRequest$, CreateBucketMetadataTableConfigurationRequest$, CreateBucketOutput$, CreateBucketRequest$, CreateMultipartUploadOutput$, CreateMultipartUploadRequest$, CreateSessionOutput$, CreateSessionRequest$, CSVInput$, CSVOutput$, DefaultRetention$, Delete$, DeleteBucketAnalyticsConfigurationRequest$, DeleteBucketCorsRequest$, DeleteBucketEncryptionRequest$, DeleteBucketIntelligentTieringConfigurationRequest$, DeleteBucketInventoryConfigurationRequest$, DeleteBucketLifecycleRequest$, DeleteBucketMetadataConfigurationRequest$, DeleteBucketMetadataTableConfigurationRequest$, DeleteBucketMetricsConfigurationRequest$, DeleteBucketOwnershipControlsRequest$, DeleteBucketPolicyRequest$, DeleteBucketReplicationRequest$, DeleteBucketRequest$, DeleteBucketTaggingRequest$, DeleteBucketWebsiteRequest$, DeletedObject$, DeleteMarkerEntry$, DeleteMarkerReplication$, DeleteObjectOutput$, DeleteObjectRequest$, DeleteObjectsOutput$, DeleteObjectsRequest$, DeleteObjectTaggingOutput$, DeleteObjectTaggingRequest$, DeletePublicAccessBlockRequest$, Destination$, DestinationResult$, Encryption$, EncryptionConfiguration$, EndEvent$, _Error$, ErrorDetails$, ErrorDocument$, EventBridgeConfiguration$, ExistingObjectReplication$, FilterRule$, GetBucketAbacOutput$, GetBucketAbacRequest$, GetBucketAccelerateConfigurationOutput$, GetBucketAccelerateConfigurationRequest$, GetBucketAclOutput$, GetBucketAclRequest$, GetBucketAnalyticsConfigurationOutput$, GetBucketAnalyticsConfigurationRequest$, GetBucketCorsOutput$, GetBucketCorsRequest$, GetBucketEncryptionOutput$, GetBucketEncryptionRequest$, GetBucketIntelligentTieringConfigurationOutput$, GetBucketIntelligentTieringConfigurationRequest$, GetBucketInventoryConfigurationOutput$, GetBucketInventoryConfigurationRequest$, GetBucketLifecycleConfigurationOutput$, GetBucketLifecycleConfigurationRequest$, GetBucketLocationOutput$, GetBucketLocationRequest$, GetBucketLoggingOutput$, GetBucketLoggingRequest$, GetBucketMetadataConfigurationOutput$, GetBucketMetadataConfigurationRequest$, GetBucketMetadataConfigurationResult$, GetBucketMetadataTableConfigurationOutput$, GetBucketMetadataTableConfigurationRequest$, GetBucketMetadataTableConfigurationResult$, GetBucketMetricsConfigurationOutput$, GetBucketMetricsConfigurationRequest$, GetBucketNotificationConfigurationRequest$, GetBucketOwnershipControlsOutput$, GetBucketOwnershipControlsRequest$, GetBucketPolicyOutput$, GetBucketPolicyRequest$, GetBucketPolicyStatusOutput$, GetBucketPolicyStatusRequest$, GetBucketReplicationOutput$, GetBucketReplicationRequest$, GetBucketRequestPaymentOutput$, GetBucketRequestPaymentRequest$, GetBucketTaggingOutput$, GetBucketTaggingRequest$, GetBucketVersioningOutput$, GetBucketVersioningRequest$, GetBucketWebsiteOutput$, GetBucketWebsiteRequest$, GetObjectAclOutput$, GetObjectAclRequest$, GetObjectAttributesOutput$, GetObjectAttributesParts$, GetObjectAttributesRequest$, GetObjectLegalHoldOutput$, GetObjectLegalHoldRequest$, GetObjectLockConfigurationOutput$, GetObjectLockConfigurationRequest$, GetObjectOutput$, GetObjectRequest$, GetObjectRetentionOutput$, GetObjectRetentionRequest$, GetObjectTaggingOutput$, GetObjectTaggingRequest$, GetObjectTorrentOutput$, GetObjectTorrentRequest$, GetPublicAccessBlockOutput$, GetPublicAccessBlockRequest$, GlacierJobParameters$, Grant$, Grantee$, HeadBucketOutput$, HeadBucketRequest$, HeadObjectOutput$, HeadObjectRequest$, IndexDocument$, Initiator$, InputSerialization$, IntelligentTieringAndOperator$, IntelligentTieringConfiguration$, IntelligentTieringFilter$, InventoryConfiguration$, InventoryDestination$, InventoryEncryption$, InventoryFilter$, InventoryS3BucketDestination$, InventorySchedule$, InventoryTableConfiguration$, InventoryTableConfigurationResult$, InventoryTableConfigurationUpdates$, JournalTableConfiguration$, JournalTableConfigurationResult$, JournalTableConfigurationUpdates$, JSONInput$, JSONOutput$, LambdaFunctionConfiguration$, LifecycleExpiration$, LifecycleRule$, LifecycleRuleAndOperator$, LifecycleRuleFilter$, ListBucketAnalyticsConfigurationsOutput$, ListBucketAnalyticsConfigurationsRequest$, ListBucketIntelligentTieringConfigurationsOutput$, ListBucketIntelligentTieringConfigurationsRequest$, ListBucketInventoryConfigurationsOutput$, ListBucketInventoryConfigurationsRequest$, ListBucketMetricsConfigurationsOutput$, ListBucketMetricsConfigurationsRequest$, ListBucketsOutput$, ListBucketsRequest$, ListDirectoryBucketsOutput$, ListDirectoryBucketsRequest$, ListMultipartUploadsOutput$, ListMultipartUploadsRequest$, ListObjectsOutput$, ListObjectsRequest$, ListObjectsV2Output$, ListObjectsV2Request$, ListObjectVersionsOutput$, ListObjectVersionsRequest$, ListPartsOutput$, ListPartsRequest$, LocationInfo$, LoggingEnabled$, MetadataConfiguration$, MetadataConfigurationResult$, MetadataEntry$, MetadataTableConfiguration$, MetadataTableConfigurationResult$, MetadataTableEncryptionConfiguration$, Metrics$, MetricsAndOperator$, MetricsConfiguration$, MultipartUpload$, NoncurrentVersionExpiration$, NoncurrentVersionTransition$, NotificationConfiguration$, NotificationConfigurationFilter$, _Object$, ObjectIdentifier$, ObjectLockConfiguration$, ObjectLockLegalHold$, ObjectLockRetention$, ObjectLockRule$, ObjectPart$, ObjectVersion$, OutputLocation$, OutputSerialization$, Owner$, OwnershipControls$, OwnershipControlsRule$, ParquetInput$, Part$, PartitionedPrefix$, PolicyStatus$, Progress$, ProgressEvent$, PublicAccessBlockConfiguration$, PutBucketAbacRequest$, PutBucketAccelerateConfigurationRequest$, PutBucketAclRequest$, PutBucketAnalyticsConfigurationRequest$, PutBucketCorsRequest$, PutBucketEncryptionRequest$, PutBucketIntelligentTieringConfigurationRequest$, PutBucketInventoryConfigurationRequest$, PutBucketLifecycleConfigurationOutput$, PutBucketLifecycleConfigurationRequest$, PutBucketLoggingRequest$, PutBucketMetricsConfigurationRequest$, PutBucketNotificationConfigurationRequest$, PutBucketOwnershipControlsRequest$, PutBucketPolicyRequest$, PutBucketReplicationRequest$, PutBucketRequestPaymentRequest$, PutBucketTaggingRequest$, PutBucketVersioningRequest$, PutBucketWebsiteRequest$, PutObjectAclOutput$, PutObjectAclRequest$, PutObjectLegalHoldOutput$, PutObjectLegalHoldRequest$, PutObjectLockConfigurationOutput$, PutObjectLockConfigurationRequest$, PutObjectOutput$, PutObjectRequest$, PutObjectRetentionOutput$, PutObjectRetentionRequest$, PutObjectTaggingOutput$, PutObjectTaggingRequest$, PutPublicAccessBlockRequest$, QueueConfiguration$, RecordExpiration$, RecordsEvent$, Redirect$, RedirectAllRequestsTo$, RenameObjectOutput$, RenameObjectRequest$, ReplicaModifications$, ReplicationConfiguration$, ReplicationRule$, ReplicationRuleAndOperator$, ReplicationRuleFilter$, ReplicationTime$, ReplicationTimeValue$, RequestPaymentConfiguration$, RequestProgress$, RestoreObjectOutput$, RestoreObjectRequest$, RestoreRequest$, RestoreStatus$, RoutingRule$, S3KeyFilter$, S3Location$, S3TablesDestination$, S3TablesDestinationResult$, ScanRange$, SelectObjectContentOutput$, SelectObjectContentRequest$, SelectParameters$, ServerSideEncryptionByDefault$, ServerSideEncryptionConfiguration$, ServerSideEncryptionRule$, SessionCredentials$, SimplePrefix$, SourceSelectionCriteria$, SSEKMS$, SseKmsEncryptedObjects$, SSEKMSEncryption$, SSES3$, Stats$, StatsEvent$, StorageClassAnalysis$, StorageClassAnalysisDataExport$, Tag$, Tagging$, TargetGrant$, TargetObjectKeyFormat$, Tiering$, TopicConfiguration$, Transition$, UpdateBucketMetadataInventoryTableConfigurationRequest$, UpdateBucketMetadataJournalTableConfigurationRequest$, UpdateObjectEncryptionRequest$, UpdateObjectEncryptionResponse$, UploadPartCopyOutput$, UploadPartCopyRequest$, UploadPartOutput$, UploadPartRequest$, VersioningConfiguration$, WebsiteConfiguration$, WriteGetObjectResponseRequest$, __Unit, AllowedHeaders, AllowedMethods, AllowedOrigins, AnalyticsConfigurationList, Buckets, ChecksumAlgorithmList, CommonPrefixList, CompletedPartList, CORSRules, DeletedObjects, DeleteMarkers, EncryptionTypeList, Errors, EventList, ExposeHeaders, FilterRuleList, Grants, IntelligentTieringConfigurationList, InventoryConfigurationList, InventoryOptionalFields, LambdaFunctionConfigurationList, LifecycleRules, MetricsConfigurationList, MultipartUploadList, NoncurrentVersionTransitionList, ObjectAttributesList, ObjectIdentifierList, ObjectList, ObjectVersionList, OptionalObjectAttributesList, OwnershipControlsRules, Parts, PartsList, QueueConfigurationList, ReplicationRules, RoutingRules, ServerSideEncryptionRules, TagSet, TargetGrants, TieringList, TopicConfigurationList, TransitionList, UserMetadata, Metadata, AnalyticsFilter$, MetricsFilter$, ObjectEncryption$, SelectObjectContentEventStream$, AbortMultipartUpload$, CompleteMultipartUpload$, CopyObject$, CreateBucket$, CreateBucketMetadataConfiguration$, CreateBucketMetadataTableConfiguration$, CreateMultipartUpload$, CreateSession$, DeleteBucket$, DeleteBucketAnalyticsConfiguration$, DeleteBucketCors$, DeleteBucketEncryption$, DeleteBucketIntelligentTieringConfiguration$, DeleteBucketInventoryConfiguration$, DeleteBucketLifecycle$, DeleteBucketMetadataConfiguration$, DeleteBucketMetadataTableConfiguration$, DeleteBucketMetricsConfiguration$, DeleteBucketOwnershipControls$, DeleteBucketPolicy$, DeleteBucketReplication$, DeleteBucketTagging$, DeleteBucketWebsite$, DeleteObject$, DeleteObjects$, DeleteObjectTagging$, DeletePublicAccessBlock$, GetBucketAbac$, GetBucketAccelerateConfiguration$, GetBucketAcl$, GetBucketAnalyticsConfiguration$, GetBucketCors$, GetBucketEncryption$, GetBucketIntelligentTieringConfiguration$, GetBucketInventoryConfiguration$, GetBucketLifecycleConfiguration$, GetBucketLocation$, GetBucketLogging$, GetBucketMetadataConfiguration$, GetBucketMetadataTableConfiguration$, GetBucketMetricsConfiguration$, GetBucketNotificationConfiguration$, GetBucketOwnershipControls$, GetBucketPolicy$, GetBucketPolicyStatus$, GetBucketReplication$, GetBucketRequestPayment$, GetBucketTagging$, GetBucketVersioning$, GetBucketWebsite$, GetObject$, GetObjectAcl$, GetObjectAttributes$, GetObjectLegalHold$, GetObjectLockConfiguration$, GetObjectRetention$, GetObjectTagging$, GetObjectTorrent$, GetPublicAccessBlock$, HeadBucket$, HeadObject$, ListBucketAnalyticsConfigurations$, ListBucketIntelligentTieringConfigurations$, ListBucketInventoryConfigurations$, ListBucketMetricsConfigurations$, ListBuckets$, ListDirectoryBuckets$, ListMultipartUploads$, ListObjects$, ListObjectsV2$, ListObjectVersions$, ListParts$, PutBucketAbac$, PutBucketAccelerateConfiguration$, PutBucketAcl$, PutBucketAnalyticsConfiguration$, PutBucketCors$, PutBucketEncryption$, PutBucketIntelligentTieringConfiguration$, PutBucketInventoryConfiguration$, PutBucketLifecycleConfiguration$, PutBucketLogging$, PutBucketMetricsConfiguration$, PutBucketNotificationConfiguration$, PutBucketOwnershipControls$, PutBucketPolicy$, PutBucketReplication$, PutBucketRequestPayment$, PutBucketTagging$, PutBucketVersioning$, PutBucketWebsite$, PutObject$, PutObjectAcl$, PutObjectLegalHold$, PutObjectLockConfiguration$, PutObjectRetention$, PutObjectTagging$, PutPublicAccessBlock$, RenameObject$, RestoreObject$, SelectObjectContent$, UpdateBucketMetadataInventoryTableConfiguration$, UpdateBucketMetadataJournalTableConfiguration$, UpdateObjectEncryption$, UploadPart$, UploadPartCopy$, WriteGetObjectResponse$; var init_schemas_0 = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_schema3(); init_errors3(); init_S3ServiceException(); _A = "Account"; _AAO = "AnalyticsAndOperator"; _AC = "AccelerateConfiguration"; _ACL = "AccessControlList"; _ACL_ = "ACL"; _ACLn = "AnalyticsConfigurationList"; _ACP = "AccessControlPolicy"; _ACT = "AccessControlTranslation"; _ACn = "AnalyticsConfiguration"; _AD = "AccessDenied"; _ADb = "AbortDate"; _AED = "AnalyticsExportDestination"; _AF = "AnalyticsFilter"; _AH = "AllowedHeaders"; _AHl = "AllowedHeader"; _AI = "AccountId"; _AIMU = "AbortIncompleteMultipartUpload"; _AKI = "AccessKeyId"; _AM = "AllowedMethods"; _AMU = "AbortMultipartUpload"; _AMUO = "AbortMultipartUploadOutput"; _AMUR = "AbortMultipartUploadRequest"; _AMl = "AllowedMethod"; _AO = "AllowedOrigins"; _AOl = "AllowedOrigin"; _APA = "AccessPointAlias"; _APAc = "AccessPointArn"; _AQRD = "AllowQuotedRecordDelimiter"; _AR = "AcceptRanges"; _ARI = "AbortRuleId"; _AS = "AbacStatus"; _ASBD = "AnalyticsS3BucketDestination"; _ASSEBD = "ApplyServerSideEncryptionByDefault"; _ASr = "ArchiveStatus"; _AT = "AccessTier"; _An = "And"; _B = "Bucket"; _BA = "BucketArn"; _BAE = "BucketAlreadyExists"; _BAI = "BucketAccountId"; _BAOBY = "BucketAlreadyOwnedByYou"; _BET = "BlockedEncryptionTypes"; _BGR = "BypassGovernanceRetention"; _BI = "BucketInfo"; _BKE = "BucketKeyEnabled"; _BLC = "BucketLifecycleConfiguration"; _BLN = "BucketLocationName"; _BLS = "BucketLoggingStatus"; _BLT = "BucketLocationType"; _BN = "BucketNamespace"; _BNu = "BucketName"; _BP = "BytesProcessed"; _BPA = "BlockPublicAcls"; _BPP = "BlockPublicPolicy"; _BR = "BucketRegion"; _BRy = "BytesReturned"; _BS = "BytesScanned"; _Bo = "Body"; _Bu = "Buckets"; _C = "Checksum"; _CA = "ChecksumAlgorithm"; _CACL = "CannedACL"; _CB = "CreateBucket"; _CBC = "CreateBucketConfiguration"; _CBMC = "CreateBucketMetadataConfiguration"; _CBMCR = "CreateBucketMetadataConfigurationRequest"; _CBMTC = "CreateBucketMetadataTableConfiguration"; _CBMTCR = "CreateBucketMetadataTableConfigurationRequest"; _CBO = "CreateBucketOutput"; _CBR = "CreateBucketRequest"; _CC = "CacheControl"; _CCRC = "ChecksumCRC32"; _CCRCC = "ChecksumCRC32C"; _CCRCNVME = "ChecksumCRC64NVME"; _CC_ = "Cache-Control"; _CD = "CreationDate"; _CD_ = "Content-Disposition"; _CDo = "ContentDisposition"; _CE = "ContinuationEvent"; _CE_ = "Content-Encoding"; _CEo = "ContentEncoding"; _CF = "CloudFunction"; _CFC = "CloudFunctionConfiguration"; _CL = "ContentLanguage"; _CL_ = "Content-Language"; _CL__ = "Content-Length"; _CLo = "ContentLength"; _CM = "Content-MD5"; _CMD = "ContentMD5"; _CMU = "CompletedMultipartUpload"; _CMUO = "CompleteMultipartUploadOutput"; _CMUOr = "CreateMultipartUploadOutput"; _CMUR = "CompleteMultipartUploadResult"; _CMURo = "CompleteMultipartUploadRequest"; _CMURr = "CreateMultipartUploadRequest"; _CMUo = "CompleteMultipartUpload"; _CMUr = "CreateMultipartUpload"; _CMh = "ChecksumMode"; _CO = "CopyObject"; _COO = "CopyObjectOutput"; _COR = "CopyObjectResult"; _CORSC = "CORSConfiguration"; _CORSR = "CORSRules"; _CORSRu = "CORSRule"; _CORo = "CopyObjectRequest"; _CP = "CommonPrefix"; _CPL = "CommonPrefixList"; _CPLo = "CompletedPartList"; _CPR = "CopyPartResult"; _CPo = "CompletedPart"; _CPom = "CommonPrefixes"; _CR = "ContentRange"; _CRSBA = "ConfirmRemoveSelfBucketAccess"; _CR_ = "Content-Range"; _CS = "CopySource"; _CSHA = "ChecksumSHA1"; _CSHAh = "ChecksumSHA256"; _CSIM = "CopySourceIfMatch"; _CSIMS = "CopySourceIfModifiedSince"; _CSINM = "CopySourceIfNoneMatch"; _CSIUS = "CopySourceIfUnmodifiedSince"; _CSO = "CreateSessionOutput"; _CSR = "CreateSessionResult"; _CSRo = "CopySourceRange"; _CSRr = "CreateSessionRequest"; _CSSSECA = "CopySourceSSECustomerAlgorithm"; _CSSSECK = "CopySourceSSECustomerKey"; _CSSSECKMD = "CopySourceSSECustomerKeyMD5"; _CSV = "CSV"; _CSVI = "CopySourceVersionId"; _CSVIn = "CSVInput"; _CSVO = "CSVOutput"; _CSo = "ConfigurationState"; _CSr = "CreateSession"; _CT = "ChecksumType"; _CT_ = "Content-Type"; _CTl = "ClientToken"; _CTo = "ContentType"; _CTom = "CompressionType"; _CTon = "ContinuationToken"; _Co = "Condition"; _Cod = "Code"; _Com = "Comments"; _Con = "Contents"; _Cont = "Cont"; _Cr = "Credentials"; _D = "Days"; _DAI = "DaysAfterInitiation"; _DB = "DeleteBucket"; _DBAC = "DeleteBucketAnalyticsConfiguration"; _DBACR = "DeleteBucketAnalyticsConfigurationRequest"; _DBC = "DeleteBucketCors"; _DBCR = "DeleteBucketCorsRequest"; _DBE = "DeleteBucketEncryption"; _DBER = "DeleteBucketEncryptionRequest"; _DBIC = "DeleteBucketInventoryConfiguration"; _DBICR = "DeleteBucketInventoryConfigurationRequest"; _DBITC = "DeleteBucketIntelligentTieringConfiguration"; _DBITCR = "DeleteBucketIntelligentTieringConfigurationRequest"; _DBL = "DeleteBucketLifecycle"; _DBLR = "DeleteBucketLifecycleRequest"; _DBMC = "DeleteBucketMetadataConfiguration"; _DBMCR = "DeleteBucketMetadataConfigurationRequest"; _DBMCRe = "DeleteBucketMetricsConfigurationRequest"; _DBMCe = "DeleteBucketMetricsConfiguration"; _DBMTC = "DeleteBucketMetadataTableConfiguration"; _DBMTCR = "DeleteBucketMetadataTableConfigurationRequest"; _DBOC = "DeleteBucketOwnershipControls"; _DBOCR = "DeleteBucketOwnershipControlsRequest"; _DBP = "DeleteBucketPolicy"; _DBPR = "DeleteBucketPolicyRequest"; _DBR = "DeleteBucketRequest"; _DBRR = "DeleteBucketReplicationRequest"; _DBRe = "DeleteBucketReplication"; _DBT = "DeleteBucketTagging"; _DBTR = "DeleteBucketTaggingRequest"; _DBW = "DeleteBucketWebsite"; _DBWR = "DeleteBucketWebsiteRequest"; _DE = "DataExport"; _DIM = "DestinationIfMatch"; _DIMS = "DestinationIfModifiedSince"; _DINM = "DestinationIfNoneMatch"; _DIUS = "DestinationIfUnmodifiedSince"; _DM = "DeleteMarker"; _DME = "DeleteMarkerEntry"; _DMR = "DeleteMarkerReplication"; _DMVI = "DeleteMarkerVersionId"; _DMe = "DeleteMarkers"; _DN = "DisplayName"; _DO = "DeletedObject"; _DOO = "DeleteObjectOutput"; _DOOe = "DeleteObjectsOutput"; _DOR = "DeleteObjectRequest"; _DORe = "DeleteObjectsRequest"; _DOT = "DeleteObjectTagging"; _DOTO = "DeleteObjectTaggingOutput"; _DOTR = "DeleteObjectTaggingRequest"; _DOe = "DeletedObjects"; _DOel = "DeleteObject"; _DOele = "DeleteObjects"; _DPAB = "DeletePublicAccessBlock"; _DPABR = "DeletePublicAccessBlockRequest"; _DR = "DataRedundancy"; _DRe = "DefaultRetention"; _DRel = "DeleteResult"; _DRes = "DestinationResult"; _Da = "Date"; _De = "Delete"; _Del = "Deleted"; _Deli = "Delimiter"; _Des = "Destination"; _Desc = "Description"; _Det = "Details"; _E = "Expiration"; _EA = "EmailAddress"; _EBC = "EventBridgeConfiguration"; _EBO = "ExpectedBucketOwner"; _EC = "EncryptionConfiguration"; _ECr = "ErrorCode"; _ED = "ErrorDetails"; _EDr = "ErrorDocument"; _EE = "EndEvent"; _EH = "ExposeHeaders"; _EHx = "ExposeHeader"; _EM = "ErrorMessage"; _EODM = "ExpiredObjectDeleteMarker"; _EOR = "ExistingObjectReplication"; _ES = "ExpiresString"; _ESBO = "ExpectedSourceBucketOwner"; _ET = "EncryptionType"; _ETL = "EncryptionTypeList"; _ETM = "EncryptionTypeMismatch"; _ETa = "ETag"; _ETn = "EncodingType"; _ETv = "EventThreshold"; _ETx = "ExpressionType"; _En = "Encryption"; _Ena = "Enabled"; _End = "End"; _Er = "Errors"; _Err = "Error"; _Ev = "Events"; _Eve = "Event"; _Ex = "Expires"; _Exp = "Expression"; _F = "Filter"; _FD = "FieldDelimiter"; _FHI = "FileHeaderInfo"; _FO = "FetchOwner"; _FR = "FilterRule"; _FRL = "FilterRuleList"; _FRi = "FilterRules"; _Fi = "Field"; _Fo = "Format"; _Fr = "Frequency"; _G = "Grants"; _GBA = "GetBucketAbac"; _GBAC = "GetBucketAccelerateConfiguration"; _GBACO = "GetBucketAccelerateConfigurationOutput"; _GBACOe = "GetBucketAnalyticsConfigurationOutput"; _GBACR = "GetBucketAccelerateConfigurationRequest"; _GBACRe = "GetBucketAnalyticsConfigurationRequest"; _GBACe = "GetBucketAnalyticsConfiguration"; _GBAO = "GetBucketAbacOutput"; _GBAOe = "GetBucketAclOutput"; _GBAR = "GetBucketAbacRequest"; _GBARe = "GetBucketAclRequest"; _GBAe = "GetBucketAcl"; _GBC = "GetBucketCors"; _GBCO = "GetBucketCorsOutput"; _GBCR = "GetBucketCorsRequest"; _GBE = "GetBucketEncryption"; _GBEO = "GetBucketEncryptionOutput"; _GBER = "GetBucketEncryptionRequest"; _GBIC = "GetBucketInventoryConfiguration"; _GBICO = "GetBucketInventoryConfigurationOutput"; _GBICR = "GetBucketInventoryConfigurationRequest"; _GBITC = "GetBucketIntelligentTieringConfiguration"; _GBITCO = "GetBucketIntelligentTieringConfigurationOutput"; _GBITCR = "GetBucketIntelligentTieringConfigurationRequest"; _GBL = "GetBucketLocation"; _GBLC = "GetBucketLifecycleConfiguration"; _GBLCO = "GetBucketLifecycleConfigurationOutput"; _GBLCR = "GetBucketLifecycleConfigurationRequest"; _GBLO = "GetBucketLocationOutput"; _GBLOe = "GetBucketLoggingOutput"; _GBLR = "GetBucketLocationRequest"; _GBLRe = "GetBucketLoggingRequest"; _GBLe = "GetBucketLogging"; _GBMC = "GetBucketMetadataConfiguration"; _GBMCO = "GetBucketMetadataConfigurationOutput"; _GBMCOe = "GetBucketMetricsConfigurationOutput"; _GBMCR = "GetBucketMetadataConfigurationResult"; _GBMCRe = "GetBucketMetadataConfigurationRequest"; _GBMCRet = "GetBucketMetricsConfigurationRequest"; _GBMCe = "GetBucketMetricsConfiguration"; _GBMTC = "GetBucketMetadataTableConfiguration"; _GBMTCO = "GetBucketMetadataTableConfigurationOutput"; _GBMTCR = "GetBucketMetadataTableConfigurationResult"; _GBMTCRe = "GetBucketMetadataTableConfigurationRequest"; _GBNC = "GetBucketNotificationConfiguration"; _GBNCR = "GetBucketNotificationConfigurationRequest"; _GBOC = "GetBucketOwnershipControls"; _GBOCO = "GetBucketOwnershipControlsOutput"; _GBOCR = "GetBucketOwnershipControlsRequest"; _GBP = "GetBucketPolicy"; _GBPO = "GetBucketPolicyOutput"; _GBPR = "GetBucketPolicyRequest"; _GBPS = "GetBucketPolicyStatus"; _GBPSO = "GetBucketPolicyStatusOutput"; _GBPSR = "GetBucketPolicyStatusRequest"; _GBR = "GetBucketReplication"; _GBRO = "GetBucketReplicationOutput"; _GBRP = "GetBucketRequestPayment"; _GBRPO = "GetBucketRequestPaymentOutput"; _GBRPR = "GetBucketRequestPaymentRequest"; _GBRR = "GetBucketReplicationRequest"; _GBT = "GetBucketTagging"; _GBTO = "GetBucketTaggingOutput"; _GBTR = "GetBucketTaggingRequest"; _GBV = "GetBucketVersioning"; _GBVO = "GetBucketVersioningOutput"; _GBVR = "GetBucketVersioningRequest"; _GBW = "GetBucketWebsite"; _GBWO = "GetBucketWebsiteOutput"; _GBWR = "GetBucketWebsiteRequest"; _GFC = "GrantFullControl"; _GJP = "GlacierJobParameters"; _GO = "GetObject"; _GOA = "GetObjectAcl"; _GOAO = "GetObjectAclOutput"; _GOAOe = "GetObjectAttributesOutput"; _GOAP = "GetObjectAttributesParts"; _GOAR = "GetObjectAclRequest"; _GOARe = "GetObjectAttributesResponse"; _GOARet = "GetObjectAttributesRequest"; _GOAe = "GetObjectAttributes"; _GOLC = "GetObjectLockConfiguration"; _GOLCO = "GetObjectLockConfigurationOutput"; _GOLCR = "GetObjectLockConfigurationRequest"; _GOLH = "GetObjectLegalHold"; _GOLHO = "GetObjectLegalHoldOutput"; _GOLHR = "GetObjectLegalHoldRequest"; _GOO = "GetObjectOutput"; _GOR = "GetObjectRequest"; _GORO = "GetObjectRetentionOutput"; _GORR = "GetObjectRetentionRequest"; _GORe = "GetObjectRetention"; _GOT = "GetObjectTagging"; _GOTO = "GetObjectTaggingOutput"; _GOTOe = "GetObjectTorrentOutput"; _GOTR = "GetObjectTaggingRequest"; _GOTRe = "GetObjectTorrentRequest"; _GOTe = "GetObjectTorrent"; _GPAB = "GetPublicAccessBlock"; _GPABO = "GetPublicAccessBlockOutput"; _GPABR = "GetPublicAccessBlockRequest"; _GR = "GrantRead"; _GRACP = "GrantReadACP"; _GW = "GrantWrite"; _GWACP = "GrantWriteACP"; _Gr = "Grant"; _Gra = "Grantee"; _HB = "HeadBucket"; _HBO = "HeadBucketOutput"; _HBR = "HeadBucketRequest"; _HECRE = "HttpErrorCodeReturnedEquals"; _HN = "HostName"; _HO = "HeadObject"; _HOO = "HeadObjectOutput"; _HOR = "HeadObjectRequest"; _HRC = "HttpRedirectCode"; _I = "Id"; _IC = "InventoryConfiguration"; _ICL = "InventoryConfigurationList"; _ID = "ID"; _IDn = "IndexDocument"; _IDnv = "InventoryDestination"; _IE = "IsEnabled"; _IEn = "InventoryEncryption"; _IF = "InventoryFilter"; _IL = "IsLatest"; _IM = "IfMatch"; _IMIT = "IfMatchInitiatedTime"; _IMLMT = "IfMatchLastModifiedTime"; _IMS = "IfMatchSize"; _IMS_ = "If-Modified-Since"; _IMSf = "IfModifiedSince"; _IMUR = "InitiateMultipartUploadResult"; _IM_ = "If-Match"; _INM = "IfNoneMatch"; _INM_ = "If-None-Match"; _IOF = "InventoryOptionalFields"; _IOS = "InvalidObjectState"; _IOV = "IncludedObjectVersions"; _IP = "IsPublic"; _IPA = "IgnorePublicAcls"; _IPM = "IdempotencyParameterMismatch"; _IR = "InvalidRequest"; _IRIP = "IsRestoreInProgress"; _IS = "InputSerialization"; _ISBD = "InventoryS3BucketDestination"; _ISn = "InventorySchedule"; _IT = "IsTruncated"; _ITAO = "IntelligentTieringAndOperator"; _ITC = "IntelligentTieringConfiguration"; _ITCL = "IntelligentTieringConfigurationList"; _ITCR = "InventoryTableConfigurationResult"; _ITCU = "InventoryTableConfigurationUpdates"; _ITCn = "InventoryTableConfiguration"; _ITF = "IntelligentTieringFilter"; _IUS = "IfUnmodifiedSince"; _IUS_ = "If-Unmodified-Since"; _IWO = "InvalidWriteOffset"; _In = "Initiator"; _Ini = "Initiated"; _JSON = "JSON"; _JSONI = "JSONInput"; _JSONO = "JSONOutput"; _JTC = "JournalTableConfiguration"; _JTCR = "JournalTableConfigurationResult"; _JTCU = "JournalTableConfigurationUpdates"; _K = "Key"; _KC = "KeyCount"; _KI = "KeyId"; _KKA = "KmsKeyArn"; _KM = "KeyMarker"; _KMSC = "KMSContext"; _KMSKA = "KMSKeyArn"; _KMSKI = "KMSKeyId"; _KMSMKID = "KMSMasterKeyID"; _KPE = "KeyPrefixEquals"; _L = "Location"; _LAMBR = "ListAllMyBucketsResult"; _LAMDBR = "ListAllMyDirectoryBucketsResult"; _LB = "ListBuckets"; _LBAC = "ListBucketAnalyticsConfigurations"; _LBACO = "ListBucketAnalyticsConfigurationsOutput"; _LBACR = "ListBucketAnalyticsConfigurationResult"; _LBACRi = "ListBucketAnalyticsConfigurationsRequest"; _LBIC = "ListBucketInventoryConfigurations"; _LBICO = "ListBucketInventoryConfigurationsOutput"; _LBICR = "ListBucketInventoryConfigurationsRequest"; _LBITC = "ListBucketIntelligentTieringConfigurations"; _LBITCO = "ListBucketIntelligentTieringConfigurationsOutput"; _LBITCR = "ListBucketIntelligentTieringConfigurationsRequest"; _LBMC = "ListBucketMetricsConfigurations"; _LBMCO = "ListBucketMetricsConfigurationsOutput"; _LBMCR = "ListBucketMetricsConfigurationsRequest"; _LBO = "ListBucketsOutput"; _LBR = "ListBucketsRequest"; _LBRi = "ListBucketResult"; _LC = "LocationConstraint"; _LCi = "LifecycleConfiguration"; _LDB = "ListDirectoryBuckets"; _LDBO = "ListDirectoryBucketsOutput"; _LDBR = "ListDirectoryBucketsRequest"; _LE = "LoggingEnabled"; _LEi = "LifecycleExpiration"; _LFA = "LambdaFunctionArn"; _LFC = "LambdaFunctionConfiguration"; _LFCL = "LambdaFunctionConfigurationList"; _LFCa = "LambdaFunctionConfigurations"; _LH = "LegalHold"; _LI = "LocationInfo"; _LICR = "ListInventoryConfigurationsResult"; _LM = "LastModified"; _LMCR = "ListMetricsConfigurationsResult"; _LMT = "LastModifiedTime"; _LMU = "ListMultipartUploads"; _LMUO = "ListMultipartUploadsOutput"; _LMUR = "ListMultipartUploadsResult"; _LMURi = "ListMultipartUploadsRequest"; _LM_ = "Last-Modified"; _LO = "ListObjects"; _LOO = "ListObjectsOutput"; _LOR = "ListObjectsRequest"; _LOV = "ListObjectsV2"; _LOVO = "ListObjectsV2Output"; _LOVOi = "ListObjectVersionsOutput"; _LOVR = "ListObjectsV2Request"; _LOVRi = "ListObjectVersionsRequest"; _LOVi = "ListObjectVersions"; _LP = "ListParts"; _LPO = "ListPartsOutput"; _LPR = "ListPartsResult"; _LPRi = "ListPartsRequest"; _LR = "LifecycleRule"; _LRAO = "LifecycleRuleAndOperator"; _LRF = "LifecycleRuleFilter"; _LRi = "LifecycleRules"; _LVR = "ListVersionsResult"; _M = "Metadata"; _MAO = "MetricsAndOperator"; _MAS = "MaxAgeSeconds"; _MB = "MaxBuckets"; _MC = "MetadataConfiguration"; _MCL = "MetricsConfigurationList"; _MCR = "MetadataConfigurationResult"; _MCe = "MetricsConfiguration"; _MD = "MetadataDirective"; _MDB = "MaxDirectoryBuckets"; _MDf = "MfaDelete"; _ME = "MetadataEntry"; _MF = "MetricsFilter"; _MFA = "MFA"; _MFAD = "MFADelete"; _MK = "MaxKeys"; _MM = "MissingMeta"; _MOS = "MpuObjectSize"; _MP = "MaxParts"; _MTC = "MetadataTableConfiguration"; _MTCR = "MetadataTableConfigurationResult"; _MTEC = "MetadataTableEncryptionConfiguration"; _MU = "MultipartUpload"; _MUL = "MultipartUploadList"; _MUa = "MaxUploads"; _Ma = "Marker"; _Me = "Metrics"; _Mes = "Message"; _Mi = "Minutes"; _Mo = "Mode"; _N = "Name"; _NC = "NotificationConfiguration"; _NCF = "NotificationConfigurationFilter"; _NCT = "NextContinuationToken"; _ND = "NoncurrentDays"; _NEKKAS = "NonEmptyKmsKeyArnString"; _NF = "NotFound"; _NKM = "NextKeyMarker"; _NM = "NextMarker"; _NNV = "NewerNoncurrentVersions"; _NPNM = "NextPartNumberMarker"; _NSB = "NoSuchBucket"; _NSK = "NoSuchKey"; _NSU = "NoSuchUpload"; _NUIM = "NextUploadIdMarker"; _NVE = "NoncurrentVersionExpiration"; _NVIM = "NextVersionIdMarker"; _NVT = "NoncurrentVersionTransitions"; _NVTL = "NoncurrentVersionTransitionList"; _NVTo = "NoncurrentVersionTransition"; _O = "Owner"; _OA = "ObjectAttributes"; _OAIATE = "ObjectAlreadyInActiveTierError"; _OC = "OwnershipControls"; _OCR = "OwnershipControlsRule"; _OCRw = "OwnershipControlsRules"; _OE = "ObjectEncryption"; _OF = "OptionalFields"; _OI = "ObjectIdentifier"; _OIL = "ObjectIdentifierList"; _OL = "OutputLocation"; _OLC = "ObjectLockConfiguration"; _OLE = "ObjectLockEnabled"; _OLEFB = "ObjectLockEnabledForBucket"; _OLLH = "ObjectLockLegalHold"; _OLLHS = "ObjectLockLegalHoldStatus"; _OLM = "ObjectLockMode"; _OLR = "ObjectLockRetention"; _OLRUD = "ObjectLockRetainUntilDate"; _OLRb = "ObjectLockRule"; _OLb = "ObjectList"; _ONIATE = "ObjectNotInActiveTierError"; _OO = "ObjectOwnership"; _OOA = "OptionalObjectAttributes"; _OP = "ObjectParts"; _OPb = "ObjectPart"; _OS = "ObjectSize"; _OSGT = "ObjectSizeGreaterThan"; _OSLT = "ObjectSizeLessThan"; _OSV = "OutputSchemaVersion"; _OSu = "OutputSerialization"; _OV = "ObjectVersion"; _OVL = "ObjectVersionList"; _Ob = "Objects"; _Obj = "Object"; _P = "Prefix"; _PABC = "PublicAccessBlockConfiguration"; _PBA = "PutBucketAbac"; _PBAC = "PutBucketAccelerateConfiguration"; _PBACR = "PutBucketAccelerateConfigurationRequest"; _PBACRu = "PutBucketAnalyticsConfigurationRequest"; _PBACu = "PutBucketAnalyticsConfiguration"; _PBAR = "PutBucketAbacRequest"; _PBARu = "PutBucketAclRequest"; _PBAu = "PutBucketAcl"; _PBC = "PutBucketCors"; _PBCR = "PutBucketCorsRequest"; _PBE = "PutBucketEncryption"; _PBER = "PutBucketEncryptionRequest"; _PBIC = "PutBucketInventoryConfiguration"; _PBICR = "PutBucketInventoryConfigurationRequest"; _PBITC = "PutBucketIntelligentTieringConfiguration"; _PBITCR = "PutBucketIntelligentTieringConfigurationRequest"; _PBL = "PutBucketLogging"; _PBLC = "PutBucketLifecycleConfiguration"; _PBLCO = "PutBucketLifecycleConfigurationOutput"; _PBLCR = "PutBucketLifecycleConfigurationRequest"; _PBLR = "PutBucketLoggingRequest"; _PBMC = "PutBucketMetricsConfiguration"; _PBMCR = "PutBucketMetricsConfigurationRequest"; _PBNC = "PutBucketNotificationConfiguration"; _PBNCR = "PutBucketNotificationConfigurationRequest"; _PBOC = "PutBucketOwnershipControls"; _PBOCR = "PutBucketOwnershipControlsRequest"; _PBP = "PutBucketPolicy"; _PBPR = "PutBucketPolicyRequest"; _PBR = "PutBucketReplication"; _PBRP = "PutBucketRequestPayment"; _PBRPR = "PutBucketRequestPaymentRequest"; _PBRR = "PutBucketReplicationRequest"; _PBT = "PutBucketTagging"; _PBTR = "PutBucketTaggingRequest"; _PBV = "PutBucketVersioning"; _PBVR = "PutBucketVersioningRequest"; _PBW = "PutBucketWebsite"; _PBWR = "PutBucketWebsiteRequest"; _PC = "PartsCount"; _PDS = "PartitionDateSource"; _PE = "ProgressEvent"; _PI = "ParquetInput"; _PL = "PartsList"; _PN = "PartNumber"; _PNM = "PartNumberMarker"; _PO = "PutObject"; _POA = "PutObjectAcl"; _POAO = "PutObjectAclOutput"; _POAR = "PutObjectAclRequest"; _POLC = "PutObjectLockConfiguration"; _POLCO = "PutObjectLockConfigurationOutput"; _POLCR = "PutObjectLockConfigurationRequest"; _POLH = "PutObjectLegalHold"; _POLHO = "PutObjectLegalHoldOutput"; _POLHR = "PutObjectLegalHoldRequest"; _POO = "PutObjectOutput"; _POR = "PutObjectRequest"; _PORO = "PutObjectRetentionOutput"; _PORR = "PutObjectRetentionRequest"; _PORu = "PutObjectRetention"; _POT = "PutObjectTagging"; _POTO = "PutObjectTaggingOutput"; _POTR = "PutObjectTaggingRequest"; _PP = "PartitionedPrefix"; _PPAB = "PutPublicAccessBlock"; _PPABR = "PutPublicAccessBlockRequest"; _PS = "PolicyStatus"; _Pa = "Parts"; _Par = "Part"; _Parq = "Parquet"; _Pay = "Payer"; _Payl = "Payload"; _Pe = "Permission"; _Po = "Policy"; _Pr = "Progress"; _Pri = "Priority"; _Pro = "Protocol"; _Q = "Quiet"; _QA = "QueueArn"; _QC = "QuoteCharacter"; _QCL = "QueueConfigurationList"; _QCu = "QueueConfigurations"; _QCue = "QueueConfiguration"; _QEC = "QuoteEscapeCharacter"; _QF = "QuoteFields"; _Qu = "Queue"; _R = "Rules"; _RART = "RedirectAllRequestsTo"; _RC = "RequestCharged"; _RCC = "ResponseCacheControl"; _RCD = "ResponseContentDisposition"; _RCE = "ResponseContentEncoding"; _RCL = "ResponseContentLanguage"; _RCT = "ResponseContentType"; _RCe = "ReplicationConfiguration"; _RD = "RecordDelimiter"; _RE = "ResponseExpires"; _RED = "RestoreExpiryDate"; _REe = "RecordExpiration"; _REec = "RecordsEvent"; _RKKID = "ReplicaKmsKeyID"; _RKPW = "ReplaceKeyPrefixWith"; _RKW = "ReplaceKeyWith"; _RM = "ReplicaModifications"; _RO = "RenameObject"; _ROO = "RenameObjectOutput"; _ROOe = "RestoreObjectOutput"; _ROP = "RestoreOutputPath"; _ROR = "RenameObjectRequest"; _RORe = "RestoreObjectRequest"; _ROe = "RestoreObject"; _RP = "RequestPayer"; _RPB = "RestrictPublicBuckets"; _RPC = "RequestPaymentConfiguration"; _RPe = "RequestProgress"; _RR = "RoutingRules"; _RRAO = "ReplicationRuleAndOperator"; _RRF = "ReplicationRuleFilter"; _RRe = "ReplicationRule"; _RRep = "ReplicationRules"; _RReq = "RequestRoute"; _RRes = "RestoreRequest"; _RRo = "RoutingRule"; _RS = "ReplicationStatus"; _RSe = "RestoreStatus"; _RSen = "RenameSource"; _RT = "ReplicationTime"; _RTV = "ReplicationTimeValue"; _RTe = "RequestToken"; _RUD = "RetainUntilDate"; _Ra = "Range"; _Re = "Restore"; _Rec = "Records"; _Red = "Redirect"; _Ret = "Retention"; _Ro = "Role"; _Ru = "Rule"; _S = "Status"; _SA = "StartAfter"; _SAK = "SecretAccessKey"; _SAs = "SseAlgorithm"; _SB = "StreamingBlob"; _SBD = "S3BucketDestination"; _SC = "StorageClass"; _SCA = "StorageClassAnalysis"; _SCADE = "StorageClassAnalysisDataExport"; _SCV = "SessionCredentialValue"; _SCe = "SessionCredentials"; _SCt = "StatusCode"; _SDV = "SkipDestinationValidation"; _SE = "StatsEvent"; _SIM = "SourceIfMatch"; _SIMS = "SourceIfModifiedSince"; _SINM = "SourceIfNoneMatch"; _SIUS = "SourceIfUnmodifiedSince"; _SK = "SSE-KMS"; _SKEO = "SseKmsEncryptedObjects"; _SKF = "S3KeyFilter"; _SKe = "S3Key"; _SL = "S3Location"; _SM = "SessionMode"; _SOC = "SelectObjectContent"; _SOCES = "SelectObjectContentEventStream"; _SOCO = "SelectObjectContentOutput"; _SOCR = "SelectObjectContentRequest"; _SP = "SelectParameters"; _SPi = "SimplePrefix"; _SR = "ScanRange"; _SS = "SSE-S3"; _SSC = "SourceSelectionCriteria"; _SSE = "ServerSideEncryption"; _SSEA = "SSEAlgorithm"; _SSEBD = "ServerSideEncryptionByDefault"; _SSEC = "ServerSideEncryptionConfiguration"; _SSECA = "SSECustomerAlgorithm"; _SSECK = "SSECustomerKey"; _SSECKMD = "SSECustomerKeyMD5"; _SSEKMS = "SSEKMS"; _SSEKMSE = "SSEKMSEncryption"; _SSEKMSEC = "SSEKMSEncryptionContext"; _SSEKMSKI = "SSEKMSKeyId"; _SSER = "ServerSideEncryptionRule"; _SSERe = "ServerSideEncryptionRules"; _SSES = "SSES3"; _ST = "SessionToken"; _STD = "S3TablesDestination"; _STDR = "S3TablesDestinationResult"; _S_ = "S3"; _Sc = "Schedule"; _Si = "Size"; _St = "Start"; _Sta = "Stats"; _Su = "Suffix"; _T = "Tags"; _TA = "TableArn"; _TAo = "TopicArn"; _TB = "TargetBucket"; _TBA = "TableBucketArn"; _TBT = "TableBucketType"; _TC = "TagCount"; _TCL = "TopicConfigurationList"; _TCo = "TopicConfigurations"; _TCop = "TopicConfiguration"; _TD = "TaggingDirective"; _TDMOS = "TransitionDefaultMinimumObjectSize"; _TG = "TargetGrants"; _TGa = "TargetGrant"; _TL = "TieringList"; _TLr = "TransitionList"; _TMP = "TooManyParts"; _TN = "TableNamespace"; _TNa = "TableName"; _TOKF = "TargetObjectKeyFormat"; _TP = "TargetPrefix"; _TPC = "TotalPartsCount"; _TS = "TagSet"; _TSa = "TableStatus"; _Ta = "Tag"; _Tag = "Tagging"; _Ti = "Tier"; _Tie = "Tierings"; _Tier = "Tiering"; _Tim = "Time"; _To = "Token"; _Top = "Topic"; _Tr = "Transitions"; _Tra = "Transition"; _Ty = "Type"; _U = "Uploads"; _UBMITC = "UpdateBucketMetadataInventoryTableConfiguration"; _UBMITCR = "UpdateBucketMetadataInventoryTableConfigurationRequest"; _UBMJTC = "UpdateBucketMetadataJournalTableConfiguration"; _UBMJTCR = "UpdateBucketMetadataJournalTableConfigurationRequest"; _UI = "UploadId"; _UIM = "UploadIdMarker"; _UM = "UserMetadata"; _UOE = "UpdateObjectEncryption"; _UOER = "UpdateObjectEncryptionRequest"; _UOERp = "UpdateObjectEncryptionResponse"; _UP = "UploadPart"; _UPC = "UploadPartCopy"; _UPCO = "UploadPartCopyOutput"; _UPCR = "UploadPartCopyRequest"; _UPO = "UploadPartOutput"; _UPR = "UploadPartRequest"; _URI = "URI"; _Up = "Upload"; _V = "Value"; _VC = "VersioningConfiguration"; _VI = "VersionId"; _VIM = "VersionIdMarker"; _Ve = "Versions"; _Ver = "Version"; _WC = "WebsiteConfiguration"; _WGOR = "WriteGetObjectResponse"; _WGORR = "WriteGetObjectResponseRequest"; _WOB = "WriteOffsetBytes"; _WRL = "WebsiteRedirectLocation"; _Y = "Years"; _ar = "accept-ranges"; _br = "bucket-region"; _c = "client"; _ct = "continuation-token"; _d = "delimiter"; _e = "error"; _eP = "eventPayload"; _en = "endpoint"; _et = "encoding-type"; _fo = "fetch-owner"; _h = "http"; _hC = "httpChecksum"; _hE = "httpError"; _hH = "httpHeader"; _hL = "hostLabel"; _hP = "httpPayload"; _hPH = "httpPrefixHeaders"; _hQ = "httpQuery"; _hi = "http://www.w3.org/2001/XMLSchema-instance"; _i = "id"; _iT = "idempotencyToken"; _km = "key-marker"; _m = "marker"; _mb = "max-buckets"; _mdb = "max-directory-buckets"; _mk = "max-keys"; _mp = "max-parts"; _mu = "max-uploads"; _p = "prefix"; _pN = "partNumber"; _pnm = "part-number-marker"; _rcc = "response-cache-control"; _rcd = "response-content-disposition"; _rce = "response-content-encoding"; _rcl = "response-content-language"; _rct = "response-content-type"; _re = "response-expires"; _s = "smithy.ts.sdk.synthetic.com.amazonaws.s3"; _sa = "start-after"; _st = "streaming"; _uI = "uploadId"; _uim = "upload-id-marker"; _vI = "versionId"; _vim = "version-id-marker"; _x = "xsi"; _xA = "xmlAttribute"; _xF = "xmlFlattened"; _xN = "xmlName"; _xNm = "xmlNamespace"; _xaa = "x-amz-acl"; _xaad = "x-amz-abort-date"; _xaapa = "x-amz-access-point-alias"; _xaari = "x-amz-abort-rule-id"; _xaas = "x-amz-archive-status"; _xaba = "x-amz-bucket-arn"; _xabgr = "x-amz-bypass-governance-retention"; _xabln = "x-amz-bucket-location-name"; _xablt = "x-amz-bucket-location-type"; _xabn = "x-amz-bucket-namespace"; _xabole = "x-amz-bucket-object-lock-enabled"; _xabolt = "x-amz-bucket-object-lock-token"; _xabr = "x-amz-bucket-region"; _xaca = "x-amz-checksum-algorithm"; _xacc = "x-amz-checksum-crc32"; _xacc_ = "x-amz-checksum-crc32c"; _xacc__ = "x-amz-checksum-crc64nvme"; _xacm = "x-amz-checksum-mode"; _xacrsba = "x-amz-confirm-remove-self-bucket-access"; _xacs = "x-amz-checksum-sha1"; _xacs_ = "x-amz-checksum-sha256"; _xacs__ = "x-amz-copy-source"; _xacsim = "x-amz-copy-source-if-match"; _xacsims = "x-amz-copy-source-if-modified-since"; _xacsinm = "x-amz-copy-source-if-none-match"; _xacsius = "x-amz-copy-source-if-unmodified-since"; _xacsm = "x-amz-create-session-mode"; _xacsr = "x-amz-copy-source-range"; _xacssseca = "x-amz-copy-source-server-side-encryption-customer-algorithm"; _xacssseck = "x-amz-copy-source-server-side-encryption-customer-key"; _xacssseckM = "x-amz-copy-source-server-side-encryption-customer-key-MD5"; _xacsvi = "x-amz-copy-source-version-id"; _xact = "x-amz-checksum-type"; _xact_ = "x-amz-client-token"; _xadm = "x-amz-delete-marker"; _xae = "x-amz-expiration"; _xaebo = "x-amz-expected-bucket-owner"; _xafec = "x-amz-fwd-error-code"; _xafem = "x-amz-fwd-error-message"; _xafhCC = "x-amz-fwd-header-Cache-Control"; _xafhCD = "x-amz-fwd-header-Content-Disposition"; _xafhCE = "x-amz-fwd-header-Content-Encoding"; _xafhCL = "x-amz-fwd-header-Content-Language"; _xafhCR = "x-amz-fwd-header-Content-Range"; _xafhCT = "x-amz-fwd-header-Content-Type"; _xafhE = "x-amz-fwd-header-ETag"; _xafhE_ = "x-amz-fwd-header-Expires"; _xafhLM = "x-amz-fwd-header-Last-Modified"; _xafhar = "x-amz-fwd-header-accept-ranges"; _xafhxacc = "x-amz-fwd-header-x-amz-checksum-crc32"; _xafhxacc_ = "x-amz-fwd-header-x-amz-checksum-crc32c"; _xafhxacc__ = "x-amz-fwd-header-x-amz-checksum-crc64nvme"; _xafhxacs = "x-amz-fwd-header-x-amz-checksum-sha1"; _xafhxacs_ = "x-amz-fwd-header-x-amz-checksum-sha256"; _xafhxadm = "x-amz-fwd-header-x-amz-delete-marker"; _xafhxae = "x-amz-fwd-header-x-amz-expiration"; _xafhxamm = "x-amz-fwd-header-x-amz-missing-meta"; _xafhxampc = "x-amz-fwd-header-x-amz-mp-parts-count"; _xafhxaollh = "x-amz-fwd-header-x-amz-object-lock-legal-hold"; _xafhxaolm = "x-amz-fwd-header-x-amz-object-lock-mode"; _xafhxaolrud = "x-amz-fwd-header-x-amz-object-lock-retain-until-date"; _xafhxar = "x-amz-fwd-header-x-amz-restore"; _xafhxarc = "x-amz-fwd-header-x-amz-request-charged"; _xafhxars = "x-amz-fwd-header-x-amz-replication-status"; _xafhxasc = "x-amz-fwd-header-x-amz-storage-class"; _xafhxasse = "x-amz-fwd-header-x-amz-server-side-encryption"; _xafhxasseakki = "x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id"; _xafhxassebke = "x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled"; _xafhxasseca = "x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm"; _xafhxasseckM = "x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5"; _xafhxatc = "x-amz-fwd-header-x-amz-tagging-count"; _xafhxavi = "x-amz-fwd-header-x-amz-version-id"; _xafs = "x-amz-fwd-status"; _xagfc = "x-amz-grant-full-control"; _xagr = "x-amz-grant-read"; _xagra = "x-amz-grant-read-acp"; _xagw = "x-amz-grant-write"; _xagwa = "x-amz-grant-write-acp"; _xaimit = "x-amz-if-match-initiated-time"; _xaimlmt = "x-amz-if-match-last-modified-time"; _xaims = "x-amz-if-match-size"; _xam = "x-amz-meta-"; _xam_ = "x-amz-mfa"; _xamd = "x-amz-metadata-directive"; _xamm = "x-amz-missing-meta"; _xamos = "x-amz-mp-object-size"; _xamp = "x-amz-max-parts"; _xampc = "x-amz-mp-parts-count"; _xaoa = "x-amz-object-attributes"; _xaollh = "x-amz-object-lock-legal-hold"; _xaolm = "x-amz-object-lock-mode"; _xaolrud = "x-amz-object-lock-retain-until-date"; _xaoo = "x-amz-object-ownership"; _xaooa = "x-amz-optional-object-attributes"; _xaos = "x-amz-object-size"; _xapnm = "x-amz-part-number-marker"; _xar = "x-amz-restore"; _xarc = "x-amz-request-charged"; _xarop = "x-amz-restore-output-path"; _xarp = "x-amz-request-payer"; _xarr = "x-amz-request-route"; _xars = "x-amz-replication-status"; _xars_ = "x-amz-rename-source"; _xarsim = "x-amz-rename-source-if-match"; _xarsims = "x-amz-rename-source-if-modified-since"; _xarsinm = "x-amz-rename-source-if-none-match"; _xarsius = "x-amz-rename-source-if-unmodified-since"; _xart = "x-amz-request-token"; _xasc = "x-amz-storage-class"; _xasca = "x-amz-sdk-checksum-algorithm"; _xasdv = "x-amz-skip-destination-validation"; _xasebo = "x-amz-source-expected-bucket-owner"; _xasse = "x-amz-server-side-encryption"; _xasseakki = "x-amz-server-side-encryption-aws-kms-key-id"; _xassebke = "x-amz-server-side-encryption-bucket-key-enabled"; _xassec = "x-amz-server-side-encryption-context"; _xasseca = "x-amz-server-side-encryption-customer-algorithm"; _xasseck = "x-amz-server-side-encryption-customer-key"; _xasseckM = "x-amz-server-side-encryption-customer-key-MD5"; _xat = "x-amz-tagging"; _xatc = "x-amz-tagging-count"; _xatd = "x-amz-tagging-directive"; _xatdmos = "x-amz-transition-default-minimum-object-size"; _xavi = "x-amz-version-id"; _xawob = "x-amz-write-offset-bytes"; _xawrl = "x-amz-website-redirect-location"; _xs = "xsi:type"; n0 = "com.amazonaws.s3"; _s_registry = TypeRegistry.for(_s); S3ServiceException$ = [-3, _s, "S3ServiceException", 0, [], []]; _s_registry.registerError(S3ServiceException$, S3ServiceException); n0_registry = TypeRegistry.for(n0); AccessDenied$ = [ -3, n0, _AD, { [_e]: _c, [_hE]: 403 }, [], [] ]; n0_registry.registerError(AccessDenied$, AccessDenied); BucketAlreadyExists$ = [ -3, n0, _BAE, { [_e]: _c, [_hE]: 409 }, [], [] ]; n0_registry.registerError(BucketAlreadyExists$, BucketAlreadyExists); BucketAlreadyOwnedByYou$ = [ -3, n0, _BAOBY, { [_e]: _c, [_hE]: 409 }, [], [] ]; n0_registry.registerError(BucketAlreadyOwnedByYou$, BucketAlreadyOwnedByYou); EncryptionTypeMismatch$ = [ -3, n0, _ETM, { [_e]: _c, [_hE]: 400 }, [], [] ]; n0_registry.registerError(EncryptionTypeMismatch$, EncryptionTypeMismatch); IdempotencyParameterMismatch$ = [ -3, n0, _IPM, { [_e]: _c, [_hE]: 400 }, [], [] ]; n0_registry.registerError(IdempotencyParameterMismatch$, IdempotencyParameterMismatch); InvalidObjectState$ = [ -3, n0, _IOS, { [_e]: _c, [_hE]: 403 }, [_SC, _AT], [0, 0] ]; n0_registry.registerError(InvalidObjectState$, InvalidObjectState); InvalidRequest$ = [ -3, n0, _IR, { [_e]: _c, [_hE]: 400 }, [], [] ]; n0_registry.registerError(InvalidRequest$, InvalidRequest); InvalidWriteOffset$ = [ -3, n0, _IWO, { [_e]: _c, [_hE]: 400 }, [], [] ]; n0_registry.registerError(InvalidWriteOffset$, InvalidWriteOffset); NoSuchBucket$ = [ -3, n0, _NSB, { [_e]: _c, [_hE]: 404 }, [], [] ]; n0_registry.registerError(NoSuchBucket$, NoSuchBucket); NoSuchKey$ = [ -3, n0, _NSK, { [_e]: _c, [_hE]: 404 }, [], [] ]; n0_registry.registerError(NoSuchKey$, NoSuchKey); NoSuchUpload$ = [ -3, n0, _NSU, { [_e]: _c, [_hE]: 404 }, [], [] ]; n0_registry.registerError(NoSuchUpload$, NoSuchUpload); NotFound$ = [ -3, n0, _NF, { [_e]: _c }, [], [] ]; n0_registry.registerError(NotFound$, NotFound); ObjectAlreadyInActiveTierError$ = [ -3, n0, _OAIATE, { [_e]: _c, [_hE]: 403 }, [], [] ]; n0_registry.registerError(ObjectAlreadyInActiveTierError$, ObjectAlreadyInActiveTierError); ObjectNotInActiveTierError$ = [ -3, n0, _ONIATE, { [_e]: _c, [_hE]: 403 }, [], [] ]; n0_registry.registerError(ObjectNotInActiveTierError$, ObjectNotInActiveTierError); TooManyParts$ = [ -3, n0, _TMP, { [_e]: _c, [_hE]: 400 }, [], [] ]; n0_registry.registerError(TooManyParts$, TooManyParts); errorTypeRegistries = [ _s_registry, n0_registry ]; CopySourceSSECustomerKey = [0, n0, _CSSSECK, 8, 0]; NonEmptyKmsKeyArnString = [0, n0, _NEKKAS, 8, 0]; SessionCredentialValue = [0, n0, _SCV, 8, 0]; SSECustomerKey = [0, n0, _SSECK, 8, 0]; SSEKMSEncryptionContext = [0, n0, _SSEKMSEC, 8, 0]; SSEKMSKeyId = [0, n0, _SSEKMSKI, 8, 0]; StreamingBlob = [0, n0, _SB, { [_st]: 1 }, 42]; AbacStatus$ = [ 3, n0, _AS, 0, [_S], [0] ]; AbortIncompleteMultipartUpload$ = [ 3, n0, _AIMU, 0, [_DAI], [1] ]; AbortMultipartUploadOutput$ = [ 3, n0, _AMUO, 0, [_RC], [[0, { [_hH]: _xarc }]] ]; AbortMultipartUploadRequest$ = [ 3, n0, _AMUR, 0, [_B, _K, _UI, _RP, _EBO, _IMIT], [[0, 1], [0, 1], [0, { [_hQ]: _uI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [6, { [_hH]: _xaimit }]], 3 ]; AccelerateConfiguration$ = [ 3, n0, _AC, 0, [_S], [0] ]; AccessControlPolicy$ = [ 3, n0, _ACP, 0, [_G, _O], [[() => Grants, { [_xN]: _ACL }], () => Owner$] ]; AccessControlTranslation$ = [ 3, n0, _ACT, 0, [_O], [0], 1 ]; AnalyticsAndOperator$ = [ 3, n0, _AAO, 0, [_P, _T], [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta }]] ]; AnalyticsConfiguration$ = [ 3, n0, _ACn, 0, [_I, _SCA, _F], [0, () => StorageClassAnalysis$, [() => AnalyticsFilter$, 0]], 2 ]; AnalyticsExportDestination$ = [ 3, n0, _AED, 0, [_SBD], [() => AnalyticsS3BucketDestination$], 1 ]; AnalyticsS3BucketDestination$ = [ 3, n0, _ASBD, 0, [_Fo, _B, _BAI, _P], [0, 0, 0, 0], 2 ]; BlockedEncryptionTypes$ = [ 3, n0, _BET, 0, [_ET], [[() => EncryptionTypeList, { [_xF]: 1 }]] ]; Bucket$ = [ 3, n0, _B, 0, [_N, _CD, _BR, _BA], [0, 4, 0, 0] ]; BucketInfo$ = [ 3, n0, _BI, 0, [_DR, _Ty], [0, 0] ]; BucketLifecycleConfiguration$ = [ 3, n0, _BLC, 0, [_R], [[() => LifecycleRules, { [_xF]: 1, [_xN]: _Ru }]], 1 ]; BucketLoggingStatus$ = [ 3, n0, _BLS, 0, [_LE], [[() => LoggingEnabled$, 0]] ]; Checksum$ = [ 3, n0, _C, 0, [_CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT], [0, 0, 0, 0, 0, 0] ]; CommonPrefix$ = [ 3, n0, _CP, 0, [_P], [0] ]; CompletedMultipartUpload$ = [ 3, n0, _CMU, 0, [_Pa], [[() => CompletedPartList, { [_xF]: 1, [_xN]: _Par }]] ]; CompletedPart$ = [ 3, n0, _CPo, 0, [_ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _PN], [0, 0, 0, 0, 0, 0, 1] ]; CompleteMultipartUploadOutput$ = [ 3, n0, _CMUO, { [_xN]: _CMUR }, [_L, _B, _K, _E, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT, _SSE, _VI, _SSEKMSKI, _BKE, _RC], [0, 0, 0, [0, { [_hH]: _xae }], 0, 0, 0, 0, 0, 0, 0, [0, { [_hH]: _xasse }], [0, { [_hH]: _xavi }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] ]; CompleteMultipartUploadRequest$ = [ 3, n0, _CMURo, 0, [_B, _K, _UI, _MU, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT, _MOS, _RP, _EBO, _IM, _INM, _SSECA, _SSECK, _SSECKMD], [[0, 1], [0, 1], [0, { [_hQ]: _uI }], [() => CompletedMultipartUpload$, { [_hP]: 1, [_xN]: _CMUo }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [1, { [_hH]: _xamos }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }]], 3 ]; Condition$ = [ 3, n0, _Co, 0, [_HECRE, _KPE], [0, 0] ]; ContinuationEvent$ = [ 3, n0, _CE, 0, [], [] ]; CopyObjectOutput$ = [ 3, n0, _COO, 0, [_COR, _E, _CSVI, _VI, _SSE, _SSECA, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RC], [[() => CopyObjectResult$, 16], [0, { [_hH]: _xae }], [0, { [_hH]: _xacsvi }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] ]; CopyObjectRequest$ = [ 3, n0, _CORo, 0, [_B, _CS, _K, _ACL_, _CC, _CA, _CDo, _CEo, _CL, _CTo, _CSIM, _CSIMS, _CSINM, _CSIUS, _Ex, _GFC, _GR, _GRACP, _GWACP, _IM, _INM, _M, _MD, _TD, _SSE, _SC, _WRL, _SSECA, _SSECK, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _CSSSECA, _CSSSECK, _CSSSECKMD, _RP, _Tag, _OLM, _OLRUD, _OLLHS, _EBO, _ESBO], [[0, 1], [0, { [_hH]: _xacs__ }], [0, 1], [0, { [_hH]: _xaa }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _xaca }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CT_ }], [0, { [_hH]: _xacsim }], [4, { [_hH]: _xacsims }], [0, { [_hH]: _xacsinm }], [4, { [_hH]: _xacsius }], [4, { [_hH]: _Ex }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagwa }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xamd }], [0, { [_hH]: _xatd }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xacssseca }], [() => CopySourceSSECustomerKey, { [_hH]: _xacssseck }], [0, { [_hH]: _xacssseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xat }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasebo }]], 3 ]; CopyObjectResult$ = [ 3, n0, _COR, 0, [_ETa, _LM, _CT, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], [0, 4, 0, 0, 0, 0, 0, 0] ]; CopyPartResult$ = [ 3, n0, _CPR, 0, [_ETa, _LM, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], [0, 4, 0, 0, 0, 0, 0] ]; CORSConfiguration$ = [ 3, n0, _CORSC, 0, [_CORSR], [[() => CORSRules, { [_xF]: 1, [_xN]: _CORSRu }]], 1 ]; CORSRule$ = [ 3, n0, _CORSRu, 0, [_AM, _AO, _ID, _AH, _EH, _MAS], [[64 | 0, { [_xF]: 1, [_xN]: _AMl }], [64 | 0, { [_xF]: 1, [_xN]: _AOl }], 0, [64 | 0, { [_xF]: 1, [_xN]: _AHl }], [64 | 0, { [_xF]: 1, [_xN]: _EHx }], 1], 2 ]; CreateBucketConfiguration$ = [ 3, n0, _CBC, 0, [_LC, _L, _B, _T], [0, () => LocationInfo$, () => BucketInfo$, [() => TagSet, 0]] ]; CreateBucketMetadataConfigurationRequest$ = [ 3, n0, _CBMCR, 0, [_B, _MC, _CMD, _CA, _EBO], [[0, 1], [() => MetadataConfiguration$, { [_hP]: 1, [_xN]: _MC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; CreateBucketMetadataTableConfigurationRequest$ = [ 3, n0, _CBMTCR, 0, [_B, _MTC, _CMD, _CA, _EBO], [[0, 1], [() => MetadataTableConfiguration$, { [_hP]: 1, [_xN]: _MTC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; CreateBucketOutput$ = [ 3, n0, _CBO, 0, [_L, _BA], [[0, { [_hH]: _L }], [0, { [_hH]: _xaba }]] ]; CreateBucketRequest$ = [ 3, n0, _CBR, 0, [_B, _ACL_, _CBC, _GFC, _GR, _GRACP, _GW, _GWACP, _OLEFB, _OO, _BN], [[0, 1], [0, { [_hH]: _xaa }], [() => CreateBucketConfiguration$, { [_hP]: 1, [_xN]: _CBC }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagw }], [0, { [_hH]: _xagwa }], [2, { [_hH]: _xabole }], [0, { [_hH]: _xaoo }], [0, { [_hH]: _xabn }]], 1 ]; CreateMultipartUploadOutput$ = [ 3, n0, _CMUOr, { [_xN]: _IMUR }, [_ADb, _ARI, _B, _K, _UI, _SSE, _SSECA, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RC, _CA, _CT], [[4, { [_hH]: _xaad }], [0, { [_hH]: _xaari }], [0, { [_xN]: _B }], 0, 0, [0, { [_hH]: _xasse }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }], [0, { [_hH]: _xaca }], [0, { [_hH]: _xact }]] ]; CreateMultipartUploadRequest$ = [ 3, n0, _CMURr, 0, [_B, _K, _ACL_, _CC, _CDo, _CEo, _CL, _CTo, _Ex, _GFC, _GR, _GRACP, _GWACP, _M, _SSE, _SC, _WRL, _SSECA, _SSECK, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RP, _Tag, _OLM, _OLRUD, _OLLHS, _EBO, _CA, _CT], [[0, 1], [0, 1], [0, { [_hH]: _xaa }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CT_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagwa }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xat }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xaca }], [0, { [_hH]: _xact }]], 2 ]; CreateSessionOutput$ = [ 3, n0, _CSO, { [_xN]: _CSR }, [_Cr, _SSE, _SSEKMSKI, _SSEKMSEC, _BKE], [[() => SessionCredentials$, { [_xN]: _Cr }], [0, { [_hH]: _xasse }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }]], 1 ]; CreateSessionRequest$ = [ 3, n0, _CSRr, 0, [_B, _SM, _SSE, _SSEKMSKI, _SSEKMSEC, _BKE], [[0, 1], [0, { [_hH]: _xacsm }], [0, { [_hH]: _xasse }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }]], 1 ]; CSVInput$ = [ 3, n0, _CSVIn, 0, [_FHI, _Com, _QEC, _RD, _FD, _QC, _AQRD], [0, 0, 0, 0, 0, 0, 2] ]; CSVOutput$ = [ 3, n0, _CSVO, 0, [_QF, _QEC, _RD, _FD, _QC], [0, 0, 0, 0, 0] ]; DefaultRetention$ = [ 3, n0, _DRe, 0, [_Mo, _D, _Y], [0, 1, 1] ]; Delete$ = [ 3, n0, _De, 0, [_Ob, _Q], [[() => ObjectIdentifierList, { [_xF]: 1, [_xN]: _Obj }], 2], 1 ]; DeleteBucketAnalyticsConfigurationRequest$ = [ 3, n0, _DBACR, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; DeleteBucketCorsRequest$ = [ 3, n0, _DBCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketEncryptionRequest$ = [ 3, n0, _DBER, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketIntelligentTieringConfigurationRequest$ = [ 3, n0, _DBITCR, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; DeleteBucketInventoryConfigurationRequest$ = [ 3, n0, _DBICR, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; DeleteBucketLifecycleRequest$ = [ 3, n0, _DBLR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketMetadataConfigurationRequest$ = [ 3, n0, _DBMCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketMetadataTableConfigurationRequest$ = [ 3, n0, _DBMTCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketMetricsConfigurationRequest$ = [ 3, n0, _DBMCRe, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; DeleteBucketOwnershipControlsRequest$ = [ 3, n0, _DBOCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketPolicyRequest$ = [ 3, n0, _DBPR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketReplicationRequest$ = [ 3, n0, _DBRR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketRequest$ = [ 3, n0, _DBR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketTaggingRequest$ = [ 3, n0, _DBTR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeleteBucketWebsiteRequest$ = [ 3, n0, _DBWR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; DeletedObject$ = [ 3, n0, _DO, 0, [_K, _VI, _DM, _DMVI], [0, 0, 2, 0] ]; DeleteMarkerEntry$ = [ 3, n0, _DME, 0, [_O, _K, _VI, _IL, _LM], [() => Owner$, 0, 0, 2, 4] ]; DeleteMarkerReplication$ = [ 3, n0, _DMR, 0, [_S], [0] ]; DeleteObjectOutput$ = [ 3, n0, _DOO, 0, [_DM, _VI, _RC], [[2, { [_hH]: _xadm }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xarc }]] ]; DeleteObjectRequest$ = [ 3, n0, _DOR, 0, [_B, _K, _MFA, _VI, _RP, _BGR, _EBO, _IM, _IMLMT, _IMS], [[0, 1], [0, 1], [0, { [_hH]: _xam_ }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [2, { [_hH]: _xabgr }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _IM_ }], [6, { [_hH]: _xaimlmt }], [1, { [_hH]: _xaims }]], 2 ]; DeleteObjectsOutput$ = [ 3, n0, _DOOe, { [_xN]: _DRel }, [_Del, _RC, _Er], [[() => DeletedObjects, { [_xF]: 1 }], [0, { [_hH]: _xarc }], [() => Errors, { [_xF]: 1, [_xN]: _Err }]] ]; DeleteObjectsRequest$ = [ 3, n0, _DORe, 0, [_B, _De, _MFA, _RP, _BGR, _EBO, _CA], [[0, 1], [() => Delete$, { [_hP]: 1, [_xN]: _De }], [0, { [_hH]: _xam_ }], [0, { [_hH]: _xarp }], [2, { [_hH]: _xabgr }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasca }]], 2 ]; DeleteObjectTaggingOutput$ = [ 3, n0, _DOTO, 0, [_VI], [[0, { [_hH]: _xavi }]] ]; DeleteObjectTaggingRequest$ = [ 3, n0, _DOTR, 0, [_B, _K, _VI, _EBO], [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xaebo }]], 2 ]; DeletePublicAccessBlockRequest$ = [ 3, n0, _DPABR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; Destination$ = [ 3, n0, _Des, 0, [_B, _A, _SC, _ACT, _EC, _RT, _Me], [0, 0, 0, () => AccessControlTranslation$, () => EncryptionConfiguration$, () => ReplicationTime$, () => Metrics$], 1 ]; DestinationResult$ = [ 3, n0, _DRes, 0, [_TBT, _TBA, _TN], [0, 0, 0] ]; Encryption$ = [ 3, n0, _En, 0, [_ET, _KMSKI, _KMSC], [0, [() => SSEKMSKeyId, 0], 0], 1 ]; EncryptionConfiguration$ = [ 3, n0, _EC, 0, [_RKKID], [0] ]; EndEvent$ = [ 3, n0, _EE, 0, [], [] ]; _Error$ = [ 3, n0, _Err, 0, [_K, _VI, _Cod, _Mes], [0, 0, 0, 0] ]; ErrorDetails$ = [ 3, n0, _ED, 0, [_ECr, _EM], [0, 0] ]; ErrorDocument$ = [ 3, n0, _EDr, 0, [_K], [0], 1 ]; EventBridgeConfiguration$ = [ 3, n0, _EBC, 0, [], [] ]; ExistingObjectReplication$ = [ 3, n0, _EOR, 0, [_S], [0], 1 ]; FilterRule$ = [ 3, n0, _FR, 0, [_N, _V], [0, 0] ]; GetBucketAbacOutput$ = [ 3, n0, _GBAO, 0, [_AS], [[() => AbacStatus$, 16]] ]; GetBucketAbacRequest$ = [ 3, n0, _GBAR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketAccelerateConfigurationOutput$ = [ 3, n0, _GBACO, { [_xN]: _AC }, [_S, _RC], [0, [0, { [_hH]: _xarc }]] ]; GetBucketAccelerateConfigurationRequest$ = [ 3, n0, _GBACR, 0, [_B, _EBO, _RP], [[0, 1], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], 1 ]; GetBucketAclOutput$ = [ 3, n0, _GBAOe, { [_xN]: _ACP }, [_O, _G], [() => Owner$, [() => Grants, { [_xN]: _ACL }]] ]; GetBucketAclRequest$ = [ 3, n0, _GBARe, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketAnalyticsConfigurationOutput$ = [ 3, n0, _GBACOe, 0, [_ACn], [[() => AnalyticsConfiguration$, 16]] ]; GetBucketAnalyticsConfigurationRequest$ = [ 3, n0, _GBACRe, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; GetBucketCorsOutput$ = [ 3, n0, _GBCO, { [_xN]: _CORSC }, [_CORSR], [[() => CORSRules, { [_xF]: 1, [_xN]: _CORSRu }]] ]; GetBucketCorsRequest$ = [ 3, n0, _GBCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketEncryptionOutput$ = [ 3, n0, _GBEO, 0, [_SSEC], [[() => ServerSideEncryptionConfiguration$, 16]] ]; GetBucketEncryptionRequest$ = [ 3, n0, _GBER, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketIntelligentTieringConfigurationOutput$ = [ 3, n0, _GBITCO, 0, [_ITC], [[() => IntelligentTieringConfiguration$, 16]] ]; GetBucketIntelligentTieringConfigurationRequest$ = [ 3, n0, _GBITCR, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; GetBucketInventoryConfigurationOutput$ = [ 3, n0, _GBICO, 0, [_IC], [[() => InventoryConfiguration$, 16]] ]; GetBucketInventoryConfigurationRequest$ = [ 3, n0, _GBICR, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; GetBucketLifecycleConfigurationOutput$ = [ 3, n0, _GBLCO, { [_xN]: _LCi }, [_R, _TDMOS], [[() => LifecycleRules, { [_xF]: 1, [_xN]: _Ru }], [0, { [_hH]: _xatdmos }]] ]; GetBucketLifecycleConfigurationRequest$ = [ 3, n0, _GBLCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketLocationOutput$ = [ 3, n0, _GBLO, { [_xN]: _LC }, [_LC], [0] ]; GetBucketLocationRequest$ = [ 3, n0, _GBLR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketLoggingOutput$ = [ 3, n0, _GBLOe, { [_xN]: _BLS }, [_LE], [[() => LoggingEnabled$, 0]] ]; GetBucketLoggingRequest$ = [ 3, n0, _GBLRe, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketMetadataConfigurationOutput$ = [ 3, n0, _GBMCO, 0, [_GBMCR], [[() => GetBucketMetadataConfigurationResult$, 16]] ]; GetBucketMetadataConfigurationRequest$ = [ 3, n0, _GBMCRe, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketMetadataConfigurationResult$ = [ 3, n0, _GBMCR, 0, [_MCR], [() => MetadataConfigurationResult$], 1 ]; GetBucketMetadataTableConfigurationOutput$ = [ 3, n0, _GBMTCO, 0, [_GBMTCR], [[() => GetBucketMetadataTableConfigurationResult$, 16]] ]; GetBucketMetadataTableConfigurationRequest$ = [ 3, n0, _GBMTCRe, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketMetadataTableConfigurationResult$ = [ 3, n0, _GBMTCR, 0, [_MTCR, _S, _Err], [() => MetadataTableConfigurationResult$, 0, () => ErrorDetails$], 2 ]; GetBucketMetricsConfigurationOutput$ = [ 3, n0, _GBMCOe, 0, [_MCe], [[() => MetricsConfiguration$, 16]] ]; GetBucketMetricsConfigurationRequest$ = [ 3, n0, _GBMCRet, 0, [_B, _I, _EBO], [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], 2 ]; GetBucketNotificationConfigurationRequest$ = [ 3, n0, _GBNCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketOwnershipControlsOutput$ = [ 3, n0, _GBOCO, 0, [_OC], [[() => OwnershipControls$, 16]] ]; GetBucketOwnershipControlsRequest$ = [ 3, n0, _GBOCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketPolicyOutput$ = [ 3, n0, _GBPO, 0, [_Po], [[0, 16]] ]; GetBucketPolicyRequest$ = [ 3, n0, _GBPR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketPolicyStatusOutput$ = [ 3, n0, _GBPSO, 0, [_PS], [[() => PolicyStatus$, 16]] ]; GetBucketPolicyStatusRequest$ = [ 3, n0, _GBPSR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketReplicationOutput$ = [ 3, n0, _GBRO, 0, [_RCe], [[() => ReplicationConfiguration$, 16]] ]; GetBucketReplicationRequest$ = [ 3, n0, _GBRR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketRequestPaymentOutput$ = [ 3, n0, _GBRPO, { [_xN]: _RPC }, [_Pay], [0] ]; GetBucketRequestPaymentRequest$ = [ 3, n0, _GBRPR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketTaggingOutput$ = [ 3, n0, _GBTO, { [_xN]: _Tag }, [_TS], [[() => TagSet, 0]], 1 ]; GetBucketTaggingRequest$ = [ 3, n0, _GBTR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketVersioningOutput$ = [ 3, n0, _GBVO, { [_xN]: _VC }, [_S, _MFAD], [0, [0, { [_xN]: _MDf }]] ]; GetBucketVersioningRequest$ = [ 3, n0, _GBVR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetBucketWebsiteOutput$ = [ 3, n0, _GBWO, { [_xN]: _WC }, [_RART, _IDn, _EDr, _RR], [() => RedirectAllRequestsTo$, () => IndexDocument$, () => ErrorDocument$, [() => RoutingRules, 0]] ]; GetBucketWebsiteRequest$ = [ 3, n0, _GBWR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetObjectAclOutput$ = [ 3, n0, _GOAO, { [_xN]: _ACP }, [_O, _G, _RC], [() => Owner$, [() => Grants, { [_xN]: _ACL }], [0, { [_hH]: _xarc }]] ]; GetObjectAclRequest$ = [ 3, n0, _GOAR, 0, [_B, _K, _VI, _RP, _EBO], [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], 2 ]; GetObjectAttributesOutput$ = [ 3, n0, _GOAOe, { [_xN]: _GOARe }, [_DM, _LM, _VI, _RC, _ETa, _C, _OP, _SC, _OS], [[2, { [_hH]: _xadm }], [4, { [_hH]: _LM_ }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xarc }], 0, () => Checksum$, [() => GetObjectAttributesParts$, 0], 0, 1] ]; GetObjectAttributesParts$ = [ 3, n0, _GOAP, 0, [_TPC, _PNM, _NPNM, _MP, _IT, _Pa], [[1, { [_xN]: _PC }], 0, 0, 1, 2, [() => PartsList, { [_xF]: 1, [_xN]: _Par }]] ]; GetObjectAttributesRequest$ = [ 3, n0, _GOARet, 0, [_B, _K, _OA, _VI, _MP, _PNM, _SSECA, _SSECK, _SSECKMD, _RP, _EBO], [[0, 1], [0, 1], [64 | 0, { [_hH]: _xaoa }], [0, { [_hQ]: _vI }], [1, { [_hH]: _xamp }], [0, { [_hH]: _xapnm }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], 3 ]; GetObjectLegalHoldOutput$ = [ 3, n0, _GOLHO, 0, [_LH], [[() => ObjectLockLegalHold$, { [_hP]: 1, [_xN]: _LH }]] ]; GetObjectLegalHoldRequest$ = [ 3, n0, _GOLHR, 0, [_B, _K, _VI, _RP, _EBO], [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], 2 ]; GetObjectLockConfigurationOutput$ = [ 3, n0, _GOLCO, 0, [_OLC], [[() => ObjectLockConfiguration$, 16]] ]; GetObjectLockConfigurationRequest$ = [ 3, n0, _GOLCR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GetObjectOutput$ = [ 3, n0, _GOO, 0, [_Bo, _DM, _AR, _E, _Re, _LM, _CLo, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT, _MM, _VI, _CC, _CDo, _CEo, _CL, _CR, _CTo, _Ex, _ES, _WRL, _SSE, _M, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _SC, _RC, _RS, _PC, _TC, _OLM, _OLRUD, _OLLHS], [[() => StreamingBlob, 16], [2, { [_hH]: _xadm }], [0, { [_hH]: _ar }], [0, { [_hH]: _xae }], [0, { [_hH]: _xar }], [4, { [_hH]: _LM_ }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _ETa }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [1, { [_hH]: _xamm }], [0, { [_hH]: _xavi }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CR_ }], [0, { [_hH]: _CT_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _ES }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasse }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xarc }], [0, { [_hH]: _xars }], [1, { [_hH]: _xampc }], [1, { [_hH]: _xatc }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }]] ]; GetObjectRequest$ = [ 3, n0, _GOR, 0, [_B, _K, _IM, _IMSf, _INM, _IUS, _Ra, _RCC, _RCD, _RCE, _RCL, _RCT, _RE, _VI, _SSECA, _SSECK, _SSECKMD, _RP, _PN, _EBO, _CMh], [[0, 1], [0, 1], [0, { [_hH]: _IM_ }], [4, { [_hH]: _IMS_ }], [0, { [_hH]: _INM_ }], [4, { [_hH]: _IUS_ }], [0, { [_hH]: _Ra }], [0, { [_hQ]: _rcc }], [0, { [_hQ]: _rcd }], [0, { [_hQ]: _rce }], [0, { [_hQ]: _rcl }], [0, { [_hQ]: _rct }], [6, { [_hQ]: _re }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [1, { [_hQ]: _pN }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xacm }]], 2 ]; GetObjectRetentionOutput$ = [ 3, n0, _GORO, 0, [_Ret], [[() => ObjectLockRetention$, { [_hP]: 1, [_xN]: _Ret }]] ]; GetObjectRetentionRequest$ = [ 3, n0, _GORR, 0, [_B, _K, _VI, _RP, _EBO], [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], 2 ]; GetObjectTaggingOutput$ = [ 3, n0, _GOTO, { [_xN]: _Tag }, [_TS, _VI], [[() => TagSet, 0], [0, { [_hH]: _xavi }]], 1 ]; GetObjectTaggingRequest$ = [ 3, n0, _GOTR, 0, [_B, _K, _VI, _EBO, _RP], [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], 2 ]; GetObjectTorrentOutput$ = [ 3, n0, _GOTOe, 0, [_Bo, _RC], [[() => StreamingBlob, 16], [0, { [_hH]: _xarc }]] ]; GetObjectTorrentRequest$ = [ 3, n0, _GOTRe, 0, [_B, _K, _RP, _EBO], [[0, 1], [0, 1], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], 2 ]; GetPublicAccessBlockOutput$ = [ 3, n0, _GPABO, 0, [_PABC], [[() => PublicAccessBlockConfiguration$, 16]] ]; GetPublicAccessBlockRequest$ = [ 3, n0, _GPABR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; GlacierJobParameters$ = [ 3, n0, _GJP, 0, [_Ti], [0], 1 ]; Grant$ = [ 3, n0, _Gr, 0, [_Gra, _Pe], [[() => Grantee$, { [_xNm]: [_x, _hi] }], 0] ]; Grantee$ = [ 3, n0, _Gra, 0, [_Ty, _DN, _EA, _ID, _URI], [[0, { [_xA]: 1, [_xN]: _xs }], 0, 0, 0, 0], 1 ]; HeadBucketOutput$ = [ 3, n0, _HBO, 0, [_BA, _BLT, _BLN, _BR, _APA], [[0, { [_hH]: _xaba }], [0, { [_hH]: _xablt }], [0, { [_hH]: _xabln }], [0, { [_hH]: _xabr }], [2, { [_hH]: _xaapa }]] ]; HeadBucketRequest$ = [ 3, n0, _HBR, 0, [_B, _EBO], [[0, 1], [0, { [_hH]: _xaebo }]], 1 ]; HeadObjectOutput$ = [ 3, n0, _HOO, 0, [_DM, _AR, _E, _Re, _ASr, _LM, _CLo, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT, _ETa, _MM, _VI, _CC, _CDo, _CEo, _CL, _CTo, _CR, _Ex, _ES, _WRL, _SSE, _M, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _SC, _RC, _RS, _PC, _TC, _OLM, _OLRUD, _OLLHS], [[2, { [_hH]: _xadm }], [0, { [_hH]: _ar }], [0, { [_hH]: _xae }], [0, { [_hH]: _xar }], [0, { [_hH]: _xaas }], [4, { [_hH]: _LM_ }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [0, { [_hH]: _ETa }], [1, { [_hH]: _xamm }], [0, { [_hH]: _xavi }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CT_ }], [0, { [_hH]: _CR_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _ES }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasse }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xarc }], [0, { [_hH]: _xars }], [1, { [_hH]: _xampc }], [1, { [_hH]: _xatc }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }]] ]; HeadObjectRequest$ = [ 3, n0, _HOR, 0, [_B, _K, _IM, _IMSf, _INM, _IUS, _Ra, _RCC, _RCD, _RCE, _RCL, _RCT, _RE, _VI, _SSECA, _SSECK, _SSECKMD, _RP, _PN, _EBO, _CMh], [[0, 1], [0, 1], [0, { [_hH]: _IM_ }], [4, { [_hH]: _IMS_ }], [0, { [_hH]: _INM_ }], [4, { [_hH]: _IUS_ }], [0, { [_hH]: _Ra }], [0, { [_hQ]: _rcc }], [0, { [_hQ]: _rcd }], [0, { [_hQ]: _rce }], [0, { [_hQ]: _rcl }], [0, { [_hQ]: _rct }], [6, { [_hQ]: _re }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [1, { [_hQ]: _pN }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xacm }]], 2 ]; IndexDocument$ = [ 3, n0, _IDn, 0, [_Su], [0], 1 ]; Initiator$ = [ 3, n0, _In, 0, [_ID, _DN], [0, 0] ]; InputSerialization$ = [ 3, n0, _IS, 0, [_CSV, _CTom, _JSON, _Parq], [() => CSVInput$, 0, () => JSONInput$, () => ParquetInput$] ]; IntelligentTieringAndOperator$ = [ 3, n0, _ITAO, 0, [_P, _T], [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta }]] ]; IntelligentTieringConfiguration$ = [ 3, n0, _ITC, 0, [_I, _S, _Tie, _F], [0, 0, [() => TieringList, { [_xF]: 1, [_xN]: _Tier }], [() => IntelligentTieringFilter$, 0]], 3 ]; IntelligentTieringFilter$ = [ 3, n0, _ITF, 0, [_P, _Ta, _An], [0, () => Tag$, [() => IntelligentTieringAndOperator$, 0]] ]; InventoryConfiguration$ = [ 3, n0, _IC, 0, [_Des, _IE, _I, _IOV, _Sc, _F, _OF], [[() => InventoryDestination$, 0], 2, 0, 0, () => InventorySchedule$, () => InventoryFilter$, [() => InventoryOptionalFields, 0]], 5 ]; InventoryDestination$ = [ 3, n0, _IDnv, 0, [_SBD], [[() => InventoryS3BucketDestination$, 0]], 1 ]; InventoryEncryption$ = [ 3, n0, _IEn, 0, [_SSES, _SSEKMS], [[() => SSES3$, { [_xN]: _SS }], [() => SSEKMS$, { [_xN]: _SK }]] ]; InventoryFilter$ = [ 3, n0, _IF, 0, [_P], [0], 1 ]; InventoryS3BucketDestination$ = [ 3, n0, _ISBD, 0, [_B, _Fo, _AI, _P, _En], [0, 0, 0, 0, [() => InventoryEncryption$, 0]], 2 ]; InventorySchedule$ = [ 3, n0, _ISn, 0, [_Fr], [0], 1 ]; InventoryTableConfiguration$ = [ 3, n0, _ITCn, 0, [_CSo, _EC], [0, () => MetadataTableEncryptionConfiguration$], 1 ]; InventoryTableConfigurationResult$ = [ 3, n0, _ITCR, 0, [_CSo, _TSa, _Err, _TNa, _TA], [0, 0, () => ErrorDetails$, 0, 0], 1 ]; InventoryTableConfigurationUpdates$ = [ 3, n0, _ITCU, 0, [_CSo, _EC], [0, () => MetadataTableEncryptionConfiguration$], 1 ]; JournalTableConfiguration$ = [ 3, n0, _JTC, 0, [_REe, _EC], [() => RecordExpiration$, () => MetadataTableEncryptionConfiguration$], 1 ]; JournalTableConfigurationResult$ = [ 3, n0, _JTCR, 0, [_TSa, _TNa, _REe, _Err, _TA], [0, 0, () => RecordExpiration$, () => ErrorDetails$, 0], 3 ]; JournalTableConfigurationUpdates$ = [ 3, n0, _JTCU, 0, [_REe], [() => RecordExpiration$], 1 ]; JSONInput$ = [ 3, n0, _JSONI, 0, [_Ty], [0] ]; JSONOutput$ = [ 3, n0, _JSONO, 0, [_RD], [0] ]; LambdaFunctionConfiguration$ = [ 3, n0, _LFC, 0, [_LFA, _Ev, _I, _F], [[0, { [_xN]: _CF }], [64 | 0, { [_xF]: 1, [_xN]: _Eve }], 0, [() => NotificationConfigurationFilter$, 0]], 2 ]; LifecycleExpiration$ = [ 3, n0, _LEi, 0, [_Da, _D, _EODM], [5, 1, 2] ]; LifecycleRule$ = [ 3, n0, _LR, 0, [_S, _E, _ID, _P, _F, _Tr, _NVT, _NVE, _AIMU], [0, () => LifecycleExpiration$, 0, 0, [() => LifecycleRuleFilter$, 0], [() => TransitionList, { [_xF]: 1, [_xN]: _Tra }], [() => NoncurrentVersionTransitionList, { [_xF]: 1, [_xN]: _NVTo }], () => NoncurrentVersionExpiration$, () => AbortIncompleteMultipartUpload$], 1 ]; LifecycleRuleAndOperator$ = [ 3, n0, _LRAO, 0, [_P, _T, _OSGT, _OSLT], [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta }], 1, 1] ]; LifecycleRuleFilter$ = [ 3, n0, _LRF, 0, [_P, _Ta, _OSGT, _OSLT, _An], [0, () => Tag$, 1, 1, [() => LifecycleRuleAndOperator$, 0]] ]; ListBucketAnalyticsConfigurationsOutput$ = [ 3, n0, _LBACO, { [_xN]: _LBACR }, [_IT, _CTon, _NCT, _ACLn], [2, 0, 0, [() => AnalyticsConfigurationList, { [_xF]: 1, [_xN]: _ACn }]] ]; ListBucketAnalyticsConfigurationsRequest$ = [ 3, n0, _LBACRi, 0, [_B, _CTon, _EBO], [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], 1 ]; ListBucketIntelligentTieringConfigurationsOutput$ = [ 3, n0, _LBITCO, 0, [_IT, _CTon, _NCT, _ITCL], [2, 0, 0, [() => IntelligentTieringConfigurationList, { [_xF]: 1, [_xN]: _ITC }]] ]; ListBucketIntelligentTieringConfigurationsRequest$ = [ 3, n0, _LBITCR, 0, [_B, _CTon, _EBO], [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], 1 ]; ListBucketInventoryConfigurationsOutput$ = [ 3, n0, _LBICO, { [_xN]: _LICR }, [_CTon, _ICL, _IT, _NCT], [0, [() => InventoryConfigurationList, { [_xF]: 1, [_xN]: _IC }], 2, 0] ]; ListBucketInventoryConfigurationsRequest$ = [ 3, n0, _LBICR, 0, [_B, _CTon, _EBO], [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], 1 ]; ListBucketMetricsConfigurationsOutput$ = [ 3, n0, _LBMCO, { [_xN]: _LMCR }, [_IT, _CTon, _NCT, _MCL], [2, 0, 0, [() => MetricsConfigurationList, { [_xF]: 1, [_xN]: _MCe }]] ]; ListBucketMetricsConfigurationsRequest$ = [ 3, n0, _LBMCR, 0, [_B, _CTon, _EBO], [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], 1 ]; ListBucketsOutput$ = [ 3, n0, _LBO, { [_xN]: _LAMBR }, [_Bu, _O, _CTon, _P], [[() => Buckets, 0], () => Owner$, 0, 0] ]; ListBucketsRequest$ = [ 3, n0, _LBR, 0, [_MB, _CTon, _P, _BR], [[1, { [_hQ]: _mb }], [0, { [_hQ]: _ct }], [0, { [_hQ]: _p }], [0, { [_hQ]: _br }]] ]; ListDirectoryBucketsOutput$ = [ 3, n0, _LDBO, { [_xN]: _LAMDBR }, [_Bu, _CTon], [[() => Buckets, 0], 0] ]; ListDirectoryBucketsRequest$ = [ 3, n0, _LDBR, 0, [_CTon, _MDB], [[0, { [_hQ]: _ct }], [1, { [_hQ]: _mdb }]] ]; ListMultipartUploadsOutput$ = [ 3, n0, _LMUO, { [_xN]: _LMUR }, [_B, _KM, _UIM, _NKM, _P, _Deli, _NUIM, _MUa, _IT, _U, _CPom, _ETn, _RC], [0, 0, 0, 0, 0, 0, 0, 1, 2, [() => MultipartUploadList, { [_xF]: 1, [_xN]: _Up }], [() => CommonPrefixList, { [_xF]: 1 }], 0, [0, { [_hH]: _xarc }]] ]; ListMultipartUploadsRequest$ = [ 3, n0, _LMURi, 0, [_B, _Deli, _ETn, _KM, _MUa, _P, _UIM, _EBO, _RP], [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [0, { [_hQ]: _km }], [1, { [_hQ]: _mu }], [0, { [_hQ]: _p }], [0, { [_hQ]: _uim }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], 1 ]; ListObjectsOutput$ = [ 3, n0, _LOO, { [_xN]: _LBRi }, [_IT, _Ma, _NM, _Con, _N, _P, _Deli, _MK, _CPom, _ETn, _RC], [2, 0, 0, [() => ObjectList, { [_xF]: 1 }], 0, 0, 0, 1, [() => CommonPrefixList, { [_xF]: 1 }], 0, [0, { [_hH]: _xarc }]] ]; ListObjectsRequest$ = [ 3, n0, _LOR, 0, [_B, _Deli, _ETn, _Ma, _MK, _P, _RP, _EBO, _OOA], [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [0, { [_hQ]: _m }], [1, { [_hQ]: _mk }], [0, { [_hQ]: _p }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [64 | 0, { [_hH]: _xaooa }]], 1 ]; ListObjectsV2Output$ = [ 3, n0, _LOVO, { [_xN]: _LBRi }, [_IT, _Con, _N, _P, _Deli, _MK, _CPom, _ETn, _KC, _CTon, _NCT, _SA, _RC], [2, [() => ObjectList, { [_xF]: 1 }], 0, 0, 0, 1, [() => CommonPrefixList, { [_xF]: 1 }], 0, 1, 0, 0, 0, [0, { [_hH]: _xarc }]] ]; ListObjectsV2Request$ = [ 3, n0, _LOVR, 0, [_B, _Deli, _ETn, _MK, _P, _CTon, _FO, _SA, _RP, _EBO, _OOA], [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [1, { [_hQ]: _mk }], [0, { [_hQ]: _p }], [0, { [_hQ]: _ct }], [2, { [_hQ]: _fo }], [0, { [_hQ]: _sa }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [64 | 0, { [_hH]: _xaooa }]], 1 ]; ListObjectVersionsOutput$ = [ 3, n0, _LOVOi, { [_xN]: _LVR }, [_IT, _KM, _VIM, _NKM, _NVIM, _Ve, _DMe, _N, _P, _Deli, _MK, _CPom, _ETn, _RC], [2, 0, 0, 0, 0, [() => ObjectVersionList, { [_xF]: 1, [_xN]: _Ver }], [() => DeleteMarkers, { [_xF]: 1, [_xN]: _DM }], 0, 0, 0, 1, [() => CommonPrefixList, { [_xF]: 1 }], 0, [0, { [_hH]: _xarc }]] ]; ListObjectVersionsRequest$ = [ 3, n0, _LOVRi, 0, [_B, _Deli, _ETn, _KM, _MK, _P, _VIM, _EBO, _RP, _OOA], [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [0, { [_hQ]: _km }], [1, { [_hQ]: _mk }], [0, { [_hQ]: _p }], [0, { [_hQ]: _vim }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }], [64 | 0, { [_hH]: _xaooa }]], 1 ]; ListPartsOutput$ = [ 3, n0, _LPO, { [_xN]: _LPR }, [_ADb, _ARI, _B, _K, _UI, _PNM, _NPNM, _MP, _IT, _Pa, _In, _O, _SC, _RC, _CA, _CT], [[4, { [_hH]: _xaad }], [0, { [_hH]: _xaari }], 0, 0, 0, 0, 0, 1, 2, [() => Parts, { [_xF]: 1, [_xN]: _Par }], () => Initiator$, () => Owner$, 0, [0, { [_hH]: _xarc }], 0, 0] ]; ListPartsRequest$ = [ 3, n0, _LPRi, 0, [_B, _K, _UI, _MP, _PNM, _RP, _EBO, _SSECA, _SSECK, _SSECKMD], [[0, 1], [0, 1], [0, { [_hQ]: _uI }], [1, { [_hQ]: _mp }], [0, { [_hQ]: _pnm }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }]], 3 ]; LocationInfo$ = [ 3, n0, _LI, 0, [_Ty, _N], [0, 0] ]; LoggingEnabled$ = [ 3, n0, _LE, 0, [_TB, _TP, _TG, _TOKF], [0, 0, [() => TargetGrants, 0], [() => TargetObjectKeyFormat$, 0]], 2 ]; MetadataConfiguration$ = [ 3, n0, _MC, 0, [_JTC, _ITCn], [() => JournalTableConfiguration$, () => InventoryTableConfiguration$], 1 ]; MetadataConfigurationResult$ = [ 3, n0, _MCR, 0, [_DRes, _JTCR, _ITCR], [() => DestinationResult$, () => JournalTableConfigurationResult$, () => InventoryTableConfigurationResult$], 1 ]; MetadataEntry$ = [ 3, n0, _ME, 0, [_N, _V], [0, 0] ]; MetadataTableConfiguration$ = [ 3, n0, _MTC, 0, [_STD], [() => S3TablesDestination$], 1 ]; MetadataTableConfigurationResult$ = [ 3, n0, _MTCR, 0, [_STDR], [() => S3TablesDestinationResult$], 1 ]; MetadataTableEncryptionConfiguration$ = [ 3, n0, _MTEC, 0, [_SAs, _KKA], [0, 0], 1 ]; Metrics$ = [ 3, n0, _Me, 0, [_S, _ETv], [0, () => ReplicationTimeValue$], 1 ]; MetricsAndOperator$ = [ 3, n0, _MAO, 0, [_P, _T, _APAc], [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta }], 0] ]; MetricsConfiguration$ = [ 3, n0, _MCe, 0, [_I, _F], [0, [() => MetricsFilter$, 0]], 1 ]; MultipartUpload$ = [ 3, n0, _MU, 0, [_UI, _K, _Ini, _SC, _O, _In, _CA, _CT], [0, 0, 4, 0, () => Owner$, () => Initiator$, 0, 0] ]; NoncurrentVersionExpiration$ = [ 3, n0, _NVE, 0, [_ND, _NNV], [1, 1] ]; NoncurrentVersionTransition$ = [ 3, n0, _NVTo, 0, [_ND, _SC, _NNV], [1, 0, 1] ]; NotificationConfiguration$ = [ 3, n0, _NC, 0, [_TCo, _QCu, _LFCa, _EBC], [[() => TopicConfigurationList, { [_xF]: 1, [_xN]: _TCop }], [() => QueueConfigurationList, { [_xF]: 1, [_xN]: _QCue }], [() => LambdaFunctionConfigurationList, { [_xF]: 1, [_xN]: _CFC }], () => EventBridgeConfiguration$] ]; NotificationConfigurationFilter$ = [ 3, n0, _NCF, 0, [_K], [[() => S3KeyFilter$, { [_xN]: _SKe }]] ]; _Object$ = [ 3, n0, _Obj, 0, [_K, _LM, _ETa, _CA, _CT, _Si, _SC, _O, _RSe], [0, 4, 0, [64 | 0, { [_xF]: 1 }], 0, 1, 0, () => Owner$, () => RestoreStatus$] ]; ObjectIdentifier$ = [ 3, n0, _OI, 0, [_K, _VI, _ETa, _LMT, _Si], [0, 0, 0, 6, 1], 1 ]; ObjectLockConfiguration$ = [ 3, n0, _OLC, 0, [_OLE, _Ru], [0, () => ObjectLockRule$] ]; ObjectLockLegalHold$ = [ 3, n0, _OLLH, 0, [_S], [0] ]; ObjectLockRetention$ = [ 3, n0, _OLR, 0, [_Mo, _RUD], [0, 5] ]; ObjectLockRule$ = [ 3, n0, _OLRb, 0, [_DRe], [() => DefaultRetention$] ]; ObjectPart$ = [ 3, n0, _OPb, 0, [_PN, _Si, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], [1, 1, 0, 0, 0, 0, 0] ]; ObjectVersion$ = [ 3, n0, _OV, 0, [_ETa, _CA, _CT, _Si, _SC, _K, _VI, _IL, _LM, _O, _RSe], [0, [64 | 0, { [_xF]: 1 }], 0, 1, 0, 0, 0, 2, 4, () => Owner$, () => RestoreStatus$] ]; OutputLocation$ = [ 3, n0, _OL, 0, [_S_], [[() => S3Location$, 0]] ]; OutputSerialization$ = [ 3, n0, _OSu, 0, [_CSV, _JSON], [() => CSVOutput$, () => JSONOutput$] ]; Owner$ = [ 3, n0, _O, 0, [_DN, _ID], [0, 0] ]; OwnershipControls$ = [ 3, n0, _OC, 0, [_R], [[() => OwnershipControlsRules, { [_xF]: 1, [_xN]: _Ru }]], 1 ]; OwnershipControlsRule$ = [ 3, n0, _OCR, 0, [_OO], [0], 1 ]; ParquetInput$ = [ 3, n0, _PI, 0, [], [] ]; Part$ = [ 3, n0, _Par, 0, [_PN, _LM, _ETa, _Si, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], [1, 4, 0, 1, 0, 0, 0, 0, 0] ]; PartitionedPrefix$ = [ 3, n0, _PP, { [_xN]: _PP }, [_PDS], [0] ]; PolicyStatus$ = [ 3, n0, _PS, 0, [_IP], [[2, { [_xN]: _IP }]] ]; Progress$ = [ 3, n0, _Pr, 0, [_BS, _BP, _BRy], [1, 1, 1] ]; ProgressEvent$ = [ 3, n0, _PE, 0, [_Det], [[() => Progress$, { [_eP]: 1 }]] ]; PublicAccessBlockConfiguration$ = [ 3, n0, _PABC, 0, [_BPA, _IPA, _BPP, _RPB], [[2, { [_xN]: _BPA }], [2, { [_xN]: _IPA }], [2, { [_xN]: _BPP }], [2, { [_xN]: _RPB }]] ]; PutBucketAbacRequest$ = [ 3, n0, _PBAR, 0, [_B, _AS, _CMD, _CA, _EBO], [[0, 1], [() => AbacStatus$, { [_hP]: 1, [_xN]: _AS }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketAccelerateConfigurationRequest$ = [ 3, n0, _PBACR, 0, [_B, _AC, _EBO, _CA], [[0, 1], [() => AccelerateConfiguration$, { [_hP]: 1, [_xN]: _AC }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasca }]], 2 ]; PutBucketAclRequest$ = [ 3, n0, _PBARu, 0, [_B, _ACL_, _ACP, _CMD, _CA, _GFC, _GR, _GRACP, _GW, _GWACP, _EBO], [[0, 1], [0, { [_hH]: _xaa }], [() => AccessControlPolicy$, { [_hP]: 1, [_xN]: _ACP }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagw }], [0, { [_hH]: _xagwa }], [0, { [_hH]: _xaebo }]], 1 ]; PutBucketAnalyticsConfigurationRequest$ = [ 3, n0, _PBACRu, 0, [_B, _I, _ACn, _EBO], [[0, 1], [0, { [_hQ]: _i }], [() => AnalyticsConfiguration$, { [_hP]: 1, [_xN]: _ACn }], [0, { [_hH]: _xaebo }]], 3 ]; PutBucketCorsRequest$ = [ 3, n0, _PBCR, 0, [_B, _CORSC, _CMD, _CA, _EBO], [[0, 1], [() => CORSConfiguration$, { [_hP]: 1, [_xN]: _CORSC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketEncryptionRequest$ = [ 3, n0, _PBER, 0, [_B, _SSEC, _CMD, _CA, _EBO], [[0, 1], [() => ServerSideEncryptionConfiguration$, { [_hP]: 1, [_xN]: _SSEC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketIntelligentTieringConfigurationRequest$ = [ 3, n0, _PBITCR, 0, [_B, _I, _ITC, _EBO], [[0, 1], [0, { [_hQ]: _i }], [() => IntelligentTieringConfiguration$, { [_hP]: 1, [_xN]: _ITC }], [0, { [_hH]: _xaebo }]], 3 ]; PutBucketInventoryConfigurationRequest$ = [ 3, n0, _PBICR, 0, [_B, _I, _IC, _EBO], [[0, 1], [0, { [_hQ]: _i }], [() => InventoryConfiguration$, { [_hP]: 1, [_xN]: _IC }], [0, { [_hH]: _xaebo }]], 3 ]; PutBucketLifecycleConfigurationOutput$ = [ 3, n0, _PBLCO, 0, [_TDMOS], [[0, { [_hH]: _xatdmos }]] ]; PutBucketLifecycleConfigurationRequest$ = [ 3, n0, _PBLCR, 0, [_B, _CA, _LCi, _EBO, _TDMOS], [[0, 1], [0, { [_hH]: _xasca }], [() => BucketLifecycleConfiguration$, { [_hP]: 1, [_xN]: _LCi }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xatdmos }]], 1 ]; PutBucketLoggingRequest$ = [ 3, n0, _PBLR, 0, [_B, _BLS, _CMD, _CA, _EBO], [[0, 1], [() => BucketLoggingStatus$, { [_hP]: 1, [_xN]: _BLS }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketMetricsConfigurationRequest$ = [ 3, n0, _PBMCR, 0, [_B, _I, _MCe, _EBO], [[0, 1], [0, { [_hQ]: _i }], [() => MetricsConfiguration$, { [_hP]: 1, [_xN]: _MCe }], [0, { [_hH]: _xaebo }]], 3 ]; PutBucketNotificationConfigurationRequest$ = [ 3, n0, _PBNCR, 0, [_B, _NC, _EBO, _SDV], [[0, 1], [() => NotificationConfiguration$, { [_hP]: 1, [_xN]: _NC }], [0, { [_hH]: _xaebo }], [2, { [_hH]: _xasdv }]], 2 ]; PutBucketOwnershipControlsRequest$ = [ 3, n0, _PBOCR, 0, [_B, _OC, _CMD, _EBO, _CA], [[0, 1], [() => OwnershipControls$, { [_hP]: 1, [_xN]: _OC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasca }]], 2 ]; PutBucketPolicyRequest$ = [ 3, n0, _PBPR, 0, [_B, _Po, _CMD, _CA, _CRSBA, _EBO], [[0, 1], [0, 16], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [2, { [_hH]: _xacrsba }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketReplicationRequest$ = [ 3, n0, _PBRR, 0, [_B, _RCe, _CMD, _CA, _To, _EBO], [[0, 1], [() => ReplicationConfiguration$, { [_hP]: 1, [_xN]: _RCe }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xabolt }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketRequestPaymentRequest$ = [ 3, n0, _PBRPR, 0, [_B, _RPC, _CMD, _CA, _EBO], [[0, 1], [() => RequestPaymentConfiguration$, { [_hP]: 1, [_xN]: _RPC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketTaggingRequest$ = [ 3, n0, _PBTR, 0, [_B, _Tag, _CMD, _CA, _EBO], [[0, 1], [() => Tagging$, { [_hP]: 1, [_xN]: _Tag }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketVersioningRequest$ = [ 3, n0, _PBVR, 0, [_B, _VC, _CMD, _CA, _MFA, _EBO], [[0, 1], [() => VersioningConfiguration$, { [_hP]: 1, [_xN]: _VC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xam_ }], [0, { [_hH]: _xaebo }]], 2 ]; PutBucketWebsiteRequest$ = [ 3, n0, _PBWR, 0, [_B, _WC, _CMD, _CA, _EBO], [[0, 1], [() => WebsiteConfiguration$, { [_hP]: 1, [_xN]: _WC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutObjectAclOutput$ = [ 3, n0, _POAO, 0, [_RC], [[0, { [_hH]: _xarc }]] ]; PutObjectAclRequest$ = [ 3, n0, _POAR, 0, [_B, _K, _ACL_, _ACP, _CMD, _CA, _GFC, _GR, _GRACP, _GW, _GWACP, _RP, _VI, _EBO], [[0, 1], [0, 1], [0, { [_hH]: _xaa }], [() => AccessControlPolicy$, { [_hP]: 1, [_xN]: _ACP }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagw }], [0, { [_hH]: _xagwa }], [0, { [_hH]: _xarp }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xaebo }]], 2 ]; PutObjectLegalHoldOutput$ = [ 3, n0, _POLHO, 0, [_RC], [[0, { [_hH]: _xarc }]] ]; PutObjectLegalHoldRequest$ = [ 3, n0, _POLHR, 0, [_B, _K, _LH, _RP, _VI, _CMD, _CA, _EBO], [[0, 1], [0, 1], [() => ObjectLockLegalHold$, { [_hP]: 1, [_xN]: _LH }], [0, { [_hH]: _xarp }], [0, { [_hQ]: _vI }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutObjectLockConfigurationOutput$ = [ 3, n0, _POLCO, 0, [_RC], [[0, { [_hH]: _xarc }]] ]; PutObjectLockConfigurationRequest$ = [ 3, n0, _POLCR, 0, [_B, _OLC, _RP, _To, _CMD, _CA, _EBO], [[0, 1], [() => ObjectLockConfiguration$, { [_hP]: 1, [_xN]: _OLC }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xabolt }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 1 ]; PutObjectOutput$ = [ 3, n0, _POO, 0, [_E, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT, _SSE, _VI, _SSECA, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _Si, _RC], [[0, { [_hH]: _xae }], [0, { [_hH]: _ETa }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [1, { [_hH]: _xaos }], [0, { [_hH]: _xarc }]] ]; PutObjectRequest$ = [ 3, n0, _POR, 0, [_B, _K, _ACL_, _Bo, _CC, _CDo, _CEo, _CL, _CLo, _CMD, _CTo, _CA, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _Ex, _IM, _INM, _GFC, _GR, _GRACP, _GWACP, _WOB, _M, _SSE, _SC, _WRL, _SSECA, _SSECK, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RP, _Tag, _OLM, _OLRUD, _OLLHS, _EBO], [[0, 1], [0, 1], [0, { [_hH]: _xaa }], [() => StreamingBlob, 16], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _CM }], [0, { [_hH]: _CT_ }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagwa }], [1, { [_hH]: _xawob }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xat }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }], [0, { [_hH]: _xaebo }]], 2 ]; PutObjectRetentionOutput$ = [ 3, n0, _PORO, 0, [_RC], [[0, { [_hH]: _xarc }]] ]; PutObjectRetentionRequest$ = [ 3, n0, _PORR, 0, [_B, _K, _Ret, _RP, _VI, _BGR, _CMD, _CA, _EBO], [[0, 1], [0, 1], [() => ObjectLockRetention$, { [_hP]: 1, [_xN]: _Ret }], [0, { [_hH]: _xarp }], [0, { [_hQ]: _vI }], [2, { [_hH]: _xabgr }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; PutObjectTaggingOutput$ = [ 3, n0, _POTO, 0, [_VI], [[0, { [_hH]: _xavi }]] ]; PutObjectTaggingRequest$ = [ 3, n0, _POTR, 0, [_B, _K, _Tag, _VI, _CMD, _CA, _EBO, _RP], [[0, 1], [0, 1], [() => Tagging$, { [_hP]: 1, [_xN]: _Tag }], [0, { [_hQ]: _vI }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], 3 ]; PutPublicAccessBlockRequest$ = [ 3, n0, _PPABR, 0, [_B, _PABC, _CMD, _CA, _EBO], [[0, 1], [() => PublicAccessBlockConfiguration$, { [_hP]: 1, [_xN]: _PABC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; QueueConfiguration$ = [ 3, n0, _QCue, 0, [_QA, _Ev, _I, _F], [[0, { [_xN]: _Qu }], [64 | 0, { [_xF]: 1, [_xN]: _Eve }], 0, [() => NotificationConfigurationFilter$, 0]], 2 ]; RecordExpiration$ = [ 3, n0, _REe, 0, [_E, _D], [0, 1], 1 ]; RecordsEvent$ = [ 3, n0, _REec, 0, [_Payl], [[21, { [_eP]: 1 }]] ]; Redirect$ = [ 3, n0, _Red, 0, [_HN, _HRC, _Pro, _RKPW, _RKW], [0, 0, 0, 0, 0] ]; RedirectAllRequestsTo$ = [ 3, n0, _RART, 0, [_HN, _Pro], [0, 0], 1 ]; RenameObjectOutput$ = [ 3, n0, _ROO, 0, [], [] ]; RenameObjectRequest$ = [ 3, n0, _ROR, 0, [_B, _K, _RSen, _DIM, _DINM, _DIMS, _DIUS, _SIM, _SINM, _SIMS, _SIUS, _CTl], [[0, 1], [0, 1], [0, { [_hH]: _xars_ }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [4, { [_hH]: _IMS_ }], [4, { [_hH]: _IUS_ }], [0, { [_hH]: _xarsim }], [0, { [_hH]: _xarsinm }], [6, { [_hH]: _xarsims }], [6, { [_hH]: _xarsius }], [0, { [_hH]: _xact_, [_iT]: 1 }]], 3 ]; ReplicaModifications$ = [ 3, n0, _RM, 0, [_S], [0], 1 ]; ReplicationConfiguration$ = [ 3, n0, _RCe, 0, [_Ro, _R], [0, [() => ReplicationRules, { [_xF]: 1, [_xN]: _Ru }]], 2 ]; ReplicationRule$ = [ 3, n0, _RRe, 0, [_S, _Des, _ID, _Pri, _P, _F, _SSC, _EOR, _DMR], [0, () => Destination$, 0, 1, 0, [() => ReplicationRuleFilter$, 0], () => SourceSelectionCriteria$, () => ExistingObjectReplication$, () => DeleteMarkerReplication$], 2 ]; ReplicationRuleAndOperator$ = [ 3, n0, _RRAO, 0, [_P, _T], [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta }]] ]; ReplicationRuleFilter$ = [ 3, n0, _RRF, 0, [_P, _Ta, _An], [0, () => Tag$, [() => ReplicationRuleAndOperator$, 0]] ]; ReplicationTime$ = [ 3, n0, _RT, 0, [_S, _Tim], [0, () => ReplicationTimeValue$], 2 ]; ReplicationTimeValue$ = [ 3, n0, _RTV, 0, [_Mi], [1] ]; RequestPaymentConfiguration$ = [ 3, n0, _RPC, 0, [_Pay], [0], 1 ]; RequestProgress$ = [ 3, n0, _RPe, 0, [_Ena], [2] ]; RestoreObjectOutput$ = [ 3, n0, _ROOe, 0, [_RC, _ROP], [[0, { [_hH]: _xarc }], [0, { [_hH]: _xarop }]] ]; RestoreObjectRequest$ = [ 3, n0, _RORe, 0, [_B, _K, _VI, _RRes, _RP, _CA, _EBO], [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [() => RestoreRequest$, { [_hP]: 1, [_xN]: _RRes }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; RestoreRequest$ = [ 3, n0, _RRes, 0, [_D, _GJP, _Ty, _Ti, _Desc, _SP, _OL], [1, () => GlacierJobParameters$, 0, 0, 0, () => SelectParameters$, [() => OutputLocation$, 0]] ]; RestoreStatus$ = [ 3, n0, _RSe, 0, [_IRIP, _RED], [2, 4] ]; RoutingRule$ = [ 3, n0, _RRo, 0, [_Red, _Co], [() => Redirect$, () => Condition$], 1 ]; S3KeyFilter$ = [ 3, n0, _SKF, 0, [_FRi], [[() => FilterRuleList, { [_xF]: 1, [_xN]: _FR }]] ]; S3Location$ = [ 3, n0, _SL, 0, [_BNu, _P, _En, _CACL, _ACL, _Tag, _UM, _SC], [0, 0, [() => Encryption$, 0], 0, [() => Grants, 0], [() => Tagging$, 0], [() => UserMetadata, 0], 0], 2 ]; S3TablesDestination$ = [ 3, n0, _STD, 0, [_TBA, _TNa], [0, 0], 2 ]; S3TablesDestinationResult$ = [ 3, n0, _STDR, 0, [_TBA, _TNa, _TA, _TN], [0, 0, 0, 0], 4 ]; ScanRange$ = [ 3, n0, _SR, 0, [_St, _End], [1, 1] ]; SelectObjectContentOutput$ = [ 3, n0, _SOCO, 0, [_Payl], [[() => SelectObjectContentEventStream$, 16]] ]; SelectObjectContentRequest$ = [ 3, n0, _SOCR, 0, [_B, _K, _Exp, _ETx, _IS, _OSu, _SSECA, _SSECK, _SSECKMD, _RPe, _SR, _EBO], [[0, 1], [0, 1], 0, 0, () => InputSerialization$, () => OutputSerialization$, [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], () => RequestProgress$, () => ScanRange$, [0, { [_hH]: _xaebo }]], 6 ]; SelectParameters$ = [ 3, n0, _SP, 0, [_IS, _ETx, _Exp, _OSu], [() => InputSerialization$, 0, 0, () => OutputSerialization$], 4 ]; ServerSideEncryptionByDefault$ = [ 3, n0, _SSEBD, 0, [_SSEA, _KMSMKID], [0, [() => SSEKMSKeyId, 0]], 1 ]; ServerSideEncryptionConfiguration$ = [ 3, n0, _SSEC, 0, [_R], [[() => ServerSideEncryptionRules, { [_xF]: 1, [_xN]: _Ru }]], 1 ]; ServerSideEncryptionRule$ = [ 3, n0, _SSER, 0, [_ASSEBD, _BKE, _BET], [[() => ServerSideEncryptionByDefault$, 0], 2, [() => BlockedEncryptionTypes$, 0]] ]; SessionCredentials$ = [ 3, n0, _SCe, 0, [_AKI, _SAK, _ST, _E], [[0, { [_xN]: _AKI }], [() => SessionCredentialValue, { [_xN]: _SAK }], [() => SessionCredentialValue, { [_xN]: _ST }], [4, { [_xN]: _E }]], 4 ]; SimplePrefix$ = [ 3, n0, _SPi, { [_xN]: _SPi }, [], [] ]; SourceSelectionCriteria$ = [ 3, n0, _SSC, 0, [_SKEO, _RM], [() => SseKmsEncryptedObjects$, () => ReplicaModifications$] ]; SSEKMS$ = [ 3, n0, _SSEKMS, { [_xN]: _SK }, [_KI], [[() => SSEKMSKeyId, 0]], 1 ]; SseKmsEncryptedObjects$ = [ 3, n0, _SKEO, 0, [_S], [0], 1 ]; SSEKMSEncryption$ = [ 3, n0, _SSEKMSE, { [_xN]: _SK }, [_KMSKA, _BKE], [[() => NonEmptyKmsKeyArnString, 0], 2], 1 ]; SSES3$ = [ 3, n0, _SSES, { [_xN]: _SS }, [], [] ]; Stats$ = [ 3, n0, _Sta, 0, [_BS, _BP, _BRy], [1, 1, 1] ]; StatsEvent$ = [ 3, n0, _SE, 0, [_Det], [[() => Stats$, { [_eP]: 1 }]] ]; StorageClassAnalysis$ = [ 3, n0, _SCA, 0, [_DE], [() => StorageClassAnalysisDataExport$] ]; StorageClassAnalysisDataExport$ = [ 3, n0, _SCADE, 0, [_OSV, _Des], [0, () => AnalyticsExportDestination$], 2 ]; Tag$ = [ 3, n0, _Ta, 0, [_K, _V], [0, 0], 2 ]; Tagging$ = [ 3, n0, _Tag, 0, [_TS], [[() => TagSet, 0]], 1 ]; TargetGrant$ = [ 3, n0, _TGa, 0, [_Gra, _Pe], [[() => Grantee$, { [_xNm]: [_x, _hi] }], 0] ]; TargetObjectKeyFormat$ = [ 3, n0, _TOKF, 0, [_SPi, _PP], [[() => SimplePrefix$, { [_xN]: _SPi }], [() => PartitionedPrefix$, { [_xN]: _PP }]] ]; Tiering$ = [ 3, n0, _Tier, 0, [_D, _AT], [1, 0], 2 ]; TopicConfiguration$ = [ 3, n0, _TCop, 0, [_TAo, _Ev, _I, _F], [[0, { [_xN]: _Top }], [64 | 0, { [_xF]: 1, [_xN]: _Eve }], 0, [() => NotificationConfigurationFilter$, 0]], 2 ]; Transition$ = [ 3, n0, _Tra, 0, [_Da, _D, _SC], [5, 1, 0] ]; UpdateBucketMetadataInventoryTableConfigurationRequest$ = [ 3, n0, _UBMITCR, 0, [_B, _ITCn, _CMD, _CA, _EBO], [[0, 1], [() => InventoryTableConfigurationUpdates$, { [_hP]: 1, [_xN]: _ITCn }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; UpdateBucketMetadataJournalTableConfigurationRequest$ = [ 3, n0, _UBMJTCR, 0, [_B, _JTC, _CMD, _CA, _EBO], [[0, 1], [() => JournalTableConfigurationUpdates$, { [_hP]: 1, [_xN]: _JTC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], 2 ]; UpdateObjectEncryptionRequest$ = [ 3, n0, _UOER, 0, [_B, _K, _OE, _VI, _RP, _EBO, _CMD, _CA], [[0, 1], [0, 1], [() => ObjectEncryption$, 16], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }]], 3 ]; UpdateObjectEncryptionResponse$ = [ 3, n0, _UOERp, 0, [_RC], [[0, { [_hH]: _xarc }]] ]; UploadPartCopyOutput$ = [ 3, n0, _UPCO, 0, [_CSVI, _CPR, _SSE, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _RC], [[0, { [_hH]: _xacsvi }], [() => CopyPartResult$, 16], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] ]; UploadPartCopyRequest$ = [ 3, n0, _UPCR, 0, [_B, _CS, _K, _PN, _UI, _CSIM, _CSIMS, _CSINM, _CSIUS, _CSRo, _SSECA, _SSECK, _SSECKMD, _CSSSECA, _CSSSECK, _CSSSECKMD, _RP, _EBO, _ESBO], [[0, 1], [0, { [_hH]: _xacs__ }], [0, 1], [1, { [_hQ]: _pN }], [0, { [_hQ]: _uI }], [0, { [_hH]: _xacsim }], [4, { [_hH]: _xacsims }], [0, { [_hH]: _xacsinm }], [4, { [_hH]: _xacsius }], [0, { [_hH]: _xacsr }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xacssseca }], [() => CopySourceSSECustomerKey, { [_hH]: _xacssseck }], [0, { [_hH]: _xacssseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasebo }]], 5 ]; UploadPartOutput$ = [ 3, n0, _UPO, 0, [_SSE, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _RC], [[0, { [_hH]: _xasse }], [0, { [_hH]: _ETa }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] ]; UploadPartRequest$ = [ 3, n0, _UPR, 0, [_B, _K, _PN, _UI, _Bo, _CLo, _CMD, _CA, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _SSECA, _SSECK, _SSECKMD, _RP, _EBO], [[0, 1], [0, 1], [1, { [_hQ]: _pN }], [0, { [_hQ]: _uI }], [() => StreamingBlob, 16], [1, { [_hH]: _CL__ }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], 4 ]; VersioningConfiguration$ = [ 3, n0, _VC, 0, [_MFAD, _S], [[0, { [_xN]: _MDf }], 0] ]; WebsiteConfiguration$ = [ 3, n0, _WC, 0, [_EDr, _IDn, _RART, _RR], [() => ErrorDocument$, () => IndexDocument$, () => RedirectAllRequestsTo$, [() => RoutingRules, 0]] ]; WriteGetObjectResponseRequest$ = [ 3, n0, _WGORR, 0, [_RReq, _RTe, _Bo, _SCt, _ECr, _EM, _AR, _CC, _CDo, _CEo, _CL, _CLo, _CR, _CTo, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _DM, _ETa, _Ex, _E, _LM, _MM, _M, _OLM, _OLLHS, _OLRUD, _PC, _RS, _RC, _Re, _SSE, _SSECA, _SSEKMSKI, _SSECKMD, _SC, _TC, _VI, _BKE], [[0, { [_hL]: 1, [_hH]: _xarr }], [0, { [_hH]: _xart }], [() => StreamingBlob, 16], [1, { [_hH]: _xafs }], [0, { [_hH]: _xafec }], [0, { [_hH]: _xafem }], [0, { [_hH]: _xafhar }], [0, { [_hH]: _xafhCC }], [0, { [_hH]: _xafhCD }], [0, { [_hH]: _xafhCE }], [0, { [_hH]: _xafhCL }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _xafhCR }], [0, { [_hH]: _xafhCT }], [0, { [_hH]: _xafhxacc }], [0, { [_hH]: _xafhxacc_ }], [0, { [_hH]: _xafhxacc__ }], [0, { [_hH]: _xafhxacs }], [0, { [_hH]: _xafhxacs_ }], [2, { [_hH]: _xafhxadm }], [0, { [_hH]: _xafhE }], [4, { [_hH]: _xafhE_ }], [0, { [_hH]: _xafhxae }], [4, { [_hH]: _xafhLM }], [1, { [_hH]: _xafhxamm }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xafhxaolm }], [0, { [_hH]: _xafhxaollh }], [5, { [_hH]: _xafhxaolrud }], [1, { [_hH]: _xafhxampc }], [0, { [_hH]: _xafhxars }], [0, { [_hH]: _xafhxarc }], [0, { [_hH]: _xafhxar }], [0, { [_hH]: _xafhxasse }], [0, { [_hH]: _xafhxasseca }], [() => SSEKMSKeyId, { [_hH]: _xafhxasseakki }], [0, { [_hH]: _xafhxasseckM }], [0, { [_hH]: _xafhxasc }], [1, { [_hH]: _xafhxatc }], [0, { [_hH]: _xafhxavi }], [2, { [_hH]: _xafhxassebke }]], 2 ]; __Unit = "unit"; AllowedHeaders = 64 | 0; AllowedMethods = 64 | 0; AllowedOrigins = 64 | 0; AnalyticsConfigurationList = [ 1, n0, _ACLn, 0, [ () => AnalyticsConfiguration$, 0 ] ]; Buckets = [ 1, n0, _Bu, 0, [ () => Bucket$, { [_xN]: _B } ] ]; ChecksumAlgorithmList = 64 | 0; CommonPrefixList = [ 1, n0, _CPL, 0, () => CommonPrefix$ ]; CompletedPartList = [ 1, n0, _CPLo, 0, () => CompletedPart$ ]; CORSRules = [ 1, n0, _CORSR, 0, [ () => CORSRule$, 0 ] ]; DeletedObjects = [ 1, n0, _DOe, 0, () => DeletedObject$ ]; DeleteMarkers = [ 1, n0, _DMe, 0, () => DeleteMarkerEntry$ ]; EncryptionTypeList = [ 1, n0, _ETL, 0, [ 0, { [_xN]: _ET } ] ]; Errors = [ 1, n0, _Er, 0, () => _Error$ ]; EventList = 64 | 0; ExposeHeaders = 64 | 0; FilterRuleList = [ 1, n0, _FRL, 0, () => FilterRule$ ]; Grants = [ 1, n0, _G, 0, [ () => Grant$, { [_xN]: _Gr } ] ]; IntelligentTieringConfigurationList = [ 1, n0, _ITCL, 0, [ () => IntelligentTieringConfiguration$, 0 ] ]; InventoryConfigurationList = [ 1, n0, _ICL, 0, [ () => InventoryConfiguration$, 0 ] ]; InventoryOptionalFields = [ 1, n0, _IOF, 0, [ 0, { [_xN]: _Fi } ] ]; LambdaFunctionConfigurationList = [ 1, n0, _LFCL, 0, [ () => LambdaFunctionConfiguration$, 0 ] ]; LifecycleRules = [ 1, n0, _LRi, 0, [ () => LifecycleRule$, 0 ] ]; MetricsConfigurationList = [ 1, n0, _MCL, 0, [ () => MetricsConfiguration$, 0 ] ]; MultipartUploadList = [ 1, n0, _MUL, 0, () => MultipartUpload$ ]; NoncurrentVersionTransitionList = [ 1, n0, _NVTL, 0, () => NoncurrentVersionTransition$ ]; ObjectAttributesList = 64 | 0; ObjectIdentifierList = [ 1, n0, _OIL, 0, () => ObjectIdentifier$ ]; ObjectList = [ 1, n0, _OLb, 0, [ () => _Object$, 0 ] ]; ObjectVersionList = [ 1, n0, _OVL, 0, [ () => ObjectVersion$, 0 ] ]; OptionalObjectAttributesList = 64 | 0; OwnershipControlsRules = [ 1, n0, _OCRw, 0, () => OwnershipControlsRule$ ]; Parts = [ 1, n0, _Pa, 0, () => Part$ ]; PartsList = [ 1, n0, _PL, 0, () => ObjectPart$ ]; QueueConfigurationList = [ 1, n0, _QCL, 0, [ () => QueueConfiguration$, 0 ] ]; ReplicationRules = [ 1, n0, _RRep, 0, [ () => ReplicationRule$, 0 ] ]; RoutingRules = [ 1, n0, _RR, 0, [ () => RoutingRule$, { [_xN]: _RRo } ] ]; ServerSideEncryptionRules = [ 1, n0, _SSERe, 0, [ () => ServerSideEncryptionRule$, 0 ] ]; TagSet = [ 1, n0, _TS, 0, [ () => Tag$, { [_xN]: _Ta } ] ]; TargetGrants = [ 1, n0, _TG, 0, [ () => TargetGrant$, { [_xN]: _Gr } ] ]; TieringList = [ 1, n0, _TL, 0, () => Tiering$ ]; TopicConfigurationList = [ 1, n0, _TCL, 0, [ () => TopicConfiguration$, 0 ] ]; TransitionList = [ 1, n0, _TLr, 0, () => Transition$ ]; UserMetadata = [ 1, n0, _UM, 0, [ () => MetadataEntry$, { [_xN]: _ME } ] ]; Metadata = 128 | 0; AnalyticsFilter$ = [ 4, n0, _AF, 0, [_P, _Ta, _An], [0, () => Tag$, [() => AnalyticsAndOperator$, 0]] ]; MetricsFilter$ = [ 4, n0, _MF, 0, [_P, _Ta, _APAc, _An], [0, () => Tag$, 0, [() => MetricsAndOperator$, 0]] ]; ObjectEncryption$ = [ 4, n0, _OE, 0, [_SSEKMS], [[() => SSEKMSEncryption$, { [_xN]: _SK }]] ]; SelectObjectContentEventStream$ = [ 4, n0, _SOCES, { [_st]: 1 }, [_Rec, _Sta, _Pr, _Cont, _End], [[() => RecordsEvent$, 0], [() => StatsEvent$, 0], [() => ProgressEvent$, 0], () => ContinuationEvent$, () => EndEvent$] ]; AbortMultipartUpload$ = [ 9, n0, _AMU, { [_h]: ["DELETE", "/{Key+}?x-id=AbortMultipartUpload", 204] }, () => AbortMultipartUploadRequest$, () => AbortMultipartUploadOutput$ ]; CompleteMultipartUpload$ = [ 9, n0, _CMUo, { [_h]: ["POST", "/{Key+}", 200] }, () => CompleteMultipartUploadRequest$, () => CompleteMultipartUploadOutput$ ]; CopyObject$ = [ 9, n0, _CO, { [_h]: ["PUT", "/{Key+}?x-id=CopyObject", 200] }, () => CopyObjectRequest$, () => CopyObjectOutput$ ]; CreateBucket$ = [ 9, n0, _CB, { [_h]: ["PUT", "/", 200] }, () => CreateBucketRequest$, () => CreateBucketOutput$ ]; CreateBucketMetadataConfiguration$ = [ 9, n0, _CBMC, { [_hC]: "-", [_h]: ["POST", "/?metadataConfiguration", 200] }, () => CreateBucketMetadataConfigurationRequest$, () => __Unit ]; CreateBucketMetadataTableConfiguration$ = [ 9, n0, _CBMTC, { [_hC]: "-", [_h]: ["POST", "/?metadataTable", 200] }, () => CreateBucketMetadataTableConfigurationRequest$, () => __Unit ]; CreateMultipartUpload$ = [ 9, n0, _CMUr, { [_h]: ["POST", "/{Key+}?uploads", 200] }, () => CreateMultipartUploadRequest$, () => CreateMultipartUploadOutput$ ]; CreateSession$ = [ 9, n0, _CSr, { [_h]: ["GET", "/?session", 200] }, () => CreateSessionRequest$, () => CreateSessionOutput$ ]; DeleteBucket$ = [ 9, n0, _DB, { [_h]: ["DELETE", "/", 204] }, () => DeleteBucketRequest$, () => __Unit ]; DeleteBucketAnalyticsConfiguration$ = [ 9, n0, _DBAC, { [_h]: ["DELETE", "/?analytics", 204] }, () => DeleteBucketAnalyticsConfigurationRequest$, () => __Unit ]; DeleteBucketCors$ = [ 9, n0, _DBC, { [_h]: ["DELETE", "/?cors", 204] }, () => DeleteBucketCorsRequest$, () => __Unit ]; DeleteBucketEncryption$ = [ 9, n0, _DBE, { [_h]: ["DELETE", "/?encryption", 204] }, () => DeleteBucketEncryptionRequest$, () => __Unit ]; DeleteBucketIntelligentTieringConfiguration$ = [ 9, n0, _DBITC, { [_h]: ["DELETE", "/?intelligent-tiering", 204] }, () => DeleteBucketIntelligentTieringConfigurationRequest$, () => __Unit ]; DeleteBucketInventoryConfiguration$ = [ 9, n0, _DBIC, { [_h]: ["DELETE", "/?inventory", 204] }, () => DeleteBucketInventoryConfigurationRequest$, () => __Unit ]; DeleteBucketLifecycle$ = [ 9, n0, _DBL, { [_h]: ["DELETE", "/?lifecycle", 204] }, () => DeleteBucketLifecycleRequest$, () => __Unit ]; DeleteBucketMetadataConfiguration$ = [ 9, n0, _DBMC, { [_h]: ["DELETE", "/?metadataConfiguration", 204] }, () => DeleteBucketMetadataConfigurationRequest$, () => __Unit ]; DeleteBucketMetadataTableConfiguration$ = [ 9, n0, _DBMTC, { [_h]: ["DELETE", "/?metadataTable", 204] }, () => DeleteBucketMetadataTableConfigurationRequest$, () => __Unit ]; DeleteBucketMetricsConfiguration$ = [ 9, n0, _DBMCe, { [_h]: ["DELETE", "/?metrics", 204] }, () => DeleteBucketMetricsConfigurationRequest$, () => __Unit ]; DeleteBucketOwnershipControls$ = [ 9, n0, _DBOC, { [_h]: ["DELETE", "/?ownershipControls", 204] }, () => DeleteBucketOwnershipControlsRequest$, () => __Unit ]; DeleteBucketPolicy$ = [ 9, n0, _DBP, { [_h]: ["DELETE", "/?policy", 204] }, () => DeleteBucketPolicyRequest$, () => __Unit ]; DeleteBucketReplication$ = [ 9, n0, _DBRe, { [_h]: ["DELETE", "/?replication", 204] }, () => DeleteBucketReplicationRequest$, () => __Unit ]; DeleteBucketTagging$ = [ 9, n0, _DBT, { [_h]: ["DELETE", "/?tagging", 204] }, () => DeleteBucketTaggingRequest$, () => __Unit ]; DeleteBucketWebsite$ = [ 9, n0, _DBW, { [_h]: ["DELETE", "/?website", 204] }, () => DeleteBucketWebsiteRequest$, () => __Unit ]; DeleteObject$ = [ 9, n0, _DOel, { [_h]: ["DELETE", "/{Key+}?x-id=DeleteObject", 204] }, () => DeleteObjectRequest$, () => DeleteObjectOutput$ ]; DeleteObjects$ = [ 9, n0, _DOele, { [_hC]: "-", [_h]: ["POST", "/?delete", 200] }, () => DeleteObjectsRequest$, () => DeleteObjectsOutput$ ]; DeleteObjectTagging$ = [ 9, n0, _DOT, { [_h]: ["DELETE", "/{Key+}?tagging", 204] }, () => DeleteObjectTaggingRequest$, () => DeleteObjectTaggingOutput$ ]; DeletePublicAccessBlock$ = [ 9, n0, _DPAB, { [_h]: ["DELETE", "/?publicAccessBlock", 204] }, () => DeletePublicAccessBlockRequest$, () => __Unit ]; GetBucketAbac$ = [ 9, n0, _GBA, { [_h]: ["GET", "/?abac", 200] }, () => GetBucketAbacRequest$, () => GetBucketAbacOutput$ ]; GetBucketAccelerateConfiguration$ = [ 9, n0, _GBAC, { [_h]: ["GET", "/?accelerate", 200] }, () => GetBucketAccelerateConfigurationRequest$, () => GetBucketAccelerateConfigurationOutput$ ]; GetBucketAcl$ = [ 9, n0, _GBAe, { [_h]: ["GET", "/?acl", 200] }, () => GetBucketAclRequest$, () => GetBucketAclOutput$ ]; GetBucketAnalyticsConfiguration$ = [ 9, n0, _GBACe, { [_h]: ["GET", "/?analytics&x-id=GetBucketAnalyticsConfiguration", 200] }, () => GetBucketAnalyticsConfigurationRequest$, () => GetBucketAnalyticsConfigurationOutput$ ]; GetBucketCors$ = [ 9, n0, _GBC, { [_h]: ["GET", "/?cors", 200] }, () => GetBucketCorsRequest$, () => GetBucketCorsOutput$ ]; GetBucketEncryption$ = [ 9, n0, _GBE, { [_h]: ["GET", "/?encryption", 200] }, () => GetBucketEncryptionRequest$, () => GetBucketEncryptionOutput$ ]; GetBucketIntelligentTieringConfiguration$ = [ 9, n0, _GBITC, { [_h]: ["GET", "/?intelligent-tiering&x-id=GetBucketIntelligentTieringConfiguration", 200] }, () => GetBucketIntelligentTieringConfigurationRequest$, () => GetBucketIntelligentTieringConfigurationOutput$ ]; GetBucketInventoryConfiguration$ = [ 9, n0, _GBIC, { [_h]: ["GET", "/?inventory&x-id=GetBucketInventoryConfiguration", 200] }, () => GetBucketInventoryConfigurationRequest$, () => GetBucketInventoryConfigurationOutput$ ]; GetBucketLifecycleConfiguration$ = [ 9, n0, _GBLC, { [_h]: ["GET", "/?lifecycle", 200] }, () => GetBucketLifecycleConfigurationRequest$, () => GetBucketLifecycleConfigurationOutput$ ]; GetBucketLocation$ = [ 9, n0, _GBL, { [_h]: ["GET", "/?location", 200] }, () => GetBucketLocationRequest$, () => GetBucketLocationOutput$ ]; GetBucketLogging$ = [ 9, n0, _GBLe, { [_h]: ["GET", "/?logging", 200] }, () => GetBucketLoggingRequest$, () => GetBucketLoggingOutput$ ]; GetBucketMetadataConfiguration$ = [ 9, n0, _GBMC, { [_h]: ["GET", "/?metadataConfiguration", 200] }, () => GetBucketMetadataConfigurationRequest$, () => GetBucketMetadataConfigurationOutput$ ]; GetBucketMetadataTableConfiguration$ = [ 9, n0, _GBMTC, { [_h]: ["GET", "/?metadataTable", 200] }, () => GetBucketMetadataTableConfigurationRequest$, () => GetBucketMetadataTableConfigurationOutput$ ]; GetBucketMetricsConfiguration$ = [ 9, n0, _GBMCe, { [_h]: ["GET", "/?metrics&x-id=GetBucketMetricsConfiguration", 200] }, () => GetBucketMetricsConfigurationRequest$, () => GetBucketMetricsConfigurationOutput$ ]; GetBucketNotificationConfiguration$ = [ 9, n0, _GBNC, { [_h]: ["GET", "/?notification", 200] }, () => GetBucketNotificationConfigurationRequest$, () => NotificationConfiguration$ ]; GetBucketOwnershipControls$ = [ 9, n0, _GBOC, { [_h]: ["GET", "/?ownershipControls", 200] }, () => GetBucketOwnershipControlsRequest$, () => GetBucketOwnershipControlsOutput$ ]; GetBucketPolicy$ = [ 9, n0, _GBP, { [_h]: ["GET", "/?policy", 200] }, () => GetBucketPolicyRequest$, () => GetBucketPolicyOutput$ ]; GetBucketPolicyStatus$ = [ 9, n0, _GBPS, { [_h]: ["GET", "/?policyStatus", 200] }, () => GetBucketPolicyStatusRequest$, () => GetBucketPolicyStatusOutput$ ]; GetBucketReplication$ = [ 9, n0, _GBR, { [_h]: ["GET", "/?replication", 200] }, () => GetBucketReplicationRequest$, () => GetBucketReplicationOutput$ ]; GetBucketRequestPayment$ = [ 9, n0, _GBRP, { [_h]: ["GET", "/?requestPayment", 200] }, () => GetBucketRequestPaymentRequest$, () => GetBucketRequestPaymentOutput$ ]; GetBucketTagging$ = [ 9, n0, _GBT, { [_h]: ["GET", "/?tagging", 200] }, () => GetBucketTaggingRequest$, () => GetBucketTaggingOutput$ ]; GetBucketVersioning$ = [ 9, n0, _GBV, { [_h]: ["GET", "/?versioning", 200] }, () => GetBucketVersioningRequest$, () => GetBucketVersioningOutput$ ]; GetBucketWebsite$ = [ 9, n0, _GBW, { [_h]: ["GET", "/?website", 200] }, () => GetBucketWebsiteRequest$, () => GetBucketWebsiteOutput$ ]; GetObject$ = [ 9, n0, _GO, { [_hC]: "-", [_h]: ["GET", "/{Key+}?x-id=GetObject", 200] }, () => GetObjectRequest$, () => GetObjectOutput$ ]; GetObjectAcl$ = [ 9, n0, _GOA, { [_h]: ["GET", "/{Key+}?acl", 200] }, () => GetObjectAclRequest$, () => GetObjectAclOutput$ ]; GetObjectAttributes$ = [ 9, n0, _GOAe, { [_h]: ["GET", "/{Key+}?attributes", 200] }, () => GetObjectAttributesRequest$, () => GetObjectAttributesOutput$ ]; GetObjectLegalHold$ = [ 9, n0, _GOLH, { [_h]: ["GET", "/{Key+}?legal-hold", 200] }, () => GetObjectLegalHoldRequest$, () => GetObjectLegalHoldOutput$ ]; GetObjectLockConfiguration$ = [ 9, n0, _GOLC, { [_h]: ["GET", "/?object-lock", 200] }, () => GetObjectLockConfigurationRequest$, () => GetObjectLockConfigurationOutput$ ]; GetObjectRetention$ = [ 9, n0, _GORe, { [_h]: ["GET", "/{Key+}?retention", 200] }, () => GetObjectRetentionRequest$, () => GetObjectRetentionOutput$ ]; GetObjectTagging$ = [ 9, n0, _GOT, { [_h]: ["GET", "/{Key+}?tagging", 200] }, () => GetObjectTaggingRequest$, () => GetObjectTaggingOutput$ ]; GetObjectTorrent$ = [ 9, n0, _GOTe, { [_h]: ["GET", "/{Key+}?torrent", 200] }, () => GetObjectTorrentRequest$, () => GetObjectTorrentOutput$ ]; GetPublicAccessBlock$ = [ 9, n0, _GPAB, { [_h]: ["GET", "/?publicAccessBlock", 200] }, () => GetPublicAccessBlockRequest$, () => GetPublicAccessBlockOutput$ ]; HeadBucket$ = [ 9, n0, _HB, { [_h]: ["HEAD", "/", 200] }, () => HeadBucketRequest$, () => HeadBucketOutput$ ]; HeadObject$ = [ 9, n0, _HO, { [_h]: ["HEAD", "/{Key+}", 200] }, () => HeadObjectRequest$, () => HeadObjectOutput$ ]; ListBucketAnalyticsConfigurations$ = [ 9, n0, _LBAC, { [_h]: ["GET", "/?analytics&x-id=ListBucketAnalyticsConfigurations", 200] }, () => ListBucketAnalyticsConfigurationsRequest$, () => ListBucketAnalyticsConfigurationsOutput$ ]; ListBucketIntelligentTieringConfigurations$ = [ 9, n0, _LBITC, { [_h]: ["GET", "/?intelligent-tiering&x-id=ListBucketIntelligentTieringConfigurations", 200] }, () => ListBucketIntelligentTieringConfigurationsRequest$, () => ListBucketIntelligentTieringConfigurationsOutput$ ]; ListBucketInventoryConfigurations$ = [ 9, n0, _LBIC, { [_h]: ["GET", "/?inventory&x-id=ListBucketInventoryConfigurations", 200] }, () => ListBucketInventoryConfigurationsRequest$, () => ListBucketInventoryConfigurationsOutput$ ]; ListBucketMetricsConfigurations$ = [ 9, n0, _LBMC, { [_h]: ["GET", "/?metrics&x-id=ListBucketMetricsConfigurations", 200] }, () => ListBucketMetricsConfigurationsRequest$, () => ListBucketMetricsConfigurationsOutput$ ]; ListBuckets$ = [ 9, n0, _LB, { [_h]: ["GET", "/?x-id=ListBuckets", 200] }, () => ListBucketsRequest$, () => ListBucketsOutput$ ]; ListDirectoryBuckets$ = [ 9, n0, _LDB, { [_h]: ["GET", "/?x-id=ListDirectoryBuckets", 200] }, () => ListDirectoryBucketsRequest$, () => ListDirectoryBucketsOutput$ ]; ListMultipartUploads$ = [ 9, n0, _LMU, { [_h]: ["GET", "/?uploads", 200] }, () => ListMultipartUploadsRequest$, () => ListMultipartUploadsOutput$ ]; ListObjects$ = [ 9, n0, _LO, { [_h]: ["GET", "/", 200] }, () => ListObjectsRequest$, () => ListObjectsOutput$ ]; ListObjectsV2$ = [ 9, n0, _LOV, { [_h]: ["GET", "/?list-type=2", 200] }, () => ListObjectsV2Request$, () => ListObjectsV2Output$ ]; ListObjectVersions$ = [ 9, n0, _LOVi, { [_h]: ["GET", "/?versions", 200] }, () => ListObjectVersionsRequest$, () => ListObjectVersionsOutput$ ]; ListParts$ = [ 9, n0, _LP, { [_h]: ["GET", "/{Key+}?x-id=ListParts", 200] }, () => ListPartsRequest$, () => ListPartsOutput$ ]; PutBucketAbac$ = [ 9, n0, _PBA, { [_hC]: "-", [_h]: ["PUT", "/?abac", 200] }, () => PutBucketAbacRequest$, () => __Unit ]; PutBucketAccelerateConfiguration$ = [ 9, n0, _PBAC, { [_hC]: "-", [_h]: ["PUT", "/?accelerate", 200] }, () => PutBucketAccelerateConfigurationRequest$, () => __Unit ]; PutBucketAcl$ = [ 9, n0, _PBAu, { [_hC]: "-", [_h]: ["PUT", "/?acl", 200] }, () => PutBucketAclRequest$, () => __Unit ]; PutBucketAnalyticsConfiguration$ = [ 9, n0, _PBACu, { [_h]: ["PUT", "/?analytics", 200] }, () => PutBucketAnalyticsConfigurationRequest$, () => __Unit ]; PutBucketCors$ = [ 9, n0, _PBC, { [_hC]: "-", [_h]: ["PUT", "/?cors", 200] }, () => PutBucketCorsRequest$, () => __Unit ]; PutBucketEncryption$ = [ 9, n0, _PBE, { [_hC]: "-", [_h]: ["PUT", "/?encryption", 200] }, () => PutBucketEncryptionRequest$, () => __Unit ]; PutBucketIntelligentTieringConfiguration$ = [ 9, n0, _PBITC, { [_h]: ["PUT", "/?intelligent-tiering", 200] }, () => PutBucketIntelligentTieringConfigurationRequest$, () => __Unit ]; PutBucketInventoryConfiguration$ = [ 9, n0, _PBIC, { [_h]: ["PUT", "/?inventory", 200] }, () => PutBucketInventoryConfigurationRequest$, () => __Unit ]; PutBucketLifecycleConfiguration$ = [ 9, n0, _PBLC, { [_hC]: "-", [_h]: ["PUT", "/?lifecycle", 200] }, () => PutBucketLifecycleConfigurationRequest$, () => PutBucketLifecycleConfigurationOutput$ ]; PutBucketLogging$ = [ 9, n0, _PBL, { [_hC]: "-", [_h]: ["PUT", "/?logging", 200] }, () => PutBucketLoggingRequest$, () => __Unit ]; PutBucketMetricsConfiguration$ = [ 9, n0, _PBMC, { [_h]: ["PUT", "/?metrics", 200] }, () => PutBucketMetricsConfigurationRequest$, () => __Unit ]; PutBucketNotificationConfiguration$ = [ 9, n0, _PBNC, { [_h]: ["PUT", "/?notification", 200] }, () => PutBucketNotificationConfigurationRequest$, () => __Unit ]; PutBucketOwnershipControls$ = [ 9, n0, _PBOC, { [_hC]: "-", [_h]: ["PUT", "/?ownershipControls", 200] }, () => PutBucketOwnershipControlsRequest$, () => __Unit ]; PutBucketPolicy$ = [ 9, n0, _PBP, { [_hC]: "-", [_h]: ["PUT", "/?policy", 200] }, () => PutBucketPolicyRequest$, () => __Unit ]; PutBucketReplication$ = [ 9, n0, _PBR, { [_hC]: "-", [_h]: ["PUT", "/?replication", 200] }, () => PutBucketReplicationRequest$, () => __Unit ]; PutBucketRequestPayment$ = [ 9, n0, _PBRP, { [_hC]: "-", [_h]: ["PUT", "/?requestPayment", 200] }, () => PutBucketRequestPaymentRequest$, () => __Unit ]; PutBucketTagging$ = [ 9, n0, _PBT, { [_hC]: "-", [_h]: ["PUT", "/?tagging", 200] }, () => PutBucketTaggingRequest$, () => __Unit ]; PutBucketVersioning$ = [ 9, n0, _PBV, { [_hC]: "-", [_h]: ["PUT", "/?versioning", 200] }, () => PutBucketVersioningRequest$, () => __Unit ]; PutBucketWebsite$ = [ 9, n0, _PBW, { [_hC]: "-", [_h]: ["PUT", "/?website", 200] }, () => PutBucketWebsiteRequest$, () => __Unit ]; PutObject$ = [ 9, n0, _PO, { [_hC]: "-", [_h]: ["PUT", "/{Key+}?x-id=PutObject", 200] }, () => PutObjectRequest$, () => PutObjectOutput$ ]; PutObjectAcl$ = [ 9, n0, _POA, { [_hC]: "-", [_h]: ["PUT", "/{Key+}?acl", 200] }, () => PutObjectAclRequest$, () => PutObjectAclOutput$ ]; PutObjectLegalHold$ = [ 9, n0, _POLH, { [_hC]: "-", [_h]: ["PUT", "/{Key+}?legal-hold", 200] }, () => PutObjectLegalHoldRequest$, () => PutObjectLegalHoldOutput$ ]; PutObjectLockConfiguration$ = [ 9, n0, _POLC, { [_hC]: "-", [_h]: ["PUT", "/?object-lock", 200] }, () => PutObjectLockConfigurationRequest$, () => PutObjectLockConfigurationOutput$ ]; PutObjectRetention$ = [ 9, n0, _PORu, { [_hC]: "-", [_h]: ["PUT", "/{Key+}?retention", 200] }, () => PutObjectRetentionRequest$, () => PutObjectRetentionOutput$ ]; PutObjectTagging$ = [ 9, n0, _POT, { [_hC]: "-", [_h]: ["PUT", "/{Key+}?tagging", 200] }, () => PutObjectTaggingRequest$, () => PutObjectTaggingOutput$ ]; PutPublicAccessBlock$ = [ 9, n0, _PPAB, { [_hC]: "-", [_h]: ["PUT", "/?publicAccessBlock", 200] }, () => PutPublicAccessBlockRequest$, () => __Unit ]; RenameObject$ = [ 9, n0, _RO, { [_h]: ["PUT", "/{Key+}?renameObject", 200] }, () => RenameObjectRequest$, () => RenameObjectOutput$ ]; RestoreObject$ = [ 9, n0, _ROe, { [_hC]: "-", [_h]: ["POST", "/{Key+}?restore", 200] }, () => RestoreObjectRequest$, () => RestoreObjectOutput$ ]; SelectObjectContent$ = [ 9, n0, _SOC, { [_h]: ["POST", "/{Key+}?select&select-type=2", 200] }, () => SelectObjectContentRequest$, () => SelectObjectContentOutput$ ]; UpdateBucketMetadataInventoryTableConfiguration$ = [ 9, n0, _UBMITC, { [_hC]: "-", [_h]: ["PUT", "/?metadataInventoryTable", 200] }, () => UpdateBucketMetadataInventoryTableConfigurationRequest$, () => __Unit ]; UpdateBucketMetadataJournalTableConfiguration$ = [ 9, n0, _UBMJTC, { [_hC]: "-", [_h]: ["PUT", "/?metadataJournalTable", 200] }, () => UpdateBucketMetadataJournalTableConfigurationRequest$, () => __Unit ]; UpdateObjectEncryption$ = [ 9, n0, _UOE, { [_hC]: "-", [_h]: ["PUT", "/{Key+}?encryption", 200] }, () => UpdateObjectEncryptionRequest$, () => UpdateObjectEncryptionResponse$ ]; UploadPart$ = [ 9, n0, _UP, { [_hC]: "-", [_h]: ["PUT", "/{Key+}?x-id=UploadPart", 200] }, () => UploadPartRequest$, () => UploadPartOutput$ ]; UploadPartCopy$ = [ 9, n0, _UPC, { [_h]: ["PUT", "/{Key+}?x-id=UploadPartCopy", 200] }, () => UploadPartCopyRequest$, () => UploadPartCopyOutput$ ]; WriteGetObjectResponse$ = [ 9, n0, _WGOR, { [_en]: ["{RequestRoute}."], [_h]: ["POST", "/WriteGetObjectResponse", 200] }, () => WriteGetObjectResponseRequest$, () => __Unit ]; } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateSessionCommand.js var CreateSessionCommand; var init_CreateSessionCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateSessionCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); CreateSessionCommand = class extends Command.classBuilder().ep({ ...commonParams, DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "CreateSession", {}).n("S3Client", "CreateSessionCommand").sc(CreateSession$).build() { }; __name(CreateSessionCommand, "CreateSessionCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/package.json var package_default; var init_package = __esm({ "../../node_modules/@aws-sdk/client-s3/package.json"() { package_default = { name: "@aws-sdk/client-s3", description: "AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native", version: "3.1009.0", scripts: { build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", "build:cjs": "node ../../scripts/compilation/inline client-s3", "build:es": "tsc -p tsconfig.es.json", "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"', "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo s3", test: "yarn g:vitest run", "test:browser": "node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.mts", "test:browser:watch": "node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.mts", "test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts && yarn test:browser", "test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.mts", "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs", "test:integration": "yarn g:vitest run -c vitest.config.integ.mts", "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts", "test:watch": "yarn g:vitest watch" }, main: "./dist-cjs/index.js", types: "./dist-types/index.d.ts", module: "./dist-es/index.js", sideEffects: false, dependencies: { "@aws-crypto/sha1-browser": "5.2.0", "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "^3.973.20", "@aws-sdk/credential-provider-node": "^3.972.21", "@aws-sdk/middleware-bucket-endpoint": "^3.972.8", "@aws-sdk/middleware-expect-continue": "^3.972.8", "@aws-sdk/middleware-flexible-checksums": "^3.973.6", "@aws-sdk/middleware-host-header": "^3.972.8", "@aws-sdk/middleware-location-constraint": "^3.972.8", "@aws-sdk/middleware-logger": "^3.972.8", "@aws-sdk/middleware-recursion-detection": "^3.972.8", "@aws-sdk/middleware-sdk-s3": "^3.972.20", "@aws-sdk/middleware-ssec": "^3.972.8", "@aws-sdk/middleware-user-agent": "^3.972.21", "@aws-sdk/region-config-resolver": "^3.972.8", "@aws-sdk/signature-v4-multi-region": "^3.996.8", "@aws-sdk/types": "^3.973.6", "@aws-sdk/util-endpoints": "^3.996.5", "@aws-sdk/util-user-agent-browser": "^3.972.8", "@aws-sdk/util-user-agent-node": "^3.973.7", "@smithy/config-resolver": "^4.4.11", "@smithy/core": "^3.23.11", "@smithy/eventstream-serde-browser": "^4.2.12", "@smithy/eventstream-serde-config-resolver": "^4.3.12", "@smithy/eventstream-serde-node": "^4.2.12", "@smithy/fetch-http-handler": "^5.3.15", "@smithy/hash-blob-browser": "^4.2.13", "@smithy/hash-node": "^4.2.12", "@smithy/hash-stream-node": "^4.2.12", "@smithy/invalid-dependency": "^4.2.12", "@smithy/md5-js": "^4.2.12", "@smithy/middleware-content-length": "^4.2.12", "@smithy/middleware-endpoint": "^4.4.25", "@smithy/middleware-retry": "^4.4.42", "@smithy/middleware-serde": "^4.2.14", "@smithy/middleware-stack": "^4.2.12", "@smithy/node-config-provider": "^4.3.12", "@smithy/node-http-handler": "^4.4.16", "@smithy/protocol-http": "^5.3.12", "@smithy/smithy-client": "^4.12.5", "@smithy/types": "^4.13.1", "@smithy/url-parser": "^4.2.12", "@smithy/util-base64": "^4.3.2", "@smithy/util-body-length-browser": "^4.2.2", "@smithy/util-body-length-node": "^4.2.3", "@smithy/util-defaults-mode-browser": "^4.3.41", "@smithy/util-defaults-mode-node": "^4.2.44", "@smithy/util-endpoints": "^3.3.3", "@smithy/util-middleware": "^4.2.12", "@smithy/util-retry": "^4.2.12", "@smithy/util-stream": "^4.5.19", "@smithy/util-utf8": "^4.2.2", "@smithy/util-waiter": "^4.2.13", tslib: "^2.6.2" }, devDependencies: { "@aws-sdk/signature-v4-crt": "3.1009.0", "@smithy/snapshot-testing": "^2.0.2", "@tsconfig/node20": "20.1.8", "@types/node": "^20.14.8", concurrently: "7.0.0", "downlevel-dts": "0.10.1", premove: "4.0.0", typescript: "~5.8.3", vitest: "^4.0.17" }, engines: { node: ">=20.0.0" }, typesVersions: { "<4.5": { "dist-types/*": [ "dist-types/ts3.4/*" ] } }, files: [ "dist-*/**" ], author: { name: "AWS SDK for JavaScript Team", url: "https://aws.amazon.com/javascript/" }, license: "Apache-2.0", browser: { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" }, "react-native": { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" }, homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3", repository: { type: "git", url: "https://github.com/aws/aws-sdk-js-v3.git", directory: "clients/client-s3" } }; } }); // ../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js var fromUtf84; var init_fromUtf8_browser3 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); fromUtf84 = /* @__PURE__ */ __name((input) => new TextEncoder().encode(input), "fromUtf8"); } }); // ../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js var init_toUint8Array3 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fromUtf8_browser3(); } }); // ../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js var init_toUtf8_browser3 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/index.js var init_dist_es44 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_fromUtf8_browser3(); init_toUint8Array3(); init_toUtf8_browser3(); } }); // ../../node_modules/@aws-crypto/sha1-browser/build/module/isEmptyData.js function isEmptyData2(data) { if (typeof data === "string") { return data.length === 0; } return data.byteLength === 0; } var init_isEmptyData2 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/build/module/isEmptyData.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(isEmptyData2, "isEmptyData"); } }); // ../../node_modules/@aws-crypto/sha1-browser/build/module/constants.js var SHA_1_HASH, SHA_1_HMAC_ALGO, EMPTY_DATA_SHA_1; var init_constants10 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/build/module/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SHA_1_HASH = { name: "SHA-1" }; SHA_1_HMAC_ALGO = { name: "HMAC", hash: SHA_1_HASH }; EMPTY_DATA_SHA_1 = new Uint8Array([ 218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9 ]); } }); // ../../node_modules/@aws-sdk/util-locate-window/dist-es/index.js function locateWindow() { if (typeof window !== "undefined") { return window; } else if (typeof self !== "undefined") { return self; } return fallbackWindow; } var fallbackWindow; var init_dist_es45 = __esm({ "../../node_modules/@aws-sdk/util-locate-window/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); fallbackWindow = {}; __name(locateWindow, "locateWindow"); } }); // ../../node_modules/@aws-crypto/sha1-browser/build/module/webCryptoSha1.js function convertToBuffer2(data) { if (typeof data === "string") { return fromUtf84(data); } if (ArrayBuffer.isView(data)) { return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } return new Uint8Array(data); } var Sha1; var init_webCryptoSha1 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/build/module/webCryptoSha1.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es44(); init_isEmptyData2(); init_constants10(); init_dist_es45(); Sha1 = /** @class */ function() { function Sha13(secret) { this.toHash = new Uint8Array(0); if (secret !== void 0) { this.key = new Promise(function(resolve, reject) { locateWindow().crypto.subtle.importKey("raw", convertToBuffer2(secret), SHA_1_HMAC_ALGO, false, ["sign"]).then(resolve, reject); }); this.key.catch(function() { }); } } __name(Sha13, "Sha1"); Sha13.prototype.update = function(data) { if (isEmptyData2(data)) { return; } var update = convertToBuffer2(data); var typedArray = new Uint8Array(this.toHash.byteLength + update.byteLength); typedArray.set(this.toHash, 0); typedArray.set(update, this.toHash.byteLength); this.toHash = typedArray; }; Sha13.prototype.digest = function() { var _this = this; if (this.key) { return this.key.then(function(key) { return locateWindow().crypto.subtle.sign(SHA_1_HMAC_ALGO, key, _this.toHash).then(function(data) { return new Uint8Array(data); }); }); } if (isEmptyData2(this.toHash)) { return Promise.resolve(EMPTY_DATA_SHA_1); } return Promise.resolve().then(function() { return locateWindow().crypto.subtle.digest(SHA_1_HASH, _this.toHash); }).then(function(data) { return Promise.resolve(new Uint8Array(data)); }); }; Sha13.prototype.reset = function() { this.toHash = new Uint8Array(0); }; return Sha13; }(); __name(convertToBuffer2, "convertToBuffer"); } }); // ../../node_modules/@aws-crypto/supports-web-crypto/build/module/supportsWebCrypto.js function supportsWebCrypto(window2) { if (supportsSecureRandom(window2) && typeof window2.crypto.subtle === "object") { var subtle3 = window2.crypto.subtle; return supportsSubtleCrypto(subtle3); } return false; } function supportsSecureRandom(window2) { if (typeof window2 === "object" && typeof window2.crypto === "object") { var getRandomValues2 = window2.crypto.getRandomValues; return typeof getRandomValues2 === "function"; } return false; } function supportsSubtleCrypto(subtle3) { return subtle3 && subtleCryptoMethods.every(function(methodName) { return typeof subtle3[methodName] === "function"; }); } var subtleCryptoMethods; var init_supportsWebCrypto = __esm({ "../../node_modules/@aws-crypto/supports-web-crypto/build/module/supportsWebCrypto.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); subtleCryptoMethods = [ "decrypt", "digest", "encrypt", "exportKey", "generateKey", "importKey", "sign", "verify" ]; __name(supportsWebCrypto, "supportsWebCrypto"); __name(supportsSecureRandom, "supportsSecureRandom"); __name(supportsSubtleCrypto, "supportsSubtleCrypto"); } }); // ../../node_modules/@aws-crypto/supports-web-crypto/build/module/index.js var init_module4 = __esm({ "../../node_modules/@aws-crypto/supports-web-crypto/build/module/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_supportsWebCrypto(); } }); // ../../node_modules/@aws-crypto/sha1-browser/build/module/crossPlatformSha1.js var Sha12; var init_crossPlatformSha1 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/build/module/crossPlatformSha1.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_webCryptoSha1(); init_module4(); init_dist_es45(); init_module(); Sha12 = /** @class */ function() { function Sha13(secret) { if (supportsWebCrypto(locateWindow())) { this.hash = new Sha1(secret); } else { throw new Error("SHA1 not supported"); } } __name(Sha13, "Sha1"); Sha13.prototype.update = function(data, encoding) { this.hash.update(convertToBuffer(data)); }; Sha13.prototype.digest = function() { return this.hash.digest(); }; Sha13.prototype.reset = function() { this.hash.reset(); }; return Sha13; }(); } }); // ../../node_modules/@aws-crypto/sha1-browser/build/module/index.js var init_module5 = __esm({ "../../node_modules/@aws-crypto/sha1-browser/build/module/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_crossPlatformSha1(); init_webCryptoSha1(); } }); // ../../node_modules/@aws-crypto/sha256-browser/build/module/constants.js var SHA_256_HASH, SHA_256_HMAC_ALGO, EMPTY_DATA_SHA_256; var init_constants11 = __esm({ "../../node_modules/@aws-crypto/sha256-browser/build/module/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SHA_256_HASH = { name: "SHA-256" }; SHA_256_HMAC_ALGO = { name: "HMAC", hash: SHA_256_HASH }; EMPTY_DATA_SHA_256 = new Uint8Array([ 227, 176, 196, 66, 152, 252, 28, 20, 154, 251, 244, 200, 153, 111, 185, 36, 39, 174, 65, 228, 100, 155, 147, 76, 164, 149, 153, 27, 120, 82, 184, 85 ]); } }); // ../../node_modules/@aws-crypto/sha256-browser/build/module/webCryptoSha256.js var Sha256; var init_webCryptoSha256 = __esm({ "../../node_modules/@aws-crypto/sha256-browser/build/module/webCryptoSha256.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_module(); init_constants11(); init_dist_es45(); Sha256 = /** @class */ function() { function Sha2564(secret) { this.toHash = new Uint8Array(0); this.secret = secret; this.reset(); } __name(Sha2564, "Sha256"); Sha2564.prototype.update = function(data) { if (isEmptyData(data)) { return; } var update = convertToBuffer(data); var typedArray = new Uint8Array(this.toHash.byteLength + update.byteLength); typedArray.set(this.toHash, 0); typedArray.set(update, this.toHash.byteLength); this.toHash = typedArray; }; Sha2564.prototype.digest = function() { var _this = this; if (this.key) { return this.key.then(function(key) { return locateWindow().crypto.subtle.sign(SHA_256_HMAC_ALGO, key, _this.toHash).then(function(data) { return new Uint8Array(data); }); }); } if (isEmptyData(this.toHash)) { return Promise.resolve(EMPTY_DATA_SHA_256); } return Promise.resolve().then(function() { return locateWindow().crypto.subtle.digest(SHA_256_HASH, _this.toHash); }).then(function(data) { return Promise.resolve(new Uint8Array(data)); }); }; Sha2564.prototype.reset = function() { var _this = this; this.toHash = new Uint8Array(0); if (this.secret && this.secret !== void 0) { this.key = new Promise(function(resolve, reject) { locateWindow().crypto.subtle.importKey("raw", convertToBuffer(_this.secret), SHA_256_HMAC_ALGO, false, ["sign"]).then(resolve, reject); }); this.key.catch(function() { }); } }; return Sha2564; }(); } }); // ../../node_modules/@aws-crypto/sha256-js/build/module/constants.js var BLOCK_SIZE, DIGEST_LENGTH, KEY, INIT, MAX_HASHABLE_LENGTH; var init_constants12 = __esm({ "../../node_modules/@aws-crypto/sha256-js/build/module/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); BLOCK_SIZE = 64; DIGEST_LENGTH = 32; KEY = new Uint32Array([ 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 ]); INIT = [ 1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225 ]; MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1; } }); // ../../node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js var RawSha256; var init_RawSha256 = __esm({ "../../node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants12(); RawSha256 = /** @class */ function() { function RawSha2562() { this.state = Int32Array.from(INIT); this.temp = new Int32Array(64); this.buffer = new Uint8Array(64); this.bufferLength = 0; this.bytesHashed = 0; this.finished = false; } __name(RawSha2562, "RawSha256"); RawSha2562.prototype.update = function(data) { if (this.finished) { throw new Error("Attempted to update an already finished hash."); } var position = 0; var byteLength = data.byteLength; this.bytesHashed += byteLength; if (this.bytesHashed * 8 > MAX_HASHABLE_LENGTH) { throw new Error("Cannot hash more than 2^53 - 1 bits"); } while (byteLength > 0) { this.buffer[this.bufferLength++] = data[position++]; byteLength--; if (this.bufferLength === BLOCK_SIZE) { this.hashBuffer(); this.bufferLength = 0; } } }; RawSha2562.prototype.digest = function() { if (!this.finished) { var bitsHashed = this.bytesHashed * 8; var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength); var undecoratedLength = this.bufferLength; bufferView.setUint8(this.bufferLength++, 128); if (undecoratedLength % BLOCK_SIZE >= BLOCK_SIZE - 8) { for (var i2 = this.bufferLength; i2 < BLOCK_SIZE; i2++) { bufferView.setUint8(i2, 0); } this.hashBuffer(); this.bufferLength = 0; } for (var i2 = this.bufferLength; i2 < BLOCK_SIZE - 8; i2++) { bufferView.setUint8(i2, 0); } bufferView.setUint32(BLOCK_SIZE - 8, Math.floor(bitsHashed / 4294967296), true); bufferView.setUint32(BLOCK_SIZE - 4, bitsHashed); this.hashBuffer(); this.finished = true; } var out = new Uint8Array(DIGEST_LENGTH); for (var i2 = 0; i2 < 8; i2++) { out[i2 * 4] = this.state[i2] >>> 24 & 255; out[i2 * 4 + 1] = this.state[i2] >>> 16 & 255; out[i2 * 4 + 2] = this.state[i2] >>> 8 & 255; out[i2 * 4 + 3] = this.state[i2] >>> 0 & 255; } return out; }; RawSha2562.prototype.hashBuffer = function() { var _a124 = this, buffer = _a124.buffer, state = _a124.state; var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7]; for (var i2 = 0; i2 < BLOCK_SIZE; i2++) { if (i2 < 16) { this.temp[i2] = (buffer[i2 * 4] & 255) << 24 | (buffer[i2 * 4 + 1] & 255) << 16 | (buffer[i2 * 4 + 2] & 255) << 8 | buffer[i2 * 4 + 3] & 255; } else { var u5 = this.temp[i2 - 2]; var t1_1 = (u5 >>> 17 | u5 << 15) ^ (u5 >>> 19 | u5 << 13) ^ u5 >>> 10; u5 = this.temp[i2 - 15]; var t2_1 = (u5 >>> 7 | u5 << 25) ^ (u5 >>> 18 | u5 << 14) ^ u5 >>> 3; this.temp[i2] = (t1_1 + this.temp[i2 - 7] | 0) + (t2_1 + this.temp[i2 - 16] | 0); } var t12 = (((state4 >>> 6 | state4 << 26) ^ (state4 >>> 11 | state4 << 21) ^ (state4 >>> 25 | state4 << 7)) + (state4 & state5 ^ ~state4 & state6) | 0) + (state7 + (KEY[i2] + this.temp[i2] | 0) | 0) | 0; var t22 = ((state0 >>> 2 | state0 << 30) ^ (state0 >>> 13 | state0 << 19) ^ (state0 >>> 22 | state0 << 10)) + (state0 & state1 ^ state0 & state2 ^ state1 & state2) | 0; state7 = state6; state6 = state5; state5 = state4; state4 = state3 + t12 | 0; state3 = state2; state2 = state1; state1 = state0; state0 = t12 + t22 | 0; } state[0] += state0; state[1] += state1; state[2] += state2; state[3] += state3; state[4] += state4; state[5] += state5; state[6] += state6; state[7] += state7; }; return RawSha2562; }(); } }); // ../../node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js function bufferFromSecret(secret) { var input = convertToBuffer(secret); if (input.byteLength > BLOCK_SIZE) { var bufferHash = new RawSha256(); bufferHash.update(input); input = bufferHash.digest(); } var buffer = new Uint8Array(BLOCK_SIZE); buffer.set(input); return buffer; } var Sha2562; var init_jsSha256 = __esm({ "../../node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tslib_es6(); init_constants12(); init_RawSha256(); init_module(); Sha2562 = /** @class */ function() { function Sha2564(secret) { this.secret = secret; this.hash = new RawSha256(); this.reset(); } __name(Sha2564, "Sha256"); Sha2564.prototype.update = function(toHash) { if (isEmptyData(toHash) || this.error) { return; } try { this.hash.update(convertToBuffer(toHash)); } catch (e2) { this.error = e2; } }; Sha2564.prototype.digestSync = function() { if (this.error) { throw this.error; } if (this.outer) { if (!this.outer.finished) { this.outer.update(this.hash.digest()); } return this.outer.digest(); } return this.hash.digest(); }; Sha2564.prototype.digest = function() { return __awaiter(this, void 0, void 0, function() { return __generator(this, function(_a124) { return [2, this.digestSync()]; }); }); }; Sha2564.prototype.reset = function() { this.hash = new RawSha256(); if (this.secret) { this.outer = new RawSha256(); var inner = bufferFromSecret(this.secret); var outer = new Uint8Array(BLOCK_SIZE); outer.set(inner); for (var i2 = 0; i2 < BLOCK_SIZE; i2++) { inner[i2] ^= 54; outer[i2] ^= 92; } this.hash.update(inner); this.outer.update(outer); for (var i2 = 0; i2 < inner.byteLength; i2++) { inner[i2] = 0; } } }; return Sha2564; }(); __name(bufferFromSecret, "bufferFromSecret"); } }); // ../../node_modules/@aws-crypto/sha256-js/build/module/index.js var init_module6 = __esm({ "../../node_modules/@aws-crypto/sha256-js/build/module/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_jsSha256(); } }); // ../../node_modules/@aws-crypto/sha256-browser/build/module/crossPlatformSha256.js var Sha2563; var init_crossPlatformSha256 = __esm({ "../../node_modules/@aws-crypto/sha256-browser/build/module/crossPlatformSha256.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_webCryptoSha256(); init_module6(); init_module4(); init_dist_es45(); init_module(); Sha2563 = /** @class */ function() { function Sha2564(secret) { if (supportsWebCrypto(locateWindow())) { this.hash = new Sha256(secret); } else { this.hash = new Sha2562(secret); } } __name(Sha2564, "Sha256"); Sha2564.prototype.update = function(data, encoding) { this.hash.update(convertToBuffer(data)); }; Sha2564.prototype.digest = function() { return this.hash.digest(); }; Sha2564.prototype.reset = function() { this.hash.reset(); }; return Sha2564; }(); } }); // ../../node_modules/@aws-crypto/sha256-browser/build/module/index.js var init_module7 = __esm({ "../../node_modules/@aws-crypto/sha256-browser/build/module/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_crossPlatformSha256(); init_webCryptoSha256(); } }); // ../../node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js var createDefaultUserAgentProvider, fallback; var init_dist_es46 = __esm({ "../../node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); createDefaultUserAgentProvider = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => async (config3) => { const navigator2 = typeof window !== "undefined" ? window.navigator : void 0; const uaString = navigator2?.userAgent ?? ""; const osName = navigator2?.userAgentData?.platform ?? fallback.os(uaString) ?? "other"; const osVersion = void 0; const brands = navigator2?.userAgentData?.brands ?? []; const brand = brands[brands.length - 1]; const browserName = brand?.brand ?? fallback.browser(uaString) ?? "unknown"; const browserVersion = brand?.version ?? "unknown"; const sections = [ ["aws-sdk-js", clientVersion], ["ua", "2.1"], [`os/${osName}`, osVersion], ["lang/js"], ["md/browser", `${browserName}_${browserVersion}`] ]; if (serviceId) { sections.push([`api/${serviceId}`, clientVersion]); } const appId = await config3?.userAgentAppId?.(); if (appId) { sections.push([`app/${appId}`]); } return sections; }, "createDefaultUserAgentProvider"); fallback = { os(ua) { if (/iPhone|iPad|iPod/.test(ua)) return "iOS"; if (/Macintosh|Mac OS X/.test(ua)) return "macOS"; if (/Windows NT/.test(ua)) return "Windows"; if (/Android/.test(ua)) return "Android"; if (/Linux/.test(ua)) return "Linux"; return void 0; }, browser(ua) { if (/EdgiOS|EdgA|Edg\//.test(ua)) return "Microsoft Edge"; if (/Firefox\//.test(ua)) return "Firefox"; if (/Chrome\//.test(ua)) return "Chrome"; if (/Safari\//.test(ua)) return "Safari"; return void 0; } }; } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/Int64.js function negate2(bytes) { for (let i2 = 0; i2 < 8; i2++) { bytes[i2] ^= 255; } for (let i2 = 7; i2 > -1; i2--) { bytes[i2]++; if (bytes[i2] !== 0) break; } } var Int642; var init_Int64 = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/Int64.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es10(); Int642 = class { bytes; constructor(bytes) { this.bytes = bytes; if (bytes.byteLength !== 8) { throw new Error("Int64 buffers must be exactly 8 bytes"); } } static fromNumber(number4) { if (number4 > 9223372036854776e3 || number4 < -9223372036854776e3) { throw new Error(`${number4} is too large (or, if negative, too small) to represent as an Int64`); } const bytes = new Uint8Array(8); for (let i2 = 7, remaining = Math.abs(Math.round(number4)); i2 > -1 && remaining > 0; i2--, remaining /= 256) { bytes[i2] = remaining; } if (number4 < 0) { negate2(bytes); } return new Int642(bytes); } valueOf() { const bytes = this.bytes.slice(0); const negative = bytes[0] & 128; if (negative) { negate2(bytes); } return parseInt(toHex(bytes), 16) * (negative ? -1 : 1); } toString() { return String(this.valueOf()); } }; __name(Int642, "Int64"); __name(negate2, "negate"); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js var HeaderMarshaller, HEADER_VALUE_TYPE2, BOOLEAN_TAG, BYTE_TAG, SHORT_TAG, INT_TAG, LONG_TAG, BINARY_TAG, STRING_TAG, TIMESTAMP_TAG, UUID_TAG, UUID_PATTERN2; var init_HeaderMarshaller = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es10(); init_Int64(); HeaderMarshaller = class { toUtf8; fromUtf8; constructor(toUtf82, fromUtf85) { this.toUtf8 = toUtf82; this.fromUtf8 = fromUtf85; } format(headers) { const chunks = []; for (const headerName of Object.keys(headers)) { const bytes = this.fromUtf8(headerName); chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); } const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); let position = 0; for (const chunk of chunks) { out.set(chunk, position); position += chunk.byteLength; } return out; } formatHeaderValue(header) { switch (header.type) { case "boolean": return Uint8Array.from([header.value ? 0 : 1]); case "byte": return Uint8Array.from([2, header.value]); case "short": const shortView = new DataView(new ArrayBuffer(3)); shortView.setUint8(0, 3); shortView.setInt16(1, header.value, false); return new Uint8Array(shortView.buffer); case "integer": const intView = new DataView(new ArrayBuffer(5)); intView.setUint8(0, 4); intView.setInt32(1, header.value, false); return new Uint8Array(intView.buffer); case "long": const longBytes = new Uint8Array(9); longBytes[0] = 5; longBytes.set(header.value.bytes, 1); return longBytes; case "binary": const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); binView.setUint8(0, 6); binView.setUint16(1, header.value.byteLength, false); const binBytes = new Uint8Array(binView.buffer); binBytes.set(header.value, 3); return binBytes; case "string": const utf8Bytes = this.fromUtf8(header.value); const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); strView.setUint8(0, 7); strView.setUint16(1, utf8Bytes.byteLength, false); const strBytes = new Uint8Array(strView.buffer); strBytes.set(utf8Bytes, 3); return strBytes; case "timestamp": const tsBytes = new Uint8Array(9); tsBytes[0] = 8; tsBytes.set(Int642.fromNumber(header.value.valueOf()).bytes, 1); return tsBytes; case "uuid": if (!UUID_PATTERN2.test(header.value)) { throw new Error(`Invalid UUID received: ${header.value}`); } const uuidBytes = new Uint8Array(17); uuidBytes[0] = 9; uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1); return uuidBytes; } } parse(headers) { const out = {}; let position = 0; while (position < headers.byteLength) { const nameLength = headers.getUint8(position++); const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); position += nameLength; switch (headers.getUint8(position++)) { case 0: out[name] = { type: BOOLEAN_TAG, value: true }; break; case 1: out[name] = { type: BOOLEAN_TAG, value: false }; break; case 2: out[name] = { type: BYTE_TAG, value: headers.getInt8(position++) }; break; case 3: out[name] = { type: SHORT_TAG, value: headers.getInt16(position, false) }; position += 2; break; case 4: out[name] = { type: INT_TAG, value: headers.getInt32(position, false) }; position += 4; break; case 5: out[name] = { type: LONG_TAG, value: new Int642(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)) }; position += 8; break; case 6: const binaryLength = headers.getUint16(position, false); position += 2; out[name] = { type: BINARY_TAG, value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength) }; position += binaryLength; break; case 7: const stringLength = headers.getUint16(position, false); position += 2; out[name] = { type: STRING_TAG, value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)) }; position += stringLength; break; case 8: out[name] = { type: TIMESTAMP_TAG, value: new Date(new Int642(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()) }; position += 8; break; case 9: const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); position += 16; out[name] = { type: UUID_TAG, value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}` }; break; default: throw new Error(`Unrecognized header type tag`); } } return out; } }; __name(HeaderMarshaller, "HeaderMarshaller"); (function(HEADER_VALUE_TYPE3) { HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid"; })(HEADER_VALUE_TYPE2 || (HEADER_VALUE_TYPE2 = {})); BOOLEAN_TAG = "boolean"; BYTE_TAG = "byte"; SHORT_TAG = "short"; INT_TAG = "integer"; LONG_TAG = "long"; BINARY_TAG = "binary"; STRING_TAG = "string"; TIMESTAMP_TAG = "timestamp"; UUID_TAG = "uuid"; UUID_PATTERN2 = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js function splitMessage({ byteLength, byteOffset, buffer }) { if (byteLength < MINIMUM_MESSAGE_LENGTH) { throw new Error("Provided message too short to accommodate event stream message overhead"); } const view = new DataView(buffer, byteOffset, byteLength); const messageLength = view.getUint32(0, false); if (byteLength !== messageLength) { throw new Error("Reported message length does not match received message length"); } const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); const checksummer = new Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH)); if (expectedPreludeChecksum !== checksummer.digest()) { throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); } checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); if (expectedMessageChecksum !== checksummer.digest()) { throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); } return { headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)) }; } var PRELUDE_MEMBER_LENGTH, PRELUDE_LENGTH, CHECKSUM_LENGTH, MINIMUM_MESSAGE_LENGTH; var init_splitMessage = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_module3(); PRELUDE_MEMBER_LENGTH = 4; PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; CHECKSUM_LENGTH = 4; MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; __name(splitMessage, "splitMessage"); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js var EventStreamCodec; var init_EventStreamCodec = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_module3(); init_HeaderMarshaller(); init_splitMessage(); EventStreamCodec = class { headerMarshaller; messageBuffer; isEndOfStream; constructor(toUtf82, fromUtf85) { this.headerMarshaller = new HeaderMarshaller(toUtf82, fromUtf85); this.messageBuffer = []; this.isEndOfStream = false; } feed(message2) { this.messageBuffer.push(this.decode(message2)); } endOfStream() { this.isEndOfStream = true; } getMessage() { const message2 = this.messageBuffer.pop(); const isEndOfStream = this.isEndOfStream; return { getMessage() { return message2; }, isEndOfStream() { return isEndOfStream; } }; } getAvailableMessages() { const messages = this.messageBuffer; this.messageBuffer = []; const isEndOfStream = this.isEndOfStream; return { getMessages() { return messages; }, isEndOfStream() { return isEndOfStream; } }; } encode({ headers: rawHeaders, body }) { const headers = this.headerMarshaller.format(rawHeaders); const length = headers.byteLength + body.byteLength + 16; const out = new Uint8Array(length); const view = new DataView(out.buffer, out.byteOffset, out.byteLength); const checksum = new Crc32(); view.setUint32(0, length, false); view.setUint32(4, headers.byteLength, false); view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); out.set(headers, 12); out.set(body, headers.byteLength + 12); view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); return out; } decode(message2) { const { headers, body } = splitMessage(message2); return { headers: this.headerMarshaller.parse(headers), body }; } formatHeaders(rawHeaders) { return this.headerMarshaller.format(rawHeaders); } }; __name(EventStreamCodec, "EventStreamCodec"); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/Message.js var init_Message = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/Message.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js var MessageDecoderStream; var init_MessageDecoderStream = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); MessageDecoderStream = class { options; constructor(options) { this.options = options; } [Symbol.asyncIterator]() { return this.asyncIterator(); } async *asyncIterator() { for await (const bytes of this.options.inputStream) { const decoded = this.options.decoder.decode(bytes); yield decoded; } } }; __name(MessageDecoderStream, "MessageDecoderStream"); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js var MessageEncoderStream; var init_MessageEncoderStream = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); MessageEncoderStream = class { options; constructor(options) { this.options = options; } [Symbol.asyncIterator]() { return this.asyncIterator(); } async *asyncIterator() { for await (const msg of this.options.messageStream) { const encoded = this.options.encoder.encode(msg); yield encoded; } if (this.options.includeEndFrame) { yield new Uint8Array(0); } } }; __name(MessageEncoderStream, "MessageEncoderStream"); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js var SmithyMessageDecoderStream; var init_SmithyMessageDecoderStream = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SmithyMessageDecoderStream = class { options; constructor(options) { this.options = options; } [Symbol.asyncIterator]() { return this.asyncIterator(); } async *asyncIterator() { for await (const message2 of this.options.messageStream) { const deserialized = await this.options.deserializer(message2); if (deserialized === void 0) continue; yield deserialized; } } }; __name(SmithyMessageDecoderStream, "SmithyMessageDecoderStream"); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js var SmithyMessageEncoderStream; var init_SmithyMessageEncoderStream = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SmithyMessageEncoderStream = class { options; constructor(options) { this.options = options; } [Symbol.asyncIterator]() { return this.asyncIterator(); } async *asyncIterator() { for await (const chunk of this.options.inputStream) { const payloadBuf = this.options.serializer(chunk); yield payloadBuf; } } }; __name(SmithyMessageEncoderStream, "SmithyMessageEncoderStream"); } }); // ../../node_modules/@smithy/eventstream-codec/dist-es/index.js var init_dist_es47 = __esm({ "../../node_modules/@smithy/eventstream-codec/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EventStreamCodec(); init_HeaderMarshaller(); init_Int64(); init_Message(); init_MessageDecoderStream(); init_MessageEncoderStream(); init_SmithyMessageDecoderStream(); init_SmithyMessageEncoderStream(); } }); // ../../node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js function getChunkedStream(source) { let currentMessageTotalLength = 0; let currentMessagePendingLength = 0; let currentMessage = null; let messageLengthBuffer = null; const allocateMessage = /* @__PURE__ */ __name((size) => { if (typeof size !== "number") { throw new Error("Attempted to allocate an event message where size was not a number: " + size); } currentMessageTotalLength = size; currentMessagePendingLength = 4; currentMessage = new Uint8Array(size); const currentMessageView = new DataView(currentMessage.buffer); currentMessageView.setUint32(0, size, false); }, "allocateMessage"); const iterator2 = /* @__PURE__ */ __name(async function* () { const sourceIterator = source[Symbol.asyncIterator](); while (true) { const { value, done } = await sourceIterator.next(); if (done) { if (!currentMessageTotalLength) { return; } else if (currentMessageTotalLength === currentMessagePendingLength) { yield currentMessage; } else { throw new Error("Truncated event message received."); } return; } const chunkLength = value.length; let currentOffset = 0; while (currentOffset < chunkLength) { if (!currentMessage) { const bytesRemaining = chunkLength - currentOffset; if (!messageLengthBuffer) { messageLengthBuffer = new Uint8Array(4); } const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining); messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength); currentMessagePendingLength += numBytesForTotal; currentOffset += numBytesForTotal; if (currentMessagePendingLength < 4) { break; } allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false)); messageLengthBuffer = null; } const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset); currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength); currentMessagePendingLength += numBytesToWrite; currentOffset += numBytesToWrite; if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) { yield currentMessage; currentMessage = null; currentMessageTotalLength = 0; currentMessagePendingLength = 0; } } } }, "iterator"); return { [Symbol.asyncIterator]: iterator2 }; } var init_getChunkedStream = __esm({ "../../node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(getChunkedStream, "getChunkedStream"); } }); // ../../node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js function getMessageUnmarshaller(deserializer, toUtf82) { return async function(message2) { const { value: messageType } = message2.headers[":message-type"]; if (messageType === "error") { const unmodeledError = new Error(message2.headers[":error-message"].value || "UnknownError"); unmodeledError.name = message2.headers[":error-code"].value; throw unmodeledError; } else if (messageType === "exception") { const code = message2.headers[":exception-type"].value; const exception = { [code]: message2 }; const deserializedException = await deserializer(exception); if (deserializedException.$unknown) { const error50 = new Error(toUtf82(message2.body)); error50.name = code; throw error50; } throw deserializedException[code]; } else if (messageType === "event") { const event = { [message2.headers[":event-type"].value]: message2 }; const deserialized = await deserializer(event); if (deserialized.$unknown) return; return deserialized; } else { throw Error(`Unrecognizable event type: ${message2.headers[":event-type"].value}`); } }; } var init_getUnmarshalledStream = __esm({ "../../node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(getMessageUnmarshaller, "getMessageUnmarshaller"); } }); // ../../node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js var EventStreamMarshaller; var init_EventStreamMarshaller = __esm({ "../../node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es47(); init_getChunkedStream(); init_getUnmarshalledStream(); EventStreamMarshaller = class { eventStreamCodec; utfEncoder; constructor({ utf8Encoder, utf8Decoder }) { this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder); this.utfEncoder = utf8Encoder; } deserialize(body, deserializer) { const inputStream = getChunkedStream(body); return new SmithyMessageDecoderStream({ messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }), deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder) }); } serialize(inputStream, serializer) { return new MessageEncoderStream({ messageStream: new SmithyMessageEncoderStream({ inputStream, serializer }), encoder: this.eventStreamCodec, includeEndFrame: true }); } }; __name(EventStreamMarshaller, "EventStreamMarshaller"); } }); // ../../node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js var init_provider = __esm({ "../../node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/eventstream-serde-universal/dist-es/index.js var init_dist_es48 = __esm({ "../../node_modules/@smithy/eventstream-serde-universal/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EventStreamMarshaller(); init_provider(); } }); // ../../node_modules/@smithy/eventstream-serde-browser/dist-es/utils.js var readableStreamtoIterable, iterableToReadableStream; var init_utils6 = __esm({ "../../node_modules/@smithy/eventstream-serde-browser/dist-es/utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); readableStreamtoIterable = /* @__PURE__ */ __name((readableStream) => ({ [Symbol.asyncIterator]: async function* () { const reader = readableStream.getReader(); try { while (true) { const { done, value } = await reader.read(); if (done) return; yield value; } } finally { reader.releaseLock(); } } }), "readableStreamtoIterable"); iterableToReadableStream = /* @__PURE__ */ __name((asyncIterable) => { const iterator2 = asyncIterable[Symbol.asyncIterator](); return new ReadableStream({ async pull(controller) { const { done, value } = await iterator2.next(); if (done) { return controller.close(); } controller.enqueue(value); } }); }, "iterableToReadableStream"); } }); // ../../node_modules/@smithy/eventstream-serde-browser/dist-es/EventStreamMarshaller.js var EventStreamMarshaller2, isReadableStream2; var init_EventStreamMarshaller2 = __esm({ "../../node_modules/@smithy/eventstream-serde-browser/dist-es/EventStreamMarshaller.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es48(); init_utils6(); EventStreamMarshaller2 = class { universalMarshaller; constructor({ utf8Encoder, utf8Decoder }) { this.universalMarshaller = new EventStreamMarshaller({ utf8Decoder, utf8Encoder }); } deserialize(body, deserializer) { const bodyIterable = isReadableStream2(body) ? readableStreamtoIterable(body) : body; return this.universalMarshaller.deserialize(bodyIterable, deserializer); } serialize(input, serializer) { const serialziedIterable = this.universalMarshaller.serialize(input, serializer); return typeof ReadableStream === "function" ? iterableToReadableStream(serialziedIterable) : serialziedIterable; } }; __name(EventStreamMarshaller2, "EventStreamMarshaller"); isReadableStream2 = /* @__PURE__ */ __name((body) => typeof ReadableStream === "function" && body instanceof ReadableStream, "isReadableStream"); } }); // ../../node_modules/@smithy/eventstream-serde-browser/dist-es/provider.js var eventStreamSerdeProvider; var init_provider2 = __esm({ "../../node_modules/@smithy/eventstream-serde-browser/dist-es/provider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EventStreamMarshaller2(); eventStreamSerdeProvider = /* @__PURE__ */ __name((options) => new EventStreamMarshaller2(options), "eventStreamSerdeProvider"); } }); // ../../node_modules/@smithy/eventstream-serde-browser/dist-es/index.js var init_dist_es49 = __esm({ "../../node_modules/@smithy/eventstream-serde-browser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_EventStreamMarshaller2(); init_provider2(); init_utils6(); } }); // ../../node_modules/@smithy/chunked-blob-reader/dist-es/index.js async function blobReader(blob2, onChunk, chunkSize = 1024 * 1024) { const size = blob2.size; let totalBytesRead = 0; while (totalBytesRead < size) { const slice = blob2.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize)); onChunk(new Uint8Array(await slice.arrayBuffer())); totalBytesRead += slice.size; } } var init_dist_es50 = __esm({ "../../node_modules/@smithy/chunked-blob-reader/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(blobReader, "blobReader"); } }); // ../../node_modules/@smithy/hash-blob-browser/dist-es/index.js var blobHasher; var init_dist_es51 = __esm({ "../../node_modules/@smithy/hash-blob-browser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es50(); blobHasher = /* @__PURE__ */ __name(async function blobHasher2(hashCtor, blob2) { const hash4 = new hashCtor(); await blobReader(blob2, (chunk) => { hash4.update(chunk); }); return hash4.digest(); }, "blobHasher"); } }); // ../../node_modules/@smithy/invalid-dependency/dist-es/invalidFunction.js var init_invalidFunction = __esm({ "../../node_modules/@smithy/invalid-dependency/dist-es/invalidFunction.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@smithy/invalid-dependency/dist-es/invalidProvider.js var invalidProvider; var init_invalidProvider = __esm({ "../../node_modules/@smithy/invalid-dependency/dist-es/invalidProvider.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); invalidProvider = /* @__PURE__ */ __name((message2) => () => Promise.reject(message2), "invalidProvider"); } }); // ../../node_modules/@smithy/invalid-dependency/dist-es/index.js var init_dist_es52 = __esm({ "../../node_modules/@smithy/invalid-dependency/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_invalidFunction(); init_invalidProvider(); } }); // ../../node_modules/@smithy/md5-js/dist-es/constants.js var BLOCK_SIZE2, DIGEST_LENGTH2, INIT2; var init_constants13 = __esm({ "../../node_modules/@smithy/md5-js/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); BLOCK_SIZE2 = 64; DIGEST_LENGTH2 = 16; INIT2 = [1732584193, 4023233417, 2562383102, 271733878]; } }); // ../../node_modules/@smithy/md5-js/dist-es/index.js function cmn(q2, a2, b2, x2, s2, t9) { a2 = (a2 + q2 & 4294967295) + (x2 + t9 & 4294967295) & 4294967295; return (a2 << s2 | a2 >>> 32 - s2) + b2 & 4294967295; } function ff(a2, b2, c2, d2, x2, s2, t9) { return cmn(b2 & c2 | ~b2 & d2, a2, b2, x2, s2, t9); } function gg(a2, b2, c2, d2, x2, s2, t9) { return cmn(b2 & d2 | c2 & ~d2, a2, b2, x2, s2, t9); } function hh(a2, b2, c2, d2, x2, s2, t9) { return cmn(b2 ^ c2 ^ d2, a2, b2, x2, s2, t9); } function ii(a2, b2, c2, d2, x2, s2, t9) { return cmn(c2 ^ (b2 | ~d2), a2, b2, x2, s2, t9); } function isEmptyData3(data) { if (typeof data === "string") { return data.length === 0; } return data.byteLength === 0; } function convertToBuffer3(data) { if (typeof data === "string") { return fromUtf8(data); } if (ArrayBuffer.isView(data)) { return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } return new Uint8Array(data); } var Md5; var init_dist_es53 = __esm({ "../../node_modules/@smithy/md5-js/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es5(); init_constants13(); Md5 = class { state; buffer; bufferLength; bytesHashed; finished; constructor() { this.reset(); } update(sourceData) { if (isEmptyData3(sourceData)) { return; } else if (this.finished) { throw new Error("Attempted to update an already finished hash."); } const data = convertToBuffer3(sourceData); let position = 0; let { byteLength } = data; this.bytesHashed += byteLength; while (byteLength > 0) { this.buffer.setUint8(this.bufferLength++, data[position++]); byteLength--; if (this.bufferLength === BLOCK_SIZE2) { this.hashBuffer(); this.bufferLength = 0; } } } async digest() { if (!this.finished) { const { buffer, bufferLength: undecoratedLength, bytesHashed } = this; const bitsHashed = bytesHashed * 8; buffer.setUint8(this.bufferLength++, 128); if (undecoratedLength % BLOCK_SIZE2 >= BLOCK_SIZE2 - 8) { for (let i2 = this.bufferLength; i2 < BLOCK_SIZE2; i2++) { buffer.setUint8(i2, 0); } this.hashBuffer(); this.bufferLength = 0; } for (let i2 = this.bufferLength; i2 < BLOCK_SIZE2 - 8; i2++) { buffer.setUint8(i2, 0); } buffer.setUint32(BLOCK_SIZE2 - 8, bitsHashed >>> 0, true); buffer.setUint32(BLOCK_SIZE2 - 4, Math.floor(bitsHashed / 4294967296), true); this.hashBuffer(); this.finished = true; } const out = new DataView(new ArrayBuffer(DIGEST_LENGTH2)); for (let i2 = 0; i2 < 4; i2++) { out.setUint32(i2 * 4, this.state[i2], true); } return new Uint8Array(out.buffer, out.byteOffset, out.byteLength); } hashBuffer() { const { buffer, state } = this; let a2 = state[0], b2 = state[1], c2 = state[2], d2 = state[3]; a2 = ff(a2, b2, c2, d2, buffer.getUint32(0, true), 7, 3614090360); d2 = ff(d2, a2, b2, c2, buffer.getUint32(4, true), 12, 3905402710); c2 = ff(c2, d2, a2, b2, buffer.getUint32(8, true), 17, 606105819); b2 = ff(b2, c2, d2, a2, buffer.getUint32(12, true), 22, 3250441966); a2 = ff(a2, b2, c2, d2, buffer.getUint32(16, true), 7, 4118548399); d2 = ff(d2, a2, b2, c2, buffer.getUint32(20, true), 12, 1200080426); c2 = ff(c2, d2, a2, b2, buffer.getUint32(24, true), 17, 2821735955); b2 = ff(b2, c2, d2, a2, buffer.getUint32(28, true), 22, 4249261313); a2 = ff(a2, b2, c2, d2, buffer.getUint32(32, true), 7, 1770035416); d2 = ff(d2, a2, b2, c2, buffer.getUint32(36, true), 12, 2336552879); c2 = ff(c2, d2, a2, b2, buffer.getUint32(40, true), 17, 4294925233); b2 = ff(b2, c2, d2, a2, buffer.getUint32(44, true), 22, 2304563134); a2 = ff(a2, b2, c2, d2, buffer.getUint32(48, true), 7, 1804603682); d2 = ff(d2, a2, b2, c2, buffer.getUint32(52, true), 12, 4254626195); c2 = ff(c2, d2, a2, b2, buffer.getUint32(56, true), 17, 2792965006); b2 = ff(b2, c2, d2, a2, buffer.getUint32(60, true), 22, 1236535329); a2 = gg(a2, b2, c2, d2, buffer.getUint32(4, true), 5, 4129170786); d2 = gg(d2, a2, b2, c2, buffer.getUint32(24, true), 9, 3225465664); c2 = gg(c2, d2, a2, b2, buffer.getUint32(44, true), 14, 643717713); b2 = gg(b2, c2, d2, a2, buffer.getUint32(0, true), 20, 3921069994); a2 = gg(a2, b2, c2, d2, buffer.getUint32(20, true), 5, 3593408605); d2 = gg(d2, a2, b2, c2, buffer.getUint32(40, true), 9, 38016083); c2 = gg(c2, d2, a2, b2, buffer.getUint32(60, true), 14, 3634488961); b2 = gg(b2, c2, d2, a2, buffer.getUint32(16, true), 20, 3889429448); a2 = gg(a2, b2, c2, d2, buffer.getUint32(36, true), 5, 568446438); d2 = gg(d2, a2, b2, c2, buffer.getUint32(56, true), 9, 3275163606); c2 = gg(c2, d2, a2, b2, buffer.getUint32(12, true), 14, 4107603335); b2 = gg(b2, c2, d2, a2, buffer.getUint32(32, true), 20, 1163531501); a2 = gg(a2, b2, c2, d2, buffer.getUint32(52, true), 5, 2850285829); d2 = gg(d2, a2, b2, c2, buffer.getUint32(8, true), 9, 4243563512); c2 = gg(c2, d2, a2, b2, buffer.getUint32(28, true), 14, 1735328473); b2 = gg(b2, c2, d2, a2, buffer.getUint32(48, true), 20, 2368359562); a2 = hh(a2, b2, c2, d2, buffer.getUint32(20, true), 4, 4294588738); d2 = hh(d2, a2, b2, c2, buffer.getUint32(32, true), 11, 2272392833); c2 = hh(c2, d2, a2, b2, buffer.getUint32(44, true), 16, 1839030562); b2 = hh(b2, c2, d2, a2, buffer.getUint32(56, true), 23, 4259657740); a2 = hh(a2, b2, c2, d2, buffer.getUint32(4, true), 4, 2763975236); d2 = hh(d2, a2, b2, c2, buffer.getUint32(16, true), 11, 1272893353); c2 = hh(c2, d2, a2, b2, buffer.getUint32(28, true), 16, 4139469664); b2 = hh(b2, c2, d2, a2, buffer.getUint32(40, true), 23, 3200236656); a2 = hh(a2, b2, c2, d2, buffer.getUint32(52, true), 4, 681279174); d2 = hh(d2, a2, b2, c2, buffer.getUint32(0, true), 11, 3936430074); c2 = hh(c2, d2, a2, b2, buffer.getUint32(12, true), 16, 3572445317); b2 = hh(b2, c2, d2, a2, buffer.getUint32(24, true), 23, 76029189); a2 = hh(a2, b2, c2, d2, buffer.getUint32(36, true), 4, 3654602809); d2 = hh(d2, a2, b2, c2, buffer.getUint32(48, true), 11, 3873151461); c2 = hh(c2, d2, a2, b2, buffer.getUint32(60, true), 16, 530742520); b2 = hh(b2, c2, d2, a2, buffer.getUint32(8, true), 23, 3299628645); a2 = ii(a2, b2, c2, d2, buffer.getUint32(0, true), 6, 4096336452); d2 = ii(d2, a2, b2, c2, buffer.getUint32(28, true), 10, 1126891415); c2 = ii(c2, d2, a2, b2, buffer.getUint32(56, true), 15, 2878612391); b2 = ii(b2, c2, d2, a2, buffer.getUint32(20, true), 21, 4237533241); a2 = ii(a2, b2, c2, d2, buffer.getUint32(48, true), 6, 1700485571); d2 = ii(d2, a2, b2, c2, buffer.getUint32(12, true), 10, 2399980690); c2 = ii(c2, d2, a2, b2, buffer.getUint32(40, true), 15, 4293915773); b2 = ii(b2, c2, d2, a2, buffer.getUint32(4, true), 21, 2240044497); a2 = ii(a2, b2, c2, d2, buffer.getUint32(32, true), 6, 1873313359); d2 = ii(d2, a2, b2, c2, buffer.getUint32(60, true), 10, 4264355552); c2 = ii(c2, d2, a2, b2, buffer.getUint32(24, true), 15, 2734768916); b2 = ii(b2, c2, d2, a2, buffer.getUint32(52, true), 21, 1309151649); a2 = ii(a2, b2, c2, d2, buffer.getUint32(16, true), 6, 4149444226); d2 = ii(d2, a2, b2, c2, buffer.getUint32(44, true), 10, 3174756917); c2 = ii(c2, d2, a2, b2, buffer.getUint32(8, true), 15, 718787259); b2 = ii(b2, c2, d2, a2, buffer.getUint32(36, true), 21, 3951481745); state[0] = a2 + state[0] & 4294967295; state[1] = b2 + state[1] & 4294967295; state[2] = c2 + state[2] & 4294967295; state[3] = d2 + state[3] & 4294967295; } reset() { this.state = Uint32Array.from(INIT2); this.buffer = new DataView(new ArrayBuffer(BLOCK_SIZE2)); this.bufferLength = 0; this.bytesHashed = 0; this.finished = false; } }; __name(Md5, "Md5"); __name(cmn, "cmn"); __name(ff, "ff"); __name(gg, "gg"); __name(hh, "hh"); __name(ii, "ii"); __name(isEmptyData3, "isEmptyData"); __name(convertToBuffer3, "convertToBuffer"); } }); // ../../node_modules/@smithy/util-defaults-mode-browser/dist-es/constants.js var DEFAULTS_MODE_OPTIONS; var init_constants14 = __esm({ "../../node_modules/@smithy/util-defaults-mode-browser/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; } }); // ../../node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js var resolveDefaultsModeConfig, useMobileConfiguration; var init_resolveDefaultsModeConfig = __esm({ "../../node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es16(); init_constants14(); resolveDefaultsModeConfig = /* @__PURE__ */ __name(({ defaultsMode } = {}) => memoize(async () => { const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; switch (mode?.toLowerCase()) { case "auto": return Promise.resolve(useMobileConfiguration() ? "mobile" : "standard"); case "mobile": case "in-region": case "cross-region": case "standard": case "legacy": return Promise.resolve(mode?.toLocaleLowerCase()); case void 0: return Promise.resolve("legacy"); default: throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); } }), "resolveDefaultsModeConfig"); useMobileConfiguration = /* @__PURE__ */ __name(() => { const navigator2 = window?.navigator; if (navigator2?.connection) { const { effectiveType, rtt, downlink } = navigator2?.connection; const slow = typeof effectiveType === "string" && effectiveType !== "4g" || Number(rtt) > 100 || Number(downlink) < 10; if (slow) { return true; } } return navigator2?.userAgentData?.mobile || typeof navigator2?.maxTouchPoints === "number" && navigator2?.maxTouchPoints > 1; }, "useMobileConfiguration"); } }); // ../../node_modules/@smithy/util-defaults-mode-browser/dist-es/index.js var init_dist_es54 = __esm({ "../../node_modules/@smithy/util-defaults-mode-browser/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_resolveDefaultsModeConfig(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js var getRuntimeConfig; var init_runtimeConfig_shared = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es23(); init_protocols2(); init_dist_es43(); init_dist_es21(); init_dist_es13(); init_dist_es6(); init_dist_es11(); init_dist_es5(); init_httpAuthSchemeProvider(); init_endpointResolver(); init_schemas_0(); getRuntimeConfig = /* @__PURE__ */ __name((config3) => { return { apiVersion: "2006-03-01", base64Decoder: config3?.base64Decoder ?? fromBase64, base64Encoder: config3?.base64Encoder ?? toBase64, disableHostPrefix: config3?.disableHostPrefix ?? false, endpointProvider: config3?.endpointProvider ?? defaultEndpointResolver, extensions: config3?.extensions ?? [], getAwsChunkedEncodingStream: config3?.getAwsChunkedEncodingStream ?? getAwsChunkedEncodingStream, httpAuthSchemeProvider: config3?.httpAuthSchemeProvider ?? defaultS3HttpAuthSchemeProvider, httpAuthSchemes: config3?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), signer: new AwsSdkSigV4Signer() }, { schemeId: "aws.auth#sigv4a", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), signer: new AwsSdkSigV4ASigner() } ], logger: config3?.logger ?? new NoOpLogger(), protocol: config3?.protocol ?? AwsRestXmlProtocol, protocolSettings: config3?.protocolSettings ?? { defaultNamespace: "com.amazonaws.s3", errorTypeRegistries, xmlNamespace: "http://s3.amazonaws.com/doc/2006-03-01/", version: "2006-03-01", serviceTarget: "AmazonS3" }, sdkStreamMixin: config3?.sdkStreamMixin ?? sdkStreamMixin, serviceId: config3?.serviceId ?? "S3", signerConstructor: config3?.signerConstructor ?? SignatureV4MultiRegion, signingEscapePath: config3?.signingEscapePath ?? false, urlParser: config3?.urlParser ?? parseUrl, useArnRegion: config3?.useArnRegion ?? void 0, utf8Decoder: config3?.utf8Decoder ?? fromUtf8, utf8Encoder: config3?.utf8Encoder ?? toUtf8 }; }, "getRuntimeConfig"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.browser.js var getRuntimeConfig2; var init_runtimeConfig_browser = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_package(); init_module5(); init_module7(); init_dist_es46(); init_dist_es37(); init_dist_es49(); init_dist_es9(); init_dist_es51(); init_dist_es52(); init_dist_es53(); init_dist_es21(); init_dist_es19(); init_dist_es54(); init_dist_es35(); init_runtimeConfig_shared(); getRuntimeConfig2 = /* @__PURE__ */ __name((config3) => { const defaultsMode = resolveDefaultsModeConfig(config3); const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider"); const clientSharedValues = getRuntimeConfig(config3); return { ...clientSharedValues, ...config3, runtime: "browser", defaultsMode, bodyLengthChecker: config3?.bodyLengthChecker ?? calculateBodyLength, credentialDefaultProvider: config3?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))), defaultUserAgentProvider: config3?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), eventStreamSerdeProvider: config3?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, maxAttempts: config3?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, md5: config3?.md5 ?? Md5, region: config3?.region ?? invalidProvider("Region is missing"), requestHandler: FetchHttpHandler.create(config3?.requestHandler ?? defaultConfigProvider), retryMode: config3?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), sha1: config3?.sha1 ?? Sha12, sha256: config3?.sha256 ?? Sha2563, streamCollector: config3?.streamCollector ?? streamCollector, streamHasher: config3?.streamHasher ?? blobHasher, useDualstackEndpoint: config3?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), useFipsEndpoint: config3?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)) }; }, "getRuntimeConfig"); } }); // ../../node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js var getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration; var init_extensions4 = __esm({ "../../node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { return { setRegion(region) { runtimeConfig.region = region; }, region() { return runtimeConfig.region; } }; }, "getAwsRegionExtensionConfiguration"); resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => { return { region: awsRegionExtensionConfiguration.region() }; }, "resolveAwsRegionExtensionConfiguration"); } }); // ../../node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/awsRegionConfig.js var init_awsRegionConfig = __esm({ "../../node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/awsRegionConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.browser.js var init_stsRegionDefaultResolver_browser = __esm({ "../../node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.browser.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/region-config-resolver/dist-es/index.js var init_dist_es55 = __esm({ "../../node_modules/@aws-sdk/region-config-resolver/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_extensions4(); init_awsRegionConfig(); init_stsRegionDefaultResolver_browser(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig; var init_httpAuthExtensionConfiguration = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; let _credentials = runtimeConfig.credentials; return { setHttpAuthScheme(httpAuthScheme) { const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); if (index === -1) { _httpAuthSchemes.push(httpAuthScheme); } else { _httpAuthSchemes.splice(index, 1, httpAuthScheme); } }, httpAuthSchemes() { return _httpAuthSchemes; }, setHttpAuthSchemeProvider(httpAuthSchemeProvider) { _httpAuthSchemeProvider = httpAuthSchemeProvider; }, httpAuthSchemeProvider() { return _httpAuthSchemeProvider; }, setCredentials(credentials) { _credentials = credentials; }, credentials() { return _credentials; } }; }, "getHttpAuthExtensionConfiguration"); resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config3) => { return { httpAuthSchemes: config3.httpAuthSchemes(), httpAuthSchemeProvider: config3.httpAuthSchemeProvider(), credentials: config3.credentials() }; }, "resolveHttpAuthRuntimeConfig"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js var resolveRuntimeExtensions; var init_runtimeExtensions = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es55(); init_dist_es2(); init_dist_es21(); init_httpAuthExtensionConfiguration(); resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); }, "resolveRuntimeExtensions"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/S3Client.js var S3Client; var init_S3Client = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/S3Client.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es3(); init_dist_es26(); init_dist_es27(); init_dist_es28(); init_dist_es29(); init_dist_es31(); init_dist_es36(); init_dist_es37(); init_dist_es15(); init_schema3(); init_dist_es38(); init_dist_es39(); init_dist_es41(); init_dist_es42(); init_dist_es21(); init_httpAuthSchemeProvider(); init_CreateSessionCommand(); init_EndpointParameters(); init_runtimeConfig_browser(); init_runtimeExtensions(); S3Client = class extends Client { config; constructor(...[configuration]) { const _config_0 = getRuntimeConfig2(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = resolveClientEndpointParameters(_config_0); const _config_2 = resolveUserAgentConfig(_config_1); const _config_3 = resolveFlexibleChecksumsConfig(_config_2); const _config_4 = resolveRetryConfig(_config_3); const _config_5 = resolveRegionConfig(_config_4); const _config_6 = resolveHostHeaderConfig(_config_5); const _config_7 = resolveEndpointConfig(_config_6); const _config_8 = resolveEventStreamSerdeConfig(_config_7); const _config_9 = resolveHttpAuthSchemeConfig(_config_8); const _config_10 = resolveS3Config(_config_9, { session: [() => this, CreateSessionCommand] }); const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []); this.config = _config_11; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultS3HttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config3) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config3.credentials, "aws.auth#sigv4a": config3.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); this.middlewareStack.use(getValidateBucketNamePlugin(this.config)); this.middlewareStack.use(getAddExpectContinuePlugin(this.config)); this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config)); this.middlewareStack.use(getS3ExpressPlugin(this.config)); this.middlewareStack.use(getS3ExpressHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } }; __name(S3Client, "S3Client"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/AbortMultipartUploadCommand.js var AbortMultipartUploadCommand; var init_AbortMultipartUploadCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/AbortMultipartUploadCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); AbortMultipartUploadCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "AbortMultipartUpload", {}).n("S3Client", "AbortMultipartUploadCommand").sc(AbortMultipartUpload$).build() { }; __name(AbortMultipartUploadCommand, "AbortMultipartUploadCommand"); } }); // ../../node_modules/@aws-sdk/middleware-ssec/dist-es/index.js function ssecMiddleware(options) { return (next) => async (args) => { const input = { ...args.input }; const properties = [ { target: "SSECustomerKey", hash: "SSECustomerKeyMD5" }, { target: "CopySourceSSECustomerKey", hash: "CopySourceSSECustomerKeyMD5" } ]; for (const prop of properties) { const value = input[prop.target]; if (value) { let valueForHash; if (typeof value === "string") { if (isValidBase64EncodedSSECustomerKey(value, options)) { valueForHash = options.base64Decoder(value); } else { valueForHash = options.utf8Decoder(value); input[prop.target] = options.base64Encoder(valueForHash); } } else { valueForHash = ArrayBuffer.isView(value) ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) : new Uint8Array(value); input[prop.target] = options.base64Encoder(valueForHash); } const hash4 = new options.md5(); hash4.update(valueForHash); input[prop.hash] = options.base64Encoder(await hash4.digest()); } } return next({ ...args, input }); }; } function isValidBase64EncodedSSECustomerKey(str, options) { const base64Regex = /^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; if (!base64Regex.test(str)) return false; try { const decodedBytes = options.base64Decoder(str); return decodedBytes.length === 32; } catch { return false; } } var ssecMiddlewareOptions, getSsecPlugin; var init_dist_es56 = __esm({ "../../node_modules/@aws-sdk/middleware-ssec/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(ssecMiddleware, "ssecMiddleware"); ssecMiddlewareOptions = { name: "ssecMiddleware", step: "initialize", tags: ["SSE"], override: true }; getSsecPlugin = /* @__PURE__ */ __name((config3) => ({ applyToStack: (clientStack) => { clientStack.add(ssecMiddleware(config3), ssecMiddlewareOptions); } }), "getSsecPlugin"); __name(isValidBase64EncodedSSECustomerKey, "isValidBase64EncodedSSECustomerKey"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/CompleteMultipartUploadCommand.js var CompleteMultipartUploadCommand; var init_CompleteMultipartUploadCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/CompleteMultipartUploadCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); CompleteMultipartUploadCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "CompleteMultipartUpload", {}).n("S3Client", "CompleteMultipartUploadCommand").sc(CompleteMultipartUpload$).build() { }; __name(CompleteMultipartUploadCommand, "CompleteMultipartUploadCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/CopyObjectCommand.js var CopyObjectCommand; var init_CopyObjectCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/CopyObjectCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); CopyObjectCommand = class extends Command.classBuilder().ep({ ...commonParams, DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" }, CopySource: { type: "contextParams", name: "CopySource" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "CopyObject", {}).n("S3Client", "CopyObjectCommand").sc(CopyObject$).build() { }; __name(CopyObjectCommand, "CopyObjectCommand"); } }); // ../../node_modules/@aws-sdk/middleware-location-constraint/dist-es/index.js function locationConstraintMiddleware(options) { return (next) => async (args) => { const { CreateBucketConfiguration } = args.input; const region = await options.region(); if (!CreateBucketConfiguration?.LocationConstraint && !CreateBucketConfiguration?.Location) { if (region !== "us-east-1") { args.input.CreateBucketConfiguration = args.input.CreateBucketConfiguration ?? {}; args.input.CreateBucketConfiguration.LocationConstraint = region; } } return next(args); }; } var locationConstraintMiddlewareOptions, getLocationConstraintPlugin; var init_dist_es57 = __esm({ "../../node_modules/@aws-sdk/middleware-location-constraint/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(locationConstraintMiddleware, "locationConstraintMiddleware"); locationConstraintMiddlewareOptions = { step: "initialize", tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"], name: "locationConstraintMiddleware", override: true }; getLocationConstraintPlugin = /* @__PURE__ */ __name((config3) => ({ applyToStack: (clientStack) => { clientStack.add(locationConstraintMiddleware(config3), locationConstraintMiddlewareOptions); } }), "getLocationConstraintPlugin"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketCommand.js var CreateBucketCommand; var init_CreateBucketCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es57(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); CreateBucketCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, DisableAccessPoints: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getLocationConstraintPlugin(config3) ]; }).s("AmazonS3", "CreateBucket", {}).n("S3Client", "CreateBucketCommand").sc(CreateBucket$).build() { }; __name(CreateBucketCommand, "CreateBucketCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketMetadataConfigurationCommand.js var CreateBucketMetadataConfigurationCommand; var init_CreateBucketMetadataConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketMetadataConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); CreateBucketMetadataConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "CreateBucketMetadataConfiguration", {}).n("S3Client", "CreateBucketMetadataConfigurationCommand").sc(CreateBucketMetadataConfiguration$).build() { }; __name(CreateBucketMetadataConfigurationCommand, "CreateBucketMetadataConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketMetadataTableConfigurationCommand.js var CreateBucketMetadataTableConfigurationCommand; var init_CreateBucketMetadataTableConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketMetadataTableConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); CreateBucketMetadataTableConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "CreateBucketMetadataTableConfiguration", {}).n("S3Client", "CreateBucketMetadataTableConfigurationCommand").sc(CreateBucketMetadataTableConfiguration$).build() { }; __name(CreateBucketMetadataTableConfigurationCommand, "CreateBucketMetadataTableConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateMultipartUploadCommand.js var CreateMultipartUploadCommand; var init_CreateMultipartUploadCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/CreateMultipartUploadCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); CreateMultipartUploadCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "CreateMultipartUpload", {}).n("S3Client", "CreateMultipartUploadCommand").sc(CreateMultipartUpload$).build() { }; __name(CreateMultipartUploadCommand, "CreateMultipartUploadCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketAnalyticsConfigurationCommand.js var DeleteBucketAnalyticsConfigurationCommand; var init_DeleteBucketAnalyticsConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketAnalyticsConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketAnalyticsConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketAnalyticsConfiguration", {}).n("S3Client", "DeleteBucketAnalyticsConfigurationCommand").sc(DeleteBucketAnalyticsConfiguration$).build() { }; __name(DeleteBucketAnalyticsConfigurationCommand, "DeleteBucketAnalyticsConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCommand.js var DeleteBucketCommand; var init_DeleteBucketCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucket", {}).n("S3Client", "DeleteBucketCommand").sc(DeleteBucket$).build() { }; __name(DeleteBucketCommand, "DeleteBucketCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCorsCommand.js var DeleteBucketCorsCommand; var init_DeleteBucketCorsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCorsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketCorsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketCors", {}).n("S3Client", "DeleteBucketCorsCommand").sc(DeleteBucketCors$).build() { }; __name(DeleteBucketCorsCommand, "DeleteBucketCorsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketEncryptionCommand.js var DeleteBucketEncryptionCommand; var init_DeleteBucketEncryptionCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketEncryptionCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketEncryptionCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketEncryption", {}).n("S3Client", "DeleteBucketEncryptionCommand").sc(DeleteBucketEncryption$).build() { }; __name(DeleteBucketEncryptionCommand, "DeleteBucketEncryptionCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketIntelligentTieringConfigurationCommand.js var DeleteBucketIntelligentTieringConfigurationCommand; var init_DeleteBucketIntelligentTieringConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketIntelligentTieringConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketIntelligentTieringConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketIntelligentTieringConfiguration", {}).n("S3Client", "DeleteBucketIntelligentTieringConfigurationCommand").sc(DeleteBucketIntelligentTieringConfiguration$).build() { }; __name(DeleteBucketIntelligentTieringConfigurationCommand, "DeleteBucketIntelligentTieringConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketInventoryConfigurationCommand.js var DeleteBucketInventoryConfigurationCommand; var init_DeleteBucketInventoryConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketInventoryConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketInventoryConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketInventoryConfiguration", {}).n("S3Client", "DeleteBucketInventoryConfigurationCommand").sc(DeleteBucketInventoryConfiguration$).build() { }; __name(DeleteBucketInventoryConfigurationCommand, "DeleteBucketInventoryConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketLifecycleCommand.js var DeleteBucketLifecycleCommand; var init_DeleteBucketLifecycleCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketLifecycleCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketLifecycleCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketLifecycle", {}).n("S3Client", "DeleteBucketLifecycleCommand").sc(DeleteBucketLifecycle$).build() { }; __name(DeleteBucketLifecycleCommand, "DeleteBucketLifecycleCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetadataConfigurationCommand.js var DeleteBucketMetadataConfigurationCommand; var init_DeleteBucketMetadataConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetadataConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketMetadataConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketMetadataConfiguration", {}).n("S3Client", "DeleteBucketMetadataConfigurationCommand").sc(DeleteBucketMetadataConfiguration$).build() { }; __name(DeleteBucketMetadataConfigurationCommand, "DeleteBucketMetadataConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetadataTableConfigurationCommand.js var DeleteBucketMetadataTableConfigurationCommand; var init_DeleteBucketMetadataTableConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetadataTableConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketMetadataTableConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketMetadataTableConfiguration", {}).n("S3Client", "DeleteBucketMetadataTableConfigurationCommand").sc(DeleteBucketMetadataTableConfiguration$).build() { }; __name(DeleteBucketMetadataTableConfigurationCommand, "DeleteBucketMetadataTableConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetricsConfigurationCommand.js var DeleteBucketMetricsConfigurationCommand; var init_DeleteBucketMetricsConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetricsConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketMetricsConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketMetricsConfiguration", {}).n("S3Client", "DeleteBucketMetricsConfigurationCommand").sc(DeleteBucketMetricsConfiguration$).build() { }; __name(DeleteBucketMetricsConfigurationCommand, "DeleteBucketMetricsConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketOwnershipControlsCommand.js var DeleteBucketOwnershipControlsCommand; var init_DeleteBucketOwnershipControlsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketOwnershipControlsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketOwnershipControlsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketOwnershipControls", {}).n("S3Client", "DeleteBucketOwnershipControlsCommand").sc(DeleteBucketOwnershipControls$).build() { }; __name(DeleteBucketOwnershipControlsCommand, "DeleteBucketOwnershipControlsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketPolicyCommand.js var DeleteBucketPolicyCommand; var init_DeleteBucketPolicyCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketPolicyCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketPolicyCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketPolicy", {}).n("S3Client", "DeleteBucketPolicyCommand").sc(DeleteBucketPolicy$).build() { }; __name(DeleteBucketPolicyCommand, "DeleteBucketPolicyCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketReplicationCommand.js var DeleteBucketReplicationCommand; var init_DeleteBucketReplicationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketReplicationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketReplicationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketReplication", {}).n("S3Client", "DeleteBucketReplicationCommand").sc(DeleteBucketReplication$).build() { }; __name(DeleteBucketReplicationCommand, "DeleteBucketReplicationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketTaggingCommand.js var DeleteBucketTaggingCommand; var init_DeleteBucketTaggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketTaggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketTaggingCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketTagging", {}).n("S3Client", "DeleteBucketTaggingCommand").sc(DeleteBucketTagging$).build() { }; __name(DeleteBucketTaggingCommand, "DeleteBucketTaggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketWebsiteCommand.js var DeleteBucketWebsiteCommand; var init_DeleteBucketWebsiteCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketWebsiteCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteBucketWebsiteCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeleteBucketWebsite", {}).n("S3Client", "DeleteBucketWebsiteCommand").sc(DeleteBucketWebsite$).build() { }; __name(DeleteBucketWebsiteCommand, "DeleteBucketWebsiteCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectCommand.js var DeleteObjectCommand; var init_DeleteObjectCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteObjectCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "DeleteObject", {}).n("S3Client", "DeleteObjectCommand").sc(DeleteObject$).build() { }; __name(DeleteObjectCommand, "DeleteObjectCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectsCommand.js var DeleteObjectsCommand; var init_DeleteObjectsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteObjectsCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "DeleteObjects", {}).n("S3Client", "DeleteObjectsCommand").sc(DeleteObjects$).build() { }; __name(DeleteObjectsCommand, "DeleteObjectsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectTaggingCommand.js var DeleteObjectTaggingCommand; var init_DeleteObjectTaggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectTaggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeleteObjectTaggingCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "DeleteObjectTagging", {}).n("S3Client", "DeleteObjectTaggingCommand").sc(DeleteObjectTagging$).build() { }; __name(DeleteObjectTaggingCommand, "DeleteObjectTaggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeletePublicAccessBlockCommand.js var DeletePublicAccessBlockCommand; var init_DeletePublicAccessBlockCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/DeletePublicAccessBlockCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); DeletePublicAccessBlockCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "DeletePublicAccessBlock", {}).n("S3Client", "DeletePublicAccessBlockCommand").sc(DeletePublicAccessBlock$).build() { }; __name(DeletePublicAccessBlockCommand, "DeletePublicAccessBlockCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAbacCommand.js var GetBucketAbacCommand; var init_GetBucketAbacCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAbacCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketAbacCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketAbac", {}).n("S3Client", "GetBucketAbacCommand").sc(GetBucketAbac$).build() { }; __name(GetBucketAbacCommand, "GetBucketAbacCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAccelerateConfigurationCommand.js var GetBucketAccelerateConfigurationCommand; var init_GetBucketAccelerateConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAccelerateConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketAccelerateConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketAccelerateConfiguration", {}).n("S3Client", "GetBucketAccelerateConfigurationCommand").sc(GetBucketAccelerateConfiguration$).build() { }; __name(GetBucketAccelerateConfigurationCommand, "GetBucketAccelerateConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAclCommand.js var GetBucketAclCommand; var init_GetBucketAclCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAclCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketAclCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketAcl", {}).n("S3Client", "GetBucketAclCommand").sc(GetBucketAcl$).build() { }; __name(GetBucketAclCommand, "GetBucketAclCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAnalyticsConfigurationCommand.js var GetBucketAnalyticsConfigurationCommand; var init_GetBucketAnalyticsConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAnalyticsConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketAnalyticsConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketAnalyticsConfiguration", {}).n("S3Client", "GetBucketAnalyticsConfigurationCommand").sc(GetBucketAnalyticsConfiguration$).build() { }; __name(GetBucketAnalyticsConfigurationCommand, "GetBucketAnalyticsConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketCorsCommand.js var GetBucketCorsCommand; var init_GetBucketCorsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketCorsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketCorsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketCors", {}).n("S3Client", "GetBucketCorsCommand").sc(GetBucketCors$).build() { }; __name(GetBucketCorsCommand, "GetBucketCorsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketEncryptionCommand.js var GetBucketEncryptionCommand; var init_GetBucketEncryptionCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketEncryptionCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketEncryptionCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketEncryption", {}).n("S3Client", "GetBucketEncryptionCommand").sc(GetBucketEncryption$).build() { }; __name(GetBucketEncryptionCommand, "GetBucketEncryptionCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketIntelligentTieringConfigurationCommand.js var GetBucketIntelligentTieringConfigurationCommand; var init_GetBucketIntelligentTieringConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketIntelligentTieringConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketIntelligentTieringConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketIntelligentTieringConfiguration", {}).n("S3Client", "GetBucketIntelligentTieringConfigurationCommand").sc(GetBucketIntelligentTieringConfiguration$).build() { }; __name(GetBucketIntelligentTieringConfigurationCommand, "GetBucketIntelligentTieringConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketInventoryConfigurationCommand.js var GetBucketInventoryConfigurationCommand; var init_GetBucketInventoryConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketInventoryConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketInventoryConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketInventoryConfiguration", {}).n("S3Client", "GetBucketInventoryConfigurationCommand").sc(GetBucketInventoryConfiguration$).build() { }; __name(GetBucketInventoryConfigurationCommand, "GetBucketInventoryConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLifecycleConfigurationCommand.js var GetBucketLifecycleConfigurationCommand; var init_GetBucketLifecycleConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLifecycleConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketLifecycleConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketLifecycleConfiguration", {}).n("S3Client", "GetBucketLifecycleConfigurationCommand").sc(GetBucketLifecycleConfiguration$).build() { }; __name(GetBucketLifecycleConfigurationCommand, "GetBucketLifecycleConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLocationCommand.js var GetBucketLocationCommand; var init_GetBucketLocationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLocationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketLocationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketLocation", {}).n("S3Client", "GetBucketLocationCommand").sc(GetBucketLocation$).build() { }; __name(GetBucketLocationCommand, "GetBucketLocationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLoggingCommand.js var GetBucketLoggingCommand; var init_GetBucketLoggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLoggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketLoggingCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketLogging", {}).n("S3Client", "GetBucketLoggingCommand").sc(GetBucketLogging$).build() { }; __name(GetBucketLoggingCommand, "GetBucketLoggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetadataConfigurationCommand.js var GetBucketMetadataConfigurationCommand; var init_GetBucketMetadataConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetadataConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketMetadataConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketMetadataConfiguration", {}).n("S3Client", "GetBucketMetadataConfigurationCommand").sc(GetBucketMetadataConfiguration$).build() { }; __name(GetBucketMetadataConfigurationCommand, "GetBucketMetadataConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetadataTableConfigurationCommand.js var GetBucketMetadataTableConfigurationCommand; var init_GetBucketMetadataTableConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetadataTableConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketMetadataTableConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketMetadataTableConfiguration", {}).n("S3Client", "GetBucketMetadataTableConfigurationCommand").sc(GetBucketMetadataTableConfiguration$).build() { }; __name(GetBucketMetadataTableConfigurationCommand, "GetBucketMetadataTableConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetricsConfigurationCommand.js var GetBucketMetricsConfigurationCommand; var init_GetBucketMetricsConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetricsConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketMetricsConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketMetricsConfiguration", {}).n("S3Client", "GetBucketMetricsConfigurationCommand").sc(GetBucketMetricsConfiguration$).build() { }; __name(GetBucketMetricsConfigurationCommand, "GetBucketMetricsConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketNotificationConfigurationCommand.js var GetBucketNotificationConfigurationCommand; var init_GetBucketNotificationConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketNotificationConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketNotificationConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketNotificationConfiguration", {}).n("S3Client", "GetBucketNotificationConfigurationCommand").sc(GetBucketNotificationConfiguration$).build() { }; __name(GetBucketNotificationConfigurationCommand, "GetBucketNotificationConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketOwnershipControlsCommand.js var GetBucketOwnershipControlsCommand; var init_GetBucketOwnershipControlsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketOwnershipControlsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketOwnershipControlsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketOwnershipControls", {}).n("S3Client", "GetBucketOwnershipControlsCommand").sc(GetBucketOwnershipControls$).build() { }; __name(GetBucketOwnershipControlsCommand, "GetBucketOwnershipControlsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyCommand.js var GetBucketPolicyCommand; var init_GetBucketPolicyCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketPolicyCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketPolicy", {}).n("S3Client", "GetBucketPolicyCommand").sc(GetBucketPolicy$).build() { }; __name(GetBucketPolicyCommand, "GetBucketPolicyCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyStatusCommand.js var GetBucketPolicyStatusCommand; var init_GetBucketPolicyStatusCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyStatusCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketPolicyStatusCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketPolicyStatus", {}).n("S3Client", "GetBucketPolicyStatusCommand").sc(GetBucketPolicyStatus$).build() { }; __name(GetBucketPolicyStatusCommand, "GetBucketPolicyStatusCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketReplicationCommand.js var GetBucketReplicationCommand; var init_GetBucketReplicationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketReplicationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketReplicationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketReplication", {}).n("S3Client", "GetBucketReplicationCommand").sc(GetBucketReplication$).build() { }; __name(GetBucketReplicationCommand, "GetBucketReplicationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketRequestPaymentCommand.js var GetBucketRequestPaymentCommand; var init_GetBucketRequestPaymentCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketRequestPaymentCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketRequestPaymentCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketRequestPayment", {}).n("S3Client", "GetBucketRequestPaymentCommand").sc(GetBucketRequestPayment$).build() { }; __name(GetBucketRequestPaymentCommand, "GetBucketRequestPaymentCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketTaggingCommand.js var GetBucketTaggingCommand; var init_GetBucketTaggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketTaggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketTaggingCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketTagging", {}).n("S3Client", "GetBucketTaggingCommand").sc(GetBucketTagging$).build() { }; __name(GetBucketTaggingCommand, "GetBucketTaggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketVersioningCommand.js var GetBucketVersioningCommand; var init_GetBucketVersioningCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketVersioningCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketVersioningCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketVersioning", {}).n("S3Client", "GetBucketVersioningCommand").sc(GetBucketVersioning$).build() { }; __name(GetBucketVersioningCommand, "GetBucketVersioningCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketWebsiteCommand.js var GetBucketWebsiteCommand; var init_GetBucketWebsiteCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketWebsiteCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetBucketWebsiteCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetBucketWebsite", {}).n("S3Client", "GetBucketWebsiteCommand").sc(GetBucketWebsite$).build() { }; __name(GetBucketWebsiteCommand, "GetBucketWebsiteCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAclCommand.js var GetObjectAclCommand; var init_GetObjectAclCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAclCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectAclCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetObjectAcl", {}).n("S3Client", "GetObjectAclCommand").sc(GetObjectAcl$).build() { }; __name(GetObjectAclCommand, "GetObjectAclCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAttributesCommand.js var GetObjectAttributesCommand; var init_GetObjectAttributesCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAttributesCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectAttributesCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "GetObjectAttributes", {}).n("S3Client", "GetObjectAttributesCommand").sc(GetObjectAttributes$).build() { }; __name(GetObjectAttributesCommand, "GetObjectAttributesCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectCommand.js var GetObjectCommand; var init_GetObjectCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestChecksumRequired: false, requestValidationModeMember: "ChecksumMode", "responseAlgorithms": ["CRC64NVME", "CRC32", "CRC32C", "SHA256", "SHA1"] }), getSsecPlugin(config3), getS3ExpiresMiddlewarePlugin(config3) ]; }).s("AmazonS3", "GetObject", {}).n("S3Client", "GetObjectCommand").sc(GetObject$).build() { }; __name(GetObjectCommand, "GetObjectCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLegalHoldCommand.js var GetObjectLegalHoldCommand; var init_GetObjectLegalHoldCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLegalHoldCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectLegalHoldCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetObjectLegalHold", {}).n("S3Client", "GetObjectLegalHoldCommand").sc(GetObjectLegalHold$).build() { }; __name(GetObjectLegalHoldCommand, "GetObjectLegalHoldCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLockConfigurationCommand.js var GetObjectLockConfigurationCommand; var init_GetObjectLockConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLockConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectLockConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetObjectLockConfiguration", {}).n("S3Client", "GetObjectLockConfigurationCommand").sc(GetObjectLockConfiguration$).build() { }; __name(GetObjectLockConfigurationCommand, "GetObjectLockConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectRetentionCommand.js var GetObjectRetentionCommand; var init_GetObjectRetentionCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectRetentionCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectRetentionCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetObjectRetention", {}).n("S3Client", "GetObjectRetentionCommand").sc(GetObjectRetention$).build() { }; __name(GetObjectRetentionCommand, "GetObjectRetentionCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTaggingCommand.js var GetObjectTaggingCommand; var init_GetObjectTaggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTaggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectTaggingCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetObjectTagging", {}).n("S3Client", "GetObjectTaggingCommand").sc(GetObjectTagging$).build() { }; __name(GetObjectTaggingCommand, "GetObjectTaggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTorrentCommand.js var GetObjectTorrentCommand; var init_GetObjectTorrentCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTorrentCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetObjectTorrentCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "GetObjectTorrent", {}).n("S3Client", "GetObjectTorrentCommand").sc(GetObjectTorrent$).build() { }; __name(GetObjectTorrentCommand, "GetObjectTorrentCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetPublicAccessBlockCommand.js var GetPublicAccessBlockCommand; var init_GetPublicAccessBlockCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/GetPublicAccessBlockCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); GetPublicAccessBlockCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "GetPublicAccessBlock", {}).n("S3Client", "GetPublicAccessBlockCommand").sc(GetPublicAccessBlock$).build() { }; __name(GetPublicAccessBlockCommand, "GetPublicAccessBlockCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/HeadBucketCommand.js var HeadBucketCommand; var init_HeadBucketCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/HeadBucketCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); HeadBucketCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "HeadBucket", {}).n("S3Client", "HeadBucketCommand").sc(HeadBucket$).build() { }; __name(HeadBucketCommand, "HeadBucketCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/HeadObjectCommand.js var HeadObjectCommand; var init_HeadObjectCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/HeadObjectCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); HeadObjectCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3), getS3ExpiresMiddlewarePlugin(config3) ]; }).s("AmazonS3", "HeadObject", {}).n("S3Client", "HeadObjectCommand").sc(HeadObject$).build() { }; __name(HeadObjectCommand, "HeadObjectCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketAnalyticsConfigurationsCommand.js var ListBucketAnalyticsConfigurationsCommand; var init_ListBucketAnalyticsConfigurationsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketAnalyticsConfigurationsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListBucketAnalyticsConfigurationsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListBucketAnalyticsConfigurations", {}).n("S3Client", "ListBucketAnalyticsConfigurationsCommand").sc(ListBucketAnalyticsConfigurations$).build() { }; __name(ListBucketAnalyticsConfigurationsCommand, "ListBucketAnalyticsConfigurationsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketIntelligentTieringConfigurationsCommand.js var ListBucketIntelligentTieringConfigurationsCommand; var init_ListBucketIntelligentTieringConfigurationsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketIntelligentTieringConfigurationsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListBucketIntelligentTieringConfigurationsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListBucketIntelligentTieringConfigurations", {}).n("S3Client", "ListBucketIntelligentTieringConfigurationsCommand").sc(ListBucketIntelligentTieringConfigurations$).build() { }; __name(ListBucketIntelligentTieringConfigurationsCommand, "ListBucketIntelligentTieringConfigurationsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketInventoryConfigurationsCommand.js var ListBucketInventoryConfigurationsCommand; var init_ListBucketInventoryConfigurationsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketInventoryConfigurationsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListBucketInventoryConfigurationsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListBucketInventoryConfigurations", {}).n("S3Client", "ListBucketInventoryConfigurationsCommand").sc(ListBucketInventoryConfigurations$).build() { }; __name(ListBucketInventoryConfigurationsCommand, "ListBucketInventoryConfigurationsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketMetricsConfigurationsCommand.js var ListBucketMetricsConfigurationsCommand; var init_ListBucketMetricsConfigurationsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketMetricsConfigurationsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListBucketMetricsConfigurationsCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListBucketMetricsConfigurations", {}).n("S3Client", "ListBucketMetricsConfigurationsCommand").sc(ListBucketMetricsConfigurations$).build() { }; __name(ListBucketMetricsConfigurationsCommand, "ListBucketMetricsConfigurationsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketsCommand.js var ListBucketsCommand; var init_ListBucketsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListBucketsCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListBuckets", {}).n("S3Client", "ListBucketsCommand").sc(ListBuckets$).build() { }; __name(ListBucketsCommand, "ListBucketsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListDirectoryBucketsCommand.js var ListDirectoryBucketsCommand; var init_ListDirectoryBucketsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListDirectoryBucketsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListDirectoryBucketsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListDirectoryBuckets", {}).n("S3Client", "ListDirectoryBucketsCommand").sc(ListDirectoryBuckets$).build() { }; __name(ListDirectoryBucketsCommand, "ListDirectoryBucketsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListMultipartUploadsCommand.js var ListMultipartUploadsCommand; var init_ListMultipartUploadsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListMultipartUploadsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListMultipartUploadsCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Prefix: { type: "contextParams", name: "Prefix" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListMultipartUploads", {}).n("S3Client", "ListMultipartUploadsCommand").sc(ListMultipartUploads$).build() { }; __name(ListMultipartUploadsCommand, "ListMultipartUploadsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsCommand.js var ListObjectsCommand; var init_ListObjectsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListObjectsCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Prefix: { type: "contextParams", name: "Prefix" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListObjects", {}).n("S3Client", "ListObjectsCommand").sc(ListObjects$).build() { }; __name(ListObjectsCommand, "ListObjectsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsV2Command.js var ListObjectsV2Command; var init_ListObjectsV2Command = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsV2Command.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListObjectsV2Command = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Prefix: { type: "contextParams", name: "Prefix" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListObjectsV2", {}).n("S3Client", "ListObjectsV2Command").sc(ListObjectsV2$).build() { }; __name(ListObjectsV2Command, "ListObjectsV2Command"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectVersionsCommand.js var ListObjectVersionsCommand; var init_ListObjectVersionsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectVersionsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListObjectVersionsCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Prefix: { type: "contextParams", name: "Prefix" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "ListObjectVersions", {}).n("S3Client", "ListObjectVersionsCommand").sc(ListObjectVersions$).build() { }; __name(ListObjectVersionsCommand, "ListObjectVersionsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListPartsCommand.js var ListPartsCommand; var init_ListPartsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/ListPartsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); ListPartsCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "ListParts", {}).n("S3Client", "ListPartsCommand").sc(ListParts$).build() { }; __name(ListPartsCommand, "ListPartsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAbacCommand.js var PutBucketAbacCommand; var init_PutBucketAbacCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAbacCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketAbacCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: false }) ]; }).s("AmazonS3", "PutBucketAbac", {}).n("S3Client", "PutBucketAbacCommand").sc(PutBucketAbac$).build() { }; __name(PutBucketAbacCommand, "PutBucketAbacCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAccelerateConfigurationCommand.js var PutBucketAccelerateConfigurationCommand; var init_PutBucketAccelerateConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAccelerateConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketAccelerateConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: false }) ]; }).s("AmazonS3", "PutBucketAccelerateConfiguration", {}).n("S3Client", "PutBucketAccelerateConfigurationCommand").sc(PutBucketAccelerateConfiguration$).build() { }; __name(PutBucketAccelerateConfigurationCommand, "PutBucketAccelerateConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAclCommand.js var PutBucketAclCommand; var init_PutBucketAclCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAclCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketAclCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketAcl", {}).n("S3Client", "PutBucketAclCommand").sc(PutBucketAcl$).build() { }; __name(PutBucketAclCommand, "PutBucketAclCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAnalyticsConfigurationCommand.js var PutBucketAnalyticsConfigurationCommand; var init_PutBucketAnalyticsConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAnalyticsConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketAnalyticsConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "PutBucketAnalyticsConfiguration", {}).n("S3Client", "PutBucketAnalyticsConfigurationCommand").sc(PutBucketAnalyticsConfiguration$).build() { }; __name(PutBucketAnalyticsConfigurationCommand, "PutBucketAnalyticsConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketCorsCommand.js var PutBucketCorsCommand; var init_PutBucketCorsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketCorsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketCorsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketCors", {}).n("S3Client", "PutBucketCorsCommand").sc(PutBucketCors$).build() { }; __name(PutBucketCorsCommand, "PutBucketCorsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketEncryptionCommand.js var PutBucketEncryptionCommand; var init_PutBucketEncryptionCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketEncryptionCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketEncryptionCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketEncryption", {}).n("S3Client", "PutBucketEncryptionCommand").sc(PutBucketEncryption$).build() { }; __name(PutBucketEncryptionCommand, "PutBucketEncryptionCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketIntelligentTieringConfigurationCommand.js var PutBucketIntelligentTieringConfigurationCommand; var init_PutBucketIntelligentTieringConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketIntelligentTieringConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketIntelligentTieringConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "PutBucketIntelligentTieringConfiguration", {}).n("S3Client", "PutBucketIntelligentTieringConfigurationCommand").sc(PutBucketIntelligentTieringConfiguration$).build() { }; __name(PutBucketIntelligentTieringConfigurationCommand, "PutBucketIntelligentTieringConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketInventoryConfigurationCommand.js var PutBucketInventoryConfigurationCommand; var init_PutBucketInventoryConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketInventoryConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketInventoryConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "PutBucketInventoryConfiguration", {}).n("S3Client", "PutBucketInventoryConfigurationCommand").sc(PutBucketInventoryConfiguration$).build() { }; __name(PutBucketInventoryConfigurationCommand, "PutBucketInventoryConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLifecycleConfigurationCommand.js var PutBucketLifecycleConfigurationCommand; var init_PutBucketLifecycleConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLifecycleConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketLifecycleConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "PutBucketLifecycleConfiguration", {}).n("S3Client", "PutBucketLifecycleConfigurationCommand").sc(PutBucketLifecycleConfiguration$).build() { }; __name(PutBucketLifecycleConfigurationCommand, "PutBucketLifecycleConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLoggingCommand.js var PutBucketLoggingCommand; var init_PutBucketLoggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLoggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketLoggingCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketLogging", {}).n("S3Client", "PutBucketLoggingCommand").sc(PutBucketLogging$).build() { }; __name(PutBucketLoggingCommand, "PutBucketLoggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketMetricsConfigurationCommand.js var PutBucketMetricsConfigurationCommand; var init_PutBucketMetricsConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketMetricsConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketMetricsConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "PutBucketMetricsConfiguration", {}).n("S3Client", "PutBucketMetricsConfigurationCommand").sc(PutBucketMetricsConfiguration$).build() { }; __name(PutBucketMetricsConfigurationCommand, "PutBucketMetricsConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketNotificationConfigurationCommand.js var PutBucketNotificationConfigurationCommand; var init_PutBucketNotificationConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketNotificationConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketNotificationConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "PutBucketNotificationConfiguration", {}).n("S3Client", "PutBucketNotificationConfigurationCommand").sc(PutBucketNotificationConfiguration$).build() { }; __name(PutBucketNotificationConfigurationCommand, "PutBucketNotificationConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketOwnershipControlsCommand.js var PutBucketOwnershipControlsCommand; var init_PutBucketOwnershipControlsCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketOwnershipControlsCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketOwnershipControlsCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketOwnershipControls", {}).n("S3Client", "PutBucketOwnershipControlsCommand").sc(PutBucketOwnershipControls$).build() { }; __name(PutBucketOwnershipControlsCommand, "PutBucketOwnershipControlsCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketPolicyCommand.js var PutBucketPolicyCommand; var init_PutBucketPolicyCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketPolicyCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketPolicyCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketPolicy", {}).n("S3Client", "PutBucketPolicyCommand").sc(PutBucketPolicy$).build() { }; __name(PutBucketPolicyCommand, "PutBucketPolicyCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketReplicationCommand.js var PutBucketReplicationCommand; var init_PutBucketReplicationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketReplicationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketReplicationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketReplication", {}).n("S3Client", "PutBucketReplicationCommand").sc(PutBucketReplication$).build() { }; __name(PutBucketReplicationCommand, "PutBucketReplicationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketRequestPaymentCommand.js var PutBucketRequestPaymentCommand; var init_PutBucketRequestPaymentCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketRequestPaymentCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketRequestPaymentCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketRequestPayment", {}).n("S3Client", "PutBucketRequestPaymentCommand").sc(PutBucketRequestPayment$).build() { }; __name(PutBucketRequestPaymentCommand, "PutBucketRequestPaymentCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketTaggingCommand.js var PutBucketTaggingCommand; var init_PutBucketTaggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketTaggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketTaggingCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketTagging", {}).n("S3Client", "PutBucketTaggingCommand").sc(PutBucketTagging$).build() { }; __name(PutBucketTaggingCommand, "PutBucketTaggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketVersioningCommand.js var PutBucketVersioningCommand; var init_PutBucketVersioningCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketVersioningCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketVersioningCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketVersioning", {}).n("S3Client", "PutBucketVersioningCommand").sc(PutBucketVersioning$).build() { }; __name(PutBucketVersioningCommand, "PutBucketVersioningCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketWebsiteCommand.js var PutBucketWebsiteCommand; var init_PutBucketWebsiteCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketWebsiteCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutBucketWebsiteCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutBucketWebsite", {}).n("S3Client", "PutBucketWebsiteCommand").sc(PutBucketWebsite$).build() { }; __name(PutBucketWebsiteCommand, "PutBucketWebsiteCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectAclCommand.js var PutObjectAclCommand; var init_PutObjectAclCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectAclCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutObjectAclCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "PutObjectAcl", {}).n("S3Client", "PutObjectAclCommand").sc(PutObjectAcl$).build() { }; __name(PutObjectAclCommand, "PutObjectAclCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectCommand.js var PutObjectCommand; var init_PutObjectCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutObjectCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: false }), getCheckContentLengthHeaderPlugin(config3), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "PutObject", {}).n("S3Client", "PutObjectCommand").sc(PutObject$).build() { }; __name(PutObjectCommand, "PutObjectCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLegalHoldCommand.js var PutObjectLegalHoldCommand; var init_PutObjectLegalHoldCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLegalHoldCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutObjectLegalHoldCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "PutObjectLegalHold", {}).n("S3Client", "PutObjectLegalHoldCommand").sc(PutObjectLegalHold$).build() { }; __name(PutObjectLegalHoldCommand, "PutObjectLegalHoldCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLockConfigurationCommand.js var PutObjectLockConfigurationCommand; var init_PutObjectLockConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLockConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutObjectLockConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "PutObjectLockConfiguration", {}).n("S3Client", "PutObjectLockConfigurationCommand").sc(PutObjectLockConfiguration$).build() { }; __name(PutObjectLockConfigurationCommand, "PutObjectLockConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectRetentionCommand.js var PutObjectRetentionCommand; var init_PutObjectRetentionCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectRetentionCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutObjectRetentionCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "PutObjectRetention", {}).n("S3Client", "PutObjectRetentionCommand").sc(PutObjectRetention$).build() { }; __name(PutObjectRetentionCommand, "PutObjectRetentionCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectTaggingCommand.js var PutObjectTaggingCommand; var init_PutObjectTaggingCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectTaggingCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutObjectTaggingCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "PutObjectTagging", {}).n("S3Client", "PutObjectTaggingCommand").sc(PutObjectTagging$).build() { }; __name(PutObjectTaggingCommand, "PutObjectTaggingCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutPublicAccessBlockCommand.js var PutPublicAccessBlockCommand; var init_PutPublicAccessBlockCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/PutPublicAccessBlockCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); PutPublicAccessBlockCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "PutPublicAccessBlock", {}).n("S3Client", "PutPublicAccessBlockCommand").sc(PutPublicAccessBlock$).build() { }; __name(PutPublicAccessBlockCommand, "PutPublicAccessBlockCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/RenameObjectCommand.js var RenameObjectCommand; var init_RenameObjectCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/RenameObjectCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); RenameObjectCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "RenameObject", {}).n("S3Client", "RenameObjectCommand").sc(RenameObject$).build() { }; __name(RenameObjectCommand, "RenameObjectCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/RestoreObjectCommand.js var RestoreObjectCommand; var init_RestoreObjectCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/RestoreObjectCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); RestoreObjectCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: false }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "RestoreObject", {}).n("S3Client", "RestoreObjectCommand").sc(RestoreObject$).build() { }; __name(RestoreObjectCommand, "RestoreObjectCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/SelectObjectContentCommand.js var SelectObjectContentCommand; var init_SelectObjectContentCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/SelectObjectContentCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); SelectObjectContentCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "SelectObjectContent", { eventStream: { output: true } }).n("S3Client", "SelectObjectContentCommand").sc(SelectObjectContent$).build() { }; __name(SelectObjectContentCommand, "SelectObjectContentCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateBucketMetadataInventoryTableConfigurationCommand.js var UpdateBucketMetadataInventoryTableConfigurationCommand; var init_UpdateBucketMetadataInventoryTableConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateBucketMetadataInventoryTableConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); UpdateBucketMetadataInventoryTableConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "UpdateBucketMetadataInventoryTableConfiguration", {}).n("S3Client", "UpdateBucketMetadataInventoryTableConfigurationCommand").sc(UpdateBucketMetadataInventoryTableConfiguration$).build() { }; __name(UpdateBucketMetadataInventoryTableConfigurationCommand, "UpdateBucketMetadataInventoryTableConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateBucketMetadataJournalTableConfigurationCommand.js var UpdateBucketMetadataJournalTableConfigurationCommand; var init_UpdateBucketMetadataJournalTableConfigurationCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateBucketMetadataJournalTableConfigurationCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); UpdateBucketMetadataJournalTableConfigurationCommand = class extends Command.classBuilder().ep({ ...commonParams, UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }) ]; }).s("AmazonS3", "UpdateBucketMetadataJournalTableConfiguration", {}).n("S3Client", "UpdateBucketMetadataJournalTableConfigurationCommand").sc(UpdateBucketMetadataJournalTableConfiguration$).build() { }; __name(UpdateBucketMetadataJournalTableConfigurationCommand, "UpdateBucketMetadataJournalTableConfigurationCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateObjectEncryptionCommand.js var UpdateObjectEncryptionCommand; var init_UpdateObjectEncryptionCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateObjectEncryptionCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); UpdateObjectEncryptionCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: true }), getThrow200ExceptionsPlugin(config3) ]; }).s("AmazonS3", "UpdateObjectEncryption", {}).n("S3Client", "UpdateObjectEncryptionCommand").sc(UpdateObjectEncryption$).build() { }; __name(UpdateObjectEncryptionCommand, "UpdateObjectEncryptionCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCommand.js var UploadPartCommand; var init_UploadPartCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es26(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); UploadPartCommand = class extends Command.classBuilder().ep({ ...commonParams, Bucket: { type: "contextParams", name: "Bucket" }, Key: { type: "contextParams", name: "Key" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config3, { requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, requestChecksumRequired: false }), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "UploadPart", {}).n("S3Client", "UploadPartCommand").sc(UploadPart$).build() { }; __name(UploadPartCommand, "UploadPartCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCopyCommand.js var UploadPartCopyCommand; var init_UploadPartCopyCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCopyCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es31(); init_dist_es56(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); UploadPartCopyCommand = class extends Command.classBuilder().ep({ ...commonParams, DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, Bucket: { type: "contextParams", name: "Bucket" } }).m(function(Command2, cs2, config3, o2) { return [ getEndpointPlugin(config3, Command2.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config3), getSsecPlugin(config3) ]; }).s("AmazonS3", "UploadPartCopy", {}).n("S3Client", "UploadPartCopyCommand").sc(UploadPartCopy$).build() { }; __name(UploadPartCopyCommand, "UploadPartCopyCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/WriteGetObjectResponseCommand.js var WriteGetObjectResponseCommand; var init_WriteGetObjectResponseCommand = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/WriteGetObjectResponseCommand.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es41(); init_dist_es21(); init_EndpointParameters(); init_schemas_0(); WriteGetObjectResponseCommand = class extends Command.classBuilder().ep({ ...commonParams, UseObjectLambdaEndpoint: { type: "staticContextParams", value: true } }).m(function(Command2, cs2, config3, o2) { return [getEndpointPlugin(config3, Command2.getEndpointParameterInstructions())]; }).s("AmazonS3", "WriteGetObjectResponse", {}).n("S3Client", "WriteGetObjectResponseCommand").sc(WriteGetObjectResponse$).build() { }; __name(WriteGetObjectResponseCommand, "WriteGetObjectResponseCommand"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListBucketsPaginator.js var paginateListBuckets; var init_ListBucketsPaginator = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListBucketsPaginator.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); init_ListBucketsCommand(); init_S3Client(); paginateListBuckets = createPaginator(S3Client, ListBucketsCommand, "ContinuationToken", "ContinuationToken", "MaxBuckets"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListDirectoryBucketsPaginator.js var paginateListDirectoryBuckets; var init_ListDirectoryBucketsPaginator = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListDirectoryBucketsPaginator.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); init_ListDirectoryBucketsCommand(); init_S3Client(); paginateListDirectoryBuckets = createPaginator(S3Client, ListDirectoryBucketsCommand, "ContinuationToken", "ContinuationToken", "MaxDirectoryBuckets"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListObjectsV2Paginator.js var paginateListObjectsV2; var init_ListObjectsV2Paginator = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListObjectsV2Paginator.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); init_ListObjectsV2Command(); init_S3Client(); paginateListObjectsV2 = createPaginator(S3Client, ListObjectsV2Command, "ContinuationToken", "NextContinuationToken", "MaxKeys"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListPartsPaginator.js var paginateListParts; var init_ListPartsPaginator = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/pagination/ListPartsPaginator.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es15(); init_ListPartsCommand(); init_S3Client(); paginateListParts = createPaginator(S3Client, ListPartsCommand, "PartNumberMarker", "NextPartNumberMarker", "MaxParts"); } }); // ../../node_modules/@smithy/util-waiter/dist-es/circularReplacer.js var getCircularReplacer; var init_circularReplacer = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/circularReplacer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); getCircularReplacer = /* @__PURE__ */ __name(() => { const seen = /* @__PURE__ */ new WeakSet(); return (key, value) => { if (typeof value === "object" && value !== null) { if (seen.has(value)) { return "[Circular]"; } seen.add(value); } return value; }; }, "getCircularReplacer"); } }); // ../../node_modules/@smithy/util-waiter/dist-es/utils/sleep.js var sleep; var init_sleep = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/utils/sleep.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); sleep = /* @__PURE__ */ __name((seconds) => { return new Promise((resolve) => setTimeout(resolve, seconds * 1e3)); }, "sleep"); } }); // ../../node_modules/@smithy/util-waiter/dist-es/waiter.js var waiterServiceDefaults, WaiterState, checkExceptions; var init_waiter2 = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/waiter.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_circularReplacer(); waiterServiceDefaults = { minDelay: 2, maxDelay: 120 }; (function(WaiterState2) { WaiterState2["ABORTED"] = "ABORTED"; WaiterState2["FAILURE"] = "FAILURE"; WaiterState2["SUCCESS"] = "SUCCESS"; WaiterState2["RETRY"] = "RETRY"; WaiterState2["TIMEOUT"] = "TIMEOUT"; })(WaiterState || (WaiterState = {})); checkExceptions = /* @__PURE__ */ __name((result) => { if (result.state === WaiterState.ABORTED) { const abortError = new Error(`${JSON.stringify({ ...result, reason: "Request was aborted" }, getCircularReplacer())}`); abortError.name = "AbortError"; throw abortError; } else if (result.state === WaiterState.TIMEOUT) { const timeoutError = new Error(`${JSON.stringify({ ...result, reason: "Waiter has timed out" }, getCircularReplacer())}`); timeoutError.name = "TimeoutError"; throw timeoutError; } else if (result.state !== WaiterState.SUCCESS) { throw new Error(`${JSON.stringify(result, getCircularReplacer())}`); } return result; }, "checkExceptions"); } }); // ../../node_modules/@smithy/util-waiter/dist-es/poller.js var exponentialBackoffWithJitter, randomInRange, runPolling, createMessageFromResponse; var init_poller = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/poller.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_circularReplacer(); init_sleep(); init_waiter2(); exponentialBackoffWithJitter = /* @__PURE__ */ __name((minDelay, maxDelay, attemptCeiling, attempt) => { if (attempt > attemptCeiling) return maxDelay; const delay = minDelay * 2 ** (attempt - 1); return randomInRange(minDelay, delay); }, "exponentialBackoffWithJitter"); randomInRange = /* @__PURE__ */ __name((min, max2) => min + Math.random() * (max2 - min), "randomInRange"); runPolling = /* @__PURE__ */ __name(async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => { const observedResponses = {}; const { state, reason } = await acceptorChecks(client, input); if (reason) { const message2 = createMessageFromResponse(reason); observedResponses[message2] |= 0; observedResponses[message2] += 1; } if (state !== WaiterState.RETRY) { return { state, reason, observedResponses }; } let currentAttempt = 1; const waitUntil = Date.now() + maxWaitTime * 1e3; const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; while (true) { if (abortController?.signal?.aborted || abortSignal?.aborted) { const message2 = "AbortController signal aborted."; observedResponses[message2] |= 0; observedResponses[message2] += 1; return { state: WaiterState.ABORTED, observedResponses }; } const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt); if (Date.now() + delay * 1e3 > waitUntil) { return { state: WaiterState.TIMEOUT, observedResponses }; } await sleep(delay); const { state: state2, reason: reason2 } = await acceptorChecks(client, input); if (reason2) { const message2 = createMessageFromResponse(reason2); observedResponses[message2] |= 0; observedResponses[message2] += 1; } if (state2 !== WaiterState.RETRY) { return { state: state2, reason: reason2, observedResponses }; } currentAttempt += 1; } }, "runPolling"); createMessageFromResponse = /* @__PURE__ */ __name((reason) => { if (reason?.$responseBodyText) { return `Deserialization error for body: ${reason.$responseBodyText}`; } if (reason?.$metadata?.httpStatusCode) { if (reason.$response || reason.message) { return `${reason.$response?.statusCode ?? reason.$metadata.httpStatusCode ?? "Unknown"}: ${reason.message}`; } return `${reason.$metadata.httpStatusCode}: OK`; } return String(reason?.message ?? JSON.stringify(reason, getCircularReplacer()) ?? "Unknown"); }, "createMessageFromResponse"); } }); // ../../node_modules/@smithy/util-waiter/dist-es/utils/validate.js var validateWaiterOptions; var init_validate = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/utils/validate.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); validateWaiterOptions = /* @__PURE__ */ __name((options) => { if (options.maxWaitTime <= 0) { throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`); } else if (options.minDelay <= 0) { throw new Error(`WaiterConfiguration.minDelay must be greater than 0`); } else if (options.maxDelay <= 0) { throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`); } else if (options.maxWaitTime <= options.minDelay) { throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); } else if (options.maxDelay < options.minDelay) { throw new Error(`WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); } }, "validateWaiterOptions"); } }); // ../../node_modules/@smithy/util-waiter/dist-es/utils/index.js var init_utils7 = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/utils/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_sleep(); init_validate(); } }); // ../../node_modules/@smithy/util-waiter/dist-es/createWaiter.js var abortTimeout, createWaiter; var init_createWaiter = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/createWaiter.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_poller(); init_utils7(); init_waiter2(); abortTimeout = /* @__PURE__ */ __name((abortSignal) => { let onAbort; const promise2 = new Promise((resolve) => { onAbort = /* @__PURE__ */ __name(() => resolve({ state: WaiterState.ABORTED }), "onAbort"); if (typeof abortSignal.addEventListener === "function") { abortSignal.addEventListener("abort", onAbort); } else { abortSignal.onabort = onAbort; } }); return { clearListener() { if (typeof abortSignal.removeEventListener === "function") { abortSignal.removeEventListener("abort", onAbort); } }, aborted: promise2 }; }, "abortTimeout"); createWaiter = /* @__PURE__ */ __name(async (options, input, acceptorChecks) => { const params = { ...waiterServiceDefaults, ...options }; validateWaiterOptions(params); const exitConditions = [runPolling(params, input, acceptorChecks)]; const finalize2 = []; if (options.abortSignal) { const { aborted: aborted2, clearListener } = abortTimeout(options.abortSignal); finalize2.push(clearListener); exitConditions.push(aborted2); } if (options.abortController?.signal) { const { aborted: aborted2, clearListener } = abortTimeout(options.abortController.signal); finalize2.push(clearListener); exitConditions.push(aborted2); } return Promise.race(exitConditions).then((result) => { for (const fn of finalize2) { fn(); } return result; }); }, "createWaiter"); } }); // ../../node_modules/@smithy/util-waiter/dist-es/index.js var init_dist_es58 = __esm({ "../../node_modules/@smithy/util-waiter/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_createWaiter(); init_waiter2(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketExists.js var checkState, waitUntilBucketExists; var init_waitForBucketExists = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketExists.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es58(); init_HeadBucketCommand(); checkState = /* @__PURE__ */ __name(async (client, input) => { let reason; try { let result = await client.send(new HeadBucketCommand(input)); reason = result; return { state: WaiterState.SUCCESS, reason }; } catch (exception) { reason = exception; if (exception.name && exception.name == "NotFound") { return { state: WaiterState.RETRY, reason }; } } return { state: WaiterState.RETRY, reason }; }, "checkState"); waitUntilBucketExists = /* @__PURE__ */ __name(async (params, input) => { const serviceDefaults = { minDelay: 5, maxDelay: 120 }; const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState); return checkExceptions(result); }, "waitUntilBucketExists"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketNotExists.js var checkState2, waitUntilBucketNotExists; var init_waitForBucketNotExists = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketNotExists.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es58(); init_HeadBucketCommand(); checkState2 = /* @__PURE__ */ __name(async (client, input) => { let reason; try { let result = await client.send(new HeadBucketCommand(input)); reason = result; } catch (exception) { reason = exception; if (exception.name && exception.name == "NotFound") { return { state: WaiterState.SUCCESS, reason }; } } return { state: WaiterState.RETRY, reason }; }, "checkState"); waitUntilBucketNotExists = /* @__PURE__ */ __name(async (params, input) => { const serviceDefaults = { minDelay: 5, maxDelay: 120 }; const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState2); return checkExceptions(result); }, "waitUntilBucketNotExists"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectExists.js var checkState3, waitUntilObjectExists; var init_waitForObjectExists = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectExists.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es58(); init_HeadObjectCommand(); checkState3 = /* @__PURE__ */ __name(async (client, input) => { let reason; try { let result = await client.send(new HeadObjectCommand(input)); reason = result; return { state: WaiterState.SUCCESS, reason }; } catch (exception) { reason = exception; if (exception.name && exception.name == "NotFound") { return { state: WaiterState.RETRY, reason }; } } return { state: WaiterState.RETRY, reason }; }, "checkState"); waitUntilObjectExists = /* @__PURE__ */ __name(async (params, input) => { const serviceDefaults = { minDelay: 5, maxDelay: 120 }; const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState3); return checkExceptions(result); }, "waitUntilObjectExists"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectNotExists.js var checkState4, waitUntilObjectNotExists; var init_waitForObjectNotExists = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectNotExists.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es58(); init_HeadObjectCommand(); checkState4 = /* @__PURE__ */ __name(async (client, input) => { let reason; try { let result = await client.send(new HeadObjectCommand(input)); reason = result; } catch (exception) { reason = exception; if (exception.name && exception.name == "NotFound") { return { state: WaiterState.SUCCESS, reason }; } } return { state: WaiterState.RETRY, reason }; }, "checkState"); waitUntilObjectNotExists = /* @__PURE__ */ __name(async (params, input) => { const serviceDefaults = { minDelay: 5, maxDelay: 120 }; const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState4); return checkExceptions(result); }, "waitUntilObjectNotExists"); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/S3.js var commands, paginators, waiters, S3; var init_S3 = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/S3.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es21(); init_AbortMultipartUploadCommand(); init_CompleteMultipartUploadCommand(); init_CopyObjectCommand(); init_CreateBucketCommand(); init_CreateBucketMetadataConfigurationCommand(); init_CreateBucketMetadataTableConfigurationCommand(); init_CreateMultipartUploadCommand(); init_CreateSessionCommand(); init_DeleteBucketAnalyticsConfigurationCommand(); init_DeleteBucketCommand(); init_DeleteBucketCorsCommand(); init_DeleteBucketEncryptionCommand(); init_DeleteBucketIntelligentTieringConfigurationCommand(); init_DeleteBucketInventoryConfigurationCommand(); init_DeleteBucketLifecycleCommand(); init_DeleteBucketMetadataConfigurationCommand(); init_DeleteBucketMetadataTableConfigurationCommand(); init_DeleteBucketMetricsConfigurationCommand(); init_DeleteBucketOwnershipControlsCommand(); init_DeleteBucketPolicyCommand(); init_DeleteBucketReplicationCommand(); init_DeleteBucketTaggingCommand(); init_DeleteBucketWebsiteCommand(); init_DeleteObjectCommand(); init_DeleteObjectsCommand(); init_DeleteObjectTaggingCommand(); init_DeletePublicAccessBlockCommand(); init_GetBucketAbacCommand(); init_GetBucketAccelerateConfigurationCommand(); init_GetBucketAclCommand(); init_GetBucketAnalyticsConfigurationCommand(); init_GetBucketCorsCommand(); init_GetBucketEncryptionCommand(); init_GetBucketIntelligentTieringConfigurationCommand(); init_GetBucketInventoryConfigurationCommand(); init_GetBucketLifecycleConfigurationCommand(); init_GetBucketLocationCommand(); init_GetBucketLoggingCommand(); init_GetBucketMetadataConfigurationCommand(); init_GetBucketMetadataTableConfigurationCommand(); init_GetBucketMetricsConfigurationCommand(); init_GetBucketNotificationConfigurationCommand(); init_GetBucketOwnershipControlsCommand(); init_GetBucketPolicyCommand(); init_GetBucketPolicyStatusCommand(); init_GetBucketReplicationCommand(); init_GetBucketRequestPaymentCommand(); init_GetBucketTaggingCommand(); init_GetBucketVersioningCommand(); init_GetBucketWebsiteCommand(); init_GetObjectAclCommand(); init_GetObjectAttributesCommand(); init_GetObjectCommand(); init_GetObjectLegalHoldCommand(); init_GetObjectLockConfigurationCommand(); init_GetObjectRetentionCommand(); init_GetObjectTaggingCommand(); init_GetObjectTorrentCommand(); init_GetPublicAccessBlockCommand(); init_HeadBucketCommand(); init_HeadObjectCommand(); init_ListBucketAnalyticsConfigurationsCommand(); init_ListBucketIntelligentTieringConfigurationsCommand(); init_ListBucketInventoryConfigurationsCommand(); init_ListBucketMetricsConfigurationsCommand(); init_ListBucketsCommand(); init_ListDirectoryBucketsCommand(); init_ListMultipartUploadsCommand(); init_ListObjectsCommand(); init_ListObjectsV2Command(); init_ListObjectVersionsCommand(); init_ListPartsCommand(); init_PutBucketAbacCommand(); init_PutBucketAccelerateConfigurationCommand(); init_PutBucketAclCommand(); init_PutBucketAnalyticsConfigurationCommand(); init_PutBucketCorsCommand(); init_PutBucketEncryptionCommand(); init_PutBucketIntelligentTieringConfigurationCommand(); init_PutBucketInventoryConfigurationCommand(); init_PutBucketLifecycleConfigurationCommand(); init_PutBucketLoggingCommand(); init_PutBucketMetricsConfigurationCommand(); init_PutBucketNotificationConfigurationCommand(); init_PutBucketOwnershipControlsCommand(); init_PutBucketPolicyCommand(); init_PutBucketReplicationCommand(); init_PutBucketRequestPaymentCommand(); init_PutBucketTaggingCommand(); init_PutBucketVersioningCommand(); init_PutBucketWebsiteCommand(); init_PutObjectAclCommand(); init_PutObjectCommand(); init_PutObjectLegalHoldCommand(); init_PutObjectLockConfigurationCommand(); init_PutObjectRetentionCommand(); init_PutObjectTaggingCommand(); init_PutPublicAccessBlockCommand(); init_RenameObjectCommand(); init_RestoreObjectCommand(); init_SelectObjectContentCommand(); init_UpdateBucketMetadataInventoryTableConfigurationCommand(); init_UpdateBucketMetadataJournalTableConfigurationCommand(); init_UpdateObjectEncryptionCommand(); init_UploadPartCommand(); init_UploadPartCopyCommand(); init_WriteGetObjectResponseCommand(); init_ListBucketsPaginator(); init_ListDirectoryBucketsPaginator(); init_ListObjectsV2Paginator(); init_ListPartsPaginator(); init_S3Client(); init_waitForBucketExists(); init_waitForBucketNotExists(); init_waitForObjectExists(); init_waitForObjectNotExists(); commands = { AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CopyObjectCommand, CreateBucketCommand, CreateBucketMetadataConfigurationCommand, CreateBucketMetadataTableConfigurationCommand, CreateMultipartUploadCommand, CreateSessionCommand, DeleteBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetadataConfigurationCommand, DeleteBucketMetadataTableConfigurationCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectCommand, DeleteObjectsCommand, DeleteObjectTaggingCommand, DeletePublicAccessBlockCommand, GetBucketAbacCommand, GetBucketAccelerateConfigurationCommand, GetBucketAclCommand, GetBucketAnalyticsConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketIntelligentTieringConfigurationCommand, GetBucketInventoryConfigurationCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketMetadataConfigurationCommand, GetBucketMetadataTableConfigurationCommand, GetBucketMetricsConfigurationCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketPolicyStatusCommand, GetBucketReplicationCommand, GetBucketRequestPaymentCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectAclCommand, GetObjectAttributesCommand, GetObjectLegalHoldCommand, GetObjectLockConfigurationCommand, GetObjectRetentionCommand, GetObjectTaggingCommand, GetObjectTorrentCommand, GetPublicAccessBlockCommand, HeadBucketCommand, HeadObjectCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListBucketsCommand, ListDirectoryBucketsCommand, ListMultipartUploadsCommand, ListObjectsCommand, ListObjectsV2Command, ListObjectVersionsCommand, ListPartsCommand, PutBucketAbacCommand, PutBucketAccelerateConfigurationCommand, PutBucketAclCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketRequestPaymentCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectAclCommand, PutObjectLegalHoldCommand, PutObjectLockConfigurationCommand, PutObjectRetentionCommand, PutObjectTaggingCommand, PutPublicAccessBlockCommand, RenameObjectCommand, RestoreObjectCommand, SelectObjectContentCommand, UpdateBucketMetadataInventoryTableConfigurationCommand, UpdateBucketMetadataJournalTableConfigurationCommand, UpdateObjectEncryptionCommand, UploadPartCommand, UploadPartCopyCommand, WriteGetObjectResponseCommand }; paginators = { paginateListBuckets, paginateListDirectoryBuckets, paginateListObjectsV2, paginateListParts }; waiters = { waitUntilBucketExists, waitUntilBucketNotExists, waitUntilObjectExists, waitUntilObjectNotExists }; S3 = class extends S3Client { }; __name(S3, "S3"); createAggregatedClient(commands, S3, { paginators, waiters }); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/commands/index.js var init_commands = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/commands/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AbortMultipartUploadCommand(); init_CompleteMultipartUploadCommand(); init_CopyObjectCommand(); init_CreateBucketCommand(); init_CreateBucketMetadataConfigurationCommand(); init_CreateBucketMetadataTableConfigurationCommand(); init_CreateMultipartUploadCommand(); init_CreateSessionCommand(); init_DeleteBucketAnalyticsConfigurationCommand(); init_DeleteBucketCommand(); init_DeleteBucketCorsCommand(); init_DeleteBucketEncryptionCommand(); init_DeleteBucketIntelligentTieringConfigurationCommand(); init_DeleteBucketInventoryConfigurationCommand(); init_DeleteBucketLifecycleCommand(); init_DeleteBucketMetadataConfigurationCommand(); init_DeleteBucketMetadataTableConfigurationCommand(); init_DeleteBucketMetricsConfigurationCommand(); init_DeleteBucketOwnershipControlsCommand(); init_DeleteBucketPolicyCommand(); init_DeleteBucketReplicationCommand(); init_DeleteBucketTaggingCommand(); init_DeleteBucketWebsiteCommand(); init_DeleteObjectCommand(); init_DeleteObjectTaggingCommand(); init_DeleteObjectsCommand(); init_DeletePublicAccessBlockCommand(); init_GetBucketAbacCommand(); init_GetBucketAccelerateConfigurationCommand(); init_GetBucketAclCommand(); init_GetBucketAnalyticsConfigurationCommand(); init_GetBucketCorsCommand(); init_GetBucketEncryptionCommand(); init_GetBucketIntelligentTieringConfigurationCommand(); init_GetBucketInventoryConfigurationCommand(); init_GetBucketLifecycleConfigurationCommand(); init_GetBucketLocationCommand(); init_GetBucketLoggingCommand(); init_GetBucketMetadataConfigurationCommand(); init_GetBucketMetadataTableConfigurationCommand(); init_GetBucketMetricsConfigurationCommand(); init_GetBucketNotificationConfigurationCommand(); init_GetBucketOwnershipControlsCommand(); init_GetBucketPolicyCommand(); init_GetBucketPolicyStatusCommand(); init_GetBucketReplicationCommand(); init_GetBucketRequestPaymentCommand(); init_GetBucketTaggingCommand(); init_GetBucketVersioningCommand(); init_GetBucketWebsiteCommand(); init_GetObjectAclCommand(); init_GetObjectAttributesCommand(); init_GetObjectCommand(); init_GetObjectLegalHoldCommand(); init_GetObjectLockConfigurationCommand(); init_GetObjectRetentionCommand(); init_GetObjectTaggingCommand(); init_GetObjectTorrentCommand(); init_GetPublicAccessBlockCommand(); init_HeadBucketCommand(); init_HeadObjectCommand(); init_ListBucketAnalyticsConfigurationsCommand(); init_ListBucketIntelligentTieringConfigurationsCommand(); init_ListBucketInventoryConfigurationsCommand(); init_ListBucketMetricsConfigurationsCommand(); init_ListBucketsCommand(); init_ListDirectoryBucketsCommand(); init_ListMultipartUploadsCommand(); init_ListObjectVersionsCommand(); init_ListObjectsCommand(); init_ListObjectsV2Command(); init_ListPartsCommand(); init_PutBucketAbacCommand(); init_PutBucketAccelerateConfigurationCommand(); init_PutBucketAclCommand(); init_PutBucketAnalyticsConfigurationCommand(); init_PutBucketCorsCommand(); init_PutBucketEncryptionCommand(); init_PutBucketIntelligentTieringConfigurationCommand(); init_PutBucketInventoryConfigurationCommand(); init_PutBucketLifecycleConfigurationCommand(); init_PutBucketLoggingCommand(); init_PutBucketMetricsConfigurationCommand(); init_PutBucketNotificationConfigurationCommand(); init_PutBucketOwnershipControlsCommand(); init_PutBucketPolicyCommand(); init_PutBucketReplicationCommand(); init_PutBucketRequestPaymentCommand(); init_PutBucketTaggingCommand(); init_PutBucketVersioningCommand(); init_PutBucketWebsiteCommand(); init_PutObjectAclCommand(); init_PutObjectCommand(); init_PutObjectLegalHoldCommand(); init_PutObjectLockConfigurationCommand(); init_PutObjectRetentionCommand(); init_PutObjectTaggingCommand(); init_PutPublicAccessBlockCommand(); init_RenameObjectCommand(); init_RestoreObjectCommand(); init_SelectObjectContentCommand(); init_UpdateBucketMetadataInventoryTableConfigurationCommand(); init_UpdateBucketMetadataJournalTableConfigurationCommand(); init_UpdateObjectEncryptionCommand(); init_UploadPartCommand(); init_UploadPartCopyCommand(); init_WriteGetObjectResponseCommand(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/pagination/Interfaces.js var init_Interfaces = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/pagination/Interfaces.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/pagination/index.js var init_pagination2 = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/pagination/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_Interfaces(); init_ListBucketsPaginator(); init_ListDirectoryBucketsPaginator(); init_ListObjectsV2Paginator(); init_ListPartsPaginator(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/waiters/index.js var init_waiters = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/waiters/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_waitForBucketExists(); init_waitForBucketNotExists(); init_waitForObjectExists(); init_waitForObjectNotExists(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/models/enums.js var init_enums = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/models/enums.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/models/models_0.js var init_models_0 = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/models/models_0.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/models/models_1.js var init_models_1 = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/models/models_1.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@aws-sdk/client-s3/dist-es/index.js var init_dist_es59 = __esm({ "../../node_modules/@aws-sdk/client-s3/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_S3Client(); init_S3(); init_commands(); init_schemas_0(); init_pagination2(); init_waiters(); init_enums(); init_errors3(); init_models_0(); init_models_1(); } }); // ../../node_modules/@aws-sdk/util-format-url/dist-es/index.js function formatUrl(request) { const { port, query } = request; let { protocol, path, hostname: hostname3 } = request; if (protocol && protocol.slice(-1) !== ":") { protocol += ":"; } if (port) { hostname3 += `:${port}`; } if (path && path.charAt(0) !== "/") { path = `/${path}`; } let queryString = query ? buildQueryString(query) : ""; if (queryString && queryString[0] !== "?") { queryString = `?${queryString}`; } let auth = ""; if (request.username != null || request.password != null) { const username = request.username ?? ""; const password = request.password ?? ""; auth = `${username}:${password}@`; } let fragment = ""; if (request.fragment) { fragment = `#${request.fragment}`; } return `${protocol}//${auth}${hostname3}${path}${queryString}${fragment}`; } var init_dist_es60 = __esm({ "../../node_modules/@aws-sdk/util-format-url/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es8(); __name(formatUrl, "formatUrl"); } }); // ../../node_modules/@aws-sdk/s3-request-presigner/dist-es/constants.js var UNSIGNED_PAYLOAD2, SHA256_HEADER2; var init_constants15 = __esm({ "../../node_modules/@aws-sdk/s3-request-presigner/dist-es/constants.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); UNSIGNED_PAYLOAD2 = "UNSIGNED-PAYLOAD"; SHA256_HEADER2 = "X-Amz-Content-Sha256"; } }); // ../../node_modules/@aws-sdk/s3-request-presigner/dist-es/presigner.js var S3RequestPresigner; var init_presigner = __esm({ "../../node_modules/@aws-sdk/s3-request-presigner/dist-es/presigner.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es43(); init_constants15(); S3RequestPresigner = class { signer; constructor(options) { const resolvedOptions = { service: options.signingName || options.service || "s3", uriEscapePath: options.uriEscapePath || false, applyChecksum: options.applyChecksum || false, ...options }; this.signer = new SignatureV4MultiRegion(resolvedOptions); } presign(requestToSign, { unsignableHeaders = /* @__PURE__ */ new Set(), hoistableHeaders = /* @__PURE__ */ new Set(), unhoistableHeaders = /* @__PURE__ */ new Set(), ...options } = {}) { this.prepareRequest(requestToSign, { unsignableHeaders, unhoistableHeaders, hoistableHeaders }); return this.signer.presign(requestToSign, { expiresIn: 900, unsignableHeaders, unhoistableHeaders, ...options }); } presignWithCredentials(requestToSign, credentials, { unsignableHeaders = /* @__PURE__ */ new Set(), hoistableHeaders = /* @__PURE__ */ new Set(), unhoistableHeaders = /* @__PURE__ */ new Set(), ...options } = {}) { this.prepareRequest(requestToSign, { unsignableHeaders, unhoistableHeaders, hoistableHeaders }); return this.signer.presignWithCredentials(requestToSign, credentials, { expiresIn: 900, unsignableHeaders, unhoistableHeaders, ...options }); } prepareRequest(requestToSign, { unsignableHeaders = /* @__PURE__ */ new Set(), unhoistableHeaders = /* @__PURE__ */ new Set(), hoistableHeaders = /* @__PURE__ */ new Set() } = {}) { unsignableHeaders.add("content-type"); Object.keys(requestToSign.headers).map((header) => header.toLowerCase()).filter((header) => header.startsWith("x-amz-server-side-encryption")).forEach((header) => { if (!hoistableHeaders.has(header)) { unhoistableHeaders.add(header); } }); requestToSign.headers[SHA256_HEADER2] = UNSIGNED_PAYLOAD2; const currentHostHeader = requestToSign.headers.host; const port = requestToSign.port; const expectedHostHeader = `${requestToSign.hostname}${requestToSign.port != null ? ":" + port : ""}`; if (!currentHostHeader || currentHostHeader === requestToSign.hostname && requestToSign.port != null) { requestToSign.headers.host = expectedHostHeader; } } }; __name(S3RequestPresigner, "S3RequestPresigner"); } }); // ../../node_modules/@aws-sdk/s3-request-presigner/dist-es/getSignedUrl.js var getSignedUrl; var init_getSignedUrl = __esm({ "../../node_modules/@aws-sdk/s3-request-presigner/dist-es/getSignedUrl.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es60(); init_dist_es41(); init_dist_es2(); init_presigner(); getSignedUrl = /* @__PURE__ */ __name(async (client, command, options = {}) => { let s3Presigner; let region; if (typeof client.config.endpointProvider === "function") { const endpointV2 = await getEndpointFromInstructions(command.input, command.constructor, client.config); const authScheme = endpointV2.properties?.authSchemes?.[0]; if (authScheme?.name === "sigv4a") { region = authScheme?.signingRegionSet?.join(","); } else { region = authScheme?.signingRegion; } s3Presigner = new S3RequestPresigner({ ...client.config, signingName: authScheme?.signingName, region: async () => region }); } else { s3Presigner = new S3RequestPresigner(client.config); } const presignInterceptMiddleware = /* @__PURE__ */ __name((next, context2) => async (args) => { const { request } = args; if (!HttpRequest.isInstance(request)) { throw new Error("Request to be presigned is not an valid HTTP request."); } delete request.headers["amz-sdk-invocation-id"]; delete request.headers["amz-sdk-request"]; delete request.headers["x-amz-user-agent"]; let presigned2; const presignerOptions = { ...options, signingRegion: options.signingRegion ?? context2["signing_region"] ?? region, signingService: options.signingService ?? context2["signing_service"] }; if (context2.s3ExpressIdentity) { presigned2 = await s3Presigner.presignWithCredentials(request, context2.s3ExpressIdentity, presignerOptions); } else { presigned2 = await s3Presigner.presign(request, presignerOptions); } return { response: {}, output: { $metadata: { httpStatusCode: 200 }, presigned: presigned2 } }; }, "presignInterceptMiddleware"); const middlewareName = "presignInterceptMiddleware"; const clientStack = client.middlewareStack.clone(); clientStack.addRelativeTo(presignInterceptMiddleware, { name: middlewareName, relation: "before", toMiddleware: "awsAuthMiddleware", override: true }); const handler = command.resolveMiddleware(clientStack, client.config, {}); const { output } = await handler({ input: command.input }); const { presigned } = output; return formatUrl(presigned); }, "getSignedUrl"); } }); // ../../node_modules/@aws-sdk/s3-request-presigner/dist-es/index.js var init_dist_es61 = __esm({ "../../node_modules/@aws-sdk/s3-request-presigner/dist-es/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getSignedUrl(); init_presigner(); } }); // src/lib/s3-client.ts async function deleteImageUtil({ bucket = s3BucketName, keys }) { if (keys.length === 0) { return true; } try { const deleteParams = { Bucket: bucket, Delete: { Objects: keys.map((key) => ({ Key: key })), Quiet: false } }; const deleteCommand = new DeleteObjectsCommand(deleteParams); await s3Client.send(deleteCommand); return true; } catch (error50) { console.error("Error deleting image:", error50); throw new Error("Failed to delete image"); return false; } } function scaffoldAssetUrl(input) { if (Array.isArray(input)) { return input.map((key) => scaffoldAssetUrl(key)); } if (!input) { return ""; } const normalizedKey = input.replace(/^\/+/, ""); const domain3 = assetsDomain.endsWith("/") ? assetsDomain.slice(0, -1) : assetsDomain; return `${domain3}/${normalizedKey}`; } async function generateSignedUrlFromS3Url(s3UrlRaw, expiresIn = 259200) { if (!s3UrlRaw) { return ""; } const s3Url2 = s3UrlRaw; try { const command = new GetObjectCommand({ Bucket: s3BucketName, Key: s3Url2 }); const signedUrl = await getSignedUrl(s3Client, command, { expiresIn }); return signedUrl; } catch (error50) { console.error("Error generating signed URL:", error50); throw new Error("Failed to generate signed URL"); } } async function generateSignedUrlsFromS3Urls(s3Urls, expiresIn = 259200) { if (!s3Urls || !s3Urls.length) { return []; } try { const signedUrls = await Promise.all( s3Urls.map((url2) => generateSignedUrlFromS3Url(url2, expiresIn).catch(() => "")) ); return signedUrls; } catch (error50) { console.error("Error generating multiple signed URLs:", error50); return s3Urls.map(() => ""); } } async function generateUploadUrl(key, mimeType, expiresIn = 180) { try { await createUploadUrlStatus(key); const command = new PutObjectCommand({ Bucket: s3BucketName, Key: key, ContentType: mimeType }); const signedUrl = await getSignedUrl(s3Client, command, { expiresIn }); return signedUrl; } catch (error50) { console.error("Error generating upload URL:", error50); throw new Error("Failed to generate upload URL"); } } function extractKeyFromPresignedUrl(url2) { const u5 = new URL(url2); const rawKey = u5.pathname.replace(/^\/+/, ""); const decodedKey = decodeURIComponent(rawKey); const parts = decodedKey.split("/"); parts.shift(); return parts.join("/"); } async function claimUploadUrl(url2) { try { const semiKey = extractKeyFromPresignedUrl(url2); const updated = await claimUploadUrlStatus(semiKey); if (!updated) { throw new Error("Upload URL not found or already claimed"); } } catch (error50) { console.error("Error claiming upload URL:", error50); throw new Error("Failed to claim upload URL"); } } var s3Client, imageUploadS3; var init_s3_client = __esm({ "src/lib/s3-client.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist_es59(); init_dist_es61(); init_dbService(); init_env_exporter(); s3Client = new S3Client({ region: s3Region, endpoint: s3Url, forcePathStyle: true, credentials: { accessKeyId: s3AccessKeyId, secretAccessKey: s3SecretAccessKey } }); imageUploadS3 = /* @__PURE__ */ __name(async (body, type, key) => { const command = new PutObjectCommand({ Bucket: s3BucketName, Key: key, Body: body, ContentType: type }); const resp = await s3Client.send(command); const imageUrl = `${key}`; return imageUrl; }, "imageUploadS3"); __name(deleteImageUtil, "deleteImageUtil"); __name(scaffoldAssetUrl, "scaffoldAssetUrl"); __name(generateSignedUrlFromS3Url, "generateSignedUrlFromS3Url"); __name(generateSignedUrlsFromS3Urls, "generateSignedUrlsFromS3Urls"); __name(generateUploadUrl, "generateUploadUrl"); __name(extractKeyFromPresignedUrl, "extractKeyFromPresignedUrl"); __name(claimUploadUrl, "claimUploadUrl"); } }); // ../../node_modules/@trpc/server/dist/initTRPC-RoZMIBeA.mjs function createMiddlewareFactory() { function createMiddlewareInner(middlewares) { return { _middlewares: middlewares, unstable_pipe(middlewareBuilderOrFn) { const pipedMiddleware = "_middlewares" in middlewareBuilderOrFn ? middlewareBuilderOrFn._middlewares : [middlewareBuilderOrFn]; return createMiddlewareInner([...middlewares, ...pipedMiddleware]); } }; } __name(createMiddlewareInner, "createMiddlewareInner"); function createMiddleware(fn) { return createMiddlewareInner([fn]); } __name(createMiddleware, "createMiddleware"); return createMiddleware; } function createInputMiddleware(parse3) { const inputMiddleware = /* @__PURE__ */ __name(async function inputValidatorMiddleware(opts) { let parsedInput; const rawInput = await opts.getRawInput(); try { parsedInput = await parse3(rawInput); } catch (cause) { throw new TRPCError({ code: "BAD_REQUEST", cause }); } const combinedInput = isObject(opts.input) && isObject(parsedInput) ? (0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)({}, opts.input), parsedInput) : parsedInput; return opts.next({ input: combinedInput }); }, "inputValidatorMiddleware"); inputMiddleware._type = "input"; return inputMiddleware; } function createOutputMiddleware(parse3) { const outputMiddleware = /* @__PURE__ */ __name(async function outputValidatorMiddleware({ next }) { const result = await next(); if (!result.ok) return result; try { const data = await parse3(result.data); return (0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)({}, result), {}, { data }); } catch (cause) { throw new TRPCError({ message: "Output validation failed", code: "INTERNAL_SERVER_ERROR", cause }); } }, "outputValidatorMiddleware"); outputMiddleware._type = "output"; return outputMiddleware; } function getParseFn(procedureParser) { const parser2 = procedureParser; const isStandardSchema = "~standard" in parser2; if (typeof parser2 === "function" && typeof parser2.assert === "function") return parser2.assert.bind(parser2); if (typeof parser2 === "function" && !isStandardSchema) return parser2; if (typeof parser2.parseAsync === "function") return parser2.parseAsync.bind(parser2); if (typeof parser2.parse === "function") return parser2.parse.bind(parser2); if (typeof parser2.validateSync === "function") return parser2.validateSync.bind(parser2); if (typeof parser2.create === "function") return parser2.create.bind(parser2); if (typeof parser2.assert === "function") return (value) => { parser2.assert(value); return value; }; if (isStandardSchema) return async (value) => { const result = await parser2["~standard"].validate(value); if (result.issues) throw new StandardSchemaV1Error(result.issues); return result.value; }; throw new Error("Could not find a validator fn"); } function createNewBuilder(def1, def2) { const { middlewares = [], inputs, meta: meta3 } = def2, rest = (0, import_objectWithoutProperties.default)(def2, _excluded); return createBuilder((0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, mergeWithoutOverrides(def1, rest)), {}, { inputs: [...def1.inputs, ...inputs !== null && inputs !== void 0 ? inputs : []], middlewares: [...def1.middlewares, ...middlewares], meta: def1.meta && meta3 ? (0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, def1.meta), meta3) : meta3 !== null && meta3 !== void 0 ? meta3 : def1.meta })); } function createBuilder(initDef = {}) { const _def = (0, import_objectSpread2$13.default)({ procedure: true, inputs: [], middlewares: [] }, initDef); const builder = { _def, input(input) { const parser2 = getParseFn(input); return createNewBuilder(_def, { inputs: [input], middlewares: [createInputMiddleware(parser2)] }); }, output(output) { const parser2 = getParseFn(output); return createNewBuilder(_def, { output, middlewares: [createOutputMiddleware(parser2)] }); }, meta(meta3) { return createNewBuilder(_def, { meta: meta3 }); }, use(middlewareBuilderOrFn) { const middlewares = "_middlewares" in middlewareBuilderOrFn ? middlewareBuilderOrFn._middlewares : [middlewareBuilderOrFn]; return createNewBuilder(_def, { middlewares }); }, unstable_concat(builder$1) { return createNewBuilder(_def, builder$1._def); }, concat(builder$1) { return createNewBuilder(_def, builder$1._def); }, query(resolver) { return createResolver((0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, _def), {}, { type: "query" }), resolver); }, mutation(resolver) { return createResolver((0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, _def), {}, { type: "mutation" }), resolver); }, subscription(resolver) { return createResolver((0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, _def), {}, { type: "subscription" }), resolver); }, experimental_caller(caller) { return createNewBuilder(_def, { caller }); } }; return builder; } function createResolver(_defIn, resolver) { const finalBuilder = createNewBuilder(_defIn, { resolver, middlewares: [/* @__PURE__ */ __name(async function resolveMiddleware(opts) { const data = await resolver(opts); return { marker: middlewareMarker, ok: true, data, ctx: opts.ctx }; }, "resolveMiddleware")] }); const _def = (0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, finalBuilder._def), {}, { type: _defIn.type, experimental_caller: Boolean(finalBuilder._def.caller), meta: finalBuilder._def.meta, $types: null }); const invoke = createProcedureCaller(finalBuilder._def); const callerOverride = finalBuilder._def.caller; if (!callerOverride) return invoke; const callerWrapper = /* @__PURE__ */ __name(async (...args) => { return await callerOverride({ args, invoke, _def }); }, "callerWrapper"); callerWrapper._def = _def; return callerWrapper; } async function callRecursive(index, _def, opts) { try { const middleware2 = _def.middlewares[index]; const result = await middleware2((0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, opts), {}, { meta: _def.meta, input: opts.input, next(_nextOpts) { var _nextOpts$getRawInput; const nextOpts = _nextOpts; return callRecursive(index + 1, _def, (0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, opts), {}, { ctx: (nextOpts === null || nextOpts === void 0 ? void 0 : nextOpts.ctx) ? (0, import_objectSpread2$13.default)((0, import_objectSpread2$13.default)({}, opts.ctx), nextOpts.ctx) : opts.ctx, input: nextOpts && "input" in nextOpts ? nextOpts.input : opts.input, getRawInput: (_nextOpts$getRawInput = nextOpts === null || nextOpts === void 0 ? void 0 : nextOpts.getRawInput) !== null && _nextOpts$getRawInput !== void 0 ? _nextOpts$getRawInput : opts.getRawInput })); } })); return result; } catch (cause) { return { ok: false, error: getTRPCErrorFromUnknown(cause), marker: middlewareMarker }; } } function createProcedureCaller(_def) { async function procedure(opts) { if (!opts || !("getRawInput" in opts)) throw new Error(codeblock); const result = await callRecursive(0, _def, opts); if (!result) throw new TRPCError({ code: "INTERNAL_SERVER_ERROR", message: "No result from middlewares - did you forget to `return next()`?" }); if (!result.ok) throw result.error; return result.data; } __name(procedure, "procedure"); procedure._def = _def; procedure.procedure = true; procedure.meta = _def.meta; return procedure; } var import_objectSpread2$2, middlewareMarker, import_defineProperty3, StandardSchemaV1Error, require_objectWithoutPropertiesLoose, require_objectWithoutProperties, import_objectWithoutProperties, import_objectSpread2$13, _excluded, codeblock, _globalThis$process, _globalThis$process2, _globalThis$process3, isServerDefault, import_objectSpread25, TRPCBuilder, initTRPC; var init_initTRPC_RoZMIBeA = __esm({ "../../node_modules/@trpc/server/dist/initTRPC-RoZMIBeA.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_getErrorShape_vC8mUXJD(); init_codes_DagpWZLc(); init_tracked_Bjtgv3wJ(); import_objectSpread2$2 = __toESM2(require_objectSpread2(), 1); middlewareMarker = "middlewareMarker"; __name(createMiddlewareFactory, "createMiddlewareFactory"); __name(createInputMiddleware, "createInputMiddleware"); __name(createOutputMiddleware, "createOutputMiddleware"); import_defineProperty3 = __toESM2(require_defineProperty(), 1); StandardSchemaV1Error = /* @__PURE__ */ __name(class extends Error { /** * Creates a schema error with useful information. * * @param issues The schema issues. */ constructor(issues) { var _issues$; super((_issues$ = issues[0]) === null || _issues$ === void 0 ? void 0 : _issues$.message); (0, import_defineProperty3.default)(this, "issues", void 0); this.name = "SchemaError"; this.issues = issues; } }, "StandardSchemaV1Error"); __name(getParseFn, "getParseFn"); require_objectWithoutPropertiesLoose = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(exports, module) { function _objectWithoutPropertiesLoose(r2, e2) { if (null == r2) return {}; var t9 = {}; for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) { if (e2.includes(n2)) continue; t9[n2] = r2[n2]; } return t9; } __name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose"); module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); require_objectWithoutProperties = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(exports, module) { var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose(); function _objectWithoutProperties$1(e2, t9) { if (null == e2) return {}; var o2, r2, i2 = objectWithoutPropertiesLoose(e2, t9); if (Object.getOwnPropertySymbols) { var s2 = Object.getOwnPropertySymbols(e2); for (r2 = 0; r2 < s2.length; r2++) o2 = s2[r2], t9.includes(o2) || {}.propertyIsEnumerable.call(e2, o2) && (i2[o2] = e2[o2]); } return i2; } __name(_objectWithoutProperties$1, "_objectWithoutProperties$1"); module.exports = _objectWithoutProperties$1, module.exports.__esModule = true, module.exports["default"] = module.exports; } }); import_objectWithoutProperties = __toESM2(require_objectWithoutProperties(), 1); import_objectSpread2$13 = __toESM2(require_objectSpread2(), 1); _excluded = [ "middlewares", "inputs", "meta" ]; __name(createNewBuilder, "createNewBuilder"); __name(createBuilder, "createBuilder"); __name(createResolver, "createResolver"); codeblock = ` This is a client-only function. If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls `.trim(); __name(callRecursive, "callRecursive"); __name(createProcedureCaller, "createProcedureCaller"); isServerDefault = typeof window === "undefined" || "Deno" in window || ((_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.env) === null || _globalThis$process === void 0 ? void 0 : _globalThis$process["NODE_ENV"]) === "test" || !!((_globalThis$process2 = globalThis.process) === null || _globalThis$process2 === void 0 || (_globalThis$process2 = _globalThis$process2.env) === null || _globalThis$process2 === void 0 ? void 0 : _globalThis$process2["JEST_WORKER_ID"]) || !!((_globalThis$process3 = globalThis.process) === null || _globalThis$process3 === void 0 || (_globalThis$process3 = _globalThis$process3.env) === null || _globalThis$process3 === void 0 ? void 0 : _globalThis$process3["VITEST_WORKER_ID"]); import_objectSpread25 = __toESM2(require_objectSpread2(), 1); TRPCBuilder = /* @__PURE__ */ __name(class TRPCBuilder2 { /** * Add a context shape as a generic to the root object * @see https://trpc.io/docs/v11/server/context */ context() { return new TRPCBuilder2(); } /** * Add a meta shape as a generic to the root object * @see https://trpc.io/docs/v11/quickstart */ meta() { return new TRPCBuilder2(); } /** * Create the root object * @see https://trpc.io/docs/v11/server/routers#initialize-trpc */ create(opts) { var _opts$transformer, _opts$isDev, _globalThis$process$1, _opts$allowOutsideOfS, _opts$errorFormatter, _opts$isServer; const config3 = (0, import_objectSpread25.default)((0, import_objectSpread25.default)({}, opts), {}, { transformer: getDataTransformer((_opts$transformer = opts === null || opts === void 0 ? void 0 : opts.transformer) !== null && _opts$transformer !== void 0 ? _opts$transformer : defaultTransformer), isDev: (_opts$isDev = opts === null || opts === void 0 ? void 0 : opts.isDev) !== null && _opts$isDev !== void 0 ? _opts$isDev : ((_globalThis$process$1 = globalThis.process) === null || _globalThis$process$1 === void 0 ? void 0 : _globalThis$process$1.env["NODE_ENV"]) !== "production", allowOutsideOfServer: (_opts$allowOutsideOfS = opts === null || opts === void 0 ? void 0 : opts.allowOutsideOfServer) !== null && _opts$allowOutsideOfS !== void 0 ? _opts$allowOutsideOfS : false, errorFormatter: (_opts$errorFormatter = opts === null || opts === void 0 ? void 0 : opts.errorFormatter) !== null && _opts$errorFormatter !== void 0 ? _opts$errorFormatter : defaultFormatter, isServer: (_opts$isServer = opts === null || opts === void 0 ? void 0 : opts.isServer) !== null && _opts$isServer !== void 0 ? _opts$isServer : isServerDefault, $types: null }); { var _opts$isServer2; const isServer = (_opts$isServer2 = opts === null || opts === void 0 ? void 0 : opts.isServer) !== null && _opts$isServer2 !== void 0 ? _opts$isServer2 : isServerDefault; if (!isServer && (opts === null || opts === void 0 ? void 0 : opts.allowOutsideOfServer) !== true) throw new Error(`You're trying to use @trpc/server in a non-server environment. This is not supported by default.`); } return { _config: config3, procedure: createBuilder({ meta: opts === null || opts === void 0 ? void 0 : opts.defaultMeta }), middleware: createMiddlewareFactory(), router: createRouterFactory(config3), mergeRouters, createCallerFactory: createCallerFactory() }; } }, "TRPCBuilder"); initTRPC = new TRPCBuilder(); } }); // ../../node_modules/@trpc/server/dist/index.mjs var init_dist3 = __esm({ "../../node_modules/@trpc/server/dist/index.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_tracked_Bjtgv3wJ(); init_initTRPC_RoZMIBeA(); } }); // src/trpc/trpc-index.ts var t8, middleware, router2, errorLoggerMiddleware, publicProcedure, protectedProcedure, createCallerFactory2, createTRPCRouter; var init_trpc_index = __esm({ "src/trpc/trpc-index.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist3(); t8 = initTRPC.context().create(); middleware = t8.middleware; router2 = t8.router; errorLoggerMiddleware = middleware(async ({ path, type, next, ctx }) => { const start = Date.now(); try { const result = await next(); const duration3 = Date.now() - start; if (false) { console.log(`\u2705 ${type} ${path} - ${duration3}ms`); } return result; } catch (error50) { const duration3 = Date.now() - start; const err = error50; console.error("\u{1F6A8} tRPC Error:", { timestamp: (/* @__PURE__ */ new Date()).toISOString(), path, type, duration: `${duration3}ms`, userId: ctx?.user?.userId || ctx?.staffUser?.id || "anonymous", error: { name: err.name, message: err.message, code: err.code, stack: err.stack }, // Add SQL-specific details if available ...err.code && { sqlCode: err.code }, ...err.meta && { sqlMeta: err.meta }, ...err.sql && { sql: err.sql } }); throw error50; } }); publicProcedure = t8.procedure.use(errorLoggerMiddleware); protectedProcedure = t8.procedure.use(errorLoggerMiddleware).use( middleware(async ({ ctx, next }) => { if (!ctx.user && !ctx.staffUser) { throw new TRPCError({ code: "UNAUTHORIZED" }); } return next(); }) ); createCallerFactory2 = t8.createCallerFactory; createTRPCRouter = t8.router; } }); // src/stores/product-store.ts async function initializeProducts() { try { console.log("Initializing product store in Redis..."); const productsData = await getAllProductsForCache(); const allStores = await getAllStoresForCache(); const storeMap = new Map(allStores.map((s2) => [s2.id, s2])); const allDeliverySlots = await getAllDeliverySlotsForCache(); const deliverySlotsMap = /* @__PURE__ */ new Map(); for (const slot of allDeliverySlots) { if (!deliverySlotsMap.has(slot.productId)) deliverySlotsMap.set(slot.productId, []); deliverySlotsMap.get(slot.productId).push(slot); } const allSpecialDeals = await getAllSpecialDealsForCache(); const specialDealsMap = /* @__PURE__ */ new Map(); for (const deal of allSpecialDeals) { if (!specialDealsMap.has(deal.productId)) specialDealsMap.set(deal.productId, []); specialDealsMap.get(deal.productId).push(deal); } const allProductTags = await getAllProductTagsForCache(); const productTagsMap = /* @__PURE__ */ new Map(); for (const tag2 of allProductTags) { if (!productTagsMap.has(tag2.productId)) productTagsMap.set(tag2.productId, []); productTagsMap.get(tag2.productId).push(tag2.tagName); } console.log("Product store initialized successfully"); } catch (error50) { console.error("Error initializing product store:", error50); } } async function getProductById5(id) { try { const product = await getProductById(id); if (!product) return null; const signedImages = scaffoldAssetUrl( product.images || [] ); const allStores = await getAllStoresForCache(); const store = product.storeId ? allStores.find((s2) => s2.id === product.storeId) || null : null; const allDeliverySlots = await getAllDeliverySlotsForCache(); const productSlots2 = allDeliverySlots.filter((s2) => s2.productId === id); const allSpecialDeals = await getAllSpecialDealsForCache(); const productDeals = allSpecialDeals.filter((d2) => d2.productId === id); const allProductTags = await getAllProductTagsForCache(); const productTagNames = allProductTags.filter((t9) => t9.productId === id).map((t9) => t9.tagName); return { id: product.id, name: product.name, shortDescription: product.shortDescription, longDescription: product.longDescription, price: product.price.toString(), marketPrice: product.marketPrice?.toString() || null, unitNotation: product.unit.shortNotation, images: signedImages, isOutOfStock: product.isOutOfStock, store: store ? { id: store.id, name: store.name, description: store.description } : null, incrementStep: product.incrementStep, productQuantity: product.productQuantity, isFlashAvailable: product.isFlashAvailable, flashPrice: product.flashPrice?.toString() || null, deliverySlots: productSlots2.map((s2) => ({ id: s2.id, deliveryTime: s2.deliveryTime, freezeTime: s2.freezeTime, isCapacityFull: s2.isCapacityFull })), specialDeals: productDeals.map((d2) => ({ quantity: d2.quantity.toString(), price: d2.price.toString(), validTill: d2.validTill })), productTags: productTagNames }; } catch (error50) { console.error(`Error getting product ${id}:`, error50); return null; } } async function getAllProducts2() { try { const productsData = await getAllProductsForCache(); const allStores = await getAllStoresForCache(); const storeMap = new Map(allStores.map((s2) => [s2.id, s2])); const allDeliverySlots = await getAllDeliverySlotsForCache(); const deliverySlotsMap = /* @__PURE__ */ new Map(); for (const slot of allDeliverySlots) { if (!deliverySlotsMap.has(slot.productId)) deliverySlotsMap.set(slot.productId, []); deliverySlotsMap.get(slot.productId).push(slot); } const allSpecialDeals = await getAllSpecialDealsForCache(); const specialDealsMap = /* @__PURE__ */ new Map(); for (const deal of allSpecialDeals) { if (!specialDealsMap.has(deal.productId)) specialDealsMap.set(deal.productId, []); specialDealsMap.get(deal.productId).push(deal); } const allProductTags = await getAllProductTagsForCache(); const productTagsMap = /* @__PURE__ */ new Map(); for (const tag2 of allProductTags) { if (!productTagsMap.has(tag2.productId)) productTagsMap.set(tag2.productId, []); productTagsMap.get(tag2.productId).push(tag2.tagName); } const products = []; for (const product of productsData) { const signedImages = scaffoldAssetUrl( product.images || [] ); const store = product.storeId ? storeMap.get(product.storeId) || null : null; const deliverySlots = deliverySlotsMap.get(product.id) || []; const specialDeals2 = specialDealsMap.get(product.id) || []; const productTags2 = productTagsMap.get(product.id) || []; products.push({ id: product.id, name: product.name, shortDescription: product.shortDescription, longDescription: product.longDescription, price: product.price.toString(), marketPrice: product.marketPrice?.toString() || null, unitNotation: product.unitShortNotation, images: signedImages, isOutOfStock: product.isOutOfStock, store: store ? { id: store.id, name: store.name, description: store.description } : null, incrementStep: product.incrementStep, productQuantity: product.productQuantity, isFlashAvailable: product.isFlashAvailable, flashPrice: product.flashPrice?.toString() || null, deliverySlots: deliverySlots.map((s2) => ({ id: s2.id, deliveryTime: s2.deliveryTime, freezeTime: s2.freezeTime, isCapacityFull: s2.isCapacityFull })), specialDeals: specialDeals2.map((d2) => ({ quantity: d2.quantity.toString(), price: d2.price.toString(), validTill: d2.validTill })), productTags: productTags2 }); } return products; } catch (error50) { console.error("Error getting all products:", error50); return []; } } var init_product_store = __esm({ "src/stores/product-store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dbService(); init_s3_client(); __name(initializeProducts, "initializeProducts"); __name(getProductById5, "getProductById"); __name(getAllProducts2, "getAllProducts"); } }); // src/stores/product-tag-store.ts async function transformTagToStoreTag(tag2) { const signedImageUrl = tag2.imageUrl ? await generateSignedUrlFromS3Url(tag2.imageUrl) : null; return { id: tag2.id, tagName: tag2.tagName, tagDescription: tag2.tagDescription, imageUrl: signedImageUrl, isDashboardTag: tag2.isDashboardTag, relatedStores: tag2.relatedStores || [], productIds: tag2.products ? tag2.products.map((p2) => p2.productId) : [] }; } async function initializeProductTagStore() { try { console.log("Initializing product tag store in Redis..."); const tagsData = await getAllTagsForCache(); const productTagsData = await getAllTagProductMappings(); const productIdsByTag = /* @__PURE__ */ new Map(); for (const pt of productTagsData) { if (!productIdsByTag.has(pt.tagId)) { productIdsByTag.set(pt.tagId, []); } productIdsByTag.get(pt.tagId).push(pt.productId); } console.log("Product tag store initialized successfully"); } catch (error50) { console.error("Error initializing product tag store:", error50); } } async function getDashboardTags() { try { const tags = await getAllProductTags(); const result = []; for (const tag2 of tags) { if (tag2.isDashboardTag) { result.push(await transformTagToStoreTag(tag2)); } } return result; } catch (error50) { console.error("Error getting dashboard tags:", error50); return []; } } async function getTagsByStoreId(storeId) { try { const tags = await getAllProductTags(); const result = []; for (const tag2 of tags) { const relatedStores = tag2.relatedStores || []; if (relatedStores.includes(storeId)) { result.push(await transformTagToStoreTag(tag2)); } } return result; } catch (error50) { console.error(`Error getting tags for store ${storeId}:`, error50); return []; } } var init_product_tag_store = __esm({ "src/stores/product-tag-store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dbService(); init_s3_client(); __name(transformTagToStoreTag, "transformTagToStoreTag"); __name(initializeProductTagStore, "initializeProductTagStore"); __name(getDashboardTags, "getDashboardTags"); __name(getTagsByStoreId, "getTagsByStoreId"); } }); // src/trpc/apis/common-apis/common.ts async function scaffoldProducts() { let products = await getAllProducts2(); products = products.filter((item) => Boolean(item.id)); const suspendedProductIds = new Set(await getSuspendedProductIds()); products = products.filter((product) => !suspendedProductIds.has(product.id)); const formattedProducts = await Promise.all( products.map(async (product) => { const nextDeliveryDate = await getNextDeliveryDateWithCapacity(product.id); return { id: product.id, name: product.name, shortDescription: product.shortDescription, price: parseFloat(product.price), marketPrice: product.marketPrice ? parseFloat(product.marketPrice) : null, unit: product.unitNotation, unitNotation: product.unitNotation, incrementStep: product.incrementStep, productQuantity: product.productQuantity, storeId: product.store?.id || null, isOutOfStock: product.isOutOfStock, isFlashAvailable: product.isFlashAvailable, nextDeliveryDate: nextDeliveryDate ? nextDeliveryDate.toISOString() : null, images: product.images, flashPrice: product.flashPrice }; }) ); return { products: formattedProducts, count: formattedProducts.length }; } var getNextDeliveryDate, commonRouter; var init_common3 = __esm({ "src/trpc/apis/common-apis/common.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_dbService(); init_product_store(); init_product_tag_store(); getNextDeliveryDate = getNextDeliveryDateWithCapacity; __name(scaffoldProducts, "scaffoldProducts"); commonRouter = router2({ getDashboardTags: publicProcedure.query(async () => { const tags = await getDashboardTags(); return { tags }; }), getAllProductsSummary: publicProcedure.query(async () => { const response = await scaffoldProducts(); return response; }) /* // Old implementation - moved to common-trpc-index.ts: getStoresSummary: publicProcedure .query(async () => { const stores = await getStoresSummary(); return { stores }; }), healthCheck: publicProcedure .query(async () => { const result = await healthCheck(); return result; }), */ }); } }); // src/apis/common-apis/apis/common-product.controller.ts var getAllProductsSummary; var init_common_product_controller = __esm({ "src/apis/common-apis/apis/common-product.controller.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_s3_client(); init_common3(); init_dbService(); getAllProductsSummary = /* @__PURE__ */ __name(async (c2) => { try { const tagId = c2.req.query("tagId"); const tagIdNum = tagId ? parseInt(tagId) : void 0; if (tagIdNum) { const products = await getAllProductsWithUnits(tagIdNum); if (products.length === 0) { return c2.json({ products: [], count: 0 }, 200); } } const productsWithUnits = await getAllProductsWithUnits(tagIdNum); const formattedProducts = await Promise.all( productsWithUnits.map(async (product) => { const nextDeliveryDate = await getNextDeliveryDate(product.id); return { id: product.id, name: product.name, shortDescription: product.shortDescription, price: product.price, marketPrice: product.marketPrice, unit: product.unitShortNotation, productQuantity: product.productQuantity, isOutOfStock: product.isOutOfStock, nextDeliveryDate: nextDeliveryDate ? nextDeliveryDate.toISOString() : null, images: scaffoldAssetUrl(product.images || []) }; }) ); return c2.json({ products: formattedProducts, count: formattedProducts.length }, 200); } catch (error50) { console.error("Get products summary error:", error50); return c2.json({ error: "Failed to fetch products summary" }, 500); } }, "getAllProductsSummary"); } }); // src/apis/common-apis/apis/common-product.router.ts var router3, commonProductsRouter, common_product_router_default; var init_common_product_router = __esm({ "src/apis/common-apis/apis/common-product.router.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist(); init_common_product_controller(); router3 = new Hono2(); router3.get("/summary", getAllProductsSummary); commonProductsRouter = router3; common_product_router_default = commonProductsRouter; } }); // src/apis/common-apis/apis/common.router.ts var router4, commonRouter2, common_router_default; var init_common_router = __esm({ "src/apis/common-apis/apis/common.router.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist(); init_common_product_router(); router4 = new Hono2(); router4.route("/products", common_product_router_default); commonRouter2 = router4; common_router_default = commonRouter2; } }); // src/v1-router.ts var router5, v1Router, v1_router_default; var init_v1_router = __esm({ "src/v1-router.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist(); init_av_router(); init_common_router(); router5 = new Hono2(); router5.route("/av", av_router_default); router5.route("/cm", common_router_default); v1Router = router5; v1_router_default = v1Router; } }); // src/test-controller.ts var router6, test_controller_default; var init_test_controller = __esm({ "src/test-controller.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist(); router6 = new Hono2(); router6.get("/", (c2) => { return c2.json({ status: "ok", message: "Health check passed", timestamp: (/* @__PURE__ */ new Date()).toISOString() }); }); test_controller_default = router6; } }); // src/middleware/auth.middleware.ts var authenticateUser; var init_auth_middleware = __esm({ "src/middleware/auth.middleware.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_webapi(); init_dbService(); init_api_error(); init_env_exporter(); authenticateUser = /* @__PURE__ */ __name(async (c2, next) => { try { const authHeader = c2.req.header("authorization"); if (!authHeader?.startsWith("Bearer ")) { throw new ApiError("Authorization token required", 401); } const token = authHeader.substring(7); console.log(c2.req.header); const { payload } = await jwtVerify(token, getEncodedJwtSecret()); const decoded = payload; if (decoded.staffId) { const staff = await getStaffUserById(decoded.staffId); if (!staff) { throw new ApiError("Invalid staff token", 401); } c2.set("staffUser", { id: staff.id, name: staff.name }); } else { c2.set("user", decoded); const suspended = await isUserSuspended(decoded.userId); if (suspended) { throw new ApiError("Account suspended", 403); } } await next(); } catch (error50) { throw error50; } }, "authenticateUser"); } }); // src/main-router.ts var router7, mainRouter, main_router_default; var init_main_router = __esm({ "src/main-router.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist(); init_v1_router(); init_test_controller(); init_auth_middleware(); router7 = new Hono2(); router7.get("/health", (c2) => { return c2.json({ status: "OK", timestamp: (/* @__PURE__ */ new Date()).toISOString(), uptime: process.uptime(), message: "Hello world" }); }); router7.get("/seed", (c2) => { return c2.json({ status: "OK", timestamp: (/* @__PURE__ */ new Date()).toISOString(), uptime: process.uptime() }); }); router7.use("*", authenticateUser); router7.route("/v1", v1_router_default); router7.route("/test", test_controller_default); mainRouter = router7; main_router_default = mainRouter; } }); // ../../node_modules/zod/v4/core/core.js function $constructor(name, initializer3, params) { function init(inst, def) { if (!inst._zod) { Object.defineProperty(inst, "_zod", { value: { def, constr: _, traits: /* @__PURE__ */ new Set() }, enumerable: false }); } if (inst._zod.traits.has(name)) { return; } inst._zod.traits.add(name); initializer3(inst, def); const proto = _.prototype; const keys = Object.keys(proto); for (let i2 = 0; i2 < keys.length; i2++) { const k2 = keys[i2]; if (!(k2 in inst)) { inst[k2] = proto[k2].bind(inst); } } } __name(init, "init"); const Parent = params?.Parent ?? Object; class Definition extends Parent { } __name(Definition, "Definition"); Object.defineProperty(Definition, "name", { value: name }); function _(def) { var _a124; const inst = params?.Parent ? new Definition() : this; init(inst, def); (_a124 = inst._zod).deferred ?? (_a124.deferred = []); for (const fn of inst._zod.deferred) { fn(); } return inst; } __name(_, "_"); Object.defineProperty(_, "init", { value: init }); Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => { if (params?.Parent && inst instanceof params.Parent) return true; return inst?._zod?.traits?.has(name); } }); Object.defineProperty(_, "name", { value: name }); return _; } function config2(newConfig) { if (newConfig) Object.assign(globalConfig, newConfig); return globalConfig; } var NEVER, $brand, $ZodAsyncError, $ZodEncodeError, globalConfig; var init_core2 = __esm({ "../../node_modules/zod/v4/core/core.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); NEVER = Object.freeze({ status: "aborted" }); __name($constructor, "$constructor"); $brand = Symbol("zod_brand"); $ZodAsyncError = class extends Error { constructor() { super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); } }; __name($ZodAsyncError, "$ZodAsyncError"); $ZodEncodeError = class extends Error { constructor(name) { super(`Encountered unidirectional transform during encode: ${name}`); this.name = "ZodEncodeError"; } }; __name($ZodEncodeError, "$ZodEncodeError"); globalConfig = {}; __name(config2, "config"); } }); // ../../node_modules/zod/v4/core/util.js var util_exports = {}; __export(util_exports, { BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES, Class: () => Class, NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES, aborted: () => aborted, allowsEval: () => allowsEval, assert: () => assert3, assertEqual: () => assertEqual, assertIs: () => assertIs, assertNever: () => assertNever, assertNotEqual: () => assertNotEqual, assignProp: () => assignProp, base64ToUint8Array: () => base64ToUint8Array, base64urlToUint8Array: () => base64urlToUint8Array, cached: () => cached, captureStackTrace: () => captureStackTrace, cleanEnum: () => cleanEnum, cleanRegex: () => cleanRegex, clone: () => clone, cloneDef: () => cloneDef, createTransparentProxy: () => createTransparentProxy, defineLazy: () => defineLazy, esc: () => esc, escapeRegex: () => escapeRegex, extend: () => extend, finalizeIssue: () => finalizeIssue, floatSafeRemainder: () => floatSafeRemainder, getElementAtPath: () => getElementAtPath, getEnumValues: () => getEnumValues, getLengthableOrigin: () => getLengthableOrigin, getParsedType: () => getParsedType, getSizableOrigin: () => getSizableOrigin, hexToUint8Array: () => hexToUint8Array, isObject: () => isObject3, isPlainObject: () => isPlainObject2, issue: () => issue, joinValues: () => joinValues, jsonStringifyReplacer: () => jsonStringifyReplacer, merge: () => merge2, mergeDefs: () => mergeDefs, normalizeParams: () => normalizeParams, nullish: () => nullish, numKeys: () => numKeys, objectClone: () => objectClone, omit: () => omit, optionalKeys: () => optionalKeys, parsedType: () => parsedType, partial: () => partial, pick: () => pick, prefixIssues: () => prefixIssues, primitiveTypes: () => primitiveTypes, promiseAllObject: () => promiseAllObject, propertyKeyTypes: () => propertyKeyTypes, randomString: () => randomString, required: () => required, safeExtend: () => safeExtend, shallowClone: () => shallowClone, slugify: () => slugify, stringifyPrimitive: () => stringifyPrimitive, uint8ArrayToBase64: () => uint8ArrayToBase64, uint8ArrayToBase64url: () => uint8ArrayToBase64url, uint8ArrayToHex: () => uint8ArrayToHex, unwrapMessage: () => unwrapMessage }); function assertEqual(val) { return val; } function assertNotEqual(val) { return val; } function assertIs(_arg) { } function assertNever(_x2) { throw new Error("Unexpected value in exhaustive check"); } function assert3(_) { } function getEnumValues(entries) { const numericValues = Object.values(entries).filter((v3) => typeof v3 === "number"); const values = Object.entries(entries).filter(([k2, _]) => numericValues.indexOf(+k2) === -1).map(([_, v3]) => v3); return values; } function joinValues(array2, separator = "|") { return array2.map((val) => stringifyPrimitive(val)).join(separator); } function jsonStringifyReplacer(_, value) { if (typeof value === "bigint") return value.toString(); return value; } function cached(getter) { const set2 = false; return { get value() { if (!set2) { const value = getter(); Object.defineProperty(this, "value", { value }); return value; } throw new Error("cached value already set"); } }; } function nullish(input) { return input === null || input === void 0; } function cleanRegex(source) { const start = source.startsWith("^") ? 1 : 0; const end = source.endsWith("$") ? source.length - 1 : source.length; return source.slice(start, end); } function floatSafeRemainder(val, step) { const valDecCount = (val.toString().split(".")[1] || "").length; const stepString = step.toString(); let stepDecCount = (stepString.split(".")[1] || "").length; if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) { const match2 = stepString.match(/\d?e-(\d?)/); if (match2?.[1]) { stepDecCount = Number.parseInt(match2[1]); } } const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); return valInt % stepInt / 10 ** decCount; } function defineLazy(object2, key, getter) { let value = void 0; Object.defineProperty(object2, key, { get() { if (value === EVALUATING) { return void 0; } if (value === void 0) { value = EVALUATING; value = getter(); } return value; }, set(v3) { Object.defineProperty(object2, key, { value: v3 // configurable: true, }); }, configurable: true }); } function objectClone(obj) { return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj)); } function assignProp(target, prop, value) { Object.defineProperty(target, prop, { value, writable: true, enumerable: true, configurable: true }); } function mergeDefs(...defs) { const mergedDescriptors = {}; for (const def of defs) { const descriptors = Object.getOwnPropertyDescriptors(def); Object.assign(mergedDescriptors, descriptors); } return Object.defineProperties({}, mergedDescriptors); } function cloneDef(schema) { return mergeDefs(schema._zod.def); } function getElementAtPath(obj, path) { if (!path) return obj; return path.reduce((acc, key) => acc?.[key], obj); } function promiseAllObject(promisesObj) { const keys = Object.keys(promisesObj); const promises = keys.map((key) => promisesObj[key]); return Promise.all(promises).then((results) => { const resolvedObj = {}; for (let i2 = 0; i2 < keys.length; i2++) { resolvedObj[keys[i2]] = results[i2]; } return resolvedObj; }); } function randomString(length = 10) { const chars2 = "abcdefghijklmnopqrstuvwxyz"; let str = ""; for (let i2 = 0; i2 < length; i2++) { str += chars2[Math.floor(Math.random() * chars2.length)]; } return str; } function esc(str) { return JSON.stringify(str); } function slugify(input) { return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, ""); } function isObject3(data) { return typeof data === "object" && data !== null && !Array.isArray(data); } function isPlainObject2(o2) { if (isObject3(o2) === false) return false; const ctor = o2.constructor; if (ctor === void 0) return true; if (typeof ctor !== "function") return true; const prot = ctor.prototype; if (isObject3(prot) === false) return false; if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { return false; } return true; } function shallowClone(o2) { if (isPlainObject2(o2)) return { ...o2 }; if (Array.isArray(o2)) return [...o2]; return o2; } function numKeys(data) { let keyCount = 0; for (const key in data) { if (Object.prototype.hasOwnProperty.call(data, key)) { keyCount++; } } return keyCount; } function escapeRegex(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function clone(inst, def, params) { const cl2 = new inst._zod.constr(def ?? inst._zod.def); if (!def || params?.parent) cl2._zod.parent = inst; return cl2; } function normalizeParams(_params) { const params = _params; if (!params) return {}; if (typeof params === "string") return { error: () => params }; if (params?.message !== void 0) { if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params"); params.error = params.message; } delete params.message; if (typeof params.error === "string") return { ...params, error: () => params.error }; return params; } function createTransparentProxy(getter) { let target; return new Proxy({}, { get(_, prop, receiver) { target ?? (target = getter()); return Reflect.get(target, prop, receiver); }, set(_, prop, value, receiver) { target ?? (target = getter()); return Reflect.set(target, prop, value, receiver); }, has(_, prop) { target ?? (target = getter()); return Reflect.has(target, prop); }, deleteProperty(_, prop) { target ?? (target = getter()); return Reflect.deleteProperty(target, prop); }, ownKeys(_) { target ?? (target = getter()); return Reflect.ownKeys(target); }, getOwnPropertyDescriptor(_, prop) { target ?? (target = getter()); return Reflect.getOwnPropertyDescriptor(target, prop); }, defineProperty(_, prop, descriptor) { target ?? (target = getter()); return Reflect.defineProperty(target, prop, descriptor); } }); } function stringifyPrimitive(value) { if (typeof value === "bigint") return value.toString() + "n"; if (typeof value === "string") return `"${value}"`; return `${value}`; } function optionalKeys(shape) { return Object.keys(shape).filter((k2) => { return shape[k2]._zod.optin === "optional" && shape[k2]._zod.optout === "optional"; }); } function pick(schema, mask) { const currDef = schema._zod.def; const checks = currDef.checks; const hasChecks = checks && checks.length > 0; if (hasChecks) { throw new Error(".pick() cannot be used on object schemas containing refinements"); } const def = mergeDefs(schema._zod.def, { get shape() { const newShape = {}; for (const key in mask) { if (!(key in currDef.shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; newShape[key] = currDef.shape[key]; } assignProp(this, "shape", newShape); return newShape; }, checks: [] }); return clone(schema, def); } function omit(schema, mask) { const currDef = schema._zod.def; const checks = currDef.checks; const hasChecks = checks && checks.length > 0; if (hasChecks) { throw new Error(".omit() cannot be used on object schemas containing refinements"); } const def = mergeDefs(schema._zod.def, { get shape() { const newShape = { ...schema._zod.def.shape }; for (const key in mask) { if (!(key in currDef.shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; delete newShape[key]; } assignProp(this, "shape", newShape); return newShape; }, checks: [] }); return clone(schema, def); } function extend(schema, shape) { if (!isPlainObject2(shape)) { throw new Error("Invalid input to extend: expected a plain object"); } const checks = schema._zod.def.checks; const hasChecks = checks && checks.length > 0; if (hasChecks) { const existingShape = schema._zod.def.shape; for (const key in shape) { if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) { throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); } } } const def = mergeDefs(schema._zod.def, { get shape() { const _shape = { ...schema._zod.def.shape, ...shape }; assignProp(this, "shape", _shape); return _shape; } }); return clone(schema, def); } function safeExtend(schema, shape) { if (!isPlainObject2(shape)) { throw new Error("Invalid input to safeExtend: expected a plain object"); } const def = mergeDefs(schema._zod.def, { get shape() { const _shape = { ...schema._zod.def.shape, ...shape }; assignProp(this, "shape", _shape); return _shape; } }); return clone(schema, def); } function merge2(a2, b2) { const def = mergeDefs(a2._zod.def, { get shape() { const _shape = { ...a2._zod.def.shape, ...b2._zod.def.shape }; assignProp(this, "shape", _shape); return _shape; }, get catchall() { return b2._zod.def.catchall; }, checks: [] // delete existing checks }); return clone(a2, def); } function partial(Class2, schema, mask) { const currDef = schema._zod.def; const checks = currDef.checks; const hasChecks = checks && checks.length > 0; if (hasChecks) { throw new Error(".partial() cannot be used on object schemas containing refinements"); } const def = mergeDefs(schema._zod.def, { get shape() { const oldShape = schema._zod.def.shape; const shape = { ...oldShape }; if (mask) { for (const key in mask) { if (!(key in oldShape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; shape[key] = Class2 ? new Class2({ type: "optional", innerType: oldShape[key] }) : oldShape[key]; } } else { for (const key in oldShape) { shape[key] = Class2 ? new Class2({ type: "optional", innerType: oldShape[key] }) : oldShape[key]; } } assignProp(this, "shape", shape); return shape; }, checks: [] }); return clone(schema, def); } function required(Class2, schema, mask) { const def = mergeDefs(schema._zod.def, { get shape() { const oldShape = schema._zod.def.shape; const shape = { ...oldShape }; if (mask) { for (const key in mask) { if (!(key in shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; shape[key] = new Class2({ type: "nonoptional", innerType: oldShape[key] }); } } else { for (const key in oldShape) { shape[key] = new Class2({ type: "nonoptional", innerType: oldShape[key] }); } } assignProp(this, "shape", shape); return shape; } }); return clone(schema, def); } function aborted(x2, startIndex = 0) { if (x2.aborted === true) return true; for (let i2 = startIndex; i2 < x2.issues.length; i2++) { if (x2.issues[i2]?.continue !== true) { return true; } } return false; } function prefixIssues(path, issues) { return issues.map((iss) => { var _a124; (_a124 = iss).path ?? (_a124.path = []); iss.path.unshift(path); return iss; }); } function unwrapMessage(message2) { return typeof message2 === "string" ? message2 : message2?.message; } function finalizeIssue(iss, ctx, config3) { const full = { ...iss, path: iss.path ?? [] }; if (!iss.message) { const message2 = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config3.customError?.(iss)) ?? unwrapMessage(config3.localeError?.(iss)) ?? "Invalid input"; full.message = message2; } delete full.inst; delete full.continue; if (!ctx?.reportInput) { delete full.input; } return full; } function getSizableOrigin(input) { if (input instanceof Set) return "set"; if (input instanceof Map) return "map"; if (input instanceof File) return "file"; return "unknown"; } function getLengthableOrigin(input) { if (Array.isArray(input)) return "array"; if (typeof input === "string") return "string"; return "unknown"; } function parsedType(data) { const t9 = typeof data; switch (t9) { case "number": { return Number.isNaN(data) ? "nan" : "number"; } case "object": { if (data === null) { return "null"; } if (Array.isArray(data)) { return "array"; } const obj = data; if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) { return obj.constructor.name; } } } return t9; } function issue(...args) { const [iss, input, inst] = args; if (typeof iss === "string") { return { message: iss, code: "custom", input, inst }; } return { ...iss }; } function cleanEnum(obj) { return Object.entries(obj).filter(([k2, _]) => { return Number.isNaN(Number.parseInt(k2, 10)); }).map((el) => el[1]); } function base64ToUint8Array(base643) { const binaryString = atob(base643); const bytes = new Uint8Array(binaryString.length); for (let i2 = 0; i2 < binaryString.length; i2++) { bytes[i2] = binaryString.charCodeAt(i2); } return bytes; } function uint8ArrayToBase64(bytes) { let binaryString = ""; for (let i2 = 0; i2 < bytes.length; i2++) { binaryString += String.fromCharCode(bytes[i2]); } return btoa(binaryString); } function base64urlToUint8Array(base64url3) { const base643 = base64url3.replace(/-/g, "+").replace(/_/g, "/"); const padding = "=".repeat((4 - base643.length % 4) % 4); return base64ToUint8Array(base643 + padding); } function uint8ArrayToBase64url(bytes) { return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); } function hexToUint8Array(hex3) { const cleanHex = hex3.replace(/^0x/, ""); if (cleanHex.length % 2 !== 0) { throw new Error("Invalid hex string length"); } const bytes = new Uint8Array(cleanHex.length / 2); for (let i2 = 0; i2 < cleanHex.length; i2 += 2) { bytes[i2 / 2] = Number.parseInt(cleanHex.slice(i2, i2 + 2), 16); } return bytes; } function uint8ArrayToHex(bytes) { return Array.from(bytes).map((b2) => b2.toString(16).padStart(2, "0")).join(""); } var EVALUATING, captureStackTrace, allowsEval, getParsedType, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class; var init_util3 = __esm({ "../../node_modules/zod/v4/core/util.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(assertEqual, "assertEqual"); __name(assertNotEqual, "assertNotEqual"); __name(assertIs, "assertIs"); __name(assertNever, "assertNever"); __name(assert3, "assert"); __name(getEnumValues, "getEnumValues"); __name(joinValues, "joinValues"); __name(jsonStringifyReplacer, "jsonStringifyReplacer"); __name(cached, "cached"); __name(nullish, "nullish"); __name(cleanRegex, "cleanRegex"); __name(floatSafeRemainder, "floatSafeRemainder"); EVALUATING = Symbol("evaluating"); __name(defineLazy, "defineLazy"); __name(objectClone, "objectClone"); __name(assignProp, "assignProp"); __name(mergeDefs, "mergeDefs"); __name(cloneDef, "cloneDef"); __name(getElementAtPath, "getElementAtPath"); __name(promiseAllObject, "promiseAllObject"); __name(randomString, "randomString"); __name(esc, "esc"); __name(slugify, "slugify"); captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { }; __name(isObject3, "isObject"); allowsEval = cached(() => { if (typeof navigator !== "undefined" && "Cloudflare-Workers"?.includes("Cloudflare")) { return false; } try { const F2 = Function; new F2(""); return true; } catch (_) { return false; } }); __name(isPlainObject2, "isPlainObject"); __name(shallowClone, "shallowClone"); __name(numKeys, "numKeys"); getParsedType = /* @__PURE__ */ __name((data) => { const t9 = typeof data; switch (t9) { case "undefined": return "undefined"; case "string": return "string"; case "number": return Number.isNaN(data) ? "nan" : "number"; case "boolean": return "boolean"; case "function": return "function"; case "bigint": return "bigint"; case "symbol": return "symbol"; case "object": if (Array.isArray(data)) { return "array"; } if (data === null) { return "null"; } if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { return "promise"; } if (typeof Map !== "undefined" && data instanceof Map) { return "map"; } if (typeof Set !== "undefined" && data instanceof Set) { return "set"; } if (typeof Date !== "undefined" && data instanceof Date) { return "date"; } if (typeof File !== "undefined" && data instanceof File) { return "file"; } return "object"; default: throw new Error(`Unknown data type: ${t9}`); } }, "getParsedType"); propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]); primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]); __name(escapeRegex, "escapeRegex"); __name(clone, "clone"); __name(normalizeParams, "normalizeParams"); __name(createTransparentProxy, "createTransparentProxy"); __name(stringifyPrimitive, "stringifyPrimitive"); __name(optionalKeys, "optionalKeys"); NUMBER_FORMAT_RANGES = { safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], int32: [-2147483648, 2147483647], uint32: [0, 4294967295], float32: [-34028234663852886e22, 34028234663852886e22], float64: [-Number.MAX_VALUE, Number.MAX_VALUE] }; BIGINT_FORMAT_RANGES = { int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")], uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")] }; __name(pick, "pick"); __name(omit, "omit"); __name(extend, "extend"); __name(safeExtend, "safeExtend"); __name(merge2, "merge"); __name(partial, "partial"); __name(required, "required"); __name(aborted, "aborted"); __name(prefixIssues, "prefixIssues"); __name(unwrapMessage, "unwrapMessage"); __name(finalizeIssue, "finalizeIssue"); __name(getSizableOrigin, "getSizableOrigin"); __name(getLengthableOrigin, "getLengthableOrigin"); __name(parsedType, "parsedType"); __name(issue, "issue"); __name(cleanEnum, "cleanEnum"); __name(base64ToUint8Array, "base64ToUint8Array"); __name(uint8ArrayToBase64, "uint8ArrayToBase64"); __name(base64urlToUint8Array, "base64urlToUint8Array"); __name(uint8ArrayToBase64url, "uint8ArrayToBase64url"); __name(hexToUint8Array, "hexToUint8Array"); __name(uint8ArrayToHex, "uint8ArrayToHex"); Class = class { constructor(..._args) { } }; __name(Class, "Class"); } }); // ../../node_modules/zod/v4/core/errors.js function flattenError(error50, mapper = (issue2) => issue2.message) { const fieldErrors = {}; const formErrors = []; for (const sub of error50.issues) { if (sub.path.length > 0) { fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; fieldErrors[sub.path[0]].push(mapper(sub)); } else { formErrors.push(mapper(sub)); } } return { formErrors, fieldErrors }; } function formatError(error50, mapper = (issue2) => issue2.message) { const fieldErrors = { _errors: [] }; const processError = /* @__PURE__ */ __name((error51) => { for (const issue2 of error51.issues) { if (issue2.code === "invalid_union" && issue2.errors.length) { issue2.errors.map((issues) => processError({ issues })); } else if (issue2.code === "invalid_key") { processError({ issues: issue2.issues }); } else if (issue2.code === "invalid_element") { processError({ issues: issue2.issues }); } else if (issue2.path.length === 0) { fieldErrors._errors.push(mapper(issue2)); } else { let curr = fieldErrors; let i2 = 0; while (i2 < issue2.path.length) { const el = issue2.path[i2]; const terminal = i2 === issue2.path.length - 1; if (!terminal) { curr[el] = curr[el] || { _errors: [] }; } else { curr[el] = curr[el] || { _errors: [] }; curr[el]._errors.push(mapper(issue2)); } curr = curr[el]; i2++; } } } }, "processError"); processError(error50); return fieldErrors; } function treeifyError(error50, mapper = (issue2) => issue2.message) { const result = { errors: [] }; const processError = /* @__PURE__ */ __name((error51, path = []) => { var _a124, _b; for (const issue2 of error51.issues) { if (issue2.code === "invalid_union" && issue2.errors.length) { issue2.errors.map((issues) => processError({ issues }, issue2.path)); } else if (issue2.code === "invalid_key") { processError({ issues: issue2.issues }, issue2.path); } else if (issue2.code === "invalid_element") { processError({ issues: issue2.issues }, issue2.path); } else { const fullpath = [...path, ...issue2.path]; if (fullpath.length === 0) { result.errors.push(mapper(issue2)); continue; } let curr = result; let i2 = 0; while (i2 < fullpath.length) { const el = fullpath[i2]; const terminal = i2 === fullpath.length - 1; if (typeof el === "string") { curr.properties ?? (curr.properties = {}); (_a124 = curr.properties)[el] ?? (_a124[el] = { errors: [] }); curr = curr.properties[el]; } else { curr.items ?? (curr.items = []); (_b = curr.items)[el] ?? (_b[el] = { errors: [] }); curr = curr.items[el]; } if (terminal) { curr.errors.push(mapper(issue2)); } i2++; } } } }, "processError"); processError(error50); return result; } function toDotPath(_path) { const segs = []; const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg); for (const seg of path) { if (typeof seg === "number") segs.push(`[${seg}]`); else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`); else if (/[^\w$]/.test(seg)) segs.push(`[${JSON.stringify(seg)}]`); else { if (segs.length) segs.push("."); segs.push(seg); } } return segs.join(""); } function prettifyError(error50) { const lines = []; const issues = [...error50.issues].sort((a2, b2) => (a2.path ?? []).length - (b2.path ?? []).length); for (const issue2 of issues) { lines.push(`\u2716 ${issue2.message}`); if (issue2.path?.length) lines.push(` \u2192 at ${toDotPath(issue2.path)}`); } return lines.join("\n"); } var initializer, $ZodError, $ZodRealError; var init_errors4 = __esm({ "../../node_modules/zod/v4/core/errors.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core2(); init_util3(); initializer = /* @__PURE__ */ __name((inst, def) => { inst.name = "$ZodError"; Object.defineProperty(inst, "_zod", { value: inst._zod, enumerable: false }); Object.defineProperty(inst, "issues", { value: def, enumerable: false }); inst.message = JSON.stringify(def, jsonStringifyReplacer, 2); Object.defineProperty(inst, "toString", { value: () => inst.message, enumerable: false }); }, "initializer"); $ZodError = $constructor("$ZodError", initializer); $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error }); __name(flattenError, "flattenError"); __name(formatError, "formatError"); __name(treeifyError, "treeifyError"); __name(toDotPath, "toDotPath"); __name(prettifyError, "prettifyError"); } }); // ../../node_modules/zod/v4/core/parse.js var _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, encode3, _decode, decode2, _encodeAsync, encodeAsync, _decodeAsync, decodeAsync, _safeEncode, safeEncode, _safeDecode, safeDecode, _safeEncodeAsync, safeEncodeAsync, _safeDecodeAsync, safeDecodeAsync; var init_parse = __esm({ "../../node_modules/zod/v4/core/parse.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core2(); init_errors4(); init_util3(); _parse = /* @__PURE__ */ __name((_Err2) => (schema, value, _ctx, _params) => { const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; const result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) { throw new $ZodAsyncError(); } if (result.issues.length) { const e2 = new (_params?.Err ?? _Err2)(result.issues.map((iss) => finalizeIssue(iss, ctx, config2()))); captureStackTrace(e2, _params?.callee); throw e2; } return result.value; }, "_parse"); parse = /* @__PURE__ */ _parse($ZodRealError); _parseAsync = /* @__PURE__ */ __name((_Err2) => async (schema, value, _ctx, params) => { const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; let result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) result = await result; if (result.issues.length) { const e2 = new (params?.Err ?? _Err2)(result.issues.map((iss) => finalizeIssue(iss, ctx, config2()))); captureStackTrace(e2, params?.callee); throw e2; } return result.value; }, "_parseAsync"); parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError); _safeParse = /* @__PURE__ */ __name((_Err2) => (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; const result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) { throw new $ZodAsyncError(); } return result.issues.length ? { success: false, error: new (_Err2 ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config2()))) } : { success: true, data: result.value }; }, "_safeParse"); safeParse = /* @__PURE__ */ _safeParse($ZodRealError); _safeParseAsync = /* @__PURE__ */ __name((_Err2) => async (schema, value, _ctx) => { const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; let result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) result = await result; return result.issues.length ? { success: false, error: new _Err2(result.issues.map((iss) => finalizeIssue(iss, ctx, config2()))) } : { success: true, data: result.value }; }, "_safeParseAsync"); safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError); _encode = /* @__PURE__ */ __name((_Err2) => (schema, value, _ctx) => { const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" }; return _parse(_Err2)(schema, value, ctx); }, "_encode"); encode3 = /* @__PURE__ */ _encode($ZodRealError); _decode = /* @__PURE__ */ __name((_Err2) => (schema, value, _ctx) => { return _parse(_Err2)(schema, value, _ctx); }, "_decode"); decode2 = /* @__PURE__ */ _decode($ZodRealError); _encodeAsync = /* @__PURE__ */ __name((_Err2) => async (schema, value, _ctx) => { const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" }; return _parseAsync(_Err2)(schema, value, ctx); }, "_encodeAsync"); encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError); _decodeAsync = /* @__PURE__ */ __name((_Err2) => async (schema, value, _ctx) => { return _parseAsync(_Err2)(schema, value, _ctx); }, "_decodeAsync"); decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError); _safeEncode = /* @__PURE__ */ __name((_Err2) => (schema, value, _ctx) => { const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" }; return _safeParse(_Err2)(schema, value, ctx); }, "_safeEncode"); safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError); _safeDecode = /* @__PURE__ */ __name((_Err2) => (schema, value, _ctx) => { return _safeParse(_Err2)(schema, value, _ctx); }, "_safeDecode"); safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError); _safeEncodeAsync = /* @__PURE__ */ __name((_Err2) => async (schema, value, _ctx) => { const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" }; return _safeParseAsync(_Err2)(schema, value, ctx); }, "_safeEncodeAsync"); safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError); _safeDecodeAsync = /* @__PURE__ */ __name((_Err2) => async (schema, value, _ctx) => { return _safeParseAsync(_Err2)(schema, value, _ctx); }, "_safeDecodeAsync"); safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError); } }); // ../../node_modules/zod/v4/core/regexes.js var regexes_exports = {}; __export(regexes_exports, { base64: () => base64, base64url: () => base64url, bigint: () => bigint2, boolean: () => boolean, browserEmail: () => browserEmail, cidrv4: () => cidrv4, cidrv6: () => cidrv6, cuid: () => cuid, cuid2: () => cuid2, date: () => date2, datetime: () => datetime, domain: () => domain2, duration: () => duration, e164: () => e164, email: () => email, emoji: () => emoji, extendedDuration: () => extendedDuration, guid: () => guid, hex: () => hex, hostname: () => hostname, html5Email: () => html5Email, idnEmail: () => idnEmail, integer: () => integer2, ipv4: () => ipv4, ipv6: () => ipv6, ksuid: () => ksuid, lowercase: () => lowercase, mac: () => mac, md5_base64: () => md5_base64, md5_base64url: () => md5_base64url, md5_hex: () => md5_hex, nanoid: () => nanoid, null: () => _null, number: () => number, rfc5322Email: () => rfc5322Email, sha1_base64: () => sha1_base64, sha1_base64url: () => sha1_base64url, sha1_hex: () => sha1_hex, sha256_base64: () => sha256_base64, sha256_base64url: () => sha256_base64url, sha256_hex: () => sha256_hex, sha384_base64: () => sha384_base64, sha384_base64url: () => sha384_base64url, sha384_hex: () => sha384_hex, sha512_base64: () => sha512_base64, sha512_base64url: () => sha512_base64url, sha512_hex: () => sha512_hex, string: () => string, time: () => time5, ulid: () => ulid, undefined: () => _undefined, unicodeEmail: () => unicodeEmail, uppercase: () => uppercase, uuid: () => uuid, uuid4: () => uuid4, uuid6: () => uuid6, uuid7: () => uuid7, xid: () => xid }); function emoji() { return new RegExp(_emoji, "u"); } function timeSource(args) { const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; return regex; } function time5(args) { return new RegExp(`^${timeSource(args)}$`); } function datetime(args) { const time7 = timeSource({ precision: args.precision }); const opts = ["Z"]; if (args.local) opts.push(""); if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); const timeRegex = `${time7}(?:${opts.join("|")})`; return new RegExp(`^${dateSource}T(?:${timeRegex})$`); } function fixedBase64(bodyLength, padding) { return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`); } function fixedBase64url(length) { return new RegExp(`^[A-Za-z0-9_-]{${length}}$`); } var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain2, e164, dateSource, date2, string, bigint2, integer2, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url; var init_regexes = __esm({ "../../node_modules/zod/v4/core/regexes.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); cuid = /^[cC][^\s-]{8,}$/; cuid2 = /^[0-9a-z]+$/; ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; xid = /^[0-9a-vA-V]{20}$/; ksuid = /^[A-Za-z0-9]{27}$/; nanoid = /^[a-zA-Z0-9_-]{21}$/; duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; extendedDuration = /^[-+]?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)?)??$/; guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; uuid = /* @__PURE__ */ __name((version4) => { if (!version4) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version4}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); }, "uuid"); uuid4 = /* @__PURE__ */ uuid(4); uuid6 = /* @__PURE__ */ uuid(6); uuid7 = /* @__PURE__ */ uuid(7); email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u; idnEmail = unicodeEmail; browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; __name(emoji, "emoji"); ipv4 = /^(?:(?: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])$/; ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; mac = /* @__PURE__ */ __name((delimiter) => { const escapedDelim = escapeRegex(delimiter ?? ":"); return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`); }, "mac"); cidrv4 = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/; cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; base64url = /^[A-Za-z0-9_-]*$/; hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/; domain2 = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/; e164 = /^\+[1-9]\d{6,14}$/; dateSource = `(?:(?:\\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])))`; date2 = /* @__PURE__ */ new RegExp(`^${dateSource}$`); __name(timeSource, "timeSource"); __name(time5, "time"); __name(datetime, "datetime"); string = /* @__PURE__ */ __name((params) => { const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; return new RegExp(`^${regex}$`); }, "string"); bigint2 = /^-?\d+n?$/; integer2 = /^-?\d+$/; number = /^-?\d+(?:\.\d+)?$/; boolean = /^(?:true|false)$/i; _null = /^null$/i; _undefined = /^undefined$/i; lowercase = /^[^A-Z]*$/; uppercase = /^[^a-z]*$/; hex = /^[0-9a-fA-F]*$/; __name(fixedBase64, "fixedBase64"); __name(fixedBase64url, "fixedBase64url"); md5_hex = /^[0-9a-fA-F]{32}$/; md5_base64 = /* @__PURE__ */ fixedBase64(22, "=="); md5_base64url = /* @__PURE__ */ fixedBase64url(22); sha1_hex = /^[0-9a-fA-F]{40}$/; sha1_base64 = /* @__PURE__ */ fixedBase64(27, "="); sha1_base64url = /* @__PURE__ */ fixedBase64url(27); sha256_hex = /^[0-9a-fA-F]{64}$/; sha256_base64 = /* @__PURE__ */ fixedBase64(43, "="); sha256_base64url = /* @__PURE__ */ fixedBase64url(43); sha384_hex = /^[0-9a-fA-F]{96}$/; sha384_base64 = /* @__PURE__ */ fixedBase64(64, ""); sha384_base64url = /* @__PURE__ */ fixedBase64url(64); sha512_hex = /^[0-9a-fA-F]{128}$/; sha512_base64 = /* @__PURE__ */ fixedBase64(86, "=="); sha512_base64url = /* @__PURE__ */ fixedBase64url(86); } }); // ../../node_modules/zod/v4/core/checks.js function handleCheckPropertyResult(result, payload, property) { if (result.issues.length) { payload.issues.push(...prefixIssues(property, result.issues)); } } var $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite; var init_checks2 = __esm({ "../../node_modules/zod/v4/core/checks.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core2(); init_regexes(); init_util3(); $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { var _a124; inst._zod ?? (inst._zod = {}); inst._zod.def = def; (_a124 = inst._zod).onattach ?? (_a124.onattach = []); }); numericOriginMap = { number: "number", bigint: "bigint", object: "date" }; $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => { $ZodCheck.init(inst, def); const origin2 = numericOriginMap[typeof def.value]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; if (def.value < curr) { if (def.inclusive) bag.maximum = def.value; else bag.exclusiveMaximum = def.value; } }); inst._zod.check = (payload) => { if (def.inclusive ? payload.value <= def.value : payload.value < def.value) { return; } payload.issues.push({ origin: origin2, code: "too_big", maximum: typeof def.value === "object" ? def.value.getTime() : def.value, input: payload.value, inclusive: def.inclusive, inst, continue: !def.abort }); }; }); $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => { $ZodCheck.init(inst, def); const origin2 = numericOriginMap[typeof def.value]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; if (def.value > curr) { if (def.inclusive) bag.minimum = def.value; else bag.exclusiveMinimum = def.value; } }); inst._zod.check = (payload) => { if (def.inclusive ? payload.value >= def.value : payload.value > def.value) { return; } payload.issues.push({ origin: origin2, code: "too_small", minimum: typeof def.value === "object" ? def.value.getTime() : def.value, input: payload.value, inclusive: def.inclusive, inst, continue: !def.abort }); }; }); $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => { $ZodCheck.init(inst, def); inst._zod.onattach.push((inst2) => { var _a124; (_a124 = inst2._zod.bag).multipleOf ?? (_a124.multipleOf = def.value); }); inst._zod.check = (payload) => { if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check."); const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0; if (isMultiple) return; payload.issues.push({ origin: typeof payload.value, code: "not_multiple_of", divisor: def.value, input: payload.value, inst, continue: !def.abort }); }; }); $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => { $ZodCheck.init(inst, def); def.format = def.format || "float64"; const isInt = def.format?.includes("int"); const origin2 = isInt ? "int" : "number"; const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.format = def.format; bag.minimum = minimum; bag.maximum = maximum; if (isInt) bag.pattern = integer2; }); inst._zod.check = (payload) => { const input = payload.value; if (isInt) { if (!Number.isInteger(input)) { payload.issues.push({ expected: origin2, format: def.format, code: "invalid_type", continue: false, input, inst }); return; } if (!Number.isSafeInteger(input)) { if (input > 0) { payload.issues.push({ input, code: "too_big", maximum: Number.MAX_SAFE_INTEGER, note: "Integers must be within the safe integer range.", inst, origin: origin2, inclusive: true, continue: !def.abort }); } else { payload.issues.push({ input, code: "too_small", minimum: Number.MIN_SAFE_INTEGER, note: "Integers must be within the safe integer range.", inst, origin: origin2, inclusive: true, continue: !def.abort }); } return; } } if (input < minimum) { payload.issues.push({ origin: "number", input, code: "too_small", minimum, inclusive: true, inst, continue: !def.abort }); } if (input > maximum) { payload.issues.push({ origin: "number", input, code: "too_big", maximum, inclusive: true, inst, continue: !def.abort }); } }; }); $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => { $ZodCheck.init(inst, def); const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.format = def.format; bag.minimum = minimum; bag.maximum = maximum; }); inst._zod.check = (payload) => { const input = payload.value; if (input < minimum) { payload.issues.push({ origin: "bigint", input, code: "too_small", minimum, inclusive: true, inst, continue: !def.abort }); } if (input > maximum) { payload.issues.push({ origin: "bigint", input, code: "too_big", maximum, inclusive: true, inst, continue: !def.abort }); } }; }); $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => { var _a124; $ZodCheck.init(inst, def); (_a124 = inst._zod.def).when ?? (_a124.when = (payload) => { const val = payload.value; return !nullish(val) && val.size !== void 0; }); inst._zod.onattach.push((inst2) => { const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; if (def.maximum < curr) inst2._zod.bag.maximum = def.maximum; }); inst._zod.check = (payload) => { const input = payload.value; const size = input.size; if (size <= def.maximum) return; payload.issues.push({ origin: getSizableOrigin(input), code: "too_big", maximum: def.maximum, inclusive: true, input, inst, continue: !def.abort }); }; }); $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => { var _a124; $ZodCheck.init(inst, def); (_a124 = inst._zod.def).when ?? (_a124.when = (payload) => { const val = payload.value; return !nullish(val) && val.size !== void 0; }); inst._zod.onattach.push((inst2) => { const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; if (def.minimum > curr) inst2._zod.bag.minimum = def.minimum; }); inst._zod.check = (payload) => { const input = payload.value; const size = input.size; if (size >= def.minimum) return; payload.issues.push({ origin: getSizableOrigin(input), code: "too_small", minimum: def.minimum, inclusive: true, input, inst, continue: !def.abort }); }; }); $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => { var _a124; $ZodCheck.init(inst, def); (_a124 = inst._zod.def).when ?? (_a124.when = (payload) => { const val = payload.value; return !nullish(val) && val.size !== void 0; }); inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.minimum = def.size; bag.maximum = def.size; bag.size = def.size; }); inst._zod.check = (payload) => { const input = payload.value; const size = input.size; if (size === def.size) return; const tooBig = size > def.size; payload.issues.push({ origin: getSizableOrigin(input), ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size }, inclusive: true, exact: true, input: payload.value, inst, continue: !def.abort }); }; }); $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { var _a124; $ZodCheck.init(inst, def); (_a124 = inst._zod.def).when ?? (_a124.when = (payload) => { const val = payload.value; return !nullish(val) && val.length !== void 0; }); inst._zod.onattach.push((inst2) => { const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; if (def.maximum < curr) inst2._zod.bag.maximum = def.maximum; }); inst._zod.check = (payload) => { const input = payload.value; const length = input.length; if (length <= def.maximum) return; const origin2 = getLengthableOrigin(input); payload.issues.push({ origin: origin2, code: "too_big", maximum: def.maximum, inclusive: true, input, inst, continue: !def.abort }); }; }); $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => { var _a124; $ZodCheck.init(inst, def); (_a124 = inst._zod.def).when ?? (_a124.when = (payload) => { const val = payload.value; return !nullish(val) && val.length !== void 0; }); inst._zod.onattach.push((inst2) => { const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; if (def.minimum > curr) inst2._zod.bag.minimum = def.minimum; }); inst._zod.check = (payload) => { const input = payload.value; const length = input.length; if (length >= def.minimum) return; const origin2 = getLengthableOrigin(input); payload.issues.push({ origin: origin2, code: "too_small", minimum: def.minimum, inclusive: true, input, inst, continue: !def.abort }); }; }); $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => { var _a124; $ZodCheck.init(inst, def); (_a124 = inst._zod.def).when ?? (_a124.when = (payload) => { const val = payload.value; return !nullish(val) && val.length !== void 0; }); inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.minimum = def.length; bag.maximum = def.length; bag.length = def.length; }); inst._zod.check = (payload) => { const input = payload.value; const length = input.length; if (length === def.length) return; const origin2 = getLengthableOrigin(input); const tooBig = length > def.length; payload.issues.push({ origin: origin2, ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }, inclusive: true, exact: true, input: payload.value, inst, continue: !def.abort }); }; }); $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => { var _a124, _b; $ZodCheck.init(inst, def); inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.format = def.format; if (def.pattern) { bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(def.pattern); } }); if (def.pattern) (_a124 = inst._zod).check ?? (_a124.check = (payload) => { def.pattern.lastIndex = 0; if (def.pattern.test(payload.value)) return; payload.issues.push({ origin: "string", code: "invalid_format", format: def.format, input: payload.value, ...def.pattern ? { pattern: def.pattern.toString() } : {}, inst, continue: !def.abort }); }); else (_b = inst._zod).check ?? (_b.check = () => { }); }); $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => { $ZodCheckStringFormat.init(inst, def); inst._zod.check = (payload) => { def.pattern.lastIndex = 0; if (def.pattern.test(payload.value)) return; payload.issues.push({ origin: "string", code: "invalid_format", format: "regex", input: payload.value, pattern: def.pattern.toString(), inst, continue: !def.abort }); }; }); $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => { def.pattern ?? (def.pattern = lowercase); $ZodCheckStringFormat.init(inst, def); }); $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => { def.pattern ?? (def.pattern = uppercase); $ZodCheckStringFormat.init(inst, def); }); $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => { $ZodCheck.init(inst, def); const escapedRegex = escapeRegex(def.includes); const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); def.pattern = pattern; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(pattern); }); inst._zod.check = (payload) => { if (payload.value.includes(def.includes, def.position)) return; payload.issues.push({ origin: "string", code: "invalid_format", format: "includes", includes: def.includes, input: payload.value, inst, continue: !def.abort }); }; }); $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => { $ZodCheck.init(inst, def); const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`); def.pattern ?? (def.pattern = pattern); inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(pattern); }); inst._zod.check = (payload) => { if (payload.value.startsWith(def.prefix)) return; payload.issues.push({ origin: "string", code: "invalid_format", format: "starts_with", prefix: def.prefix, input: payload.value, inst, continue: !def.abort }); }; }); $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => { $ZodCheck.init(inst, def); const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`); def.pattern ?? (def.pattern = pattern); inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(pattern); }); inst._zod.check = (payload) => { if (payload.value.endsWith(def.suffix)) return; payload.issues.push({ origin: "string", code: "invalid_format", format: "ends_with", suffix: def.suffix, input: payload.value, inst, continue: !def.abort }); }; }); __name(handleCheckPropertyResult, "handleCheckPropertyResult"); $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst, def) => { $ZodCheck.init(inst, def); inst._zod.check = (payload) => { const result = def.schema._zod.run({ value: payload.value[def.property], issues: [] }, {}); if (result instanceof Promise) { return result.then((result2) => handleCheckPropertyResult(result2, payload, def.property)); } handleCheckPropertyResult(result, payload, def.property); return; }; }); $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => { $ZodCheck.init(inst, def); const mimeSet = new Set(def.mime); inst._zod.onattach.push((inst2) => { inst2._zod.bag.mime = def.mime; }); inst._zod.check = (payload) => { if (mimeSet.has(payload.value.type)) return; payload.issues.push({ code: "invalid_value", values: def.mime, input: payload.value.type, inst, continue: !def.abort }); }; }); $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => { $ZodCheck.init(inst, def); inst._zod.check = (payload) => { payload.value = def.tx(payload.value); }; }); } }); // ../../node_modules/zod/v4/core/doc.js var Doc; var init_doc = __esm({ "../../node_modules/zod/v4/core/doc.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); Doc = class { constructor(args = []) { this.content = []; this.indent = 0; if (this) this.args = args; } indented(fn) { this.indent += 1; fn(this); this.indent -= 1; } write(arg) { if (typeof arg === "function") { arg(this, { execution: "sync" }); arg(this, { execution: "async" }); return; } const content = arg; const lines = content.split("\n").filter((x2) => x2); const minIndent = Math.min(...lines.map((x2) => x2.length - x2.trimStart().length)); const dedented = lines.map((x2) => x2.slice(minIndent)).map((x2) => " ".repeat(this.indent * 2) + x2); for (const line of dedented) { this.content.push(line); } } compile() { const F2 = Function; const args = this?.args; const content = this?.content ?? [``]; const lines = [...content.map((x2) => ` ${x2}`)]; return new F2(...args, lines.join("\n")); } }; __name(Doc, "Doc"); } }); // ../../node_modules/zod/v4/core/versions.js var version3; var init_versions = __esm({ "../../node_modules/zod/v4/core/versions.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); version3 = { major: 4, minor: 3, patch: 6 }; } }); // ../../node_modules/zod/v4/core/schemas.js function isValidBase64(data) { if (data === "") return true; if (data.length % 4 !== 0) return false; try { atob(data); return true; } catch { return false; } } function isValidBase64URL(data) { if (!base64url.test(data)) return false; const base643 = data.replace(/[-_]/g, (c2) => c2 === "-" ? "+" : "/"); const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "="); return isValidBase64(padded); } function isValidJWT(token, algorithm = null) { try { const tokensParts = token.split("."); if (tokensParts.length !== 3) return false; const [header] = tokensParts; if (!header) return false; const parsedHeader = JSON.parse(atob(header)); if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false; if (!parsedHeader.alg) return false; if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false; return true; } catch { return false; } } function handleArrayResult(result, final, index) { if (result.issues.length) { final.issues.push(...prefixIssues(index, result.issues)); } final.value[index] = result.value; } function handlePropertyResult(result, final, key, input, isOptionalOut) { if (result.issues.length) { if (isOptionalOut && !(key in input)) { return; } final.issues.push(...prefixIssues(key, result.issues)); } if (result.value === void 0) { if (key in input) { final.value[key] = void 0; } } else { final.value[key] = result.value; } } function normalizeDef(def) { const keys = Object.keys(def.shape); for (const k2 of keys) { if (!def.shape?.[k2]?._zod?.traits?.has("$ZodType")) { throw new Error(`Invalid element at key "${k2}": expected a Zod schema`); } } const okeys = optionalKeys(def.shape); return { ...def, keys, keySet: new Set(keys), numKeys: keys.length, optionalKeys: new Set(okeys) }; } function handleCatchall(proms, input, payload, ctx, def, inst) { const unrecognized = []; const keySet = def.keySet; const _catchall = def.catchall._zod; const t9 = _catchall.def.type; const isOptionalOut = _catchall.optout === "optional"; for (const key in input) { if (keySet.has(key)) continue; if (t9 === "never") { unrecognized.push(key); continue; } const r2 = _catchall.run({ value: input[key], issues: [] }, ctx); if (r2 instanceof Promise) { proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input, isOptionalOut))); } else { handlePropertyResult(r2, payload, key, input, isOptionalOut); } } if (unrecognized.length) { payload.issues.push({ code: "unrecognized_keys", keys: unrecognized, input, inst }); } if (!proms.length) return payload; return Promise.all(proms).then(() => { return payload; }); } function handleUnionResults(results, final, inst, ctx) { for (const result of results) { if (result.issues.length === 0) { final.value = result.value; return final; } } const nonaborted = results.filter((r2) => !aborted(r2)); if (nonaborted.length === 1) { final.value = nonaborted[0].value; return nonaborted[0]; } final.issues.push({ code: "invalid_union", input: final.value, inst, errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config2()))) }); return final; } function handleExclusiveUnionResults(results, final, inst, ctx) { const successes = results.filter((r2) => r2.issues.length === 0); if (successes.length === 1) { final.value = successes[0].value; return final; } if (successes.length === 0) { final.issues.push({ code: "invalid_union", input: final.value, inst, errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config2()))) }); } else { final.issues.push({ code: "invalid_union", input: final.value, inst, errors: [], inclusive: false }); } return final; } function mergeValues(a2, b2) { if (a2 === b2) { return { valid: true, data: a2 }; } if (a2 instanceof Date && b2 instanceof Date && +a2 === +b2) { return { valid: true, data: a2 }; } if (isPlainObject2(a2) && isPlainObject2(b2)) { const bKeys = Object.keys(b2); const sharedKeys = Object.keys(a2).filter((key) => bKeys.indexOf(key) !== -1); const newObj = { ...a2, ...b2 }; for (const key of sharedKeys) { const sharedValue = mergeValues(a2[key], b2[key]); if (!sharedValue.valid) { return { valid: false, mergeErrorPath: [key, ...sharedValue.mergeErrorPath] }; } newObj[key] = sharedValue.data; } return { valid: true, data: newObj }; } if (Array.isArray(a2) && Array.isArray(b2)) { if (a2.length !== b2.length) { return { valid: false, mergeErrorPath: [] }; } const newArray = []; for (let index = 0; index < a2.length; index++) { const itemA = a2[index]; const itemB = b2[index]; const sharedValue = mergeValues(itemA, itemB); if (!sharedValue.valid) { return { valid: false, mergeErrorPath: [index, ...sharedValue.mergeErrorPath] }; } newArray.push(sharedValue.data); } return { valid: true, data: newArray }; } return { valid: false, mergeErrorPath: [] }; } function handleIntersectionResults(result, left, right) { const unrecKeys = /* @__PURE__ */ new Map(); let unrecIssue; for (const iss of left.issues) { if (iss.code === "unrecognized_keys") { unrecIssue ?? (unrecIssue = iss); for (const k2 of iss.keys) { if (!unrecKeys.has(k2)) unrecKeys.set(k2, {}); unrecKeys.get(k2).l = true; } } else { result.issues.push(iss); } } for (const iss of right.issues) { if (iss.code === "unrecognized_keys") { for (const k2 of iss.keys) { if (!unrecKeys.has(k2)) unrecKeys.set(k2, {}); unrecKeys.get(k2).r = true; } } else { result.issues.push(iss); } } const bothKeys = [...unrecKeys].filter(([, f2]) => f2.l && f2.r).map(([k2]) => k2); if (bothKeys.length && unrecIssue) { result.issues.push({ ...unrecIssue, keys: bothKeys }); } if (aborted(result)) return result; const merged = mergeValues(left.value, right.value); if (!merged.valid) { throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`); } result.value = merged.data; return result; } function handleTupleResult(result, final, index) { if (result.issues.length) { final.issues.push(...prefixIssues(index, result.issues)); } final.value[index] = result.value; } function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) { if (keyResult.issues.length) { if (propertyKeyTypes.has(typeof key)) { final.issues.push(...prefixIssues(key, keyResult.issues)); } else { final.issues.push({ code: "invalid_key", origin: "map", input, inst, issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config2())) }); } } if (valueResult.issues.length) { if (propertyKeyTypes.has(typeof key)) { final.issues.push(...prefixIssues(key, valueResult.issues)); } else { final.issues.push({ origin: "map", code: "invalid_element", input, inst, key, issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config2())) }); } } final.value.set(keyResult.value, valueResult.value); } function handleSetResult(result, final) { if (result.issues.length) { final.issues.push(...result.issues); } final.value.add(result.value); } function handleOptionalResult(result, input) { if (result.issues.length && input === void 0) { return { issues: [], value: void 0 }; } return result; } function handleDefaultResult(payload, def) { if (payload.value === void 0) { payload.value = def.defaultValue; } return payload; } function handleNonOptionalResult(payload, inst) { if (!payload.issues.length && payload.value === void 0) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: payload.value, inst }); } return payload; } function handlePipeResult(left, next, ctx) { if (left.issues.length) { left.aborted = true; return left; } return next._zod.run({ value: left.value, issues: left.issues }, ctx); } function handleCodecAResult(result, def, ctx) { if (result.issues.length) { result.aborted = true; return result; } const direction = ctx.direction || "forward"; if (direction === "forward") { const transformed = def.transform(result.value, result); if (transformed instanceof Promise) { return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx)); } return handleCodecTxResult(result, transformed, def.out, ctx); } else { const transformed = def.reverseTransform(result.value, result); if (transformed instanceof Promise) { return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx)); } return handleCodecTxResult(result, transformed, def.in, ctx); } } function handleCodecTxResult(left, value, nextSchema, ctx) { if (left.issues.length) { left.aborted = true; return left; } return nextSchema._zod.run({ value, issues: left.issues }, ctx); } function handleReadonlyResult(payload) { payload.value = Object.freeze(payload.value); return payload; } function handleRefineResult(result, payload, input, inst) { if (!result) { const _iss = { code: "custom", input, inst, // incorporates params.error into issue reporting path: [...inst._zod.def.path ?? []], // incorporates params.error into issue reporting continue: !inst._zod.def.abort // params: inst._zod.def.params, }; if (inst._zod.def.params) _iss.params = inst._zod.def.params; payload.issues.push(issue(_iss)); } } var $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom; var init_schemas = __esm({ "../../node_modules/zod/v4/core/schemas.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_checks2(); init_core2(); init_doc(); init_parse(); init_regexes(); init_util3(); init_versions(); init_util3(); $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { var _a124; inst ?? (inst = {}); inst._zod.def = def; inst._zod.bag = inst._zod.bag || {}; inst._zod.version = version3; const checks = [...inst._zod.def.checks ?? []]; if (inst._zod.traits.has("$ZodCheck")) { checks.unshift(inst); } for (const ch2 of checks) { for (const fn of ch2._zod.onattach) { fn(inst); } } if (checks.length === 0) { (_a124 = inst._zod).deferred ?? (_a124.deferred = []); inst._zod.deferred?.push(() => { inst._zod.run = inst._zod.parse; }); } else { const runChecks = /* @__PURE__ */ __name((payload, checks2, ctx) => { let isAborted = aborted(payload); let asyncResult; for (const ch2 of checks2) { if (ch2._zod.def.when) { const shouldRun = ch2._zod.def.when(payload); if (!shouldRun) continue; } else if (isAborted) { continue; } const currLen = payload.issues.length; const _ = ch2._zod.check(payload); if (_ instanceof Promise && ctx?.async === false) { throw new $ZodAsyncError(); } if (asyncResult || _ instanceof Promise) { asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { await _; const nextLen = payload.issues.length; if (nextLen === currLen) return; if (!isAborted) isAborted = aborted(payload, currLen); }); } else { const nextLen = payload.issues.length; if (nextLen === currLen) continue; if (!isAborted) isAborted = aborted(payload, currLen); } } if (asyncResult) { return asyncResult.then(() => { return payload; }); } return payload; }, "runChecks"); const handleCanaryResult = /* @__PURE__ */ __name((canary, payload, ctx) => { if (aborted(canary)) { canary.aborted = true; return canary; } const checkResult = runChecks(payload, checks, ctx); if (checkResult instanceof Promise) { if (ctx.async === false) throw new $ZodAsyncError(); return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx)); } return inst._zod.parse(checkResult, ctx); }, "handleCanaryResult"); inst._zod.run = (payload, ctx) => { if (ctx.skipChecks) { return inst._zod.parse(payload, ctx); } if (ctx.direction === "backward") { const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true }); if (canary instanceof Promise) { return canary.then((canary2) => { return handleCanaryResult(canary2, payload, ctx); }); } return handleCanaryResult(canary, payload, ctx); } const result = inst._zod.parse(payload, ctx); if (result instanceof Promise) { if (ctx.async === false) throw new $ZodAsyncError(); return result.then((result2) => runChecks(result2, checks, ctx)); } return runChecks(result, checks, ctx); }; } defineLazy(inst, "~standard", () => ({ validate: (value) => { try { const r2 = safeParse(inst, value); return r2.success ? { value: r2.data } : { issues: r2.error?.issues }; } catch (_) { return safeParseAsync(inst, value).then((r2) => r2.success ? { value: r2.data } : { issues: r2.error?.issues }); } }, vendor: "zod", version: 1 })); }); $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag); inst._zod.parse = (payload, _) => { if (def.coerce) try { payload.value = String(payload.value); } catch (_2) { } if (typeof payload.value === "string") return payload; payload.issues.push({ expected: "string", code: "invalid_type", input: payload.value, inst }); return payload; }; }); $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => { $ZodCheckStringFormat.init(inst, def); $ZodString.init(inst, def); }); $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => { def.pattern ?? (def.pattern = guid); $ZodStringFormat.init(inst, def); }); $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { if (def.version) { const versionMap = { v1: 1, v2: 2, v3: 3, v4: 4, v5: 5, v6: 6, v7: 7, v8: 8 }; const v3 = versionMap[def.version]; if (v3 === void 0) throw new Error(`Invalid UUID version: "${def.version}"`); def.pattern ?? (def.pattern = uuid(v3)); } else def.pattern ?? (def.pattern = uuid()); $ZodStringFormat.init(inst, def); }); $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => { def.pattern ?? (def.pattern = email); $ZodStringFormat.init(inst, def); }); $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { $ZodStringFormat.init(inst, def); inst._zod.check = (payload) => { try { const trimmed = payload.value.trim(); const url2 = new URL(trimmed); if (def.hostname) { def.hostname.lastIndex = 0; if (!def.hostname.test(url2.hostname)) { payload.issues.push({ code: "invalid_format", format: "url", note: "Invalid hostname", pattern: def.hostname.source, input: payload.value, inst, continue: !def.abort }); } } if (def.protocol) { def.protocol.lastIndex = 0; if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) { payload.issues.push({ code: "invalid_format", format: "url", note: "Invalid protocol", pattern: def.protocol.source, input: payload.value, inst, continue: !def.abort }); } } if (def.normalize) { payload.value = url2.href; } else { payload.value = trimmed; } return; } catch (_) { payload.issues.push({ code: "invalid_format", format: "url", input: payload.value, inst, continue: !def.abort }); } }; }); $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => { def.pattern ?? (def.pattern = emoji()); $ZodStringFormat.init(inst, def); }); $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { def.pattern ?? (def.pattern = nanoid); $ZodStringFormat.init(inst, def); }); $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => { def.pattern ?? (def.pattern = cuid); $ZodStringFormat.init(inst, def); }); $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => { def.pattern ?? (def.pattern = cuid2); $ZodStringFormat.init(inst, def); }); $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => { def.pattern ?? (def.pattern = ulid); $ZodStringFormat.init(inst, def); }); $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => { def.pattern ?? (def.pattern = xid); $ZodStringFormat.init(inst, def); }); $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => { def.pattern ?? (def.pattern = ksuid); $ZodStringFormat.init(inst, def); }); $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => { def.pattern ?? (def.pattern = datetime(def)); $ZodStringFormat.init(inst, def); }); $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => { def.pattern ?? (def.pattern = date2); $ZodStringFormat.init(inst, def); }); $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => { def.pattern ?? (def.pattern = time5(def)); $ZodStringFormat.init(inst, def); }); $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => { def.pattern ?? (def.pattern = duration); $ZodStringFormat.init(inst, def); }); $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => { def.pattern ?? (def.pattern = ipv4); $ZodStringFormat.init(inst, def); inst._zod.bag.format = `ipv4`; }); $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { def.pattern ?? (def.pattern = ipv6); $ZodStringFormat.init(inst, def); inst._zod.bag.format = `ipv6`; inst._zod.check = (payload) => { try { new URL(`http://[${payload.value}]`); } catch { payload.issues.push({ code: "invalid_format", format: "ipv6", input: payload.value, inst, continue: !def.abort }); } }; }); $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => { def.pattern ?? (def.pattern = mac(def.delimiter)); $ZodStringFormat.init(inst, def); inst._zod.bag.format = `mac`; }); $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => { def.pattern ?? (def.pattern = cidrv4); $ZodStringFormat.init(inst, def); }); $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => { def.pattern ?? (def.pattern = cidrv6); $ZodStringFormat.init(inst, def); inst._zod.check = (payload) => { const parts = payload.value.split("/"); try { if (parts.length !== 2) throw new Error(); const [address, prefix] = parts; if (!prefix) throw new Error(); const prefixNum = Number(prefix); if (`${prefixNum}` !== prefix) throw new Error(); if (prefixNum < 0 || prefixNum > 128) throw new Error(); new URL(`http://[${address}]`); } catch { payload.issues.push({ code: "invalid_format", format: "cidrv6", input: payload.value, inst, continue: !def.abort }); } }; }); __name(isValidBase64, "isValidBase64"); $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { def.pattern ?? (def.pattern = base64); $ZodStringFormat.init(inst, def); inst._zod.bag.contentEncoding = "base64"; inst._zod.check = (payload) => { if (isValidBase64(payload.value)) return; payload.issues.push({ code: "invalid_format", format: "base64", input: payload.value, inst, continue: !def.abort }); }; }); __name(isValidBase64URL, "isValidBase64URL"); $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => { def.pattern ?? (def.pattern = base64url); $ZodStringFormat.init(inst, def); inst._zod.bag.contentEncoding = "base64url"; inst._zod.check = (payload) => { if (isValidBase64URL(payload.value)) return; payload.issues.push({ code: "invalid_format", format: "base64url", input: payload.value, inst, continue: !def.abort }); }; }); $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => { def.pattern ?? (def.pattern = e164); $ZodStringFormat.init(inst, def); }); __name(isValidJWT, "isValidJWT"); $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { $ZodStringFormat.init(inst, def); inst._zod.check = (payload) => { if (isValidJWT(payload.value, def.alg)) return; payload.issues.push({ code: "invalid_format", format: "jwt", input: payload.value, inst, continue: !def.abort }); }; }); $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => { $ZodStringFormat.init(inst, def); inst._zod.check = (payload) => { if (def.fn(payload.value)) return; payload.issues.push({ code: "invalid_format", format: def.format, input: payload.value, inst, continue: !def.abort }); }; }); $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = inst._zod.bag.pattern ?? number; inst._zod.parse = (payload, _ctx) => { if (def.coerce) try { payload.value = Number(payload.value); } catch (_) { } const input = payload.value; if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) { return payload; } const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0; payload.issues.push({ expected: "number", code: "invalid_type", input, inst, ...received ? { received } : {} }); return payload; }; }); $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => { $ZodCheckNumberFormat.init(inst, def); $ZodNumber.init(inst, def); }); $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = boolean; inst._zod.parse = (payload, _ctx) => { if (def.coerce) try { payload.value = Boolean(payload.value); } catch (_) { } const input = payload.value; if (typeof input === "boolean") return payload; payload.issues.push({ expected: "boolean", code: "invalid_type", input, inst }); return payload; }; }); $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = bigint2; inst._zod.parse = (payload, _ctx) => { if (def.coerce) try { payload.value = BigInt(payload.value); } catch (_) { } if (typeof payload.value === "bigint") return payload; payload.issues.push({ expected: "bigint", code: "invalid_type", input: payload.value, inst }); return payload; }; }); $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, def) => { $ZodCheckBigIntFormat.init(inst, def); $ZodBigInt.init(inst, def); }); $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (typeof input === "symbol") return payload; payload.issues.push({ expected: "symbol", code: "invalid_type", input, inst }); return payload; }; }); $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = _undefined; inst._zod.values = /* @__PURE__ */ new Set([void 0]); inst._zod.optin = "optional"; inst._zod.optout = "optional"; inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (typeof input === "undefined") return payload; payload.issues.push({ expected: "undefined", code: "invalid_type", input, inst }); return payload; }; }); $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = _null; inst._zod.values = /* @__PURE__ */ new Set([null]); inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (input === null) return payload; payload.issues.push({ expected: "null", code: "invalid_type", input, inst }); return payload; }; }); $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload) => payload; }); $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload) => payload; }); $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, _ctx) => { payload.issues.push({ expected: "never", code: "invalid_type", input: payload.value, inst }); return payload; }; }); $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (typeof input === "undefined") return payload; payload.issues.push({ expected: "void", code: "invalid_type", input, inst }); return payload; }; }); $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, _ctx) => { if (def.coerce) { try { payload.value = new Date(payload.value); } catch (_err) { } } const input = payload.value; const isDate2 = input instanceof Date; const isValidDate = isDate2 && !Number.isNaN(input.getTime()); if (isValidDate) return payload; payload.issues.push({ expected: "date", code: "invalid_type", input, ...isDate2 ? { received: "Invalid Date" } : {}, inst }); return payload; }; }); __name(handleArrayResult, "handleArrayResult"); $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; if (!Array.isArray(input)) { payload.issues.push({ expected: "array", code: "invalid_type", input, inst }); return payload; } payload.value = Array(input.length); const proms = []; for (let i2 = 0; i2 < input.length; i2++) { const item = input[i2]; const result = def.element._zod.run({ value: item, issues: [] }, ctx); if (result instanceof Promise) { proms.push(result.then((result2) => handleArrayResult(result2, payload, i2))); } else { handleArrayResult(result, payload, i2); } } if (proms.length) { return Promise.all(proms).then(() => payload); } return payload; }; }); __name(handlePropertyResult, "handlePropertyResult"); __name(normalizeDef, "normalizeDef"); __name(handleCatchall, "handleCatchall"); $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { $ZodType.init(inst, def); const desc2 = Object.getOwnPropertyDescriptor(def, "shape"); if (!desc2?.get) { const sh = def.shape; Object.defineProperty(def, "shape", { get: () => { const newSh = { ...sh }; Object.defineProperty(def, "shape", { value: newSh }); return newSh; } }); } const _normalized = cached(() => normalizeDef(def)); defineLazy(inst._zod, "propValues", () => { const shape = def.shape; const propValues = {}; for (const key in shape) { const field = shape[key]._zod; if (field.values) { propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set()); for (const v3 of field.values) propValues[key].add(v3); } } return propValues; }); const isObject5 = isObject3; const catchall = def.catchall; let value; inst._zod.parse = (payload, ctx) => { value ?? (value = _normalized.value); const input = payload.value; if (!isObject5(input)) { payload.issues.push({ expected: "object", code: "invalid_type", input, inst }); return payload; } payload.value = {}; const proms = []; const shape = value.shape; for (const key of value.keys) { const el = shape[key]; const isOptionalOut = el._zod.optout === "optional"; const r2 = el._zod.run({ value: input[key], issues: [] }, ctx); if (r2 instanceof Promise) { proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input, isOptionalOut))); } else { handlePropertyResult(r2, payload, key, input, isOptionalOut); } } if (!catchall) { return proms.length ? Promise.all(proms).then(() => payload) : payload; } return handleCatchall(proms, input, payload, ctx, _normalized.value, inst); }; }); $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => { $ZodObject.init(inst, def); const superParse = inst._zod.parse; const _normalized = cached(() => normalizeDef(def)); const generateFastpass = /* @__PURE__ */ __name((shape) => { const doc = new Doc(["shape", "payload", "ctx"]); const normalized = _normalized.value; const parseStr = /* @__PURE__ */ __name((key) => { const k2 = esc(key); return `shape[${k2}]._zod.run({ value: input[${k2}], issues: [] }, ctx)`; }, "parseStr"); doc.write(`const input = payload.value;`); const ids = /* @__PURE__ */ Object.create(null); let counter = 0; for (const key of normalized.keys) { ids[key] = `key_${counter++}`; } doc.write(`const newResult = {};`); for (const key of normalized.keys) { const id = ids[key]; const k2 = esc(key); const schema = shape[key]; const isOptionalOut = schema?._zod?.optout === "optional"; doc.write(`const ${id} = ${parseStr(key)};`); if (isOptionalOut) { doc.write(` if (${id}.issues.length) { if (${k2} in input) { payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ ...iss, path: iss.path ? [${k2}, ...iss.path] : [${k2}] }))); } } if (${id}.value === undefined) { if (${k2} in input) { newResult[${k2}] = undefined; } } else { newResult[${k2}] = ${id}.value; } `); } else { doc.write(` if (${id}.issues.length) { payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ ...iss, path: iss.path ? [${k2}, ...iss.path] : [${k2}] }))); } if (${id}.value === undefined) { if (${k2} in input) { newResult[${k2}] = undefined; } } else { newResult[${k2}] = ${id}.value; } `); } } doc.write(`payload.value = newResult;`); doc.write(`return payload;`); const fn = doc.compile(); return (payload, ctx) => fn(shape, payload, ctx); }, "generateFastpass"); let fastpass; const isObject5 = isObject3; const jit = !globalConfig.jitless; const allowsEval2 = allowsEval; const fastEnabled = jit && allowsEval2.value; const catchall = def.catchall; let value; inst._zod.parse = (payload, ctx) => { value ?? (value = _normalized.value); const input = payload.value; if (!isObject5(input)) { payload.issues.push({ expected: "object", code: "invalid_type", input, inst }); return payload; } if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) { if (!fastpass) fastpass = generateFastpass(def.shape); payload = fastpass(payload, ctx); if (!catchall) return payload; return handleCatchall([], input, payload, ctx, value, inst); } return superParse(payload, ctx); }; }); __name(handleUnionResults, "handleUnionResults"); $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "optin", () => def.options.some((o2) => o2._zod.optin === "optional") ? "optional" : void 0); defineLazy(inst._zod, "optout", () => def.options.some((o2) => o2._zod.optout === "optional") ? "optional" : void 0); defineLazy(inst._zod, "values", () => { if (def.options.every((o2) => o2._zod.values)) { return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); } return void 0; }); defineLazy(inst._zod, "pattern", () => { if (def.options.every((o2) => o2._zod.pattern)) { const patterns = def.options.map((o2) => o2._zod.pattern); return new RegExp(`^(${patterns.map((p2) => cleanRegex(p2.source)).join("|")})$`); } return void 0; }); const single = def.options.length === 1; const first = def.options[0]._zod.run; inst._zod.parse = (payload, ctx) => { if (single) { return first(payload, ctx); } let async = false; const results = []; for (const option of def.options) { const result = option._zod.run({ value: payload.value, issues: [] }, ctx); if (result instanceof Promise) { results.push(result); async = true; } else { if (result.issues.length === 0) return result; results.push(result); } } if (!async) return handleUnionResults(results, payload, inst, ctx); return Promise.all(results).then((results2) => { return handleUnionResults(results2, payload, inst, ctx); }); }; }); __name(handleExclusiveUnionResults, "handleExclusiveUnionResults"); $ZodXor = /* @__PURE__ */ $constructor("$ZodXor", (inst, def) => { $ZodUnion.init(inst, def); def.inclusive = false; const single = def.options.length === 1; const first = def.options[0]._zod.run; inst._zod.parse = (payload, ctx) => { if (single) { return first(payload, ctx); } let async = false; const results = []; for (const option of def.options) { const result = option._zod.run({ value: payload.value, issues: [] }, ctx); if (result instanceof Promise) { results.push(result); async = true; } else { results.push(result); } } if (!async) return handleExclusiveUnionResults(results, payload, inst, ctx); return Promise.all(results).then((results2) => { return handleExclusiveUnionResults(results2, payload, inst, ctx); }); }; }); $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => { def.inclusive = false; $ZodUnion.init(inst, def); const _super = inst._zod.parse; defineLazy(inst._zod, "propValues", () => { const propValues = {}; for (const option of def.options) { const pv = option._zod.propValues; if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`); for (const [k2, v3] of Object.entries(pv)) { if (!propValues[k2]) propValues[k2] = /* @__PURE__ */ new Set(); for (const val of v3) { propValues[k2].add(val); } } } return propValues; }); const disc = cached(() => { const opts = def.options; const map2 = /* @__PURE__ */ new Map(); for (const o2 of opts) { const values = o2._zod.propValues?.[def.discriminator]; if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o2)}"`); for (const v3 of values) { if (map2.has(v3)) { throw new Error(`Duplicate discriminator value "${String(v3)}"`); } map2.set(v3, o2); } } return map2; }); inst._zod.parse = (payload, ctx) => { const input = payload.value; if (!isObject3(input)) { payload.issues.push({ code: "invalid_type", expected: "object", input, inst }); return payload; } const opt = disc.value.get(input?.[def.discriminator]); if (opt) { return opt._zod.run(payload, ctx); } if (def.unionFallback) { return _super(payload, ctx); } payload.issues.push({ code: "invalid_union", errors: [], note: "No matching discriminator", discriminator: def.discriminator, input, path: [def.discriminator], inst }); return payload; }; }); $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; const left = def.left._zod.run({ value: input, issues: [] }, ctx); const right = def.right._zod.run({ value: input, issues: [] }, ctx); const async = left instanceof Promise || right instanceof Promise; if (async) { return Promise.all([left, right]).then(([left2, right2]) => { return handleIntersectionResults(payload, left2, right2); }); } return handleIntersectionResults(payload, left, right); }; }); __name(mergeValues, "mergeValues"); __name(handleIntersectionResults, "handleIntersectionResults"); $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => { $ZodType.init(inst, def); const items = def.items; inst._zod.parse = (payload, ctx) => { const input = payload.value; if (!Array.isArray(input)) { payload.issues.push({ input, inst, expected: "tuple", code: "invalid_type" }); return payload; } payload.value = []; const proms = []; const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional"); const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex; if (!def.rest) { const tooBig = input.length > items.length; const tooSmall = input.length < optStart - 1; if (tooBig || tooSmall) { payload.issues.push({ ...tooBig ? { code: "too_big", maximum: items.length, inclusive: true } : { code: "too_small", minimum: items.length }, input, inst, origin: "array" }); return payload; } } let i2 = -1; for (const item of items) { i2++; if (i2 >= input.length) { if (i2 >= optStart) continue; } const result = item._zod.run({ value: input[i2], issues: [] }, ctx); if (result instanceof Promise) { proms.push(result.then((result2) => handleTupleResult(result2, payload, i2))); } else { handleTupleResult(result, payload, i2); } } if (def.rest) { const rest = input.slice(items.length); for (const el of rest) { i2++; const result = def.rest._zod.run({ value: el, issues: [] }, ctx); if (result instanceof Promise) { proms.push(result.then((result2) => handleTupleResult(result2, payload, i2))); } else { handleTupleResult(result, payload, i2); } } } if (proms.length) return Promise.all(proms).then(() => payload); return payload; }; }); __name(handleTupleResult, "handleTupleResult"); $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; if (!isPlainObject2(input)) { payload.issues.push({ expected: "record", code: "invalid_type", input, inst }); return payload; } const proms = []; const values = def.keyType._zod.values; if (values) { payload.value = {}; const recordKeys = /* @__PURE__ */ new Set(); for (const key of values) { if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { recordKeys.add(typeof key === "number" ? key.toString() : key); const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); if (result instanceof Promise) { proms.push(result.then((result2) => { if (result2.issues.length) { payload.issues.push(...prefixIssues(key, result2.issues)); } payload.value[key] = result2.value; })); } else { if (result.issues.length) { payload.issues.push(...prefixIssues(key, result.issues)); } payload.value[key] = result.value; } } } let unrecognized; for (const key in input) { if (!recordKeys.has(key)) { unrecognized = unrecognized ?? []; unrecognized.push(key); } } if (unrecognized && unrecognized.length > 0) { payload.issues.push({ code: "unrecognized_keys", input, inst, keys: unrecognized }); } } else { payload.value = {}; for (const key of Reflect.ownKeys(input)) { if (key === "__proto__") continue; let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); if (keyResult instanceof Promise) { throw new Error("Async schemas not supported in object keys currently"); } const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length; if (checkNumericKey) { const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx); if (retryResult instanceof Promise) { throw new Error("Async schemas not supported in object keys currently"); } if (retryResult.issues.length === 0) { keyResult = retryResult; } } if (keyResult.issues.length) { if (def.mode === "loose") { payload.value[key] = input[key]; } else { payload.issues.push({ code: "invalid_key", origin: "record", issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config2())), input: key, path: [key], inst }); } continue; } const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); if (result instanceof Promise) { proms.push(result.then((result2) => { if (result2.issues.length) { payload.issues.push(...prefixIssues(key, result2.issues)); } payload.value[keyResult.value] = result2.value; })); } else { if (result.issues.length) { payload.issues.push(...prefixIssues(key, result.issues)); } payload.value[keyResult.value] = result.value; } } } if (proms.length) { return Promise.all(proms).then(() => payload); } return payload; }; }); $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; if (!(input instanceof Map)) { payload.issues.push({ expected: "map", code: "invalid_type", input, inst }); return payload; } const proms = []; payload.value = /* @__PURE__ */ new Map(); for (const [key, value] of input) { const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx); if (keyResult instanceof Promise || valueResult instanceof Promise) { proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => { handleMapResult(keyResult2, valueResult2, payload, key, input, inst, ctx); })); } else { handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx); } } if (proms.length) return Promise.all(proms).then(() => payload); return payload; }; }); __name(handleMapResult, "handleMapResult"); $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; if (!(input instanceof Set)) { payload.issues.push({ input, inst, expected: "set", code: "invalid_type" }); return payload; } const proms = []; payload.value = /* @__PURE__ */ new Set(); for (const item of input) { const result = def.valueType._zod.run({ value: item, issues: [] }, ctx); if (result instanceof Promise) { proms.push(result.then((result2) => handleSetResult(result2, payload))); } else handleSetResult(result, payload); } if (proms.length) return Promise.all(proms).then(() => payload); return payload; }; }); __name(handleSetResult, "handleSetResult"); $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { $ZodType.init(inst, def); const values = getEnumValues(def.entries); const valuesSet = new Set(values); inst._zod.values = valuesSet; inst._zod.pattern = new RegExp(`^(${values.filter((k2) => propertyKeyTypes.has(typeof k2)).map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2.toString()).join("|")})$`); inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (valuesSet.has(input)) { return payload; } payload.issues.push({ code: "invalid_value", values, input, inst }); return payload; }; }); $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => { $ZodType.init(inst, def); if (def.values.length === 0) { throw new Error("Cannot create literal schema with no valid values"); } const values = new Set(def.values); inst._zod.values = values; inst._zod.pattern = new RegExp(`^(${def.values.map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2 ? escapeRegex(o2.toString()) : String(o2)).join("|")})$`); inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (values.has(input)) { return payload; } payload.issues.push({ code: "invalid_value", values: def.values, input, inst }); return payload; }; }); $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (input instanceof File) return payload; payload.issues.push({ expected: "file", code: "invalid_type", input, inst }); return payload; }; }); $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { throw new $ZodEncodeError(inst.constructor.name); } const _out = def.transform(payload.value, payload); if (ctx.async) { const output = _out instanceof Promise ? _out : Promise.resolve(_out); return output.then((output2) => { payload.value = output2; return payload; }); } if (_out instanceof Promise) { throw new $ZodAsyncError(); } payload.value = _out; return payload; }; }); __name(handleOptionalResult, "handleOptionalResult"); $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; inst._zod.optout = "optional"; defineLazy(inst._zod, "values", () => { return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0; }); defineLazy(inst._zod, "pattern", () => { const pattern = def.innerType._zod.pattern; return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; }); inst._zod.parse = (payload, ctx) => { if (def.innerType._zod.optin === "optional") { const result = def.innerType._zod.run(payload, ctx); if (result instanceof Promise) return result.then((r2) => handleOptionalResult(r2, payload.value)); return handleOptionalResult(result, payload.value); } if (payload.value === void 0) { return payload; } return def.innerType._zod.run(payload, ctx); }; }); $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => { $ZodOptional.init(inst, def); defineLazy(inst._zod, "values", () => def.innerType._zod.values); defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern); inst._zod.parse = (payload, ctx) => { return def.innerType._zod.run(payload, ctx); }; }); $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); defineLazy(inst._zod, "pattern", () => { const pattern = def.innerType._zod.pattern; return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; }); defineLazy(inst._zod, "values", () => { return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0; }); inst._zod.parse = (payload, ctx) => { if (payload.value === null) return payload; return def.innerType._zod.run(payload, ctx); }; }); $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; defineLazy(inst._zod, "values", () => def.innerType._zod.values); inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { return def.innerType._zod.run(payload, ctx); } if (payload.value === void 0) { payload.value = def.defaultValue; return payload; } const result = def.innerType._zod.run(payload, ctx); if (result instanceof Promise) { return result.then((result2) => handleDefaultResult(result2, def)); } return handleDefaultResult(result, def); }; }); __name(handleDefaultResult, "handleDefaultResult"); $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; defineLazy(inst._zod, "values", () => def.innerType._zod.values); inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { return def.innerType._zod.run(payload, ctx); } if (payload.value === void 0) { payload.value = def.defaultValue; } return def.innerType._zod.run(payload, ctx); }; }); $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "values", () => { const v3 = def.innerType._zod.values; return v3 ? new Set([...v3].filter((x2) => x2 !== void 0)) : void 0; }); inst._zod.parse = (payload, ctx) => { const result = def.innerType._zod.run(payload, ctx); if (result instanceof Promise) { return result.then((result2) => handleNonOptionalResult(result2, inst)); } return handleNonOptionalResult(result, inst); }; }); __name(handleNonOptionalResult, "handleNonOptionalResult"); $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { throw new $ZodEncodeError("ZodSuccess"); } const result = def.innerType._zod.run(payload, ctx); if (result instanceof Promise) { return result.then((result2) => { payload.value = result2.issues.length === 0; return payload; }); } payload.value = result.issues.length === 0; return payload; }; }); $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); defineLazy(inst._zod, "values", () => def.innerType._zod.values); inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { return def.innerType._zod.run(payload, ctx); } const result = def.innerType._zod.run(payload, ctx); if (result instanceof Promise) { return result.then((result2) => { payload.value = result2.value; if (result2.issues.length) { payload.value = def.catchValue({ ...payload, error: { issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config2())) }, input: payload.value }); payload.issues = []; } return payload; }); } payload.value = result.value; if (result.issues.length) { payload.value = def.catchValue({ ...payload, error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config2())) }, input: payload.value }); payload.issues = []; } return payload; }; }); $ZodNaN = /* @__PURE__ */ $constructor("$ZodNaN", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, _ctx) => { if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) { payload.issues.push({ input: payload.value, inst, expected: "nan", code: "invalid_type" }); return payload; } return payload; }; }); $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "values", () => def.in._zod.values); defineLazy(inst._zod, "optin", () => def.in._zod.optin); defineLazy(inst._zod, "optout", () => def.out._zod.optout); defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { const right = def.out._zod.run(payload, ctx); if (right instanceof Promise) { return right.then((right2) => handlePipeResult(right2, def.in, ctx)); } return handlePipeResult(right, def.in, ctx); } const left = def.in._zod.run(payload, ctx); if (left instanceof Promise) { return left.then((left2) => handlePipeResult(left2, def.out, ctx)); } return handlePipeResult(left, def.out, ctx); }; }); __name(handlePipeResult, "handlePipeResult"); $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "values", () => def.in._zod.values); defineLazy(inst._zod, "optin", () => def.in._zod.optin); defineLazy(inst._zod, "optout", () => def.out._zod.optout); defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); inst._zod.parse = (payload, ctx) => { const direction = ctx.direction || "forward"; if (direction === "forward") { const left = def.in._zod.run(payload, ctx); if (left instanceof Promise) { return left.then((left2) => handleCodecAResult(left2, def, ctx)); } return handleCodecAResult(left, def, ctx); } else { const right = def.out._zod.run(payload, ctx); if (right instanceof Promise) { return right.then((right2) => handleCodecAResult(right2, def, ctx)); } return handleCodecAResult(right, def, ctx); } }; }); __name(handleCodecAResult, "handleCodecAResult"); __name(handleCodecTxResult, "handleCodecTxResult"); $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); defineLazy(inst._zod, "values", () => def.innerType._zod.values); defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin); defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout); inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { return def.innerType._zod.run(payload, ctx); } const result = def.innerType._zod.run(payload, ctx); if (result instanceof Promise) { return result.then(handleReadonlyResult); } return handleReadonlyResult(result); }; }); __name(handleReadonlyResult, "handleReadonlyResult"); $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => { $ZodType.init(inst, def); const regexParts = []; for (const part of def.parts) { if (typeof part === "object" && part !== null) { if (!part._zod.pattern) { throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`); } const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern; if (!source) throw new Error(`Invalid template literal part: ${part._zod.traits}`); const start = source.startsWith("^") ? 1 : 0; const end = source.endsWith("$") ? source.length - 1 : source.length; regexParts.push(source.slice(start, end)); } else if (part === null || primitiveTypes.has(typeof part)) { regexParts.push(escapeRegex(`${part}`)); } else { throw new Error(`Invalid template literal part: ${part}`); } } inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`); inst._zod.parse = (payload, _ctx) => { if (typeof payload.value !== "string") { payload.issues.push({ input: payload.value, inst, expected: "string", code: "invalid_type" }); return payload; } inst._zod.pattern.lastIndex = 0; if (!inst._zod.pattern.test(payload.value)) { payload.issues.push({ input: payload.value, inst, code: "invalid_format", format: def.format ?? "template_literal", pattern: inst._zod.pattern.source }); return payload; } return payload; }; }); $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => { $ZodType.init(inst, def); inst._def = def; inst._zod.def = def; inst.implement = (func) => { if (typeof func !== "function") { throw new Error("implement() must be called with a function"); } return function(...args) { const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args; const result = Reflect.apply(func, this, parsedArgs); if (inst._def.output) { return parse(inst._def.output, result); } return result; }; }; inst.implementAsync = (func) => { if (typeof func !== "function") { throw new Error("implementAsync() must be called with a function"); } return async function(...args) { const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args; const result = await Reflect.apply(func, this, parsedArgs); if (inst._def.output) { return await parseAsync(inst._def.output, result); } return result; }; }; inst._zod.parse = (payload, _ctx) => { if (typeof payload.value !== "function") { payload.issues.push({ code: "invalid_type", expected: "function", input: payload.value, inst }); return payload; } const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise"; if (hasPromiseOutput) { payload.value = inst.implementAsync(payload.value); } else { payload.value = inst.implement(payload.value); } return payload; }; inst.input = (...args) => { const F2 = inst.constructor; if (Array.isArray(args[0])) { return new F2({ type: "function", input: new $ZodTuple({ type: "tuple", items: args[0], rest: args[1] }), output: inst._def.output }); } return new F2({ type: "function", input: args[0], output: inst._def.output }); }; inst.output = (output) => { const F2 = inst.constructor; return new F2({ type: "function", input: inst._def.input, output }); }; return inst; }); $ZodPromise = /* @__PURE__ */ $constructor("$ZodPromise", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx)); }; }); $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "innerType", () => def.getter()); defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern); defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues); defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0); defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? void 0); inst._zod.parse = (payload, ctx) => { const inner = inst._zod.innerType; return inner._zod.run(payload, ctx); }; }); $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { $ZodCheck.init(inst, def); $ZodType.init(inst, def); inst._zod.parse = (payload, _) => { return payload; }; inst._zod.check = (payload) => { const input = payload.value; const r2 = def.fn(input); if (r2 instanceof Promise) { return r2.then((r3) => handleRefineResult(r3, payload, input, inst)); } handleRefineResult(r2, payload, input, inst); return; }; }); __name(handleRefineResult, "handleRefineResult"); } }); // ../../node_modules/zod/v4/locales/ar.js function ar_default() { return { localeError: error3() }; } var error3; var init_ar = __esm({ "../../node_modules/zod/v4/locales/ar.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error3 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" }, file: { unit: "\u0628\u0627\u064A\u062A", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" }, array: { unit: "\u0639\u0646\u0635\u0631", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" }, set: { unit: "\u0639\u0646\u0635\u0631", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0645\u062F\u062E\u0644", email: "\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A", url: "\u0631\u0627\u0628\u0637", emoji: "\u0625\u064A\u0645\u0648\u062C\u064A", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO", date: "\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO", time: "\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO", duration: "\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO", ipv4: "\u0639\u0646\u0648\u0627\u0646 IPv4", ipv6: "\u0639\u0646\u0648\u0627\u0646 IPv6", cidrv4: "\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4", cidrv6: "\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6", base64: "\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded", base64url: "\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded", json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON", e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164", jwt: "JWT", template_literal: "\u0645\u062F\u062E\u0644" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${issue2.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${received}`; } return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${stringifyPrimitive(issue2.values[0])}`; return `\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return ` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue2.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"}`; return `\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue2.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue2.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; } return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue2.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${issue2.prefix}"`; if (_issue.format === "ends_with") return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${_issue.includes}"`; if (_issue.format === "regex") return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${_issue.pattern}`; return `${FormatDictionary[_issue.format] ?? issue2.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`; } case "not_multiple_of": return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${issue2.divisor}`; case "unrecognized_keys": return `\u0645\u0639\u0631\u0641${issue2.keys.length > 1 ? "\u0627\u062A" : ""} \u063A\u0631\u064A\u0628${issue2.keys.length > 1 ? "\u0629" : ""}: ${joinValues(issue2.keys, "\u060C ")}`; case "invalid_key": return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue2.origin}`; case "invalid_union": return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"; case "invalid_element": return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue2.origin}`; default: return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"; } }; }, "error"); __name(ar_default, "default"); } }); // ../../node_modules/zod/v4/locales/az.js function az_default() { return { localeError: error4() }; } var error4; var init_az = __esm({ "../../node_modules/zod/v4/locales/az.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error4 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "simvol", verb: "olmal\u0131d\u0131r" }, file: { unit: "bayt", verb: "olmal\u0131d\u0131r" }, array: { unit: "element", verb: "olmal\u0131d\u0131r" }, set: { unit: "element", verb: "olmal\u0131d\u0131r" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "input", email: "email address", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO datetime", date: "ISO date", time: "ISO time", duration: "ISO duration", ipv4: "IPv4 address", ipv6: "IPv6 address", cidrv4: "IPv4 range", cidrv6: "IPv6 range", base64: "base64-encoded string", base64url: "base64url-encoded string", json_string: "JSON string", e164: "E.164 number", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${issue2.expected}, daxil olan ${received}`; } return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${expected}, daxil olan ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${stringifyPrimitive(issue2.values[0])}`; return `Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue2.origin ?? "d\u0259y\u0259r"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element"}`; return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue2.origin ?? "d\u0259y\u0259r"} ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue2.origin} ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Yanl\u0131\u015F m\u0259tn: "${_issue.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`; if (_issue.format === "ends_with") return `Yanl\u0131\u015F m\u0259tn: "${_issue.suffix}" il\u0259 bitm\u0259lidir`; if (_issue.format === "includes") return `Yanl\u0131\u015F m\u0259tn: "${_issue.includes}" daxil olmal\u0131d\u0131r`; if (_issue.format === "regex") return `Yanl\u0131\u015F m\u0259tn: ${_issue.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`; return `Yanl\u0131\u015F ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Yanl\u0131\u015F \u0259d\u0259d: ${issue2.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`; case "unrecognized_keys": return `Tan\u0131nmayan a\xE7ar${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `${issue2.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`; case "invalid_union": return "Yanl\u0131\u015F d\u0259y\u0259r"; case "invalid_element": return `${issue2.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`; default: return `Yanl\u0131\u015F d\u0259y\u0259r`; } }; }, "error"); __name(az_default, "default"); } }); // ../../node_modules/zod/v4/locales/be.js function getBelarusianPlural(count4, one, few, many) { const absCount = Math.abs(count4); const lastDigit = absCount % 10; const lastTwoDigits = absCount % 100; if (lastTwoDigits >= 11 && lastTwoDigits <= 19) { return many; } if (lastDigit === 1) { return one; } if (lastDigit >= 2 && lastDigit <= 4) { return few; } return many; } function be_default() { return { localeError: error5() }; } var error5; var init_be = __esm({ "../../node_modules/zod/v4/locales/be.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); __name(getBelarusianPlural, "getBelarusianPlural"); error5 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: { one: "\u0441\u0456\u043C\u0432\u0430\u043B", few: "\u0441\u0456\u043C\u0432\u0430\u043B\u044B", many: "\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E" }, verb: "\u043C\u0435\u0446\u044C" }, array: { unit: { one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442", few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B", many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E" }, verb: "\u043C\u0435\u0446\u044C" }, set: { unit: { one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442", few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B", many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E" }, verb: "\u043C\u0435\u0446\u044C" }, file: { unit: { one: "\u0431\u0430\u0439\u0442", few: "\u0431\u0430\u0439\u0442\u044B", many: "\u0431\u0430\u0439\u0442\u0430\u045E" }, verb: "\u043C\u0435\u0446\u044C" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0443\u0432\u043E\u0434", email: "email \u0430\u0434\u0440\u0430\u0441", url: "URL", emoji: "\u044D\u043C\u043E\u0434\u0437\u0456", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441", date: "ISO \u0434\u0430\u0442\u0430", time: "ISO \u0447\u0430\u0441", duration: "ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C", ipv4: "IPv4 \u0430\u0434\u0440\u0430\u0441", ipv6: "IPv6 \u0430\u0434\u0440\u0430\u0441", cidrv4: "IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D", cidrv6: "IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D", base64: "\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64", base64url: "\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url", json_string: "JSON \u0440\u0430\u0434\u043E\u043A", e164: "\u043D\u0443\u043C\u0430\u0440 E.164", jwt: "JWT", template_literal: "\u0443\u0432\u043E\u0434" }; const TypeDictionary = { nan: "NaN", number: "\u043B\u0456\u043A", array: "\u043C\u0430\u0441\u0456\u045E" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${issue2.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${received}`; } return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${stringifyPrimitive(issue2.values[0])}`; return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { const maxValue = Number(issue2.maximum); const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue2.maximum.toString()} ${unit}`; } return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { const minValue = Number(issue2.minimum); const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue2.minimum.toString()} ${unit}`; } return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${_issue.prefix}"`; if (_issue.format === "ends_with") return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`; return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue2.divisor}`; case "unrecognized_keys": return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${issue2.keys.length > 1 ? "\u043A\u043B\u044E\u0447\u044B" : "\u043A\u043B\u044E\u0447"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${issue2.origin}`; case "invalid_union": return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"; case "invalid_element": return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${issue2.origin}`; default: return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434`; } }; }, "error"); __name(be_default, "default"); } }); // ../../node_modules/zod/v4/locales/bg.js function bg_default() { return { localeError: error6() }; } var error6; var init_bg = __esm({ "../../node_modules/zod/v4/locales/bg.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error6 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" }, file: { unit: "\u0431\u0430\u0439\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" }, array: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" }, set: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0432\u0445\u043E\u0434", email: "\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441", url: "URL", emoji: "\u0435\u043C\u043E\u0434\u0436\u0438", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \u0432\u0440\u0435\u043C\u0435", date: "ISO \u0434\u0430\u0442\u0430", time: "ISO \u0432\u0440\u0435\u043C\u0435", duration: "ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442", ipv4: "IPv4 \u0430\u0434\u0440\u0435\u0441", ipv6: "IPv6 \u0430\u0434\u0440\u0435\u0441", cidrv4: "IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D", cidrv6: "IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D", base64: "base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437", base64url: "base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437", json_string: "JSON \u043D\u0438\u0437", e164: "E.164 \u043D\u043E\u043C\u0435\u0440", jwt: "JWT", template_literal: "\u0432\u0445\u043E\u0434" }; const TypeDictionary = { nan: "NaN", number: "\u0447\u0438\u0441\u043B\u043E", array: "\u043C\u0430\u0441\u0438\u0432" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${issue2.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${received}`; } return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${stringifyPrimitive(issue2.values[0])}`; return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`; return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${_issue.pattern}`; let invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D"; if (_issue.format === "emoji") invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"; if (_issue.format === "datetime") invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"; if (_issue.format === "date") invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"; if (_issue.format === "time") invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"; if (_issue.format === "duration") invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"; return `${invalid_adj} ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${issue2.divisor}`; case "unrecognized_keys": return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${issue2.keys.length > 1 ? "\u0438" : ""} \u043A\u043B\u044E\u0447${issue2.keys.length > 1 ? "\u043E\u0432\u0435" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${issue2.origin}`; case "invalid_union": return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"; case "invalid_element": return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${issue2.origin}`; default: return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434`; } }; }, "error"); __name(bg_default, "default"); } }); // ../../node_modules/zod/v4/locales/ca.js function ca_default() { return { localeError: error7() }; } var error7; var init_ca = __esm({ "../../node_modules/zod/v4/locales/ca.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error7 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "car\xE0cters", verb: "contenir" }, file: { unit: "bytes", verb: "contenir" }, array: { unit: "elements", verb: "contenir" }, set: { unit: "elements", verb: "contenir" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "entrada", email: "adre\xE7a electr\xF2nica", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "data i hora ISO", date: "data ISO", time: "hora ISO", duration: "durada ISO", ipv4: "adre\xE7a IPv4", ipv6: "adre\xE7a IPv6", cidrv4: "rang IPv4", cidrv6: "rang IPv6", base64: "cadena codificada en base64", base64url: "cadena codificada en base64url", json_string: "cadena JSON", e164: "n\xFAmero E.164", jwt: "JWT", template_literal: "entrada" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Tipus inv\xE0lid: s'esperava instanceof ${issue2.expected}, s'ha rebut ${received}`; } return `Tipus inv\xE0lid: s'esperava ${expected}, s'ha rebut ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Valor inv\xE0lid: s'esperava ${stringifyPrimitive(issue2.values[0])}`; return `Opci\xF3 inv\xE0lida: s'esperava una de ${joinValues(issue2.values, " o ")}`; case "too_big": { const adj = issue2.inclusive ? "com a m\xE0xim" : "menys de"; const sizing = getSizing(issue2.origin); if (sizing) return `Massa gran: s'esperava que ${issue2.origin ?? "el valor"} contingu\xE9s ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`; return `Massa gran: s'esperava que ${issue2.origin ?? "el valor"} fos ${adj} ${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? "com a m\xEDnim" : "m\xE9s de"; const sizing = getSizing(issue2.origin); if (sizing) { return `Massa petit: s'esperava que ${issue2.origin} contingu\xE9s ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; } return `Massa petit: s'esperava que ${issue2.origin} fos ${adj} ${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `Format inv\xE0lid: ha de comen\xE7ar amb "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `Format inv\xE0lid: ha d'acabar amb "${_issue.suffix}"`; if (_issue.format === "includes") return `Format inv\xE0lid: ha d'incloure "${_issue.includes}"`; if (_issue.format === "regex") return `Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${_issue.pattern}`; return `Format inv\xE0lid per a ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${issue2.divisor}`; case "unrecognized_keys": return `Clau${issue2.keys.length > 1 ? "s" : ""} no reconeguda${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Clau inv\xE0lida a ${issue2.origin}`; case "invalid_union": return "Entrada inv\xE0lida"; case "invalid_element": return `Element inv\xE0lid a ${issue2.origin}`; default: return `Entrada inv\xE0lida`; } }; }, "error"); __name(ca_default, "default"); } }); // ../../node_modules/zod/v4/locales/cs.js function cs_default() { return { localeError: error8() }; } var error8; var init_cs = __esm({ "../../node_modules/zod/v4/locales/cs.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error8 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "znak\u016F", verb: "m\xEDt" }, file: { unit: "bajt\u016F", verb: "m\xEDt" }, array: { unit: "prvk\u016F", verb: "m\xEDt" }, set: { unit: "prvk\u016F", verb: "m\xEDt" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "regul\xE1rn\xED v\xFDraz", email: "e-mailov\xE1 adresa", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "datum a \u010Das ve form\xE1tu ISO", date: "datum ve form\xE1tu ISO", time: "\u010Das ve form\xE1tu ISO", duration: "doba trv\xE1n\xED ISO", ipv4: "IPv4 adresa", ipv6: "IPv6 adresa", cidrv4: "rozsah IPv4", cidrv6: "rozsah IPv6", base64: "\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64", base64url: "\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url", json_string: "\u0159et\u011Bzec ve form\xE1tu JSON", e164: "\u010D\xEDslo E.164", jwt: "JWT", template_literal: "vstup" }; const TypeDictionary = { nan: "NaN", number: "\u010D\xEDslo", string: "\u0159et\u011Bzec", function: "funkce", array: "pole" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${issue2.expected}, obdr\u017Eeno ${received}`; } return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${expected}, obdr\u017Eeno ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${stringifyPrimitive(issue2.values[0])}`; return `Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue2.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "prvk\u016F"}`; } return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue2.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue2.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue2.minimum.toString()} ${sizing.unit ?? "prvk\u016F"}`; } return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue2.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${_issue.suffix}"`; if (_issue.format === "includes") return `Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${_issue.includes}"`; if (_issue.format === "regex") return `Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${_issue.pattern}`; return `Neplatn\xFD form\xE1t ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${issue2.divisor}`; case "unrecognized_keys": return `Nezn\xE1m\xE9 kl\xED\u010De: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Neplatn\xFD kl\xED\u010D v ${issue2.origin}`; case "invalid_union": return "Neplatn\xFD vstup"; case "invalid_element": return `Neplatn\xE1 hodnota v ${issue2.origin}`; default: return `Neplatn\xFD vstup`; } }; }, "error"); __name(cs_default, "default"); } }); // ../../node_modules/zod/v4/locales/da.js function da_default() { return { localeError: error9() }; } var error9; var init_da = __esm({ "../../node_modules/zod/v4/locales/da.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error9 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "tegn", verb: "havde" }, file: { unit: "bytes", verb: "havde" }, array: { unit: "elementer", verb: "indeholdt" }, set: { unit: "elementer", verb: "indeholdt" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "input", email: "e-mailadresse", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO dato- og klokkesl\xE6t", date: "ISO-dato", time: "ISO-klokkesl\xE6t", duration: "ISO-varighed", ipv4: "IPv4-omr\xE5de", ipv6: "IPv6-omr\xE5de", cidrv4: "IPv4-spektrum", cidrv6: "IPv6-spektrum", base64: "base64-kodet streng", base64url: "base64url-kodet streng", json_string: "JSON-streng", e164: "E.164-nummer", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { nan: "NaN", string: "streng", number: "tal", boolean: "boolean", array: "liste", object: "objekt", set: "s\xE6t", file: "fil" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Ugyldigt input: forventede instanceof ${issue2.expected}, fik ${received}`; } return `Ugyldigt input: forventede ${expected}, fik ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Ugyldig v\xE6rdi: forventede ${stringifyPrimitive(issue2.values[0])}`; return `Ugyldigt valg: forventede en af f\xF8lgende ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); const origin2 = TypeDictionary[issue2.origin] ?? issue2.origin; if (sizing) return `For stor: forventede ${origin2 ?? "value"} ${sizing.verb} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "elementer"}`; return `For stor: forventede ${origin2 ?? "value"} havde ${adj} ${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); const origin2 = TypeDictionary[issue2.origin] ?? issue2.origin; if (sizing) { return `For lille: forventede ${origin2} ${sizing.verb} ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; } return `For lille: forventede ${origin2} havde ${adj} ${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Ugyldig streng: skal starte med "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Ugyldig streng: skal ende med "${_issue.suffix}"`; if (_issue.format === "includes") return `Ugyldig streng: skal indeholde "${_issue.includes}"`; if (_issue.format === "regex") return `Ugyldig streng: skal matche m\xF8nsteret ${_issue.pattern}`; return `Ugyldig ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Ugyldigt tal: skal v\xE6re deleligt med ${issue2.divisor}`; case "unrecognized_keys": return `${issue2.keys.length > 1 ? "Ukendte n\xF8gler" : "Ukendt n\xF8gle"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Ugyldig n\xF8gle i ${issue2.origin}`; case "invalid_union": return "Ugyldigt input: matcher ingen af de tilladte typer"; case "invalid_element": return `Ugyldig v\xE6rdi i ${issue2.origin}`; default: return `Ugyldigt input`; } }; }, "error"); __name(da_default, "default"); } }); // ../../node_modules/zod/v4/locales/de.js function de_default() { return { localeError: error10() }; } var error10; var init_de = __esm({ "../../node_modules/zod/v4/locales/de.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error10 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "Zeichen", verb: "zu haben" }, file: { unit: "Bytes", verb: "zu haben" }, array: { unit: "Elemente", verb: "zu haben" }, set: { unit: "Elemente", verb: "zu haben" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "Eingabe", email: "E-Mail-Adresse", url: "URL", emoji: "Emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO-Datum und -Uhrzeit", date: "ISO-Datum", time: "ISO-Uhrzeit", duration: "ISO-Dauer", ipv4: "IPv4-Adresse", ipv6: "IPv6-Adresse", cidrv4: "IPv4-Bereich", cidrv6: "IPv6-Bereich", base64: "Base64-codierter String", base64url: "Base64-URL-codierter String", json_string: "JSON-String", e164: "E.164-Nummer", jwt: "JWT", template_literal: "Eingabe" }; const TypeDictionary = { nan: "NaN", number: "Zahl", array: "Array" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Ung\xFCltige Eingabe: erwartet instanceof ${issue2.expected}, erhalten ${received}`; } return `Ung\xFCltige Eingabe: erwartet ${expected}, erhalten ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Ung\xFCltige Eingabe: erwartet ${stringifyPrimitive(issue2.values[0])}`; return `Ung\xFCltige Option: erwartet eine von ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Zu gro\xDF: erwartet, dass ${issue2.origin ?? "Wert"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`; return `Zu gro\xDF: erwartet, dass ${issue2.origin ?? "Wert"} ${adj}${issue2.maximum.toString()} ist`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Zu klein: erwartet, dass ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} hat`; } return `Zu klein: erwartet, dass ${issue2.origin} ${adj}${issue2.minimum.toString()} ist`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Ung\xFCltiger String: muss mit "${_issue.prefix}" beginnen`; if (_issue.format === "ends_with") return `Ung\xFCltiger String: muss mit "${_issue.suffix}" enden`; if (_issue.format === "includes") return `Ung\xFCltiger String: muss "${_issue.includes}" enthalten`; if (_issue.format === "regex") return `Ung\xFCltiger String: muss dem Muster ${_issue.pattern} entsprechen`; return `Ung\xFCltig: ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Ung\xFCltige Zahl: muss ein Vielfaches von ${issue2.divisor} sein`; case "unrecognized_keys": return `${issue2.keys.length > 1 ? "Unbekannte Schl\xFCssel" : "Unbekannter Schl\xFCssel"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Ung\xFCltiger Schl\xFCssel in ${issue2.origin}`; case "invalid_union": return "Ung\xFCltige Eingabe"; case "invalid_element": return `Ung\xFCltiger Wert in ${issue2.origin}`; default: return `Ung\xFCltige Eingabe`; } }; }, "error"); __name(de_default, "default"); } }); // ../../node_modules/zod/v4/locales/en.js function en_default() { return { localeError: error11() }; } var error11; var init_en = __esm({ "../../node_modules/zod/v4/locales/en.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error11 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "characters", verb: "to have" }, file: { unit: "bytes", verb: "to have" }, array: { unit: "items", verb: "to have" }, set: { unit: "items", verb: "to have" }, map: { unit: "entries", verb: "to have" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "input", email: "email address", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO datetime", date: "ISO date", time: "ISO time", duration: "ISO duration", ipv4: "IPv4 address", ipv6: "IPv6 address", mac: "MAC address", cidrv4: "IPv4 range", cidrv6: "IPv6 range", base64: "base64-encoded string", base64url: "base64url-encoded string", json_string: "JSON string", e164: "E.164 number", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { // Compatibility: "nan" -> "NaN" for display nan: "NaN" // All other type names omitted - they fall back to raw values via ?? operator }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; return `Invalid input: expected ${expected}, received ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`; return `Invalid option: expected one of ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Too big: expected ${issue2.origin ?? "value"} to have ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`; return `Too big: expected ${issue2.origin ?? "value"} to be ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Too small: expected ${issue2.origin} to have ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Too small: expected ${issue2.origin} to be ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `Invalid string: must start with "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `Invalid string: must end with "${_issue.suffix}"`; if (_issue.format === "includes") return `Invalid string: must include "${_issue.includes}"`; if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`; return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Invalid number: must be a multiple of ${issue2.divisor}`; case "unrecognized_keys": return `Unrecognized key${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Invalid key in ${issue2.origin}`; case "invalid_union": return "Invalid input"; case "invalid_element": return `Invalid value in ${issue2.origin}`; default: return `Invalid input`; } }; }, "error"); __name(en_default, "default"); } }); // ../../node_modules/zod/v4/locales/eo.js function eo_default() { return { localeError: error12() }; } var error12; var init_eo = __esm({ "../../node_modules/zod/v4/locales/eo.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error12 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "karaktrojn", verb: "havi" }, file: { unit: "bajtojn", verb: "havi" }, array: { unit: "elementojn", verb: "havi" }, set: { unit: "elementojn", verb: "havi" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "enigo", email: "retadreso", url: "URL", emoji: "emo\u011Dio", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO-datotempo", date: "ISO-dato", time: "ISO-tempo", duration: "ISO-da\u016Dro", ipv4: "IPv4-adreso", ipv6: "IPv6-adreso", cidrv4: "IPv4-rango", cidrv6: "IPv6-rango", base64: "64-ume kodita karaktraro", base64url: "URL-64-ume kodita karaktraro", json_string: "JSON-karaktraro", e164: "E.164-nombro", jwt: "JWT", template_literal: "enigo" }; const TypeDictionary = { nan: "NaN", number: "nombro", array: "tabelo", null: "senvalora" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Nevalida enigo: atendi\u011Dis instanceof ${issue2.expected}, ricevi\u011Dis ${received}`; } return `Nevalida enigo: atendi\u011Dis ${expected}, ricevi\u011Dis ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Nevalida enigo: atendi\u011Dis ${stringifyPrimitive(issue2.values[0])}`; return `Nevalida opcio: atendi\u011Dis unu el ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Tro granda: atendi\u011Dis ke ${issue2.origin ?? "valoro"} havu ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementojn"}`; return `Tro granda: atendi\u011Dis ke ${issue2.origin ?? "valoro"} havu ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Tro malgranda: atendi\u011Dis ke ${issue2.origin} havu ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Tro malgranda: atendi\u011Dis ke ${issue2.origin} estu ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenci\u011Di per "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Nevalida karaktraro: devas fini\u011Di per "${_issue.suffix}"`; if (_issue.format === "includes") return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`; if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`; return `Nevalida ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Nevalida nombro: devas esti oblo de ${issue2.divisor}`; case "unrecognized_keys": return `Nekonata${issue2.keys.length > 1 ? "j" : ""} \u015Dlosilo${issue2.keys.length > 1 ? "j" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Nevalida \u015Dlosilo en ${issue2.origin}`; case "invalid_union": return "Nevalida enigo"; case "invalid_element": return `Nevalida valoro en ${issue2.origin}`; default: return `Nevalida enigo`; } }; }, "error"); __name(eo_default, "default"); } }); // ../../node_modules/zod/v4/locales/es.js function es_default() { return { localeError: error13() }; } var error13; var init_es = __esm({ "../../node_modules/zod/v4/locales/es.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error13 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "caracteres", verb: "tener" }, file: { unit: "bytes", verb: "tener" }, array: { unit: "elementos", verb: "tener" }, set: { unit: "elementos", verb: "tener" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "entrada", email: "direcci\xF3n de correo electr\xF3nico", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "fecha y hora ISO", date: "fecha ISO", time: "hora ISO", duration: "duraci\xF3n ISO", ipv4: "direcci\xF3n IPv4", ipv6: "direcci\xF3n IPv6", cidrv4: "rango IPv4", cidrv6: "rango IPv6", base64: "cadena codificada en base64", base64url: "URL codificada en base64", json_string: "cadena JSON", e164: "n\xFAmero E.164", jwt: "JWT", template_literal: "entrada" }; const TypeDictionary = { nan: "NaN", string: "texto", number: "n\xFAmero", boolean: "booleano", array: "arreglo", object: "objeto", set: "conjunto", file: "archivo", date: "fecha", bigint: "n\xFAmero grande", symbol: "s\xEDmbolo", undefined: "indefinido", null: "nulo", function: "funci\xF3n", map: "mapa", record: "registro", tuple: "tupla", enum: "enumeraci\xF3n", union: "uni\xF3n", literal: "literal", promise: "promesa", void: "vac\xEDo", never: "nunca", unknown: "desconocido", any: "cualquiera" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Entrada inv\xE1lida: se esperaba instanceof ${issue2.expected}, recibido ${received}`; } return `Entrada inv\xE1lida: se esperaba ${expected}, recibido ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Entrada inv\xE1lida: se esperaba ${stringifyPrimitive(issue2.values[0])}`; return `Opci\xF3n inv\xE1lida: se esperaba una de ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); const origin2 = TypeDictionary[issue2.origin] ?? issue2.origin; if (sizing) return `Demasiado grande: se esperaba que ${origin2 ?? "valor"} tuviera ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementos"}`; return `Demasiado grande: se esperaba que ${origin2 ?? "valor"} fuera ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); const origin2 = TypeDictionary[issue2.origin] ?? issue2.origin; if (sizing) { return `Demasiado peque\xF1o: se esperaba que ${origin2} tuviera ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Demasiado peque\xF1o: se esperaba que ${origin2} fuera ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Cadena inv\xE1lida: debe comenzar con "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Cadena inv\xE1lida: debe terminar en "${_issue.suffix}"`; if (_issue.format === "includes") return `Cadena inv\xE1lida: debe incluir "${_issue.includes}"`; if (_issue.format === "regex") return `Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${_issue.pattern}`; return `Inv\xE1lido ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${issue2.divisor}`; case "unrecognized_keys": return `Llave${issue2.keys.length > 1 ? "s" : ""} desconocida${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Llave inv\xE1lida en ${TypeDictionary[issue2.origin] ?? issue2.origin}`; case "invalid_union": return "Entrada inv\xE1lida"; case "invalid_element": return `Valor inv\xE1lido en ${TypeDictionary[issue2.origin] ?? issue2.origin}`; default: return `Entrada inv\xE1lida`; } }; }, "error"); __name(es_default, "default"); } }); // ../../node_modules/zod/v4/locales/fa.js function fa_default() { return { localeError: error14() }; } var error14; var init_fa = __esm({ "../../node_modules/zod/v4/locales/fa.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error14 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" }, file: { unit: "\u0628\u0627\u06CC\u062A", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" }, array: { unit: "\u0622\u06CC\u062A\u0645", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" }, set: { unit: "\u0622\u06CC\u062A\u0645", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0648\u0631\u0648\u062F\u06CC", email: "\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644", url: "URL", emoji: "\u0627\u06CC\u0645\u0648\u062C\u06CC", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648", date: "\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648", time: "\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648", duration: "\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648", ipv4: "IPv4 \u0622\u062F\u0631\u0633", ipv6: "IPv6 \u0622\u062F\u0631\u0633", cidrv4: "IPv4 \u062F\u0627\u0645\u0646\u0647", cidrv6: "IPv6 \u062F\u0627\u0645\u0646\u0647", base64: "base64-encoded \u0631\u0634\u062A\u0647", base64url: "base64url-encoded \u0631\u0634\u062A\u0647", json_string: "JSON \u0631\u0634\u062A\u0647", e164: "E.164 \u0639\u062F\u062F", jwt: "JWT", template_literal: "\u0648\u0631\u0648\u062F\u06CC" }; const TypeDictionary = { nan: "NaN", number: "\u0639\u062F\u062F", array: "\u0622\u0631\u0627\u06CC\u0647" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${issue2.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${received} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`; } return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${received} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`; } case "invalid_value": if (issue2.values.length === 1) { return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${stringifyPrimitive(issue2.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`; } return `\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${joinValues(issue2.values, "|")} \u0645\u06CC\u200C\u0628\u0648\u062F`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue2.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`; } return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue2.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} \u0628\u0627\u0634\u062F`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} ${sizing.unit} \u0628\u0627\u0634\u062F`; } return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} \u0628\u0627\u0634\u062F`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${_issue.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`; } if (_issue.format === "ends_with") { return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${_issue.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`; } if (_issue.format === "includes") { return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${_issue.includes}" \u0628\u0627\u0634\u062F`; } if (_issue.format === "regex") { return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${_issue.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`; } return `${FormatDictionary[_issue.format] ?? issue2.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`; } case "not_multiple_of": return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${issue2.divisor} \u0628\u0627\u0634\u062F`; case "unrecognized_keys": return `\u06A9\u0644\u06CC\u062F${issue2.keys.length > 1 ? "\u0647\u0627\u06CC" : ""} \u0646\u0627\u0634\u0646\u0627\u0633: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${issue2.origin}`; case "invalid_union": return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631`; case "invalid_element": return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${issue2.origin}`; default: return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631`; } }; }, "error"); __name(fa_default, "default"); } }); // ../../node_modules/zod/v4/locales/fi.js function fi_default() { return { localeError: error15() }; } var error15; var init_fi = __esm({ "../../node_modules/zod/v4/locales/fi.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error15 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "merkki\xE4", subject: "merkkijonon" }, file: { unit: "tavua", subject: "tiedoston" }, array: { unit: "alkiota", subject: "listan" }, set: { unit: "alkiota", subject: "joukon" }, number: { unit: "", subject: "luvun" }, bigint: { unit: "", subject: "suuren kokonaisluvun" }, int: { unit: "", subject: "kokonaisluvun" }, date: { unit: "", subject: "p\xE4iv\xE4m\xE4\xE4r\xE4n" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "s\xE4\xE4nn\xF6llinen lauseke", email: "s\xE4hk\xF6postiosoite", url: "URL-osoite", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO-aikaleima", date: "ISO-p\xE4iv\xE4m\xE4\xE4r\xE4", time: "ISO-aika", duration: "ISO-kesto", ipv4: "IPv4-osoite", ipv6: "IPv6-osoite", cidrv4: "IPv4-alue", cidrv6: "IPv6-alue", base64: "base64-koodattu merkkijono", base64url: "base64url-koodattu merkkijono", json_string: "JSON-merkkijono", e164: "E.164-luku", jwt: "JWT", template_literal: "templaattimerkkijono" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Virheellinen tyyppi: odotettiin instanceof ${issue2.expected}, oli ${received}`; } return `Virheellinen tyyppi: odotettiin ${expected}, oli ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Virheellinen sy\xF6te: t\xE4ytyy olla ${stringifyPrimitive(issue2.values[0])}`; return `Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { return `Liian suuri: ${sizing.subject} t\xE4ytyy olla ${adj}${issue2.maximum.toString()} ${sizing.unit}`.trim(); } return `Liian suuri: arvon t\xE4ytyy olla ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Liian pieni: ${sizing.subject} t\xE4ytyy olla ${adj}${issue2.minimum.toString()} ${sizing.unit}`.trim(); } return `Liian pieni: arvon t\xE4ytyy olla ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Virheellinen sy\xF6te: t\xE4ytyy alkaa "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Virheellinen sy\xF6te: t\xE4ytyy loppua "${_issue.suffix}"`; if (_issue.format === "includes") return `Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${_issue.includes}"`; if (_issue.format === "regex") { return `Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${_issue.pattern}`; } return `Virheellinen ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Virheellinen luku: t\xE4ytyy olla luvun ${issue2.divisor} monikerta`; case "unrecognized_keys": return `${issue2.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return "Virheellinen avain tietueessa"; case "invalid_union": return "Virheellinen unioni"; case "invalid_element": return "Virheellinen arvo joukossa"; default: return `Virheellinen sy\xF6te`; } }; }, "error"); __name(fi_default, "default"); } }); // ../../node_modules/zod/v4/locales/fr.js function fr_default() { return { localeError: error16() }; } var error16; var init_fr = __esm({ "../../node_modules/zod/v4/locales/fr.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error16 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "caract\xE8res", verb: "avoir" }, file: { unit: "octets", verb: "avoir" }, array: { unit: "\xE9l\xE9ments", verb: "avoir" }, set: { unit: "\xE9l\xE9ments", verb: "avoir" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "entr\xE9e", email: "adresse e-mail", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "date et heure ISO", date: "date ISO", time: "heure ISO", duration: "dur\xE9e ISO", ipv4: "adresse IPv4", ipv6: "adresse IPv6", cidrv4: "plage IPv4", cidrv6: "plage IPv6", base64: "cha\xEEne encod\xE9e en base64", base64url: "cha\xEEne encod\xE9e en base64url", json_string: "cha\xEEne JSON", e164: "num\xE9ro E.164", jwt: "JWT", template_literal: "entr\xE9e" }; const TypeDictionary = { nan: "NaN", number: "nombre", array: "tableau" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Entr\xE9e invalide : instanceof ${issue2.expected} attendu, ${received} re\xE7u`; } return `Entr\xE9e invalide : ${expected} attendu, ${received} re\xE7u`; } case "invalid_value": if (issue2.values.length === 1) return `Entr\xE9e invalide : ${stringifyPrimitive(issue2.values[0])} attendu`; return `Option invalide : une valeur parmi ${joinValues(issue2.values, "|")} attendue`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Trop grand : ${issue2.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`; return `Trop grand : ${issue2.origin ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Trop petit : ${issue2.origin} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Trop petit : ${issue2.origin} doit \xEAtre ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Cha\xEEne invalide : doit commencer par "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Cha\xEEne invalide : doit se terminer par "${_issue.suffix}"`; if (_issue.format === "includes") return `Cha\xEEne invalide : doit inclure "${_issue.includes}"`; if (_issue.format === "regex") return `Cha\xEEne invalide : doit correspondre au mod\xE8le ${_issue.pattern}`; return `${FormatDictionary[_issue.format] ?? issue2.format} invalide`; } case "not_multiple_of": return `Nombre invalide : doit \xEAtre un multiple de ${issue2.divisor}`; case "unrecognized_keys": return `Cl\xE9${issue2.keys.length > 1 ? "s" : ""} non reconnue${issue2.keys.length > 1 ? "s" : ""} : ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Cl\xE9 invalide dans ${issue2.origin}`; case "invalid_union": return "Entr\xE9e invalide"; case "invalid_element": return `Valeur invalide dans ${issue2.origin}`; default: return `Entr\xE9e invalide`; } }; }, "error"); __name(fr_default, "default"); } }); // ../../node_modules/zod/v4/locales/fr-CA.js function fr_CA_default() { return { localeError: error17() }; } var error17; var init_fr_CA = __esm({ "../../node_modules/zod/v4/locales/fr-CA.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error17 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "caract\xE8res", verb: "avoir" }, file: { unit: "octets", verb: "avoir" }, array: { unit: "\xE9l\xE9ments", verb: "avoir" }, set: { unit: "\xE9l\xE9ments", verb: "avoir" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "entr\xE9e", email: "adresse courriel", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "date-heure ISO", date: "date ISO", time: "heure ISO", duration: "dur\xE9e ISO", ipv4: "adresse IPv4", ipv6: "adresse IPv6", cidrv4: "plage IPv4", cidrv6: "plage IPv6", base64: "cha\xEEne encod\xE9e en base64", base64url: "cha\xEEne encod\xE9e en base64url", json_string: "cha\xEEne JSON", e164: "num\xE9ro E.164", jwt: "JWT", template_literal: "entr\xE9e" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Entr\xE9e invalide : attendu instanceof ${issue2.expected}, re\xE7u ${received}`; } return `Entr\xE9e invalide : attendu ${expected}, re\xE7u ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Entr\xE9e invalide : attendu ${stringifyPrimitive(issue2.values[0])}`; return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "\u2264" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Trop grand : attendu que ${issue2.origin ?? "la valeur"} ait ${adj}${issue2.maximum.toString()} ${sizing.unit}`; return `Trop grand : attendu que ${issue2.origin ?? "la valeur"} soit ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? "\u2265" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Trop petit : attendu que ${issue2.origin} ait ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Trop petit : attendu que ${issue2.origin} soit ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `Cha\xEEne invalide : doit commencer par "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `Cha\xEEne invalide : doit se terminer par "${_issue.suffix}"`; if (_issue.format === "includes") return `Cha\xEEne invalide : doit inclure "${_issue.includes}"`; if (_issue.format === "regex") return `Cha\xEEne invalide : doit correspondre au motif ${_issue.pattern}`; return `${FormatDictionary[_issue.format] ?? issue2.format} invalide`; } case "not_multiple_of": return `Nombre invalide : doit \xEAtre un multiple de ${issue2.divisor}`; case "unrecognized_keys": return `Cl\xE9${issue2.keys.length > 1 ? "s" : ""} non reconnue${issue2.keys.length > 1 ? "s" : ""} : ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Cl\xE9 invalide dans ${issue2.origin}`; case "invalid_union": return "Entr\xE9e invalide"; case "invalid_element": return `Valeur invalide dans ${issue2.origin}`; default: return `Entr\xE9e invalide`; } }; }, "error"); __name(fr_CA_default, "default"); } }); // ../../node_modules/zod/v4/locales/he.js function he_default() { return { localeError: error18() }; } var error18; var init_he = __esm({ "../../node_modules/zod/v4/locales/he.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error18 = /* @__PURE__ */ __name(() => { const TypeNames = { string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" }, number: { label: "\u05DE\u05E1\u05E4\u05E8", gender: "m" }, boolean: { label: "\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9", gender: "m" }, bigint: { label: "BigInt", gender: "m" }, date: { label: "\u05EA\u05D0\u05E8\u05D9\u05DA", gender: "m" }, array: { label: "\u05DE\u05E2\u05E8\u05DA", gender: "m" }, object: { label: "\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8", gender: "m" }, null: { label: "\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)", gender: "m" }, undefined: { label: "\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)", gender: "m" }, symbol: { label: "\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)", gender: "m" }, function: { label: "\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4", gender: "f" }, map: { label: "\u05DE\u05E4\u05D4 (Map)", gender: "f" }, set: { label: "\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)", gender: "f" }, file: { label: "\u05E7\u05D5\u05D1\u05E5", gender: "m" }, promise: { label: "Promise", gender: "m" }, NaN: { label: "NaN", gender: "m" }, unknown: { label: "\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2", gender: "m" }, value: { label: "\u05E2\u05E8\u05DA", gender: "m" } }; const Sizable = { string: { unit: "\u05EA\u05D5\u05D5\u05D9\u05DD", shortLabel: "\u05E7\u05E6\u05E8", longLabel: "\u05D0\u05E8\u05D5\u05DA" }, file: { unit: "\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" }, array: { unit: "\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" }, set: { unit: "\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" }, number: { unit: "", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" } // no unit }; const typeEntry = /* @__PURE__ */ __name((t9) => t9 ? TypeNames[t9] : void 0, "typeEntry"); const typeLabel = /* @__PURE__ */ __name((t9) => { const e2 = typeEntry(t9); if (e2) return e2.label; return t9 ?? TypeNames.unknown.label; }, "typeLabel"); const withDefinite = /* @__PURE__ */ __name((t9) => `\u05D4${typeLabel(t9)}`, "withDefinite"); const verbFor = /* @__PURE__ */ __name((t9) => { const e2 = typeEntry(t9); const gender = e2?.gender ?? "m"; return gender === "f" ? "\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA" : "\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA"; }, "verbFor"); const getSizing = /* @__PURE__ */ __name((origin2) => { if (!origin2) return null; return Sizable[origin2] ?? null; }, "getSizing"); const FormatDictionary = { regex: { label: "\u05E7\u05DC\u05D8", gender: "m" }, email: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC", gender: "f" }, url: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA", gender: "f" }, emoji: { label: "\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9", gender: "m" }, uuid: { label: "UUID", gender: "m" }, nanoid: { label: "nanoid", gender: "m" }, guid: { label: "GUID", gender: "m" }, cuid: { label: "cuid", gender: "m" }, cuid2: { label: "cuid2", gender: "m" }, ulid: { label: "ULID", gender: "m" }, xid: { label: "XID", gender: "m" }, ksuid: { label: "KSUID", gender: "m" }, datetime: { label: "\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO", gender: "m" }, date: { label: "\u05EA\u05D0\u05E8\u05D9\u05DA ISO", gender: "m" }, time: { label: "\u05D6\u05DE\u05DF ISO", gender: "m" }, duration: { label: "\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO", gender: "m" }, ipv4: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA IPv4", gender: "f" }, ipv6: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA IPv6", gender: "f" }, cidrv4: { label: "\u05D8\u05D5\u05D5\u05D7 IPv4", gender: "m" }, cidrv6: { label: "\u05D8\u05D5\u05D5\u05D7 IPv6", gender: "m" }, base64: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64", gender: "f" }, base64url: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA", gender: "f" }, json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" }, e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" }, jwt: { label: "JWT", gender: "m" }, ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" }, includes: { label: "\u05E7\u05DC\u05D8", gender: "m" }, lowercase: { label: "\u05E7\u05DC\u05D8", gender: "m" }, starts_with: { label: "\u05E7\u05DC\u05D8", gender: "m" }, uppercase: { label: "\u05E7\u05DC\u05D8", gender: "m" } }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expectedKey = issue2.expected; const expected = TypeDictionary[expectedKey ?? ""] ?? typeLabel(expectedKey); const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? TypeNames[receivedType]?.label ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${issue2.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`; } return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`; } case "invalid_value": { if (issue2.values.length === 1) { return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${stringifyPrimitive(issue2.values[0])}`; } const stringified = issue2.values.map((v3) => stringifyPrimitive(v3)); if (issue2.values.length === 2) { return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${stringified[0]} \u05D0\u05D5 ${stringified[1]}`; } const lastValue = stringified[stringified.length - 1]; const restValues = stringified.slice(0, -1).join(", "); return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${restValues} \u05D0\u05D5 ${lastValue}`; } case "too_big": { const sizing = getSizing(issue2.origin); const subject = withDefinite(issue2.origin ?? "value"); if (issue2.origin === "string") { return `${sizing?.longLabel ?? "\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue2.maximum.toString()} ${sizing?.unit ?? ""} ${issue2.inclusive ? "\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA" : "\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim(); } if (issue2.origin === "number") { const comparison = issue2.inclusive ? `\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue2.maximum}` : `\u05E7\u05D8\u05DF \u05DE-${issue2.maximum}`; return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${comparison}`; } if (issue2.origin === "array" || issue2.origin === "set") { const verb = issue2.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA"; const comparison = issue2.inclusive ? `${issue2.maximum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA` : `\u05E4\u05D7\u05D5\u05EA \u05DE-${issue2.maximum} ${sizing?.unit ?? ""}`; return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim(); } const adj = issue2.inclusive ? "<=" : "<"; const be2 = verbFor(issue2.origin ?? "value"); if (sizing?.unit) { return `${sizing.longLabel} \u05DE\u05D3\u05D9: ${subject} ${be2} ${adj}${issue2.maximum.toString()} ${sizing.unit}`; } return `${sizing?.longLabel ?? "\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${subject} ${be2} ${adj}${issue2.maximum.toString()}`; } case "too_small": { const sizing = getSizing(issue2.origin); const subject = withDefinite(issue2.origin ?? "value"); if (issue2.origin === "string") { return `${sizing?.shortLabel ?? "\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue2.minimum.toString()} ${sizing?.unit ?? ""} ${issue2.inclusive ? "\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8" : "\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim(); } if (issue2.origin === "number") { const comparison = issue2.inclusive ? `\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue2.minimum}` : `\u05D2\u05D3\u05D5\u05DC \u05DE-${issue2.minimum}`; return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${comparison}`; } if (issue2.origin === "array" || issue2.origin === "set") { const verb = issue2.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA"; if (issue2.minimum === 1 && issue2.inclusive) { const singularPhrase = issue2.origin === "set" ? "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3" : "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3"; return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${singularPhrase}`; } const comparison = issue2.inclusive ? `${issue2.minimum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8` : `\u05D9\u05D5\u05EA\u05E8 \u05DE-${issue2.minimum} ${sizing?.unit ?? ""}`; return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim(); } const adj = issue2.inclusive ? ">=" : ">"; const be2 = verbFor(issue2.origin ?? "value"); if (sizing?.unit) { return `${sizing.shortLabel} \u05DE\u05D3\u05D9: ${subject} ${be2} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `${sizing?.shortLabel ?? "\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${subject} ${be2} ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${_issue.prefix}"`; if (_issue.format === "ends_with") return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${_issue.includes}"`; if (_issue.format === "regex") return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${_issue.pattern}`; const nounEntry = FormatDictionary[_issue.format]; const noun = nounEntry?.label ?? _issue.format; const gender = nounEntry?.gender ?? "m"; const adjective = gender === "f" ? "\u05EA\u05E7\u05D9\u05E0\u05D4" : "\u05EA\u05E7\u05D9\u05DF"; return `${noun} \u05DC\u05D0 ${adjective}`; } case "not_multiple_of": return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${issue2.divisor}`; case "unrecognized_keys": return `\u05DE\u05E4\u05EA\u05D7${issue2.keys.length > 1 ? "\u05D5\u05EA" : ""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${issue2.keys.length > 1 ? "\u05D9\u05DD" : "\u05D4"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": { return `\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8`; } case "invalid_union": return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"; case "invalid_element": { const place = withDefinite(issue2.origin ?? "array"); return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${place}`; } default: return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`; } }; }, "error"); __name(he_default, "default"); } }); // ../../node_modules/zod/v4/locales/hu.js function hu_default() { return { localeError: error19() }; } var error19; var init_hu = __esm({ "../../node_modules/zod/v4/locales/hu.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error19 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "karakter", verb: "legyen" }, file: { unit: "byte", verb: "legyen" }, array: { unit: "elem", verb: "legyen" }, set: { unit: "elem", verb: "legyen" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "bemenet", email: "email c\xEDm", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO id\u0151b\xE9lyeg", date: "ISO d\xE1tum", time: "ISO id\u0151", duration: "ISO id\u0151intervallum", ipv4: "IPv4 c\xEDm", ipv6: "IPv6 c\xEDm", cidrv4: "IPv4 tartom\xE1ny", cidrv6: "IPv6 tartom\xE1ny", base64: "base64-k\xF3dolt string", base64url: "base64url-k\xF3dolt string", json_string: "JSON string", e164: "E.164 sz\xE1m", jwt: "JWT", template_literal: "bemenet" }; const TypeDictionary = { nan: "NaN", number: "sz\xE1m", array: "t\xF6mb" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${issue2.expected}, a kapott \xE9rt\xE9k ${received}`; } return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${expected}, a kapott \xE9rt\xE9k ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${stringifyPrimitive(issue2.values[0])}`; return `\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `T\xFAl nagy: ${issue2.origin ?? "\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elem"}`; return `T\xFAl nagy: a bemeneti \xE9rt\xE9k ${issue2.origin ?? "\xE9rt\xE9k"} t\xFAl nagy: ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue2.origin} m\xE9rete t\xFAl kicsi ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue2.origin} t\xFAl kicsi ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\xC9rv\xE9nytelen string: "${_issue.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`; if (_issue.format === "ends_with") return `\xC9rv\xE9nytelen string: "${_issue.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`; if (_issue.format === "includes") return `\xC9rv\xE9nytelen string: "${_issue.includes}" \xE9rt\xE9ket kell tartalmaznia`; if (_issue.format === "regex") return `\xC9rv\xE9nytelen string: ${_issue.pattern} mint\xE1nak kell megfelelnie`; return `\xC9rv\xE9nytelen ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\xC9rv\xE9nytelen sz\xE1m: ${issue2.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`; case "unrecognized_keys": return `Ismeretlen kulcs${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\xC9rv\xE9nytelen kulcs ${issue2.origin}`; case "invalid_union": return "\xC9rv\xE9nytelen bemenet"; case "invalid_element": return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${issue2.origin}`; default: return `\xC9rv\xE9nytelen bemenet`; } }; }, "error"); __name(hu_default, "default"); } }); // ../../node_modules/zod/v4/locales/hy.js function getArmenianPlural(count4, one, many) { return Math.abs(count4) === 1 ? one : many; } function withDefiniteArticle(word) { if (!word) return ""; const vowels = ["\u0561", "\u0565", "\u0568", "\u056B", "\u0578", "\u0578\u0582", "\u0585"]; const lastChar = word[word.length - 1]; return word + (vowels.includes(lastChar) ? "\u0576" : "\u0568"); } function hy_default() { return { localeError: error20() }; } var error20; var init_hy = __esm({ "../../node_modules/zod/v4/locales/hy.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); __name(getArmenianPlural, "getArmenianPlural"); __name(withDefiniteArticle, "withDefiniteArticle"); error20 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: { one: "\u0576\u0577\u0561\u0576", many: "\u0576\u0577\u0561\u0576\u0576\u0565\u0580" }, verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C" }, file: { unit: { one: "\u0562\u0561\u0575\u0569", many: "\u0562\u0561\u0575\u0569\u0565\u0580" }, verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C" }, array: { unit: { one: "\u057F\u0561\u0580\u0580", many: "\u057F\u0561\u0580\u0580\u0565\u0580" }, verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C" }, set: { unit: { one: "\u057F\u0561\u0580\u0580", many: "\u057F\u0561\u0580\u0580\u0565\u0580" }, verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0574\u0578\u0582\u057F\u0584", email: "\u0567\u056C. \u0570\u0561\u057D\u0581\u0565", url: "URL", emoji: "\u0567\u0574\u0578\u057B\u056B", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574", date: "ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E", time: "ISO \u056A\u0561\u0574", duration: "ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576", ipv4: "IPv4 \u0570\u0561\u057D\u0581\u0565", ipv6: "IPv6 \u0570\u0561\u057D\u0581\u0565", cidrv4: "IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584", cidrv6: "IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584", base64: "base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572", base64url: "base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572", json_string: "JSON \u057F\u0578\u0572", e164: "E.164 \u0570\u0561\u0574\u0561\u0580", jwt: "JWT", template_literal: "\u0574\u0578\u0582\u057F\u0584" }; const TypeDictionary = { nan: "NaN", number: "\u0569\u056B\u057E", array: "\u0566\u0561\u0576\u0563\u057E\u0561\u056E" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${issue2.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${received}`; } return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${stringifyPrimitive(issue2.values[1])}`; return `\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { const maxValue = Number(issue2.maximum); const unit = getArmenianPlural(maxValue, sizing.unit.one, sizing.unit.many); return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue2.maximum.toString()} ${unit}`; } return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { const minValue = Number(issue2.minimum); const unit = getArmenianPlural(minValue, sizing.unit.one, sizing.unit.many); return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue2.minimum.toString()} ${unit}`; } return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin)} \u056C\u056B\u0576\u056B ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${_issue.prefix}"-\u0578\u057E`; if (_issue.format === "ends_with") return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${_issue.suffix}"-\u0578\u057E`; if (_issue.format === "includes") return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${_issue.includes}"`; if (_issue.format === "regex") return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${_issue.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`; return `\u054D\u056D\u0561\u056C ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${issue2.divisor}-\u056B`; case "unrecognized_keys": return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${issue2.keys.length > 1 ? "\u0576\u0565\u0580" : ""}. ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${withDefiniteArticle(issue2.origin)}-\u0578\u0582\u0574`; case "invalid_union": return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"; case "invalid_element": return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${withDefiniteArticle(issue2.origin)}-\u0578\u0582\u0574`; default: return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574`; } }; }, "error"); __name(hy_default, "default"); } }); // ../../node_modules/zod/v4/locales/id.js function id_default() { return { localeError: error21() }; } var error21; var init_id = __esm({ "../../node_modules/zod/v4/locales/id.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error21 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "karakter", verb: "memiliki" }, file: { unit: "byte", verb: "memiliki" }, array: { unit: "item", verb: "memiliki" }, set: { unit: "item", verb: "memiliki" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "input", email: "alamat email", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "tanggal dan waktu format ISO", date: "tanggal format ISO", time: "jam format ISO", duration: "durasi format ISO", ipv4: "alamat IPv4", ipv6: "alamat IPv6", cidrv4: "rentang alamat IPv4", cidrv6: "rentang alamat IPv6", base64: "string dengan enkode base64", base64url: "string dengan enkode base64url", json_string: "string JSON", e164: "angka E.164", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Input tidak valid: diharapkan instanceof ${issue2.expected}, diterima ${received}`; } return `Input tidak valid: diharapkan ${expected}, diterima ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Input tidak valid: diharapkan ${stringifyPrimitive(issue2.values[0])}`; return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Terlalu besar: diharapkan ${issue2.origin ?? "value"} memiliki ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemen"}`; return `Terlalu besar: diharapkan ${issue2.origin ?? "value"} menjadi ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Terlalu kecil: diharapkan ${issue2.origin} memiliki ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Terlalu kecil: diharapkan ${issue2.origin} menjadi ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`; if (_issue.format === "ends_with") return `String tidak valid: harus berakhir dengan "${_issue.suffix}"`; if (_issue.format === "includes") return `String tidak valid: harus menyertakan "${_issue.includes}"`; if (_issue.format === "regex") return `String tidak valid: harus sesuai pola ${_issue.pattern}`; return `${FormatDictionary[_issue.format] ?? issue2.format} tidak valid`; } case "not_multiple_of": return `Angka tidak valid: harus kelipatan dari ${issue2.divisor}`; case "unrecognized_keys": return `Kunci tidak dikenali ${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Kunci tidak valid di ${issue2.origin}`; case "invalid_union": return "Input tidak valid"; case "invalid_element": return `Nilai tidak valid di ${issue2.origin}`; default: return `Input tidak valid`; } }; }, "error"); __name(id_default, "default"); } }); // ../../node_modules/zod/v4/locales/is.js function is_default() { return { localeError: error22() }; } var error22; var init_is = __esm({ "../../node_modules/zod/v4/locales/is.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error22 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "stafi", verb: "a\xF0 hafa" }, file: { unit: "b\xE6ti", verb: "a\xF0 hafa" }, array: { unit: "hluti", verb: "a\xF0 hafa" }, set: { unit: "hluti", verb: "a\xF0 hafa" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "gildi", email: "netfang", url: "vefsl\xF3\xF0", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO dagsetning og t\xEDmi", date: "ISO dagsetning", time: "ISO t\xEDmi", duration: "ISO t\xEDmalengd", ipv4: "IPv4 address", ipv6: "IPv6 address", cidrv4: "IPv4 range", cidrv6: "IPv6 range", base64: "base64-encoded strengur", base64url: "base64url-encoded strengur", json_string: "JSON strengur", e164: "E.164 t\xF6lugildi", jwt: "JWT", template_literal: "gildi" }; const TypeDictionary = { nan: "NaN", number: "n\xFAmer", array: "fylki" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Rangt gildi: \xDE\xFA sl\xF3st inn ${received} \xFEar sem \xE1 a\xF0 vera instanceof ${issue2.expected}`; } return `Rangt gildi: \xDE\xFA sl\xF3st inn ${received} \xFEar sem \xE1 a\xF0 vera ${expected}`; } case "invalid_value": if (issue2.values.length === 1) return `Rangt gildi: gert r\xE1\xF0 fyrir ${stringifyPrimitive(issue2.values[0])}`; return `\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin ?? "gildi"} hafi ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "hluti"}`; return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin ?? "gildi"} s\xE9 ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin} hafi ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin} s\xE9 ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${_issue.suffix}"`; if (_issue.format === "includes") return `\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${_issue.includes}"`; if (_issue.format === "regex") return `\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${_issue.pattern}`; return `Rangt ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${issue2.divisor}`; case "unrecognized_keys": return `\xD3\xFEekkt ${issue2.keys.length > 1 ? "ir lyklar" : "ur lykill"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Rangur lykill \xED ${issue2.origin}`; case "invalid_union": return "Rangt gildi"; case "invalid_element": return `Rangt gildi \xED ${issue2.origin}`; default: return `Rangt gildi`; } }; }, "error"); __name(is_default, "default"); } }); // ../../node_modules/zod/v4/locales/it.js function it_default() { return { localeError: error23() }; } var error23; var init_it = __esm({ "../../node_modules/zod/v4/locales/it.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error23 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "caratteri", verb: "avere" }, file: { unit: "byte", verb: "avere" }, array: { unit: "elementi", verb: "avere" }, set: { unit: "elementi", verb: "avere" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "input", email: "indirizzo email", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "data e ora ISO", date: "data ISO", time: "ora ISO", duration: "durata ISO", ipv4: "indirizzo IPv4", ipv6: "indirizzo IPv6", cidrv4: "intervallo IPv4", cidrv6: "intervallo IPv6", base64: "stringa codificata in base64", base64url: "URL codificata in base64", json_string: "stringa JSON", e164: "numero E.164", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { nan: "NaN", number: "numero", array: "vettore" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Input non valido: atteso instanceof ${issue2.expected}, ricevuto ${received}`; } return `Input non valido: atteso ${expected}, ricevuto ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Input non valido: atteso ${stringifyPrimitive(issue2.values[0])}`; return `Opzione non valida: atteso uno tra ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Troppo grande: ${issue2.origin ?? "valore"} deve avere ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementi"}`; return `Troppo grande: ${issue2.origin ?? "valore"} deve essere ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Troppo piccolo: ${issue2.origin} deve avere ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Troppo piccolo: ${issue2.origin} deve essere ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Stringa non valida: deve iniziare con "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Stringa non valida: deve terminare con "${_issue.suffix}"`; if (_issue.format === "includes") return `Stringa non valida: deve includere "${_issue.includes}"`; if (_issue.format === "regex") return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`; return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Numero non valido: deve essere un multiplo di ${issue2.divisor}`; case "unrecognized_keys": return `Chiav${issue2.keys.length > 1 ? "i" : "e"} non riconosciut${issue2.keys.length > 1 ? "e" : "a"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Chiave non valida in ${issue2.origin}`; case "invalid_union": return "Input non valido"; case "invalid_element": return `Valore non valido in ${issue2.origin}`; default: return `Input non valido`; } }; }, "error"); __name(it_default, "default"); } }); // ../../node_modules/zod/v4/locales/ja.js function ja_default() { return { localeError: error24() }; } var error24; var init_ja = __esm({ "../../node_modules/zod/v4/locales/ja.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error24 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" }, file: { unit: "\u30D0\u30A4\u30C8", verb: "\u3067\u3042\u308B" }, array: { unit: "\u8981\u7D20", verb: "\u3067\u3042\u308B" }, set: { unit: "\u8981\u7D20", verb: "\u3067\u3042\u308B" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u5165\u529B\u5024", email: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9", url: "URL", emoji: "\u7D75\u6587\u5B57", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO\u65E5\u6642", date: "ISO\u65E5\u4ED8", time: "ISO\u6642\u523B", duration: "ISO\u671F\u9593", ipv4: "IPv4\u30A2\u30C9\u30EC\u30B9", ipv6: "IPv6\u30A2\u30C9\u30EC\u30B9", cidrv4: "IPv4\u7BC4\u56F2", cidrv6: "IPv6\u7BC4\u56F2", base64: "base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217", base64url: "base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217", json_string: "JSON\u6587\u5B57\u5217", e164: "E.164\u756A\u53F7", jwt: "JWT", template_literal: "\u5165\u529B\u5024" }; const TypeDictionary = { nan: "NaN", number: "\u6570\u5024", array: "\u914D\u5217" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u7121\u52B9\u306A\u5165\u529B: instanceof ${issue2.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${received}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`; } return `\u7121\u52B9\u306A\u5165\u529B: ${expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${received}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`; } case "invalid_value": if (issue2.values.length === 1) return `\u7121\u52B9\u306A\u5165\u529B: ${stringifyPrimitive(issue2.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`; return `\u7121\u52B9\u306A\u9078\u629E: ${joinValues(issue2.values, "\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; case "too_big": { const adj = issue2.inclusive ? "\u4EE5\u4E0B\u3067\u3042\u308B" : "\u3088\u308A\u5C0F\u3055\u3044"; const sizing = getSizing(issue2.origin); if (sizing) return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue2.origin ?? "\u5024"}\u306F${issue2.maximum.toString()}${sizing.unit ?? "\u8981\u7D20"}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue2.origin ?? "\u5024"}\u306F${issue2.maximum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; } case "too_small": { const adj = issue2.inclusive ? "\u4EE5\u4E0A\u3067\u3042\u308B" : "\u3088\u308A\u5927\u304D\u3044"; const sizing = getSizing(issue2.origin); if (sizing) return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue2.origin}\u306F${issue2.minimum.toString()}${sizing.unit}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue2.origin}\u306F${issue2.minimum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; if (_issue.format === "ends_with") return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; if (_issue.format === "includes") return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; if (_issue.format === "regex") return `\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${_issue.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; return `\u7121\u52B9\u306A${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u7121\u52B9\u306A\u6570\u5024: ${issue2.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; case "unrecognized_keys": return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${issue2.keys.length > 1 ? "\u7FA4" : ""}: ${joinValues(issue2.keys, "\u3001")}`; case "invalid_key": return `${issue2.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`; case "invalid_union": return "\u7121\u52B9\u306A\u5165\u529B"; case "invalid_element": return `${issue2.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`; default: return `\u7121\u52B9\u306A\u5165\u529B`; } }; }, "error"); __name(ja_default, "default"); } }); // ../../node_modules/zod/v4/locales/ka.js function ka_default() { return { localeError: error25() }; } var error25; var init_ka = __esm({ "../../node_modules/zod/v4/locales/ka.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error25 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" }, file: { unit: "\u10D1\u10D0\u10D8\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" }, array: { unit: "\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" }, set: { unit: "\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0", email: "\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8", url: "URL", emoji: "\u10D4\u10DB\u10DD\u10EF\u10D8", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD", date: "\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8", time: "\u10D3\u10E0\u10DD", duration: "\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0", ipv4: "IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8", ipv6: "IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8", cidrv4: "IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8", cidrv6: "IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8", base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8", base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8", json_string: "JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8", e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8", jwt: "JWT", template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0" }; const TypeDictionary = { nan: "NaN", number: "\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8", string: "\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8", boolean: "\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8", function: "\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0", array: "\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${issue2.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${received}`; } return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${stringifyPrimitive(issue2.values[0])}`; return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${joinValues(issue2.values, "|")}-\u10D3\u10D0\u10DC`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit}`; return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`; } if (_issue.format === "ends_with") return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`; if (_issue.format === "includes") return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`; if (_issue.format === "regex") return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`; return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${issue2.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`; case "unrecognized_keys": return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${issue2.keys.length > 1 ? "\u10D4\u10D1\u10D8" : "\u10D8"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${issue2.origin}-\u10E8\u10D8`; case "invalid_union": return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"; case "invalid_element": return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${issue2.origin}-\u10E8\u10D8`; default: return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0`; } }; }, "error"); __name(ka_default, "default"); } }); // ../../node_modules/zod/v4/locales/km.js function km_default() { return { localeError: error26() }; } var error26; var init_km = __esm({ "../../node_modules/zod/v4/locales/km.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error26 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" }, file: { unit: "\u1794\u17C3", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" }, array: { unit: "\u1792\u17B6\u178F\u17BB", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" }, set: { unit: "\u1792\u17B6\u178F\u17BB", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B", email: "\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B", url: "URL", emoji: "\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO", date: "\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO", time: "\u1798\u17C9\u17C4\u1784 ISO", duration: "\u179A\u1799\u17C8\u1796\u17C1\u179B ISO", ipv4: "\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4", ipv6: "\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6", cidrv4: "\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4", cidrv6: "\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6", base64: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64", base64url: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url", json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON", e164: "\u179B\u17C1\u1781 E.164", jwt: "JWT", template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B" }; const TypeDictionary = { nan: "NaN", number: "\u179B\u17C1\u1781", array: "\u17A2\u17B6\u179A\u17C1 (Array)", null: "\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${issue2.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${received}`; } return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${stringifyPrimitive(issue2.values[0])}`; return `\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u1792\u17B6\u178F\u17BB"}`; return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin} ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; } return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin} ${adj} ${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${_issue.includes}"`; if (_issue.format === "regex") return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${_issue.pattern}`; return `\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${issue2.divisor}`; case "unrecognized_keys": return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue2.origin}`; case "invalid_union": return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C`; case "invalid_element": return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue2.origin}`; default: return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C`; } }; }, "error"); __name(km_default, "default"); } }); // ../../node_modules/zod/v4/locales/kh.js function kh_default() { return km_default(); } var init_kh = __esm({ "../../node_modules/zod/v4/locales/kh.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_km(); __name(kh_default, "default"); } }); // ../../node_modules/zod/v4/locales/ko.js function ko_default() { return { localeError: error27() }; } var error27; var init_ko = __esm({ "../../node_modules/zod/v4/locales/ko.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error27 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\uBB38\uC790", verb: "to have" }, file: { unit: "\uBC14\uC774\uD2B8", verb: "to have" }, array: { unit: "\uAC1C", verb: "to have" }, set: { unit: "\uAC1C", verb: "to have" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\uC785\uB825", email: "\uC774\uBA54\uC77C \uC8FC\uC18C", url: "URL", emoji: "\uC774\uBAA8\uC9C0", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \uB0A0\uC9DC\uC2DC\uAC04", date: "ISO \uB0A0\uC9DC", time: "ISO \uC2DC\uAC04", duration: "ISO \uAE30\uAC04", ipv4: "IPv4 \uC8FC\uC18C", ipv6: "IPv6 \uC8FC\uC18C", cidrv4: "IPv4 \uBC94\uC704", cidrv6: "IPv6 \uBC94\uC704", base64: "base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4", base64url: "base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4", json_string: "JSON \uBB38\uC790\uC5F4", e164: "E.164 \uBC88\uD638", jwt: "JWT", template_literal: "\uC785\uB825" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${issue2.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${received}\uC785\uB2C8\uB2E4`; } return `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${received}\uC785\uB2C8\uB2E4`; } case "invalid_value": if (issue2.values.length === 1) return `\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${stringifyPrimitive(issue2.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`; return `\uC798\uBABB\uB41C \uC635\uC158: ${joinValues(issue2.values, "\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`; case "too_big": { const adj = issue2.inclusive ? "\uC774\uD558" : "\uBBF8\uB9CC"; const suffix = adj === "\uBBF8\uB9CC" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4"; const sizing = getSizing(issue2.origin); const unit = sizing?.unit ?? "\uC694\uC18C"; if (sizing) return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue2.maximum.toString()}${unit} ${adj}${suffix}`; return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue2.maximum.toString()} ${adj}${suffix}`; } case "too_small": { const adj = issue2.inclusive ? "\uC774\uC0C1" : "\uCD08\uACFC"; const suffix = adj === "\uC774\uC0C1" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4"; const sizing = getSizing(issue2.origin); const unit = sizing?.unit ?? "\uC694\uC18C"; if (sizing) { return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue2.minimum.toString()}${unit} ${adj}${suffix}`; } return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue2.minimum.toString()} ${adj}${suffix}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`; } if (_issue.format === "ends_with") return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`; if (_issue.format === "includes") return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`; if (_issue.format === "regex") return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${_issue.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`; return `\uC798\uBABB\uB41C ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\uC798\uBABB\uB41C \uC22B\uC790: ${issue2.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`; case "unrecognized_keys": return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\uC798\uBABB\uB41C \uD0A4: ${issue2.origin}`; case "invalid_union": return `\uC798\uBABB\uB41C \uC785\uB825`; case "invalid_element": return `\uC798\uBABB\uB41C \uAC12: ${issue2.origin}`; default: return `\uC798\uBABB\uB41C \uC785\uB825`; } }; }, "error"); __name(ko_default, "default"); } }); // ../../node_modules/zod/v4/locales/lt.js function getUnitTypeFromNumber(number4) { const abs = Math.abs(number4); const last = abs % 10; const last2 = abs % 100; if (last2 >= 11 && last2 <= 19 || last === 0) return "many"; if (last === 1) return "one"; return "few"; } function lt_default() { return { localeError: error28() }; } var capitalizeFirstCharacter, error28; var init_lt = __esm({ "../../node_modules/zod/v4/locales/lt.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); capitalizeFirstCharacter = /* @__PURE__ */ __name((text2) => { return text2.charAt(0).toUpperCase() + text2.slice(1); }, "capitalizeFirstCharacter"); __name(getUnitTypeFromNumber, "getUnitTypeFromNumber"); error28 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: { one: "simbolis", few: "simboliai", many: "simboli\u0173" }, verb: { smaller: { inclusive: "turi b\u016Bti ne ilgesn\u0117 kaip", notInclusive: "turi b\u016Bti trumpesn\u0117 kaip" }, bigger: { inclusive: "turi b\u016Bti ne trumpesn\u0117 kaip", notInclusive: "turi b\u016Bti ilgesn\u0117 kaip" } } }, file: { unit: { one: "baitas", few: "baitai", many: "bait\u0173" }, verb: { smaller: { inclusive: "turi b\u016Bti ne didesnis kaip", notInclusive: "turi b\u016Bti ma\u017Eesnis kaip" }, bigger: { inclusive: "turi b\u016Bti ne ma\u017Eesnis kaip", notInclusive: "turi b\u016Bti didesnis kaip" } } }, array: { unit: { one: "element\u0105", few: "elementus", many: "element\u0173" }, verb: { smaller: { inclusive: "turi tur\u0117ti ne daugiau kaip", notInclusive: "turi tur\u0117ti ma\u017Eiau kaip" }, bigger: { inclusive: "turi tur\u0117ti ne ma\u017Eiau kaip", notInclusive: "turi tur\u0117ti daugiau kaip" } } }, set: { unit: { one: "element\u0105", few: "elementus", many: "element\u0173" }, verb: { smaller: { inclusive: "turi tur\u0117ti ne daugiau kaip", notInclusive: "turi tur\u0117ti ma\u017Eiau kaip" }, bigger: { inclusive: "turi tur\u0117ti ne ma\u017Eiau kaip", notInclusive: "turi tur\u0117ti daugiau kaip" } } } }; function getSizing(origin2, unitType, inclusive, targetShouldBe) { const result = Sizable[origin2] ?? null; if (result === null) return result; return { unit: result.unit[unitType], verb: result.verb[targetShouldBe][inclusive ? "inclusive" : "notInclusive"] }; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u012Fvestis", email: "el. pa\u0161to adresas", url: "URL", emoji: "jaustukas", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO data ir laikas", date: "ISO data", time: "ISO laikas", duration: "ISO trukm\u0117", ipv4: "IPv4 adresas", ipv6: "IPv6 adresas", cidrv4: "IPv4 tinklo prefiksas (CIDR)", cidrv6: "IPv6 tinklo prefiksas (CIDR)", base64: "base64 u\u017Ekoduota eilut\u0117", base64url: "base64url u\u017Ekoduota eilut\u0117", json_string: "JSON eilut\u0117", e164: "E.164 numeris", jwt: "JWT", template_literal: "\u012Fvestis" }; const TypeDictionary = { nan: "NaN", number: "skai\u010Dius", bigint: "sveikasis skai\u010Dius", string: "eilut\u0117", boolean: "login\u0117 reik\u0161m\u0117", undefined: "neapibr\u0117\u017Eta reik\u0161m\u0117", function: "funkcija", symbol: "simbolis", array: "masyvas", object: "objektas", null: "nulin\u0117 reik\u0161m\u0117" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Gautas tipas ${received}, o tik\u0117tasi - instanceof ${issue2.expected}`; } return `Gautas tipas ${received}, o tik\u0117tasi - ${expected}`; } case "invalid_value": if (issue2.values.length === 1) return `Privalo b\u016Bti ${stringifyPrimitive(issue2.values[0])}`; return `Privalo b\u016Bti vienas i\u0161 ${joinValues(issue2.values, "|")} pasirinkim\u0173`; case "too_big": { const origin2 = TypeDictionary[issue2.origin] ?? issue2.origin; const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.maximum)), issue2.inclusive ?? false, "smaller"); if (sizing?.verb) return `${capitalizeFirstCharacter(origin2 ?? issue2.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue2.maximum.toString()} ${sizing.unit ?? "element\u0173"}`; const adj = issue2.inclusive ? "ne didesnis kaip" : "ma\u017Eesnis kaip"; return `${capitalizeFirstCharacter(origin2 ?? issue2.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue2.maximum.toString()} ${sizing?.unit}`; } case "too_small": { const origin2 = TypeDictionary[issue2.origin] ?? issue2.origin; const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.minimum)), issue2.inclusive ?? false, "bigger"); if (sizing?.verb) return `${capitalizeFirstCharacter(origin2 ?? issue2.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue2.minimum.toString()} ${sizing.unit ?? "element\u0173"}`; const adj = issue2.inclusive ? "ne ma\u017Eesnis kaip" : "didesnis kaip"; return `${capitalizeFirstCharacter(origin2 ?? issue2.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue2.minimum.toString()} ${sizing?.unit}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `Eilut\u0117 privalo prasid\u0117ti "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `Eilut\u0117 privalo pasibaigti "${_issue.suffix}"`; if (_issue.format === "includes") return `Eilut\u0117 privalo \u012Ftraukti "${_issue.includes}"`; if (_issue.format === "regex") return `Eilut\u0117 privalo atitikti ${_issue.pattern}`; return `Neteisingas ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Skai\u010Dius privalo b\u016Bti ${issue2.divisor} kartotinis.`; case "unrecognized_keys": return `Neatpa\u017Eint${issue2.keys.length > 1 ? "i" : "as"} rakt${issue2.keys.length > 1 ? "ai" : "as"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return "Rastas klaidingas raktas"; case "invalid_union": return "Klaidinga \u012Fvestis"; case "invalid_element": { const origin2 = TypeDictionary[issue2.origin] ?? issue2.origin; return `${capitalizeFirstCharacter(origin2 ?? issue2.origin ?? "reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`; } default: return "Klaidinga \u012Fvestis"; } }; }, "error"); __name(lt_default, "default"); } }); // ../../node_modules/zod/v4/locales/mk.js function mk_default() { return { localeError: error29() }; } var error29; var init_mk = __esm({ "../../node_modules/zod/v4/locales/mk.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error29 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" }, file: { unit: "\u0431\u0430\u0458\u0442\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" }, array: { unit: "\u0441\u0442\u0430\u0432\u043A\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" }, set: { unit: "\u0441\u0442\u0430\u0432\u043A\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0432\u043D\u0435\u0441", email: "\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430", url: "URL", emoji: "\u0435\u043C\u043E\u045F\u0438", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435", date: "ISO \u0434\u0430\u0442\u0443\u043C", time: "ISO \u0432\u0440\u0435\u043C\u0435", duration: "ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435", ipv4: "IPv4 \u0430\u0434\u0440\u0435\u0441\u0430", ipv6: "IPv6 \u0430\u0434\u0440\u0435\u0441\u0430", cidrv4: "IPv4 \u043E\u043F\u0441\u0435\u0433", cidrv6: "IPv6 \u043E\u043F\u0441\u0435\u0433", base64: "base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430", base64url: "base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430", json_string: "JSON \u043D\u0438\u0437\u0430", e164: "E.164 \u0431\u0440\u043E\u0458", jwt: "JWT", template_literal: "\u0432\u043D\u0435\u0441" }; const TypeDictionary = { nan: "NaN", number: "\u0431\u0440\u043E\u0458", array: "\u043D\u0438\u0437\u0430" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${issue2.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${received}`; } return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`; return `\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`; return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${_issue.suffix}"`; if (_issue.format === "includes") return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${_issue.pattern}`; return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${issue2.divisor}`; case "unrecognized_keys": return `${issue2.keys.length > 1 ? "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438" : "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${issue2.origin}`; case "invalid_union": return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"; case "invalid_element": return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${issue2.origin}`; default: return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441`; } }; }, "error"); __name(mk_default, "default"); } }); // ../../node_modules/zod/v4/locales/ms.js function ms_default() { return { localeError: error30() }; } var error30; var init_ms = __esm({ "../../node_modules/zod/v4/locales/ms.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error30 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "aksara", verb: "mempunyai" }, file: { unit: "bait", verb: "mempunyai" }, array: { unit: "elemen", verb: "mempunyai" }, set: { unit: "elemen", verb: "mempunyai" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "input", email: "alamat e-mel", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "tarikh masa ISO", date: "tarikh ISO", time: "masa ISO", duration: "tempoh ISO", ipv4: "alamat IPv4", ipv6: "alamat IPv6", cidrv4: "julat IPv4", cidrv6: "julat IPv6", base64: "string dikodkan base64", base64url: "string dikodkan base64url", json_string: "string JSON", e164: "nombor E.164", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { nan: "NaN", number: "nombor" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Input tidak sah: dijangka instanceof ${issue2.expected}, diterima ${received}`; } return `Input tidak sah: dijangka ${expected}, diterima ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Input tidak sah: dijangka ${stringifyPrimitive(issue2.values[0])}`; return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Terlalu besar: dijangka ${issue2.origin ?? "nilai"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemen"}`; return `Terlalu besar: dijangka ${issue2.origin ?? "nilai"} adalah ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Terlalu kecil: dijangka ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Terlalu kecil: dijangka ${issue2.origin} adalah ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`; if (_issue.format === "ends_with") return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`; if (_issue.format === "includes") return `String tidak sah: mesti mengandungi "${_issue.includes}"`; if (_issue.format === "regex") return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`; return `${FormatDictionary[_issue.format] ?? issue2.format} tidak sah`; } case "not_multiple_of": return `Nombor tidak sah: perlu gandaan ${issue2.divisor}`; case "unrecognized_keys": return `Kunci tidak dikenali: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Kunci tidak sah dalam ${issue2.origin}`; case "invalid_union": return "Input tidak sah"; case "invalid_element": return `Nilai tidak sah dalam ${issue2.origin}`; default: return `Input tidak sah`; } }; }, "error"); __name(ms_default, "default"); } }); // ../../node_modules/zod/v4/locales/nl.js function nl_default() { return { localeError: error31() }; } var error31; var init_nl = __esm({ "../../node_modules/zod/v4/locales/nl.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error31 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "tekens", verb: "heeft" }, file: { unit: "bytes", verb: "heeft" }, array: { unit: "elementen", verb: "heeft" }, set: { unit: "elementen", verb: "heeft" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "invoer", email: "emailadres", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO datum en tijd", date: "ISO datum", time: "ISO tijd", duration: "ISO duur", ipv4: "IPv4-adres", ipv6: "IPv6-adres", cidrv4: "IPv4-bereik", cidrv6: "IPv6-bereik", base64: "base64-gecodeerde tekst", base64url: "base64 URL-gecodeerde tekst", json_string: "JSON string", e164: "E.164-nummer", jwt: "JWT", template_literal: "invoer" }; const TypeDictionary = { nan: "NaN", number: "getal" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Ongeldige invoer: verwacht instanceof ${issue2.expected}, ontving ${received}`; } return `Ongeldige invoer: verwacht ${expected}, ontving ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue2.values[0])}`; return `Ongeldige optie: verwacht \xE9\xE9n van ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); const longName = issue2.origin === "date" ? "laat" : issue2.origin === "string" ? "lang" : "groot"; if (sizing) return `Te ${longName}: verwacht dat ${issue2.origin ?? "waarde"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementen"} ${sizing.verb}`; return `Te ${longName}: verwacht dat ${issue2.origin ?? "waarde"} ${adj}${issue2.maximum.toString()} is`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); const shortName = issue2.origin === "date" ? "vroeg" : issue2.origin === "string" ? "kort" : "klein"; if (sizing) { return `Te ${shortName}: verwacht dat ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`; } return `Te ${shortName}: verwacht dat ${issue2.origin} ${adj}${issue2.minimum.toString()} is`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`; } if (_issue.format === "ends_with") return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`; if (_issue.format === "includes") return `Ongeldige tekst: moet "${_issue.includes}" bevatten`; if (_issue.format === "regex") return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`; return `Ongeldig: ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Ongeldig getal: moet een veelvoud van ${issue2.divisor} zijn`; case "unrecognized_keys": return `Onbekende key${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Ongeldige key in ${issue2.origin}`; case "invalid_union": return "Ongeldige invoer"; case "invalid_element": return `Ongeldige waarde in ${issue2.origin}`; default: return `Ongeldige invoer`; } }; }, "error"); __name(nl_default, "default"); } }); // ../../node_modules/zod/v4/locales/no.js function no_default() { return { localeError: error32() }; } var error32; var init_no = __esm({ "../../node_modules/zod/v4/locales/no.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error32 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "tegn", verb: "\xE5 ha" }, file: { unit: "bytes", verb: "\xE5 ha" }, array: { unit: "elementer", verb: "\xE5 inneholde" }, set: { unit: "elementer", verb: "\xE5 inneholde" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "input", email: "e-postadresse", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO dato- og klokkeslett", date: "ISO-dato", time: "ISO-klokkeslett", duration: "ISO-varighet", ipv4: "IPv4-omr\xE5de", ipv6: "IPv6-omr\xE5de", cidrv4: "IPv4-spekter", cidrv6: "IPv6-spekter", base64: "base64-enkodet streng", base64url: "base64url-enkodet streng", json_string: "JSON-streng", e164: "E.164-nummer", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { nan: "NaN", number: "tall", array: "liste" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Ugyldig input: forventet instanceof ${issue2.expected}, fikk ${received}`; } return `Ugyldig input: forventet ${expected}, fikk ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Ugyldig verdi: forventet ${stringifyPrimitive(issue2.values[0])}`; return `Ugyldig valg: forventet en av ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `For stor(t): forventet ${issue2.origin ?? "value"} til \xE5 ha ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementer"}`; return `For stor(t): forventet ${issue2.origin ?? "value"} til \xE5 ha ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `For lite(n): forventet ${issue2.origin} til \xE5 ha ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `For lite(n): forventet ${issue2.origin} til \xE5 ha ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Ugyldig streng: m\xE5 starte med "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Ugyldig streng: m\xE5 ende med "${_issue.suffix}"`; if (_issue.format === "includes") return `Ugyldig streng: m\xE5 inneholde "${_issue.includes}"`; if (_issue.format === "regex") return `Ugyldig streng: m\xE5 matche m\xF8nsteret ${_issue.pattern}`; return `Ugyldig ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${issue2.divisor}`; case "unrecognized_keys": return `${issue2.keys.length > 1 ? "Ukjente n\xF8kler" : "Ukjent n\xF8kkel"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Ugyldig n\xF8kkel i ${issue2.origin}`; case "invalid_union": return "Ugyldig input"; case "invalid_element": return `Ugyldig verdi i ${issue2.origin}`; default: return `Ugyldig input`; } }; }, "error"); __name(no_default, "default"); } }); // ../../node_modules/zod/v4/locales/ota.js function ota_default() { return { localeError: error33() }; } var error33; var init_ota = __esm({ "../../node_modules/zod/v4/locales/ota.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error33 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "harf", verb: "olmal\u0131d\u0131r" }, file: { unit: "bayt", verb: "olmal\u0131d\u0131r" }, array: { unit: "unsur", verb: "olmal\u0131d\u0131r" }, set: { unit: "unsur", verb: "olmal\u0131d\u0131r" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "giren", email: "epostag\xE2h", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO heng\xE2m\u0131", date: "ISO tarihi", time: "ISO zaman\u0131", duration: "ISO m\xFCddeti", ipv4: "IPv4 ni\u015F\xE2n\u0131", ipv6: "IPv6 ni\u015F\xE2n\u0131", cidrv4: "IPv4 menzili", cidrv6: "IPv6 menzili", base64: "base64-\u015Fifreli metin", base64url: "base64url-\u015Fifreli metin", json_string: "JSON metin", e164: "E.164 say\u0131s\u0131", jwt: "JWT", template_literal: "giren" }; const TypeDictionary = { nan: "NaN", number: "numara", array: "saf", null: "gayb" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `F\xE2sit giren: umulan instanceof ${issue2.expected}, al\u0131nan ${received}`; } return `F\xE2sit giren: umulan ${expected}, al\u0131nan ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `F\xE2sit giren: umulan ${stringifyPrimitive(issue2.values[0])}`; return `F\xE2sit tercih: m\xFBteberler ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Fazla b\xFCy\xFCk: ${issue2.origin ?? "value"}, ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmal\u0131yd\u0131.`; return `Fazla b\xFCy\xFCk: ${issue2.origin ?? "value"}, ${adj}${issue2.maximum.toString()} olmal\u0131yd\u0131.`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Fazla k\xFC\xE7\xFCk: ${issue2.origin}, ${adj}${issue2.minimum.toString()} ${sizing.unit} sahip olmal\u0131yd\u0131.`; } return `Fazla k\xFC\xE7\xFCk: ${issue2.origin}, ${adj}${issue2.minimum.toString()} olmal\u0131yd\u0131.`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `F\xE2sit metin: "${_issue.prefix}" ile ba\u015Flamal\u0131.`; if (_issue.format === "ends_with") return `F\xE2sit metin: "${_issue.suffix}" ile bitmeli.`; if (_issue.format === "includes") return `F\xE2sit metin: "${_issue.includes}" ihtiv\xE2 etmeli.`; if (_issue.format === "regex") return `F\xE2sit metin: ${_issue.pattern} nak\u015F\u0131na uymal\u0131.`; return `F\xE2sit ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `F\xE2sit say\u0131: ${issue2.divisor} kat\u0131 olmal\u0131yd\u0131.`; case "unrecognized_keys": return `Tan\u0131nmayan anahtar ${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `${issue2.origin} i\xE7in tan\u0131nmayan anahtar var.`; case "invalid_union": return "Giren tan\u0131namad\u0131."; case "invalid_element": return `${issue2.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`; default: return `K\u0131ymet tan\u0131namad\u0131.`; } }; }, "error"); __name(ota_default, "default"); } }); // ../../node_modules/zod/v4/locales/ps.js function ps_default() { return { localeError: error34() }; } var error34; var init_ps = __esm({ "../../node_modules/zod/v4/locales/ps.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error34 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" }, file: { unit: "\u0628\u0627\u06CC\u067C\u0633", verb: "\u0648\u0644\u0631\u064A" }, array: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" }, set: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0648\u0631\u0648\u062F\u064A", email: "\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9", url: "\u06CC\u0648 \u0622\u0631 \u0627\u0644", emoji: "\u0627\u06CC\u0645\u0648\u062C\u064A", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A", date: "\u0646\u06D0\u067C\u0647", time: "\u0648\u062E\u062A", duration: "\u0645\u0648\u062F\u0647", ipv4: "\u062F IPv4 \u067E\u062A\u0647", ipv6: "\u062F IPv6 \u067E\u062A\u0647", cidrv4: "\u062F IPv4 \u0633\u0627\u062D\u0647", cidrv6: "\u062F IPv6 \u0633\u0627\u062D\u0647", base64: "base64-encoded \u0645\u062A\u0646", base64url: "base64url-encoded \u0645\u062A\u0646", json_string: "JSON \u0645\u062A\u0646", e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647", jwt: "JWT", template_literal: "\u0648\u0631\u0648\u062F\u064A" }; const TypeDictionary = { nan: "NaN", number: "\u0639\u062F\u062F", array: "\u0627\u0631\u06D0" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${issue2.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${received} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`; } return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${received} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`; } case "invalid_value": if (issue2.values.length === 1) { return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${stringifyPrimitive(issue2.values[0])} \u0648\u0627\u06CC`; } return `\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${joinValues(issue2.values, "|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue2.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`; } return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue2.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} \u0648\u064A`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} ${sizing.unit} \u0648\u0644\u0631\u064A`; } return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} \u0648\u064A`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${_issue.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`; } if (_issue.format === "ends_with") { return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${_issue.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`; } if (_issue.format === "includes") { return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${_issue.includes}" \u0648\u0644\u0631\u064A`; } if (_issue.format === "regex") { return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${_issue.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`; } return `${FormatDictionary[_issue.format] ?? issue2.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`; } case "not_multiple_of": return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${issue2.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`; case "unrecognized_keys": return `\u0646\u0627\u0633\u0645 ${issue2.keys.length > 1 ? "\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647" : "\u06A9\u0644\u06CC\u0689"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${issue2.origin} \u06A9\u06D0`; case "invalid_union": return `\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A`; case "invalid_element": return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${issue2.origin} \u06A9\u06D0`; default: return `\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A`; } }; }, "error"); __name(ps_default, "default"); } }); // ../../node_modules/zod/v4/locales/pl.js function pl_default() { return { localeError: error35() }; } var error35; var init_pl = __esm({ "../../node_modules/zod/v4/locales/pl.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error35 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "znak\xF3w", verb: "mie\u0107" }, file: { unit: "bajt\xF3w", verb: "mie\u0107" }, array: { unit: "element\xF3w", verb: "mie\u0107" }, set: { unit: "element\xF3w", verb: "mie\u0107" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "wyra\u017Cenie", email: "adres email", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "data i godzina w formacie ISO", date: "data w formacie ISO", time: "godzina w formacie ISO", duration: "czas trwania ISO", ipv4: "adres IPv4", ipv6: "adres IPv6", cidrv4: "zakres IPv4", cidrv6: "zakres IPv6", base64: "ci\u0105g znak\xF3w zakodowany w formacie base64", base64url: "ci\u0105g znak\xF3w zakodowany w formacie base64url", json_string: "ci\u0105g znak\xF3w w formacie JSON", e164: "liczba E.164", jwt: "JWT", template_literal: "wej\u015Bcie" }; const TypeDictionary = { nan: "NaN", number: "liczba", array: "tablica" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${issue2.expected}, otrzymano ${received}`; } return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${expected}, otrzymano ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${stringifyPrimitive(issue2.values[0])}`; return `Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { return `Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element\xF3w"}`; } return `Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue2.minimum.toString()} ${sizing.unit ?? "element\xF3w"}`; } return `Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${_issue.suffix}"`; if (_issue.format === "includes") return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${_issue.includes}"`; if (_issue.format === "regex") return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${_issue.pattern}`; return `Nieprawid\u0142ow(y/a/e) ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${issue2.divisor}`; case "unrecognized_keys": return `Nierozpoznane klucze${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Nieprawid\u0142owy klucz w ${issue2.origin}`; case "invalid_union": return "Nieprawid\u0142owe dane wej\u015Bciowe"; case "invalid_element": return `Nieprawid\u0142owa warto\u015B\u0107 w ${issue2.origin}`; default: return `Nieprawid\u0142owe dane wej\u015Bciowe`; } }; }, "error"); __name(pl_default, "default"); } }); // ../../node_modules/zod/v4/locales/pt.js function pt_default() { return { localeError: error36() }; } var error36; var init_pt = __esm({ "../../node_modules/zod/v4/locales/pt.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error36 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "caracteres", verb: "ter" }, file: { unit: "bytes", verb: "ter" }, array: { unit: "itens", verb: "ter" }, set: { unit: "itens", verb: "ter" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "padr\xE3o", email: "endere\xE7o de e-mail", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "data e hora ISO", date: "data ISO", time: "hora ISO", duration: "dura\xE7\xE3o ISO", ipv4: "endere\xE7o IPv4", ipv6: "endere\xE7o IPv6", cidrv4: "faixa de IPv4", cidrv6: "faixa de IPv6", base64: "texto codificado em base64", base64url: "URL codificada em base64", json_string: "texto JSON", e164: "n\xFAmero E.164", jwt: "JWT", template_literal: "entrada" }; const TypeDictionary = { nan: "NaN", number: "n\xFAmero", null: "nulo" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Tipo inv\xE1lido: esperado instanceof ${issue2.expected}, recebido ${received}`; } return `Tipo inv\xE1lido: esperado ${expected}, recebido ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Entrada inv\xE1lida: esperado ${stringifyPrimitive(issue2.values[0])}`; return `Op\xE7\xE3o inv\xE1lida: esperada uma das ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Muito grande: esperado que ${issue2.origin ?? "valor"} tivesse ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementos"}`; return `Muito grande: esperado que ${issue2.origin ?? "valor"} fosse ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Muito pequeno: esperado que ${issue2.origin} tivesse ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Muito pequeno: esperado que ${issue2.origin} fosse ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Texto inv\xE1lido: deve come\xE7ar com "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Texto inv\xE1lido: deve terminar com "${_issue.suffix}"`; if (_issue.format === "includes") return `Texto inv\xE1lido: deve incluir "${_issue.includes}"`; if (_issue.format === "regex") return `Texto inv\xE1lido: deve corresponder ao padr\xE3o ${_issue.pattern}`; return `${FormatDictionary[_issue.format] ?? issue2.format} inv\xE1lido`; } case "not_multiple_of": return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`; case "unrecognized_keys": return `Chave${issue2.keys.length > 1 ? "s" : ""} desconhecida${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Chave inv\xE1lida em ${issue2.origin}`; case "invalid_union": return "Entrada inv\xE1lida"; case "invalid_element": return `Valor inv\xE1lido em ${issue2.origin}`; default: return `Campo inv\xE1lido`; } }; }, "error"); __name(pt_default, "default"); } }); // ../../node_modules/zod/v4/locales/ru.js function getRussianPlural(count4, one, few, many) { const absCount = Math.abs(count4); const lastDigit = absCount % 10; const lastTwoDigits = absCount % 100; if (lastTwoDigits >= 11 && lastTwoDigits <= 19) { return many; } if (lastDigit === 1) { return one; } if (lastDigit >= 2 && lastDigit <= 4) { return few; } return many; } function ru_default() { return { localeError: error37() }; } var error37; var init_ru = __esm({ "../../node_modules/zod/v4/locales/ru.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); __name(getRussianPlural, "getRussianPlural"); error37 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: { one: "\u0441\u0438\u043C\u0432\u043E\u043B", few: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", many: "\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432" }, verb: "\u0438\u043C\u0435\u0442\u044C" }, file: { unit: { one: "\u0431\u0430\u0439\u0442", few: "\u0431\u0430\u0439\u0442\u0430", many: "\u0431\u0430\u0439\u0442" }, verb: "\u0438\u043C\u0435\u0442\u044C" }, array: { unit: { one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442", few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430", many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432" }, verb: "\u0438\u043C\u0435\u0442\u044C" }, set: { unit: { one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442", few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430", many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432" }, verb: "\u0438\u043C\u0435\u0442\u044C" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0432\u0432\u043E\u0434", email: "email \u0430\u0434\u0440\u0435\u0441", url: "URL", emoji: "\u044D\u043C\u043E\u0434\u0437\u0438", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F", date: "ISO \u0434\u0430\u0442\u0430", time: "ISO \u0432\u0440\u0435\u043C\u044F", duration: "ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C", ipv4: "IPv4 \u0430\u0434\u0440\u0435\u0441", ipv6: "IPv6 \u0430\u0434\u0440\u0435\u0441", cidrv4: "IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D", cidrv6: "IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D", base64: "\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64", base64url: "\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url", json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430", e164: "\u043D\u043E\u043C\u0435\u0440 E.164", jwt: "JWT", template_literal: "\u0432\u0432\u043E\u0434" }; const TypeDictionary = { nan: "NaN", number: "\u0447\u0438\u0441\u043B\u043E", array: "\u043C\u0430\u0441\u0441\u0438\u0432" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${issue2.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${received}`; } return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${stringifyPrimitive(issue2.values[0])}`; return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { const maxValue = Number(issue2.maximum); const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue2.maximum.toString()} ${unit}`; } return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { const minValue = Number(issue2.minimum); const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue2.minimum.toString()} ${unit}`; } return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${_issue.prefix}"`; if (_issue.format === "ends_with") return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`; return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue2.divisor}`; case "unrecognized_keys": return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${issue2.keys.length > 1 ? "\u044B\u0435" : "\u044B\u0439"} \u043A\u043B\u044E\u0447${issue2.keys.length > 1 ? "\u0438" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${issue2.origin}`; case "invalid_union": return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"; case "invalid_element": return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${issue2.origin}`; default: return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435`; } }; }, "error"); __name(ru_default, "default"); } }); // ../../node_modules/zod/v4/locales/sl.js function sl_default() { return { localeError: error38() }; } var error38; var init_sl = __esm({ "../../node_modules/zod/v4/locales/sl.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error38 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "znakov", verb: "imeti" }, file: { unit: "bajtov", verb: "imeti" }, array: { unit: "elementov", verb: "imeti" }, set: { unit: "elementov", verb: "imeti" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "vnos", email: "e-po\u0161tni naslov", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO datum in \u010Das", date: "ISO datum", time: "ISO \u010Das", duration: "ISO trajanje", ipv4: "IPv4 naslov", ipv6: "IPv6 naslov", cidrv4: "obseg IPv4", cidrv6: "obseg IPv6", base64: "base64 kodiran niz", base64url: "base64url kodiran niz", json_string: "JSON niz", e164: "E.164 \u0161tevilka", jwt: "JWT", template_literal: "vnos" }; const TypeDictionary = { nan: "NaN", number: "\u0161tevilo", array: "tabela" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Neveljaven vnos: pri\u010Dakovano instanceof ${issue2.expected}, prejeto ${received}`; } return `Neveljaven vnos: pri\u010Dakovano ${expected}, prejeto ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Neveljaven vnos: pri\u010Dakovano ${stringifyPrimitive(issue2.values[0])}`; return `Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Preveliko: pri\u010Dakovano, da bo ${issue2.origin ?? "vrednost"} imelo ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementov"}`; return `Preveliko: pri\u010Dakovano, da bo ${issue2.origin ?? "vrednost"} ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Premajhno: pri\u010Dakovano, da bo ${issue2.origin} imelo ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Premajhno: pri\u010Dakovano, da bo ${issue2.origin} ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `Neveljaven niz: mora se za\u010Deti z "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `Neveljaven niz: mora se kon\u010Dati z "${_issue.suffix}"`; if (_issue.format === "includes") return `Neveljaven niz: mora vsebovati "${_issue.includes}"`; if (_issue.format === "regex") return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`; return `Neveljaven ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${issue2.divisor}`; case "unrecognized_keys": return `Neprepoznan${issue2.keys.length > 1 ? "i klju\u010Di" : " klju\u010D"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Neveljaven klju\u010D v ${issue2.origin}`; case "invalid_union": return "Neveljaven vnos"; case "invalid_element": return `Neveljavna vrednost v ${issue2.origin}`; default: return "Neveljaven vnos"; } }; }, "error"); __name(sl_default, "default"); } }); // ../../node_modules/zod/v4/locales/sv.js function sv_default() { return { localeError: error39() }; } var error39; var init_sv = __esm({ "../../node_modules/zod/v4/locales/sv.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error39 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "tecken", verb: "att ha" }, file: { unit: "bytes", verb: "att ha" }, array: { unit: "objekt", verb: "att inneh\xE5lla" }, set: { unit: "objekt", verb: "att inneh\xE5lla" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "regulj\xE4rt uttryck", email: "e-postadress", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO-datum och tid", date: "ISO-datum", time: "ISO-tid", duration: "ISO-varaktighet", ipv4: "IPv4-intervall", ipv6: "IPv6-intervall", cidrv4: "IPv4-spektrum", cidrv6: "IPv6-spektrum", base64: "base64-kodad str\xE4ng", base64url: "base64url-kodad str\xE4ng", json_string: "JSON-str\xE4ng", e164: "E.164-nummer", jwt: "JWT", template_literal: "mall-literal" }; const TypeDictionary = { nan: "NaN", number: "antal", array: "lista" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${issue2.expected}, fick ${received}`; } return `Ogiltig inmatning: f\xF6rv\xE4ntat ${expected}, fick ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Ogiltig inmatning: f\xF6rv\xE4ntat ${stringifyPrimitive(issue2.values[0])}`; return `Ogiltigt val: f\xF6rv\xE4ntade en av ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { return `F\xF6r stor(t): f\xF6rv\xE4ntade ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element"}`; } return `F\xF6r stor(t): f\xF6rv\xE4ntat ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `Ogiltig str\xE4ng: m\xE5ste sluta med "${_issue.suffix}"`; if (_issue.format === "includes") return `Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${_issue.includes}"`; if (_issue.format === "regex") return `Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${_issue.pattern}"`; return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Ogiltigt tal: m\xE5ste vara en multipel av ${issue2.divisor}`; case "unrecognized_keys": return `${issue2.keys.length > 1 ? "Ok\xE4nda nycklar" : "Ok\xE4nd nyckel"}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Ogiltig nyckel i ${issue2.origin ?? "v\xE4rdet"}`; case "invalid_union": return "Ogiltig input"; case "invalid_element": return `Ogiltigt v\xE4rde i ${issue2.origin ?? "v\xE4rdet"}`; default: return `Ogiltig input`; } }; }, "error"); __name(sv_default, "default"); } }); // ../../node_modules/zod/v4/locales/ta.js function ta_default() { return { localeError: error40() }; } var error40; var init_ta = __esm({ "../../node_modules/zod/v4/locales/ta.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error40 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" }, file: { unit: "\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" }, array: { unit: "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" }, set: { unit: "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1", email: "\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD", date: "ISO \u0BA4\u0BC7\u0BA4\u0BBF", time: "ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD", duration: "ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1", ipv4: "IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF", ipv6: "IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF", cidrv4: "IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1", cidrv6: "IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1", base64: "base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD", base64url: "base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD", json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD", e164: "E.164 \u0B8E\u0BA3\u0BCD", jwt: "JWT", template_literal: "input" }; const TypeDictionary = { nan: "NaN", number: "\u0B8E\u0BA3\u0BCD", array: "\u0B85\u0BA3\u0BBF", null: "\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${issue2.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${received}`; } return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${stringifyPrimitive(issue2.values[0])}`; return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${joinValues(issue2.values, "|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue2.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin} ${adj}${issue2.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; if (_issue.format === "ends_with") return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; if (_issue.format === "includes") return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; if (_issue.format === "regex") return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${_issue.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${issue2.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; case "unrecognized_keys": return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${issue2.keys.length > 1 ? "\u0B95\u0BB3\u0BCD" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `${issue2.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`; case "invalid_union": return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"; case "invalid_element": return `${issue2.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`; default: return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1`; } }; }, "error"); __name(ta_default, "default"); } }); // ../../node_modules/zod/v4/locales/th.js function th_default() { return { localeError: error41() }; } var error41; var init_th = __esm({ "../../node_modules/zod/v4/locales/th.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error41 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }, file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }, array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }, set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19", email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25", url: "URL", emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO", date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO", time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO", duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO", ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4", ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6", cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4", cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6", base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64", base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL", json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON", e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)", jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT", template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19" }; const TypeDictionary = { nan: "NaN", number: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02", array: "\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)", null: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue2.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`; } return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${stringifyPrimitive(issue2.values[0])}`; return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19" : "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32"; const sizing = getSizing(issue2.origin); if (sizing) return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`; return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? "\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22" : "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.minimum.toString()} ${sizing.unit}`; } return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${_issue.prefix}"`; } if (_issue.format === "ends_with") return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${_issue.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`; if (_issue.format === "regex") return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${_issue.pattern}`; return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${issue2.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`; case "unrecognized_keys": return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue2.origin}`; case "invalid_union": return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49"; case "invalid_element": return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue2.origin}`; default: return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07`; } }; }, "error"); __name(th_default, "default"); } }); // ../../node_modules/zod/v4/locales/tr.js function tr_default() { return { localeError: error42() }; } var error42; var init_tr = __esm({ "../../node_modules/zod/v4/locales/tr.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error42 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "karakter", verb: "olmal\u0131" }, file: { unit: "bayt", verb: "olmal\u0131" }, array: { unit: "\xF6\u011Fe", verb: "olmal\u0131" }, set: { unit: "\xF6\u011Fe", verb: "olmal\u0131" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "girdi", email: "e-posta adresi", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO tarih ve saat", date: "ISO tarih", time: "ISO saat", duration: "ISO s\xFCre", ipv4: "IPv4 adresi", ipv6: "IPv6 adresi", cidrv4: "IPv4 aral\u0131\u011F\u0131", cidrv6: "IPv6 aral\u0131\u011F\u0131", base64: "base64 ile \u015Fifrelenmi\u015F metin", base64url: "base64url ile \u015Fifrelenmi\u015F metin", json_string: "JSON dizesi", e164: "E.164 say\u0131s\u0131", jwt: "JWT", template_literal: "\u015Eablon dizesi" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Ge\xE7ersiz de\u011Fer: beklenen instanceof ${issue2.expected}, al\u0131nan ${received}`; } return `Ge\xE7ersiz de\u011Fer: beklenen ${expected}, al\u0131nan ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Ge\xE7ersiz de\u011Fer: beklenen ${stringifyPrimitive(issue2.values[0])}`; return `Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\xC7ok b\xFCy\xFCk: beklenen ${issue2.origin ?? "de\u011Fer"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xF6\u011Fe"}`; return `\xC7ok b\xFCy\xFCk: beklenen ${issue2.origin ?? "de\u011Fer"} ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue2.origin} ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Ge\xE7ersiz metin: "${_issue.prefix}" ile ba\u015Flamal\u0131`; if (_issue.format === "ends_with") return `Ge\xE7ersiz metin: "${_issue.suffix}" ile bitmeli`; if (_issue.format === "includes") return `Ge\xE7ersiz metin: "${_issue.includes}" i\xE7ermeli`; if (_issue.format === "regex") return `Ge\xE7ersiz metin: ${_issue.pattern} desenine uymal\u0131`; return `Ge\xE7ersiz ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Ge\xE7ersiz say\u0131: ${issue2.divisor} ile tam b\xF6l\xFCnebilmeli`; case "unrecognized_keys": return `Tan\u0131nmayan anahtar${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `${issue2.origin} i\xE7inde ge\xE7ersiz anahtar`; case "invalid_union": return "Ge\xE7ersiz de\u011Fer"; case "invalid_element": return `${issue2.origin} i\xE7inde ge\xE7ersiz de\u011Fer`; default: return `Ge\xE7ersiz de\u011Fer`; } }; }, "error"); __name(tr_default, "default"); } }); // ../../node_modules/zod/v4/locales/uk.js function uk_default() { return { localeError: error43() }; } var error43; var init_uk = __esm({ "../../node_modules/zod/v4/locales/uk.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error43 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" }, file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" }, array: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" }, set: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456", email: "\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438", url: "URL", emoji: "\u0435\u043C\u043E\u0434\u0437\u0456", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO", date: "\u0434\u0430\u0442\u0430 ISO", time: "\u0447\u0430\u0441 ISO", duration: "\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO", ipv4: "\u0430\u0434\u0440\u0435\u0441\u0430 IPv4", ipv6: "\u0430\u0434\u0440\u0435\u0441\u0430 IPv6", cidrv4: "\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4", cidrv6: "\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6", base64: "\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64", base64url: "\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url", json_string: "\u0440\u044F\u0434\u043E\u043A JSON", e164: "\u043D\u043E\u043C\u0435\u0440 E.164", jwt: "JWT", template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456" }; const TypeDictionary = { nan: "NaN", number: "\u0447\u0438\u0441\u043B\u043E", array: "\u043C\u0430\u0441\u0438\u0432" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${issue2.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${received}`; } return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${stringifyPrimitive(issue2.values[0])}`; return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`; return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin} \u0431\u0443\u0434\u0435 ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${_issue.prefix}"`; if (_issue.format === "ends_with") return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`; return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${issue2.divisor}`; case "unrecognized_keys": return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${issue2.keys.length > 1 ? "\u0456" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${issue2.origin}`; case "invalid_union": return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"; case "invalid_element": return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${issue2.origin}`; default: return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456`; } }; }, "error"); __name(uk_default, "default"); } }); // ../../node_modules/zod/v4/locales/ua.js function ua_default() { return uk_default(); } var init_ua = __esm({ "../../node_modules/zod/v4/locales/ua.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_uk(); __name(ua_default, "default"); } }); // ../../node_modules/zod/v4/locales/ur.js function ur_default() { return { localeError: error44() }; } var error44; var init_ur = __esm({ "../../node_modules/zod/v4/locales/ur.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error44 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" }, file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" }, array: { unit: "\u0622\u0626\u0679\u0645\u0632", verb: "\u06C1\u0648\u0646\u0627" }, set: { unit: "\u0622\u0626\u0679\u0645\u0632", verb: "\u06C1\u0648\u0646\u0627" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0627\u0646 \u067E\u0679", email: "\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633", url: "\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644", emoji: "\u0627\u06CC\u0645\u0648\u062C\u06CC", uuid: "\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC", uuidv4: "\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4", uuidv6: "\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6", nanoid: "\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC", guid: "\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC", cuid: "\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC", cuid2: "\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2", ulid: "\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC", xid: "\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC", ksuid: "\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC", datetime: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645", date: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E", time: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A", duration: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A", ipv4: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633", ipv6: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633", cidrv4: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C", cidrv6: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C", base64: "\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF", base64url: "\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF", json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF", e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631", jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC", template_literal: "\u0627\u0646 \u067E\u0679" }; const TypeDictionary = { nan: "NaN", number: "\u0646\u0645\u0628\u0631", array: "\u0622\u0631\u06D2", null: "\u0646\u0644" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${issue2.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${received} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`; } return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${received} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`; } case "invalid_value": if (issue2.values.length === 1) return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${stringifyPrimitive(issue2.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; return `\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${joinValues(issue2.values, "|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue2.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`; return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue2.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${adj}${issue2.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue2.origin} \u06A9\u06D2 ${adj}${issue2.minimum.toString()} ${sizing.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`; } return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue2.origin} \u06A9\u0627 ${adj}${issue2.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; } if (_issue.format === "ends_with") return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; if (_issue.format === "includes") return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; if (_issue.format === "regex") return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${_issue.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; return `\u063A\u0644\u0637 ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${issue2.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; case "unrecognized_keys": return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${issue2.keys.length > 1 ? "\u0632" : ""}: ${joinValues(issue2.keys, "\u060C ")}`; case "invalid_key": return `${issue2.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`; case "invalid_union": return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"; case "invalid_element": return `${issue2.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`; default: return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679`; } }; }, "error"); __name(ur_default, "default"); } }); // ../../node_modules/zod/v4/locales/uz.js function uz_default() { return { localeError: error45() }; } var error45; var init_uz = __esm({ "../../node_modules/zod/v4/locales/uz.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error45 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "belgi", verb: "bo\u2018lishi kerak" }, file: { unit: "bayt", verb: "bo\u2018lishi kerak" }, array: { unit: "element", verb: "bo\u2018lishi kerak" }, set: { unit: "element", verb: "bo\u2018lishi kerak" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "kirish", email: "elektron pochta manzili", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO sana va vaqti", date: "ISO sana", time: "ISO vaqt", duration: "ISO davomiylik", ipv4: "IPv4 manzil", ipv6: "IPv6 manzil", mac: "MAC manzil", cidrv4: "IPv4 diapazon", cidrv6: "IPv6 diapazon", base64: "base64 kodlangan satr", base64url: "base64url kodlangan satr", json_string: "JSON satr", e164: "E.164 raqam", jwt: "JWT", template_literal: "kirish" }; const TypeDictionary = { nan: "NaN", number: "raqam", array: "massiv" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `Noto\u2018g\u2018ri kirish: kutilgan instanceof ${issue2.expected}, qabul qilingan ${received}`; } return `Noto\u2018g\u2018ri kirish: kutilgan ${expected}, qabul qilingan ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `Noto\u2018g\u2018ri kirish: kutilgan ${stringifyPrimitive(issue2.values[0])}`; return `Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Juda katta: kutilgan ${issue2.origin ?? "qiymat"} ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`; return `Juda katta: kutilgan ${issue2.origin ?? "qiymat"} ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Juda kichik: kutilgan ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`; } return `Juda kichik: kutilgan ${issue2.origin} ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Noto\u2018g\u2018ri satr: "${_issue.prefix}" bilan boshlanishi kerak`; if (_issue.format === "ends_with") return `Noto\u2018g\u2018ri satr: "${_issue.suffix}" bilan tugashi kerak`; if (_issue.format === "includes") return `Noto\u2018g\u2018ri satr: "${_issue.includes}" ni o\u2018z ichiga olishi kerak`; if (_issue.format === "regex") return `Noto\u2018g\u2018ri satr: ${_issue.pattern} shabloniga mos kelishi kerak`; return `Noto\u2018g\u2018ri ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `Noto\u2018g\u2018ri raqam: ${issue2.divisor} ning karralisi bo\u2018lishi kerak`; case "unrecognized_keys": return `Noma\u2019lum kalit${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `${issue2.origin} dagi kalit noto\u2018g\u2018ri`; case "invalid_union": return "Noto\u2018g\u2018ri kirish"; case "invalid_element": return `${issue2.origin} da noto\u2018g\u2018ri qiymat`; default: return `Noto\u2018g\u2018ri kirish`; } }; }, "error"); __name(uz_default, "default"); } }); // ../../node_modules/zod/v4/locales/vi.js function vi_default() { return { localeError: error46() }; } var error46; var init_vi = __esm({ "../../node_modules/zod/v4/locales/vi.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error46 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" }, file: { unit: "byte", verb: "c\xF3" }, array: { unit: "ph\u1EA7n t\u1EED", verb: "c\xF3" }, set: { unit: "ph\u1EA7n t\u1EED", verb: "c\xF3" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u0111\u1EA7u v\xE0o", email: "\u0111\u1ECBa ch\u1EC9 email", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ng\xE0y gi\u1EDD ISO", date: "ng\xE0y ISO", time: "gi\u1EDD ISO", duration: "kho\u1EA3ng th\u1EDDi gian ISO", ipv4: "\u0111\u1ECBa ch\u1EC9 IPv4", ipv6: "\u0111\u1ECBa ch\u1EC9 IPv6", cidrv4: "d\u1EA3i IPv4", cidrv6: "d\u1EA3i IPv6", base64: "chu\u1ED7i m\xE3 h\xF3a base64", base64url: "chu\u1ED7i m\xE3 h\xF3a base64url", json_string: "chu\u1ED7i JSON", e164: "s\u1ED1 E.164", jwt: "JWT", template_literal: "\u0111\u1EA7u v\xE0o" }; const TypeDictionary = { nan: "NaN", number: "s\u1ED1", array: "m\u1EA3ng" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${issue2.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${received}`; } return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${stringifyPrimitive(issue2.values[0])}`; return `T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue2.origin ?? "gi\xE1 tr\u1ECB"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "ph\u1EA7n t\u1EED"}`; return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue2.origin ?? "gi\xE1 tr\u1ECB"} ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue2.origin} ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${_issue.prefix}"`; if (_issue.format === "ends_with") return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${_issue.suffix}"`; if (_issue.format === "includes") return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${_issue.includes}"`; if (_issue.format === "regex") return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${_issue.pattern}`; return `${FormatDictionary[_issue.format] ?? issue2.format} kh\xF4ng h\u1EE3p l\u1EC7`; } case "not_multiple_of": return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${issue2.divisor}`; case "unrecognized_keys": return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue2.origin}`; case "invalid_union": return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"; case "invalid_element": return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue2.origin}`; default: return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7`; } }; }, "error"); __name(vi_default, "default"); } }); // ../../node_modules/zod/v4/locales/zh-CN.js function zh_CN_default() { return { localeError: error47() }; } var error47; var init_zh_CN = __esm({ "../../node_modules/zod/v4/locales/zh-CN.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error47 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" }, file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" }, array: { unit: "\u9879", verb: "\u5305\u542B" }, set: { unit: "\u9879", verb: "\u5305\u542B" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u8F93\u5165", email: "\u7535\u5B50\u90AE\u4EF6", url: "URL", emoji: "\u8868\u60C5\u7B26\u53F7", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO\u65E5\u671F\u65F6\u95F4", date: "ISO\u65E5\u671F", time: "ISO\u65F6\u95F4", duration: "ISO\u65F6\u957F", ipv4: "IPv4\u5730\u5740", ipv6: "IPv6\u5730\u5740", cidrv4: "IPv4\u7F51\u6BB5", cidrv6: "IPv6\u7F51\u6BB5", base64: "base64\u7F16\u7801\u5B57\u7B26\u4E32", base64url: "base64url\u7F16\u7801\u5B57\u7B26\u4E32", json_string: "JSON\u5B57\u7B26\u4E32", e164: "E.164\u53F7\u7801", jwt: "JWT", template_literal: "\u8F93\u5165" }; const TypeDictionary = { nan: "NaN", number: "\u6570\u5B57", array: "\u6570\u7EC4", null: "\u7A7A\u503C(null)" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${issue2.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${received}`; } return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${stringifyPrimitive(issue2.values[0])}`; return `\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue2.origin ?? "\u503C"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u4E2A\u5143\u7D20"}`; return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue2.origin ?? "\u503C"} ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue2.origin} ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${_issue.prefix}" \u5F00\u5934`; if (_issue.format === "ends_with") return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${_issue.suffix}" \u7ED3\u5C3E`; if (_issue.format === "includes") return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${_issue.includes}"`; if (_issue.format === "regex") return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${_issue.pattern}`; return `\u65E0\u6548${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${issue2.divisor} \u7684\u500D\u6570`; case "unrecognized_keys": return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `${issue2.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`; case "invalid_union": return "\u65E0\u6548\u8F93\u5165"; case "invalid_element": return `${issue2.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`; default: return `\u65E0\u6548\u8F93\u5165`; } }; }, "error"); __name(zh_CN_default, "default"); } }); // ../../node_modules/zod/v4/locales/zh-TW.js function zh_TW_default() { return { localeError: error48() }; } var error48; var init_zh_TW = __esm({ "../../node_modules/zod/v4/locales/zh-TW.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error48 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" }, file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" }, array: { unit: "\u9805\u76EE", verb: "\u64C1\u6709" }, set: { unit: "\u9805\u76EE", verb: "\u64C1\u6709" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u8F38\u5165", email: "\u90F5\u4EF6\u5730\u5740", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO \u65E5\u671F\u6642\u9593", date: "ISO \u65E5\u671F", time: "ISO \u6642\u9593", duration: "ISO \u671F\u9593", ipv4: "IPv4 \u4F4D\u5740", ipv6: "IPv6 \u4F4D\u5740", cidrv4: "IPv4 \u7BC4\u570D", cidrv6: "IPv6 \u7BC4\u570D", base64: "base64 \u7DE8\u78BC\u5B57\u4E32", base64url: "base64url \u7DE8\u78BC\u5B57\u4E32", json_string: "JSON \u5B57\u4E32", e164: "E.164 \u6578\u503C", jwt: "JWT", template_literal: "\u8F38\u5165" }; const TypeDictionary = { nan: "NaN" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${issue2.expected}\uFF0C\u4F46\u6536\u5230 ${received}`; } return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${expected}\uFF0C\u4F46\u6536\u5230 ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${stringifyPrimitive(issue2.values[0])}`; return `\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue2.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u500B\u5143\u7D20"}`; return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue2.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue2.maximum.toString()}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) { return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue2.origin} \u61C9\u70BA ${adj}${issue2.minimum.toString()} ${sizing.unit}`; } return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue2.origin} \u61C9\u70BA ${adj}${issue2.minimum.toString()}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") { return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${_issue.prefix}" \u958B\u982D`; } if (_issue.format === "ends_with") return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${_issue.suffix}" \u7D50\u5C3E`; if (_issue.format === "includes") return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${_issue.includes}"`; if (_issue.format === "regex") return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${_issue.pattern}`; return `\u7121\u6548\u7684 ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${issue2.divisor} \u7684\u500D\u6578`; case "unrecognized_keys": return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${issue2.keys.length > 1 ? "\u5011" : ""}\uFF1A${joinValues(issue2.keys, "\u3001")}`; case "invalid_key": return `${issue2.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`; case "invalid_union": return "\u7121\u6548\u7684\u8F38\u5165\u503C"; case "invalid_element": return `${issue2.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`; default: return `\u7121\u6548\u7684\u8F38\u5165\u503C`; } }; }, "error"); __name(zh_TW_default, "default"); } }); // ../../node_modules/zod/v4/locales/yo.js function yo_default() { return { localeError: error49() }; } var error49; var init_yo = __esm({ "../../node_modules/zod/v4/locales/yo.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util3(); error49 = /* @__PURE__ */ __name(() => { const Sizable = { string: { unit: "\xE0mi", verb: "n\xED" }, file: { unit: "bytes", verb: "n\xED" }, array: { unit: "nkan", verb: "n\xED" }, set: { unit: "nkan", verb: "n\xED" } }; function getSizing(origin2) { return Sizable[origin2] ?? null; } __name(getSizing, "getSizing"); const FormatDictionary = { regex: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9", email: "\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "\xE0k\xF3k\xF2 ISO", date: "\u1ECDj\u1ECD\u0301 ISO", time: "\xE0k\xF3k\xF2 ISO", duration: "\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO", ipv4: "\xE0d\xEDr\u1EB9\u0301s\xEC IPv4", ipv6: "\xE0d\xEDr\u1EB9\u0301s\xEC IPv6", cidrv4: "\xE0gb\xE8gb\xE8 IPv4", cidrv6: "\xE0gb\xE8gb\xE8 IPv6", base64: "\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64", base64url: "\u1ECD\u0300r\u1ECD\u0300 base64url", json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON", e164: "n\u1ECD\u0301mb\xE0 E.164", jwt: "JWT", template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9" }; const TypeDictionary = { nan: "NaN", number: "n\u1ECD\u0301mb\xE0", array: "akop\u1ECD" }; return (issue2) => { switch (issue2.code) { case "invalid_type": { const expected = TypeDictionary[issue2.expected] ?? issue2.expected; const receivedType = parsedType(issue2.input); const received = TypeDictionary[receivedType] ?? receivedType; if (/^[A-Z]/.test(issue2.expected)) { return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${issue2.expected}, \xE0m\u1ECD\u0300 a r\xED ${received}`; } return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${expected}, \xE0m\u1ECD\u0300 a r\xED ${received}`; } case "invalid_value": if (issue2.values.length === 1) return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${stringifyPrimitive(issue2.values[0])}`; return `\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${joinValues(issue2.values, "|")}`; case "too_big": { const adj = issue2.inclusive ? "<=" : "<"; const sizing = getSizing(issue2.origin); if (sizing) return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue2.origin ?? "iye"} ${sizing.verb} ${adj}${issue2.maximum} ${sizing.unit}`; return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue2.maximum}`; } case "too_small": { const adj = issue2.inclusive ? ">=" : ">"; const sizing = getSizing(issue2.origin); if (sizing) return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum} ${sizing.unit}`; return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue2.minimum}`; } case "invalid_format": { const _issue = issue2; if (_issue.format === "starts_with") return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${_issue.prefix}"`; if (_issue.format === "ends_with") return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${_issue.suffix}"`; if (_issue.format === "includes") return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${_issue.includes}"`; if (_issue.format === "regex") return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${_issue.pattern}`; return `A\u1E63\xEC\u1E63e: ${FormatDictionary[_issue.format] ?? issue2.format}`; } case "not_multiple_of": return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${issue2.divisor}`; case "unrecognized_keys": return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${joinValues(issue2.keys, ", ")}`; case "invalid_key": return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue2.origin}`; case "invalid_union": return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"; case "invalid_element": return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue2.origin}`; default: return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"; } }; }, "error"); __name(yo_default, "default"); } }); // ../../node_modules/zod/v4/locales/index.js var locales_exports = {}; __export(locales_exports, { ar: () => ar_default, az: () => az_default, be: () => be_default, bg: () => bg_default, ca: () => ca_default, cs: () => cs_default, da: () => da_default, de: () => de_default, en: () => en_default, eo: () => eo_default, es: () => es_default, fa: () => fa_default, fi: () => fi_default, fr: () => fr_default, frCA: () => fr_CA_default, he: () => he_default, hu: () => hu_default, hy: () => hy_default, id: () => id_default, is: () => is_default, it: () => it_default, ja: () => ja_default, ka: () => ka_default, kh: () => kh_default, km: () => km_default, ko: () => ko_default, lt: () => lt_default, mk: () => mk_default, ms: () => ms_default, nl: () => nl_default, no: () => no_default, ota: () => ota_default, pl: () => pl_default, ps: () => ps_default, pt: () => pt_default, ru: () => ru_default, sl: () => sl_default, sv: () => sv_default, ta: () => ta_default, th: () => th_default, tr: () => tr_default, ua: () => ua_default, uk: () => uk_default, ur: () => ur_default, uz: () => uz_default, vi: () => vi_default, yo: () => yo_default, zhCN: () => zh_CN_default, zhTW: () => zh_TW_default }); var init_locales = __esm({ "../../node_modules/zod/v4/locales/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_ar(); init_az(); init_be(); init_bg(); init_ca(); init_cs(); init_da(); init_de(); init_en(); init_eo(); init_es(); init_fa(); init_fi(); init_fr(); init_fr_CA(); init_he(); init_hu(); init_hy(); init_id(); init_is(); init_it(); init_ja(); init_ka(); init_kh(); init_km(); init_ko(); init_lt(); init_mk(); init_ms(); init_nl(); init_no(); init_ota(); init_ps(); init_pl(); init_pt(); init_ru(); init_sl(); init_sv(); init_ta(); init_th(); init_tr(); init_ua(); init_uk(); init_ur(); init_uz(); init_vi(); init_zh_CN(); init_zh_TW(); init_yo(); } }); // ../../node_modules/zod/v4/core/registries.js function registry() { return new $ZodRegistry(); } var _a123, $output, $input, $ZodRegistry, globalRegistry; var init_registries = __esm({ "../../node_modules/zod/v4/core/registries.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); $output = Symbol("ZodOutput"); $input = Symbol("ZodInput"); $ZodRegistry = class { constructor() { this._map = /* @__PURE__ */ new WeakMap(); this._idmap = /* @__PURE__ */ new Map(); } add(schema, ..._meta) { const meta3 = _meta[0]; this._map.set(schema, meta3); if (meta3 && typeof meta3 === "object" && "id" in meta3) { this._idmap.set(meta3.id, schema); } return this; } clear() { this._map = /* @__PURE__ */ new WeakMap(); this._idmap = /* @__PURE__ */ new Map(); return this; } remove(schema) { const meta3 = this._map.get(schema); if (meta3 && typeof meta3 === "object" && "id" in meta3) { this._idmap.delete(meta3.id); } this._map.delete(schema); return this; } get(schema) { const p2 = schema._zod.parent; if (p2) { const pm = { ...this.get(p2) ?? {} }; delete pm.id; const f2 = { ...pm, ...this._map.get(schema) }; return Object.keys(f2).length ? f2 : void 0; } return this._map.get(schema); } has(schema) { return this._map.has(schema); } }; __name($ZodRegistry, "$ZodRegistry"); __name(registry, "registry"); (_a123 = globalThis).__zod_globalRegistry ?? (_a123.__zod_globalRegistry = registry()); globalRegistry = globalThis.__zod_globalRegistry; } }); // ../../node_modules/zod/v4/core/api.js function _string(Class2, params) { return new Class2({ type: "string", ...normalizeParams(params) }); } function _coercedString(Class2, params) { return new Class2({ type: "string", coerce: true, ...normalizeParams(params) }); } function _email(Class2, params) { return new Class2({ type: "string", format: "email", check: "string_format", abort: false, ...normalizeParams(params) }); } function _guid(Class2, params) { return new Class2({ type: "string", format: "guid", check: "string_format", abort: false, ...normalizeParams(params) }); } function _uuid(Class2, params) { return new Class2({ type: "string", format: "uuid", check: "string_format", abort: false, ...normalizeParams(params) }); } function _uuidv4(Class2, params) { return new Class2({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v4", ...normalizeParams(params) }); } function _uuidv6(Class2, params) { return new Class2({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v6", ...normalizeParams(params) }); } function _uuidv7(Class2, params) { return new Class2({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v7", ...normalizeParams(params) }); } function _url(Class2, params) { return new Class2({ type: "string", format: "url", check: "string_format", abort: false, ...normalizeParams(params) }); } function _emoji2(Class2, params) { return new Class2({ type: "string", format: "emoji", check: "string_format", abort: false, ...normalizeParams(params) }); } function _nanoid(Class2, params) { return new Class2({ type: "string", format: "nanoid", check: "string_format", abort: false, ...normalizeParams(params) }); } function _cuid(Class2, params) { return new Class2({ type: "string", format: "cuid", check: "string_format", abort: false, ...normalizeParams(params) }); } function _cuid2(Class2, params) { return new Class2({ type: "string", format: "cuid2", check: "string_format", abort: false, ...normalizeParams(params) }); } function _ulid(Class2, params) { return new Class2({ type: "string", format: "ulid", check: "string_format", abort: false, ...normalizeParams(params) }); } function _xid(Class2, params) { return new Class2({ type: "string", format: "xid", check: "string_format", abort: false, ...normalizeParams(params) }); } function _ksuid(Class2, params) { return new Class2({ type: "string", format: "ksuid", check: "string_format", abort: false, ...normalizeParams(params) }); } function _ipv4(Class2, params) { return new Class2({ type: "string", format: "ipv4", check: "string_format", abort: false, ...normalizeParams(params) }); } function _ipv6(Class2, params) { return new Class2({ type: "string", format: "ipv6", check: "string_format", abort: false, ...normalizeParams(params) }); } function _mac(Class2, params) { return new Class2({ type: "string", format: "mac", check: "string_format", abort: false, ...normalizeParams(params) }); } function _cidrv4(Class2, params) { return new Class2({ type: "string", format: "cidrv4", check: "string_format", abort: false, ...normalizeParams(params) }); } function _cidrv6(Class2, params) { return new Class2({ type: "string", format: "cidrv6", check: "string_format", abort: false, ...normalizeParams(params) }); } function _base64(Class2, params) { return new Class2({ type: "string", format: "base64", check: "string_format", abort: false, ...normalizeParams(params) }); } function _base64url(Class2, params) { return new Class2({ type: "string", format: "base64url", check: "string_format", abort: false, ...normalizeParams(params) }); } function _e164(Class2, params) { return new Class2({ type: "string", format: "e164", check: "string_format", abort: false, ...normalizeParams(params) }); } function _jwt(Class2, params) { return new Class2({ type: "string", format: "jwt", check: "string_format", abort: false, ...normalizeParams(params) }); } function _isoDateTime(Class2, params) { return new Class2({ type: "string", format: "datetime", check: "string_format", offset: false, local: false, precision: null, ...normalizeParams(params) }); } function _isoDate(Class2, params) { return new Class2({ type: "string", format: "date", check: "string_format", ...normalizeParams(params) }); } function _isoTime(Class2, params) { return new Class2({ type: "string", format: "time", check: "string_format", precision: null, ...normalizeParams(params) }); } function _isoDuration(Class2, params) { return new Class2({ type: "string", format: "duration", check: "string_format", ...normalizeParams(params) }); } function _number(Class2, params) { return new Class2({ type: "number", checks: [], ...normalizeParams(params) }); } function _coercedNumber(Class2, params) { return new Class2({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }); } function _int(Class2, params) { return new Class2({ type: "number", check: "number_format", abort: false, format: "safeint", ...normalizeParams(params) }); } function _float32(Class2, params) { return new Class2({ type: "number", check: "number_format", abort: false, format: "float32", ...normalizeParams(params) }); } function _float64(Class2, params) { return new Class2({ type: "number", check: "number_format", abort: false, format: "float64", ...normalizeParams(params) }); } function _int32(Class2, params) { return new Class2({ type: "number", check: "number_format", abort: false, format: "int32", ...normalizeParams(params) }); } function _uint32(Class2, params) { return new Class2({ type: "number", check: "number_format", abort: false, format: "uint32", ...normalizeParams(params) }); } function _boolean(Class2, params) { return new Class2({ type: "boolean", ...normalizeParams(params) }); } function _coercedBoolean(Class2, params) { return new Class2({ type: "boolean", coerce: true, ...normalizeParams(params) }); } function _bigint(Class2, params) { return new Class2({ type: "bigint", ...normalizeParams(params) }); } function _coercedBigint(Class2, params) { return new Class2({ type: "bigint", coerce: true, ...normalizeParams(params) }); } function _int64(Class2, params) { return new Class2({ type: "bigint", check: "bigint_format", abort: false, format: "int64", ...normalizeParams(params) }); } function _uint64(Class2, params) { return new Class2({ type: "bigint", check: "bigint_format", abort: false, format: "uint64", ...normalizeParams(params) }); } function _symbol(Class2, params) { return new Class2({ type: "symbol", ...normalizeParams(params) }); } function _undefined2(Class2, params) { return new Class2({ type: "undefined", ...normalizeParams(params) }); } function _null2(Class2, params) { return new Class2({ type: "null", ...normalizeParams(params) }); } function _any(Class2) { return new Class2({ type: "any" }); } function _unknown(Class2) { return new Class2({ type: "unknown" }); } function _never(Class2, params) { return new Class2({ type: "never", ...normalizeParams(params) }); } function _void(Class2, params) { return new Class2({ type: "void", ...normalizeParams(params) }); } function _date(Class2, params) { return new Class2({ type: "date", ...normalizeParams(params) }); } function _coercedDate(Class2, params) { return new Class2({ type: "date", coerce: true, ...normalizeParams(params) }); } function _nan(Class2, params) { return new Class2({ type: "nan", ...normalizeParams(params) }); } function _lt(value, params) { return new $ZodCheckLessThan({ check: "less_than", ...normalizeParams(params), value, inclusive: false }); } function _lte(value, params) { return new $ZodCheckLessThan({ check: "less_than", ...normalizeParams(params), value, inclusive: true }); } function _gt(value, params) { return new $ZodCheckGreaterThan({ check: "greater_than", ...normalizeParams(params), value, inclusive: false }); } function _gte(value, params) { return new $ZodCheckGreaterThan({ check: "greater_than", ...normalizeParams(params), value, inclusive: true }); } function _positive(params) { return _gt(0, params); } function _negative(params) { return _lt(0, params); } function _nonpositive(params) { return _lte(0, params); } function _nonnegative(params) { return _gte(0, params); } function _multipleOf(value, params) { return new $ZodCheckMultipleOf({ check: "multiple_of", ...normalizeParams(params), value }); } function _maxSize(maximum, params) { return new $ZodCheckMaxSize({ check: "max_size", ...normalizeParams(params), maximum }); } function _minSize(minimum, params) { return new $ZodCheckMinSize({ check: "min_size", ...normalizeParams(params), minimum }); } function _size(size, params) { return new $ZodCheckSizeEquals({ check: "size_equals", ...normalizeParams(params), size }); } function _maxLength(maximum, params) { const ch2 = new $ZodCheckMaxLength({ check: "max_length", ...normalizeParams(params), maximum }); return ch2; } function _minLength(minimum, params) { return new $ZodCheckMinLength({ check: "min_length", ...normalizeParams(params), minimum }); } function _length(length, params) { return new $ZodCheckLengthEquals({ check: "length_equals", ...normalizeParams(params), length }); } function _regex(pattern, params) { return new $ZodCheckRegex({ check: "string_format", format: "regex", ...normalizeParams(params), pattern }); } function _lowercase(params) { return new $ZodCheckLowerCase({ check: "string_format", format: "lowercase", ...normalizeParams(params) }); } function _uppercase(params) { return new $ZodCheckUpperCase({ check: "string_format", format: "uppercase", ...normalizeParams(params) }); } function _includes(includes, params) { return new $ZodCheckIncludes({ check: "string_format", format: "includes", ...normalizeParams(params), includes }); } function _startsWith(prefix, params) { return new $ZodCheckStartsWith({ check: "string_format", format: "starts_with", ...normalizeParams(params), prefix }); } function _endsWith(suffix, params) { return new $ZodCheckEndsWith({ check: "string_format", format: "ends_with", ...normalizeParams(params), suffix }); } function _property(property, schema, params) { return new $ZodCheckProperty({ check: "property", property, schema, ...normalizeParams(params) }); } function _mime(types, params) { return new $ZodCheckMimeType({ check: "mime_type", mime: types, ...normalizeParams(params) }); } function _overwrite(tx) { return new $ZodCheckOverwrite({ check: "overwrite", tx }); } function _normalize(form) { return _overwrite((input) => input.normalize(form)); } function _trim() { return _overwrite((input) => input.trim()); } function _toLowerCase() { return _overwrite((input) => input.toLowerCase()); } function _toUpperCase() { return _overwrite((input) => input.toUpperCase()); } function _slugify() { return _overwrite((input) => slugify(input)); } function _array(Class2, element, params) { return new Class2({ type: "array", element, // get element() { // return element; // }, ...normalizeParams(params) }); } function _union(Class2, options, params) { return new Class2({ type: "union", options, ...normalizeParams(params) }); } function _xor(Class2, options, params) { return new Class2({ type: "union", options, inclusive: false, ...normalizeParams(params) }); } function _discriminatedUnion(Class2, discriminator, options, params) { return new Class2({ type: "union", options, discriminator, ...normalizeParams(params) }); } function _intersection(Class2, left, right) { return new Class2({ type: "intersection", left, right }); } function _tuple(Class2, items, _paramsOrRest, _params) { const hasRest = _paramsOrRest instanceof $ZodType; const params = hasRest ? _params : _paramsOrRest; const rest = hasRest ? _paramsOrRest : null; return new Class2({ type: "tuple", items, rest, ...normalizeParams(params) }); } function _record(Class2, keyType, valueType, params) { return new Class2({ type: "record", keyType, valueType, ...normalizeParams(params) }); } function _map(Class2, keyType, valueType, params) { return new Class2({ type: "map", keyType, valueType, ...normalizeParams(params) }); } function _set(Class2, valueType, params) { return new Class2({ type: "set", valueType, ...normalizeParams(params) }); } function _enum(Class2, values, params) { const entries = Array.isArray(values) ? Object.fromEntries(values.map((v3) => [v3, v3])) : values; return new Class2({ type: "enum", entries, ...normalizeParams(params) }); } function _nativeEnum(Class2, entries, params) { return new Class2({ type: "enum", entries, ...normalizeParams(params) }); } function _literal(Class2, value, params) { return new Class2({ type: "literal", values: Array.isArray(value) ? value : [value], ...normalizeParams(params) }); } function _file(Class2, params) { return new Class2({ type: "file", ...normalizeParams(params) }); } function _transform(Class2, fn) { return new Class2({ type: "transform", transform: fn }); } function _optional(Class2, innerType) { return new Class2({ type: "optional", innerType }); } function _nullable(Class2, innerType) { return new Class2({ type: "nullable", innerType }); } function _default(Class2, innerType, defaultValue) { return new Class2({ type: "default", innerType, get defaultValue() { return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue); } }); } function _nonoptional(Class2, innerType, params) { return new Class2({ type: "nonoptional", innerType, ...normalizeParams(params) }); } function _success(Class2, innerType) { return new Class2({ type: "success", innerType }); } function _catch(Class2, innerType, catchValue) { return new Class2({ type: "catch", innerType, catchValue: typeof catchValue === "function" ? catchValue : () => catchValue }); } function _pipe(Class2, in_, out) { return new Class2({ type: "pipe", in: in_, out }); } function _readonly(Class2, innerType) { return new Class2({ type: "readonly", innerType }); } function _templateLiteral(Class2, parts, params) { return new Class2({ type: "template_literal", parts, ...normalizeParams(params) }); } function _lazy(Class2, getter) { return new Class2({ type: "lazy", getter }); } function _promise(Class2, innerType) { return new Class2({ type: "promise", innerType }); } function _custom(Class2, fn, _params) { const norm = normalizeParams(_params); norm.abort ?? (norm.abort = true); const schema = new Class2({ type: "custom", check: "custom", fn, ...norm }); return schema; } function _refine(Class2, fn, _params) { const schema = new Class2({ type: "custom", check: "custom", fn, ...normalizeParams(_params) }); return schema; } function _superRefine(fn) { const ch2 = _check((payload) => { payload.addIssue = (issue2) => { if (typeof issue2 === "string") { payload.issues.push(issue(issue2, payload.value, ch2._zod.def)); } else { const _issue = issue2; if (_issue.fatal) _issue.continue = false; _issue.code ?? (_issue.code = "custom"); _issue.input ?? (_issue.input = payload.value); _issue.inst ?? (_issue.inst = ch2); _issue.continue ?? (_issue.continue = !ch2._zod.def.abort); payload.issues.push(issue(_issue)); } }; return fn(payload.value, payload); }); return ch2; } function _check(fn, params) { const ch2 = new $ZodCheck({ check: "custom", ...normalizeParams(params) }); ch2._zod.check = fn; return ch2; } function describe(description) { const ch2 = new $ZodCheck({ check: "describe" }); ch2._zod.onattach = [ (inst) => { const existing = globalRegistry.get(inst) ?? {}; globalRegistry.add(inst, { ...existing, description }); } ]; ch2._zod.check = () => { }; return ch2; } function meta(metadata) { const ch2 = new $ZodCheck({ check: "meta" }); ch2._zod.onattach = [ (inst) => { const existing = globalRegistry.get(inst) ?? {}; globalRegistry.add(inst, { ...existing, ...metadata }); } ]; ch2._zod.check = () => { }; return ch2; } function _stringbool(Classes, _params) { const params = normalizeParams(_params); let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"]; let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"]; if (params.case !== "sensitive") { truthyArray = truthyArray.map((v3) => typeof v3 === "string" ? v3.toLowerCase() : v3); falsyArray = falsyArray.map((v3) => typeof v3 === "string" ? v3.toLowerCase() : v3); } const truthySet = new Set(truthyArray); const falsySet = new Set(falsyArray); const _Codec = Classes.Codec ?? $ZodCodec; const _Boolean = Classes.Boolean ?? $ZodBoolean; const _String = Classes.String ?? $ZodString; const stringSchema = new _String({ type: "string", error: params.error }); const booleanSchema = new _Boolean({ type: "boolean", error: params.error }); const codec2 = new _Codec({ type: "pipe", in: stringSchema, out: booleanSchema, transform: (input, payload) => { let data = input; if (params.case !== "sensitive") data = data.toLowerCase(); if (truthySet.has(data)) { return true; } else if (falsySet.has(data)) { return false; } else { payload.issues.push({ code: "invalid_value", expected: "stringbool", values: [...truthySet, ...falsySet], input: payload.value, inst: codec2, continue: false }); return {}; } }, reverseTransform: (input, _payload) => { if (input === true) { return truthyArray[0] || "true"; } else { return falsyArray[0] || "false"; } }, error: params.error }); return codec2; } function _stringFormat(Class2, format2, fnOrRegex, _params = {}) { const params = normalizeParams(_params); const def = { ...normalizeParams(_params), check: "string_format", type: "string", format: format2, fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val), ...params }; if (fnOrRegex instanceof RegExp) { def.pattern = fnOrRegex; } const inst = new Class2(def); return inst; } var TimePrecision; var init_api = __esm({ "../../node_modules/zod/v4/core/api.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_checks2(); init_registries(); init_schemas(); init_util3(); __name(_string, "_string"); __name(_coercedString, "_coercedString"); __name(_email, "_email"); __name(_guid, "_guid"); __name(_uuid, "_uuid"); __name(_uuidv4, "_uuidv4"); __name(_uuidv6, "_uuidv6"); __name(_uuidv7, "_uuidv7"); __name(_url, "_url"); __name(_emoji2, "_emoji"); __name(_nanoid, "_nanoid"); __name(_cuid, "_cuid"); __name(_cuid2, "_cuid2"); __name(_ulid, "_ulid"); __name(_xid, "_xid"); __name(_ksuid, "_ksuid"); __name(_ipv4, "_ipv4"); __name(_ipv6, "_ipv6"); __name(_mac, "_mac"); __name(_cidrv4, "_cidrv4"); __name(_cidrv6, "_cidrv6"); __name(_base64, "_base64"); __name(_base64url, "_base64url"); __name(_e164, "_e164"); __name(_jwt, "_jwt"); TimePrecision = { Any: null, Minute: -1, Second: 0, Millisecond: 3, Microsecond: 6 }; __name(_isoDateTime, "_isoDateTime"); __name(_isoDate, "_isoDate"); __name(_isoTime, "_isoTime"); __name(_isoDuration, "_isoDuration"); __name(_number, "_number"); __name(_coercedNumber, "_coercedNumber"); __name(_int, "_int"); __name(_float32, "_float32"); __name(_float64, "_float64"); __name(_int32, "_int32"); __name(_uint32, "_uint32"); __name(_boolean, "_boolean"); __name(_coercedBoolean, "_coercedBoolean"); __name(_bigint, "_bigint"); __name(_coercedBigint, "_coercedBigint"); __name(_int64, "_int64"); __name(_uint64, "_uint64"); __name(_symbol, "_symbol"); __name(_undefined2, "_undefined"); __name(_null2, "_null"); __name(_any, "_any"); __name(_unknown, "_unknown"); __name(_never, "_never"); __name(_void, "_void"); __name(_date, "_date"); __name(_coercedDate, "_coercedDate"); __name(_nan, "_nan"); __name(_lt, "_lt"); __name(_lte, "_lte"); __name(_gt, "_gt"); __name(_gte, "_gte"); __name(_positive, "_positive"); __name(_negative, "_negative"); __name(_nonpositive, "_nonpositive"); __name(_nonnegative, "_nonnegative"); __name(_multipleOf, "_multipleOf"); __name(_maxSize, "_maxSize"); __name(_minSize, "_minSize"); __name(_size, "_size"); __name(_maxLength, "_maxLength"); __name(_minLength, "_minLength"); __name(_length, "_length"); __name(_regex, "_regex"); __name(_lowercase, "_lowercase"); __name(_uppercase, "_uppercase"); __name(_includes, "_includes"); __name(_startsWith, "_startsWith"); __name(_endsWith, "_endsWith"); __name(_property, "_property"); __name(_mime, "_mime"); __name(_overwrite, "_overwrite"); __name(_normalize, "_normalize"); __name(_trim, "_trim"); __name(_toLowerCase, "_toLowerCase"); __name(_toUpperCase, "_toUpperCase"); __name(_slugify, "_slugify"); __name(_array, "_array"); __name(_union, "_union"); __name(_xor, "_xor"); __name(_discriminatedUnion, "_discriminatedUnion"); __name(_intersection, "_intersection"); __name(_tuple, "_tuple"); __name(_record, "_record"); __name(_map, "_map"); __name(_set, "_set"); __name(_enum, "_enum"); __name(_nativeEnum, "_nativeEnum"); __name(_literal, "_literal"); __name(_file, "_file"); __name(_transform, "_transform"); __name(_optional, "_optional"); __name(_nullable, "_nullable"); __name(_default, "_default"); __name(_nonoptional, "_nonoptional"); __name(_success, "_success"); __name(_catch, "_catch"); __name(_pipe, "_pipe"); __name(_readonly, "_readonly"); __name(_templateLiteral, "_templateLiteral"); __name(_lazy, "_lazy"); __name(_promise, "_promise"); __name(_custom, "_custom"); __name(_refine, "_refine"); __name(_superRefine, "_superRefine"); __name(_check, "_check"); __name(describe, "describe"); __name(meta, "meta"); __name(_stringbool, "_stringbool"); __name(_stringFormat, "_stringFormat"); } }); // ../../node_modules/zod/v4/core/to-json-schema.js function initializeContext(params) { let target = params?.target ?? "draft-2020-12"; if (target === "draft-4") target = "draft-04"; if (target === "draft-7") target = "draft-07"; return { processors: params.processors ?? {}, metadataRegistry: params?.metadata ?? globalRegistry, target, unrepresentable: params?.unrepresentable ?? "throw", override: params?.override ?? (() => { }), io: params?.io ?? "output", counter: 0, seen: /* @__PURE__ */ new Map(), cycles: params?.cycles ?? "ref", reused: params?.reused ?? "inline", external: params?.external ?? void 0 }; } function process2(schema, ctx, _params = { path: [], schemaPath: [] }) { var _a124; const def = schema._zod.def; const seen = ctx.seen.get(schema); if (seen) { seen.count++; const isCycle = _params.schemaPath.includes(schema); if (isCycle) { seen.cycle = _params.path; } return seen.schema; } const result = { schema: {}, count: 1, cycle: void 0, path: _params.path }; ctx.seen.set(schema, result); const overrideSchema = schema._zod.toJSONSchema?.(); if (overrideSchema) { result.schema = overrideSchema; } else { const params = { ..._params, schemaPath: [..._params.schemaPath, schema], path: _params.path }; if (schema._zod.processJSONSchema) { schema._zod.processJSONSchema(ctx, result.schema, params); } else { const _json = result.schema; const processor = ctx.processors[def.type]; if (!processor) { throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`); } processor(schema, ctx, _json, params); } const parent = schema._zod.parent; if (parent) { if (!result.ref) result.ref = parent; process2(parent, ctx, params); ctx.seen.get(parent).isParent = true; } } const meta3 = ctx.metadataRegistry.get(schema); if (meta3) Object.assign(result.schema, meta3); if (ctx.io === "input" && isTransforming(schema)) { delete result.schema.examples; delete result.schema.default; } if (ctx.io === "input" && result.schema._prefault) (_a124 = result.schema).default ?? (_a124.default = result.schema._prefault); delete result.schema._prefault; const _result = ctx.seen.get(schema); return _result.schema; } function extractDefs(ctx, schema) { const root = ctx.seen.get(schema); if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); const idToSchema = /* @__PURE__ */ new Map(); for (const entry of ctx.seen.entries()) { const id = ctx.metadataRegistry.get(entry[0])?.id; if (id) { const existing = idToSchema.get(id); if (existing && existing !== entry[0]) { throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); } idToSchema.set(id, entry[0]); } } const makeURI = /* @__PURE__ */ __name((entry) => { const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions"; if (ctx.external) { const externalId = ctx.external.registry.get(entry[0])?.id; const uriGenerator = ctx.external.uri ?? ((id2) => id2); if (externalId) { return { ref: uriGenerator(externalId) }; } const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`; entry[1].defId = id; return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` }; } if (entry[1] === root) { return { ref: "#" }; } const uriPrefix = `#`; const defUriPrefix = `${uriPrefix}/${defsSegment}/`; const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`; return { defId, ref: defUriPrefix + defId }; }, "makeURI"); const extractToDef = /* @__PURE__ */ __name((entry) => { if (entry[1].schema.$ref) { return; } const seen = entry[1]; const { ref, defId } = makeURI(entry); seen.def = { ...seen.schema }; if (defId) seen.defId = defId; const schema2 = seen.schema; for (const key in schema2) { delete schema2[key]; } schema2.$ref = ref; }, "extractToDef"); if (ctx.cycles === "throw") { for (const entry of ctx.seen.entries()) { const seen = entry[1]; if (seen.cycle) { throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); } } } for (const entry of ctx.seen.entries()) { const seen = entry[1]; if (schema === entry[0]) { extractToDef(entry); continue; } if (ctx.external) { const ext = ctx.external.registry.get(entry[0])?.id; if (schema !== entry[0] && ext) { extractToDef(entry); continue; } } const id = ctx.metadataRegistry.get(entry[0])?.id; if (id) { extractToDef(entry); continue; } if (seen.cycle) { extractToDef(entry); continue; } if (seen.count > 1) { if (ctx.reused === "ref") { extractToDef(entry); continue; } } } } function finalize(ctx, schema) { const root = ctx.seen.get(schema); if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); const flattenRef = /* @__PURE__ */ __name((zodSchema) => { const seen = ctx.seen.get(zodSchema); if (seen.ref === null) return; const schema2 = seen.def ?? seen.schema; const _cached = { ...schema2 }; const ref = seen.ref; seen.ref = null; if (ref) { flattenRef(ref); const refSeen = ctx.seen.get(ref); const refSchema = refSeen.schema; if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) { schema2.allOf = schema2.allOf ?? []; schema2.allOf.push(refSchema); } else { Object.assign(schema2, refSchema); } Object.assign(schema2, _cached); const isParentRef = zodSchema._zod.parent === ref; if (isParentRef) { for (const key in schema2) { if (key === "$ref" || key === "allOf") continue; if (!(key in _cached)) { delete schema2[key]; } } } if (refSchema.$ref && refSeen.def) { for (const key in schema2) { if (key === "$ref" || key === "allOf") continue; if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) { delete schema2[key]; } } } } const parent = zodSchema._zod.parent; if (parent && parent !== ref) { flattenRef(parent); const parentSeen = ctx.seen.get(parent); if (parentSeen?.schema.$ref) { schema2.$ref = parentSeen.schema.$ref; if (parentSeen.def) { for (const key in schema2) { if (key === "$ref" || key === "allOf") continue; if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) { delete schema2[key]; } } } } } ctx.override({ zodSchema, jsonSchema: schema2, path: seen.path ?? [] }); }, "flattenRef"); for (const entry of [...ctx.seen.entries()].reverse()) { flattenRef(entry[0]); } const result = {}; if (ctx.target === "draft-2020-12") { result.$schema = "https://json-schema.org/draft/2020-12/schema"; } else if (ctx.target === "draft-07") { result.$schema = "http://json-schema.org/draft-07/schema#"; } else if (ctx.target === "draft-04") { result.$schema = "http://json-schema.org/draft-04/schema#"; } else if (ctx.target === "openapi-3.0") { } else { } if (ctx.external?.uri) { const id = ctx.external.registry.get(schema)?.id; if (!id) throw new Error("Schema is missing an `id` property"); result.$id = ctx.external.uri(id); } Object.assign(result, root.def ?? root.schema); const defs = ctx.external?.defs ?? {}; for (const entry of ctx.seen.entries()) { const seen = entry[1]; if (seen.def && seen.defId) { defs[seen.defId] = seen.def; } } if (ctx.external) { } else { if (Object.keys(defs).length > 0) { if (ctx.target === "draft-2020-12") { result.$defs = defs; } else { result.definitions = defs; } } } try { const finalized = JSON.parse(JSON.stringify(result)); Object.defineProperty(finalized, "~standard", { value: { ...schema["~standard"], jsonSchema: { input: createStandardJSONSchemaMethod(schema, "input", ctx.processors), output: createStandardJSONSchemaMethod(schema, "output", ctx.processors) } }, enumerable: false, writable: false }); return finalized; } catch (_err) { throw new Error("Error converting schema to JSON."); } } function isTransforming(_schema, _ctx) { const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() }; if (ctx.seen.has(_schema)) return false; ctx.seen.add(_schema); const def = _schema._zod.def; if (def.type === "transform") return true; if (def.type === "array") return isTransforming(def.element, ctx); if (def.type === "set") return isTransforming(def.valueType, ctx); if (def.type === "lazy") return isTransforming(def.getter(), ctx); if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") { return isTransforming(def.innerType, ctx); } if (def.type === "intersection") { return isTransforming(def.left, ctx) || isTransforming(def.right, ctx); } if (def.type === "record" || def.type === "map") { return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx); } if (def.type === "pipe") { return isTransforming(def.in, ctx) || isTransforming(def.out, ctx); } if (def.type === "object") { for (const key in def.shape) { if (isTransforming(def.shape[key], ctx)) return true; } return false; } if (def.type === "union") { for (const option of def.options) { if (isTransforming(option, ctx)) return true; } return false; } if (def.type === "tuple") { for (const item of def.items) { if (isTransforming(item, ctx)) return true; } if (def.rest && isTransforming(def.rest, ctx)) return true; return false; } return false; } var createToJSONSchemaMethod, createStandardJSONSchemaMethod; var init_to_json_schema = __esm({ "../../node_modules/zod/v4/core/to-json-schema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_registries(); __name(initializeContext, "initializeContext"); __name(process2, "process"); __name(extractDefs, "extractDefs"); __name(finalize, "finalize"); __name(isTransforming, "isTransforming"); createToJSONSchemaMethod = /* @__PURE__ */ __name((schema, processors = {}) => (params) => { const ctx = initializeContext({ ...params, processors }); process2(schema, ctx); extractDefs(ctx, schema); return finalize(ctx, schema); }, "createToJSONSchemaMethod"); createStandardJSONSchemaMethod = /* @__PURE__ */ __name((schema, io, processors = {}) => (params) => { const { libraryOptions, target } = params ?? {}; const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors }); process2(schema, ctx); extractDefs(ctx, schema); return finalize(ctx, schema); }, "createStandardJSONSchemaMethod"); } }); // ../../node_modules/zod/v4/core/json-schema-processors.js function toJSONSchema(input, params) { if ("_idmap" in input) { const registry2 = input; const ctx2 = initializeContext({ ...params, processors: allProcessors }); const defs = {}; for (const entry of registry2._idmap.entries()) { const [_, schema] = entry; process2(schema, ctx2); } const schemas = {}; const external = { registry: registry2, uri: params?.uri, defs }; ctx2.external = external; for (const entry of registry2._idmap.entries()) { const [key, schema] = entry; extractDefs(ctx2, schema); schemas[key] = finalize(ctx2, schema); } if (Object.keys(defs).length > 0) { const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions"; schemas.__shared = { [defsSegment]: defs }; } return { schemas }; } const ctx = initializeContext({ ...params, processors: allProcessors }); process2(input, ctx); extractDefs(ctx, input); return finalize(ctx, input); } var formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors; var init_json_schema_processors = __esm({ "../../node_modules/zod/v4/core/json-schema-processors.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_to_json_schema(); init_util3(); formatMap = { guid: "uuid", url: "uri", datetime: "date-time", json_string: "json-string", regex: "" // do not set }; stringProcessor = /* @__PURE__ */ __name((schema, ctx, _json, _params) => { const json2 = _json; json2.type = "string"; const { minimum, maximum, format: format2, patterns, contentEncoding } = schema._zod.bag; if (typeof minimum === "number") json2.minLength = minimum; if (typeof maximum === "number") json2.maxLength = maximum; if (format2) { json2.format = formatMap[format2] ?? format2; if (json2.format === "") delete json2.format; if (format2 === "time") { delete json2.format; } } if (contentEncoding) json2.contentEncoding = contentEncoding; if (patterns && patterns.size > 0) { const regexes = [...patterns]; if (regexes.length === 1) json2.pattern = regexes[0].source; else if (regexes.length > 1) { json2.allOf = [ ...regexes.map((regex) => ({ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {}, pattern: regex.source })) ]; } } }, "stringProcessor"); numberProcessor = /* @__PURE__ */ __name((schema, ctx, _json, _params) => { const json2 = _json; const { minimum, maximum, format: format2, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag; if (typeof format2 === "string" && format2.includes("int")) json2.type = "integer"; else json2.type = "number"; if (typeof exclusiveMinimum === "number") { if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") { json2.minimum = exclusiveMinimum; json2.exclusiveMinimum = true; } else { json2.exclusiveMinimum = exclusiveMinimum; } } if (typeof minimum === "number") { json2.minimum = minimum; if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") { if (exclusiveMinimum >= minimum) delete json2.minimum; else delete json2.exclusiveMinimum; } } if (typeof exclusiveMaximum === "number") { if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") { json2.maximum = exclusiveMaximum; json2.exclusiveMaximum = true; } else { json2.exclusiveMaximum = exclusiveMaximum; } } if (typeof maximum === "number") { json2.maximum = maximum; if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") { if (exclusiveMaximum <= maximum) delete json2.maximum; else delete json2.exclusiveMaximum; } } if (typeof multipleOf === "number") json2.multipleOf = multipleOf; }, "numberProcessor"); booleanProcessor = /* @__PURE__ */ __name((_schema, _ctx, json2, _params) => { json2.type = "boolean"; }, "booleanProcessor"); bigintProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("BigInt cannot be represented in JSON Schema"); } }, "bigintProcessor"); symbolProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Symbols cannot be represented in JSON Schema"); } }, "symbolProcessor"); nullProcessor = /* @__PURE__ */ __name((_schema, ctx, json2, _params) => { if (ctx.target === "openapi-3.0") { json2.type = "string"; json2.nullable = true; json2.enum = [null]; } else { json2.type = "null"; } }, "nullProcessor"); undefinedProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Undefined cannot be represented in JSON Schema"); } }, "undefinedProcessor"); voidProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Void cannot be represented in JSON Schema"); } }, "voidProcessor"); neverProcessor = /* @__PURE__ */ __name((_schema, _ctx, json2, _params) => { json2.not = {}; }, "neverProcessor"); anyProcessor = /* @__PURE__ */ __name((_schema, _ctx, _json, _params) => { }, "anyProcessor"); unknownProcessor = /* @__PURE__ */ __name((_schema, _ctx, _json, _params) => { }, "unknownProcessor"); dateProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Date cannot be represented in JSON Schema"); } }, "dateProcessor"); enumProcessor = /* @__PURE__ */ __name((schema, _ctx, json2, _params) => { const def = schema._zod.def; const values = getEnumValues(def.entries); if (values.every((v3) => typeof v3 === "number")) json2.type = "number"; if (values.every((v3) => typeof v3 === "string")) json2.type = "string"; json2.enum = values; }, "enumProcessor"); literalProcessor = /* @__PURE__ */ __name((schema, ctx, json2, _params) => { const def = schema._zod.def; const vals = []; for (const val of def.values) { if (val === void 0) { if (ctx.unrepresentable === "throw") { throw new Error("Literal `undefined` cannot be represented in JSON Schema"); } else { } } else if (typeof val === "bigint") { if (ctx.unrepresentable === "throw") { throw new Error("BigInt literals cannot be represented in JSON Schema"); } else { vals.push(Number(val)); } } else { vals.push(val); } } if (vals.length === 0) { } else if (vals.length === 1) { const val = vals[0]; json2.type = val === null ? "null" : typeof val; if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") { json2.enum = [val]; } else { json2.const = val; } } else { if (vals.every((v3) => typeof v3 === "number")) json2.type = "number"; if (vals.every((v3) => typeof v3 === "string")) json2.type = "string"; if (vals.every((v3) => typeof v3 === "boolean")) json2.type = "boolean"; if (vals.every((v3) => v3 === null)) json2.type = "null"; json2.enum = vals; } }, "literalProcessor"); nanProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("NaN cannot be represented in JSON Schema"); } }, "nanProcessor"); templateLiteralProcessor = /* @__PURE__ */ __name((schema, _ctx, json2, _params) => { const _json = json2; const pattern = schema._zod.pattern; if (!pattern) throw new Error("Pattern not found in template literal"); _json.type = "string"; _json.pattern = pattern.source; }, "templateLiteralProcessor"); fileProcessor = /* @__PURE__ */ __name((schema, _ctx, json2, _params) => { const _json = json2; const file2 = { type: "string", format: "binary", contentEncoding: "binary" }; const { minimum, maximum, mime } = schema._zod.bag; if (minimum !== void 0) file2.minLength = minimum; if (maximum !== void 0) file2.maxLength = maximum; if (mime) { if (mime.length === 1) { file2.contentMediaType = mime[0]; Object.assign(_json, file2); } else { Object.assign(_json, file2); _json.anyOf = mime.map((m2) => ({ contentMediaType: m2 })); } } else { Object.assign(_json, file2); } }, "fileProcessor"); successProcessor = /* @__PURE__ */ __name((_schema, _ctx, json2, _params) => { json2.type = "boolean"; }, "successProcessor"); customProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Custom types cannot be represented in JSON Schema"); } }, "customProcessor"); functionProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Function types cannot be represented in JSON Schema"); } }, "functionProcessor"); transformProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Transforms cannot be represented in JSON Schema"); } }, "transformProcessor"); mapProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Map cannot be represented in JSON Schema"); } }, "mapProcessor"); setProcessor = /* @__PURE__ */ __name((_schema, ctx, _json, _params) => { if (ctx.unrepresentable === "throw") { throw new Error("Set cannot be represented in JSON Schema"); } }, "setProcessor"); arrayProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const json2 = _json; const def = schema._zod.def; const { minimum, maximum } = schema._zod.bag; if (typeof minimum === "number") json2.minItems = minimum; if (typeof maximum === "number") json2.maxItems = maximum; json2.type = "array"; json2.items = process2(def.element, ctx, { ...params, path: [...params.path, "items"] }); }, "arrayProcessor"); objectProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const json2 = _json; const def = schema._zod.def; json2.type = "object"; json2.properties = {}; const shape = def.shape; for (const key in shape) { json2.properties[key] = process2(shape[key], ctx, { ...params, path: [...params.path, "properties", key] }); } const allKeys = new Set(Object.keys(shape)); const requiredKeys = new Set([...allKeys].filter((key) => { const v3 = def.shape[key]._zod; if (ctx.io === "input") { return v3.optin === void 0; } else { return v3.optout === void 0; } })); if (requiredKeys.size > 0) { json2.required = Array.from(requiredKeys); } if (def.catchall?._zod.def.type === "never") { json2.additionalProperties = false; } else if (!def.catchall) { if (ctx.io === "output") json2.additionalProperties = false; } else if (def.catchall) { json2.additionalProperties = process2(def.catchall, ctx, { ...params, path: [...params.path, "additionalProperties"] }); } }, "objectProcessor"); unionProcessor = /* @__PURE__ */ __name((schema, ctx, json2, params) => { const def = schema._zod.def; const isExclusive = def.inclusive === false; const options = def.options.map((x2, i2) => process2(x2, ctx, { ...params, path: [...params.path, isExclusive ? "oneOf" : "anyOf", i2] })); if (isExclusive) { json2.oneOf = options; } else { json2.anyOf = options; } }, "unionProcessor"); intersectionProcessor = /* @__PURE__ */ __name((schema, ctx, json2, params) => { const def = schema._zod.def; const a2 = process2(def.left, ctx, { ...params, path: [...params.path, "allOf", 0] }); const b2 = process2(def.right, ctx, { ...params, path: [...params.path, "allOf", 1] }); const isSimpleIntersection = /* @__PURE__ */ __name((val) => "allOf" in val && Object.keys(val).length === 1, "isSimpleIntersection"); const allOf = [ ...isSimpleIntersection(a2) ? a2.allOf : [a2], ...isSimpleIntersection(b2) ? b2.allOf : [b2] ]; json2.allOf = allOf; }, "intersectionProcessor"); tupleProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const json2 = _json; const def = schema._zod.def; json2.type = "array"; const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items"; const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems"; const prefixItems = def.items.map((x2, i2) => process2(x2, ctx, { ...params, path: [...params.path, prefixPath, i2] })); const rest = def.rest ? process2(def.rest, ctx, { ...params, path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []] }) : null; if (ctx.target === "draft-2020-12") { json2.prefixItems = prefixItems; if (rest) { json2.items = rest; } } else if (ctx.target === "openapi-3.0") { json2.items = { anyOf: prefixItems }; if (rest) { json2.items.anyOf.push(rest); } json2.minItems = prefixItems.length; if (!rest) { json2.maxItems = prefixItems.length; } } else { json2.items = prefixItems; if (rest) { json2.additionalItems = rest; } } const { minimum, maximum } = schema._zod.bag; if (typeof minimum === "number") json2.minItems = minimum; if (typeof maximum === "number") json2.maxItems = maximum; }, "tupleProcessor"); recordProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const json2 = _json; const def = schema._zod.def; json2.type = "object"; const keyType = def.keyType; const keyBag = keyType._zod.bag; const patterns = keyBag?.patterns; if (def.mode === "loose" && patterns && patterns.size > 0) { const valueSchema = process2(def.valueType, ctx, { ...params, path: [...params.path, "patternProperties", "*"] }); json2.patternProperties = {}; for (const pattern of patterns) { json2.patternProperties[pattern.source] = valueSchema; } } else { if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") { json2.propertyNames = process2(def.keyType, ctx, { ...params, path: [...params.path, "propertyNames"] }); } json2.additionalProperties = process2(def.valueType, ctx, { ...params, path: [...params.path, "additionalProperties"] }); } const keyValues = keyType._zod.values; if (keyValues) { const validKeyValues = [...keyValues].filter((v3) => typeof v3 === "string" || typeof v3 === "number"); if (validKeyValues.length > 0) { json2.required = validKeyValues; } } }, "recordProcessor"); nullableProcessor = /* @__PURE__ */ __name((schema, ctx, json2, params) => { const def = schema._zod.def; const inner = process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); if (ctx.target === "openapi-3.0") { seen.ref = def.innerType; json2.nullable = true; } else { json2.anyOf = [inner, { type: "null" }]; } }, "nullableProcessor"); nonoptionalProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const def = schema._zod.def; process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; }, "nonoptionalProcessor"); defaultProcessor = /* @__PURE__ */ __name((schema, ctx, json2, params) => { const def = schema._zod.def; process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; json2.default = JSON.parse(JSON.stringify(def.defaultValue)); }, "defaultProcessor"); prefaultProcessor = /* @__PURE__ */ __name((schema, ctx, json2, params) => { const def = schema._zod.def; process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; if (ctx.io === "input") json2._prefault = JSON.parse(JSON.stringify(def.defaultValue)); }, "prefaultProcessor"); catchProcessor = /* @__PURE__ */ __name((schema, ctx, json2, params) => { const def = schema._zod.def; process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; let catchValue; try { catchValue = def.catchValue(void 0); } catch { throw new Error("Dynamic catch values are not supported in JSON Schema"); } json2.default = catchValue; }, "catchProcessor"); pipeProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const def = schema._zod.def; const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out; process2(innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = innerType; }, "pipeProcessor"); readonlyProcessor = /* @__PURE__ */ __name((schema, ctx, json2, params) => { const def = schema._zod.def; process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; json2.readOnly = true; }, "readonlyProcessor"); promiseProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const def = schema._zod.def; process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; }, "promiseProcessor"); optionalProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const def = schema._zod.def; process2(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; }, "optionalProcessor"); lazyProcessor = /* @__PURE__ */ __name((schema, ctx, _json, params) => { const innerType = schema._zod.innerType; process2(innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = innerType; }, "lazyProcessor"); allProcessors = { string: stringProcessor, number: numberProcessor, boolean: booleanProcessor, bigint: bigintProcessor, symbol: symbolProcessor, null: nullProcessor, undefined: undefinedProcessor, void: voidProcessor, never: neverProcessor, any: anyProcessor, unknown: unknownProcessor, date: dateProcessor, enum: enumProcessor, literal: literalProcessor, nan: nanProcessor, template_literal: templateLiteralProcessor, file: fileProcessor, success: successProcessor, custom: customProcessor, function: functionProcessor, transform: transformProcessor, map: mapProcessor, set: setProcessor, array: arrayProcessor, object: objectProcessor, union: unionProcessor, intersection: intersectionProcessor, tuple: tupleProcessor, record: recordProcessor, nullable: nullableProcessor, nonoptional: nonoptionalProcessor, default: defaultProcessor, prefault: prefaultProcessor, catch: catchProcessor, pipe: pipeProcessor, readonly: readonlyProcessor, promise: promiseProcessor, optional: optionalProcessor, lazy: lazyProcessor }; __name(toJSONSchema, "toJSONSchema"); } }); // ../../node_modules/zod/v4/core/json-schema-generator.js var JSONSchemaGenerator; var init_json_schema_generator = __esm({ "../../node_modules/zod/v4/core/json-schema-generator.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_json_schema_processors(); init_to_json_schema(); JSONSchemaGenerator = class { /** @deprecated Access via ctx instead */ get metadataRegistry() { return this.ctx.metadataRegistry; } /** @deprecated Access via ctx instead */ get target() { return this.ctx.target; } /** @deprecated Access via ctx instead */ get unrepresentable() { return this.ctx.unrepresentable; } /** @deprecated Access via ctx instead */ get override() { return this.ctx.override; } /** @deprecated Access via ctx instead */ get io() { return this.ctx.io; } /** @deprecated Access via ctx instead */ get counter() { return this.ctx.counter; } set counter(value) { this.ctx.counter = value; } /** @deprecated Access via ctx instead */ get seen() { return this.ctx.seen; } constructor(params) { let normalizedTarget = params?.target ?? "draft-2020-12"; if (normalizedTarget === "draft-4") normalizedTarget = "draft-04"; if (normalizedTarget === "draft-7") normalizedTarget = "draft-07"; this.ctx = initializeContext({ processors: allProcessors, target: normalizedTarget, ...params?.metadata && { metadata: params.metadata }, ...params?.unrepresentable && { unrepresentable: params.unrepresentable }, ...params?.override && { override: params.override }, ...params?.io && { io: params.io } }); } /** * Process a schema to prepare it for JSON Schema generation. * This must be called before emit(). */ process(schema, _params = { path: [], schemaPath: [] }) { return process2(schema, this.ctx, _params); } /** * Emit the final JSON Schema after processing. * Must call process() first. */ emit(schema, _params) { if (_params) { if (_params.cycles) this.ctx.cycles = _params.cycles; if (_params.reused) this.ctx.reused = _params.reused; if (_params.external) this.ctx.external = _params.external; } extractDefs(this.ctx, schema); const result = finalize(this.ctx, schema); const { "~standard": _, ...plainResult } = result; return plainResult; } }; __name(JSONSchemaGenerator, "JSONSchemaGenerator"); } }); // ../../node_modules/zod/v4/core/json-schema.js var json_schema_exports = {}; var init_json_schema = __esm({ "../../node_modules/zod/v4/core/json-schema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/zod/v4/core/index.js var core_exports2 = {}; __export(core_exports2, { $ZodAny: () => $ZodAny, $ZodArray: () => $ZodArray, $ZodAsyncError: () => $ZodAsyncError, $ZodBase64: () => $ZodBase64, $ZodBase64URL: () => $ZodBase64URL, $ZodBigInt: () => $ZodBigInt, $ZodBigIntFormat: () => $ZodBigIntFormat, $ZodBoolean: () => $ZodBoolean, $ZodCIDRv4: () => $ZodCIDRv4, $ZodCIDRv6: () => $ZodCIDRv6, $ZodCUID: () => $ZodCUID, $ZodCUID2: () => $ZodCUID2, $ZodCatch: () => $ZodCatch, $ZodCheck: () => $ZodCheck, $ZodCheckBigIntFormat: () => $ZodCheckBigIntFormat, $ZodCheckEndsWith: () => $ZodCheckEndsWith, $ZodCheckGreaterThan: () => $ZodCheckGreaterThan, $ZodCheckIncludes: () => $ZodCheckIncludes, $ZodCheckLengthEquals: () => $ZodCheckLengthEquals, $ZodCheckLessThan: () => $ZodCheckLessThan, $ZodCheckLowerCase: () => $ZodCheckLowerCase, $ZodCheckMaxLength: () => $ZodCheckMaxLength, $ZodCheckMaxSize: () => $ZodCheckMaxSize, $ZodCheckMimeType: () => $ZodCheckMimeType, $ZodCheckMinLength: () => $ZodCheckMinLength, $ZodCheckMinSize: () => $ZodCheckMinSize, $ZodCheckMultipleOf: () => $ZodCheckMultipleOf, $ZodCheckNumberFormat: () => $ZodCheckNumberFormat, $ZodCheckOverwrite: () => $ZodCheckOverwrite, $ZodCheckProperty: () => $ZodCheckProperty, $ZodCheckRegex: () => $ZodCheckRegex, $ZodCheckSizeEquals: () => $ZodCheckSizeEquals, $ZodCheckStartsWith: () => $ZodCheckStartsWith, $ZodCheckStringFormat: () => $ZodCheckStringFormat, $ZodCheckUpperCase: () => $ZodCheckUpperCase, $ZodCodec: () => $ZodCodec, $ZodCustom: () => $ZodCustom, $ZodCustomStringFormat: () => $ZodCustomStringFormat, $ZodDate: () => $ZodDate, $ZodDefault: () => $ZodDefault, $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion, $ZodE164: () => $ZodE164, $ZodEmail: () => $ZodEmail, $ZodEmoji: () => $ZodEmoji, $ZodEncodeError: () => $ZodEncodeError, $ZodEnum: () => $ZodEnum, $ZodError: () => $ZodError, $ZodExactOptional: () => $ZodExactOptional, $ZodFile: () => $ZodFile, $ZodFunction: () => $ZodFunction, $ZodGUID: () => $ZodGUID, $ZodIPv4: () => $ZodIPv4, $ZodIPv6: () => $ZodIPv6, $ZodISODate: () => $ZodISODate, $ZodISODateTime: () => $ZodISODateTime, $ZodISODuration: () => $ZodISODuration, $ZodISOTime: () => $ZodISOTime, $ZodIntersection: () => $ZodIntersection, $ZodJWT: () => $ZodJWT, $ZodKSUID: () => $ZodKSUID, $ZodLazy: () => $ZodLazy, $ZodLiteral: () => $ZodLiteral, $ZodMAC: () => $ZodMAC, $ZodMap: () => $ZodMap, $ZodNaN: () => $ZodNaN, $ZodNanoID: () => $ZodNanoID, $ZodNever: () => $ZodNever, $ZodNonOptional: () => $ZodNonOptional, $ZodNull: () => $ZodNull, $ZodNullable: () => $ZodNullable, $ZodNumber: () => $ZodNumber, $ZodNumberFormat: () => $ZodNumberFormat, $ZodObject: () => $ZodObject, $ZodObjectJIT: () => $ZodObjectJIT, $ZodOptional: () => $ZodOptional, $ZodPipe: () => $ZodPipe, $ZodPrefault: () => $ZodPrefault, $ZodPromise: () => $ZodPromise, $ZodReadonly: () => $ZodReadonly, $ZodRealError: () => $ZodRealError, $ZodRecord: () => $ZodRecord, $ZodRegistry: () => $ZodRegistry, $ZodSet: () => $ZodSet, $ZodString: () => $ZodString, $ZodStringFormat: () => $ZodStringFormat, $ZodSuccess: () => $ZodSuccess, $ZodSymbol: () => $ZodSymbol, $ZodTemplateLiteral: () => $ZodTemplateLiteral, $ZodTransform: () => $ZodTransform, $ZodTuple: () => $ZodTuple, $ZodType: () => $ZodType, $ZodULID: () => $ZodULID, $ZodURL: () => $ZodURL, $ZodUUID: () => $ZodUUID, $ZodUndefined: () => $ZodUndefined, $ZodUnion: () => $ZodUnion, $ZodUnknown: () => $ZodUnknown, $ZodVoid: () => $ZodVoid, $ZodXID: () => $ZodXID, $ZodXor: () => $ZodXor, $brand: () => $brand, $constructor: () => $constructor, $input: () => $input, $output: () => $output, Doc: () => Doc, JSONSchema: () => json_schema_exports, JSONSchemaGenerator: () => JSONSchemaGenerator, NEVER: () => NEVER, TimePrecision: () => TimePrecision, _any: () => _any, _array: () => _array, _base64: () => _base64, _base64url: () => _base64url, _bigint: () => _bigint, _boolean: () => _boolean, _catch: () => _catch, _check: () => _check, _cidrv4: () => _cidrv4, _cidrv6: () => _cidrv6, _coercedBigint: () => _coercedBigint, _coercedBoolean: () => _coercedBoolean, _coercedDate: () => _coercedDate, _coercedNumber: () => _coercedNumber, _coercedString: () => _coercedString, _cuid: () => _cuid, _cuid2: () => _cuid2, _custom: () => _custom, _date: () => _date, _decode: () => _decode, _decodeAsync: () => _decodeAsync, _default: () => _default, _discriminatedUnion: () => _discriminatedUnion, _e164: () => _e164, _email: () => _email, _emoji: () => _emoji2, _encode: () => _encode, _encodeAsync: () => _encodeAsync, _endsWith: () => _endsWith, _enum: () => _enum, _file: () => _file, _float32: () => _float32, _float64: () => _float64, _gt: () => _gt, _gte: () => _gte, _guid: () => _guid, _includes: () => _includes, _int: () => _int, _int32: () => _int32, _int64: () => _int64, _intersection: () => _intersection, _ipv4: () => _ipv4, _ipv6: () => _ipv6, _isoDate: () => _isoDate, _isoDateTime: () => _isoDateTime, _isoDuration: () => _isoDuration, _isoTime: () => _isoTime, _jwt: () => _jwt, _ksuid: () => _ksuid, _lazy: () => _lazy, _length: () => _length, _literal: () => _literal, _lowercase: () => _lowercase, _lt: () => _lt, _lte: () => _lte, _mac: () => _mac, _map: () => _map, _max: () => _lte, _maxLength: () => _maxLength, _maxSize: () => _maxSize, _mime: () => _mime, _min: () => _gte, _minLength: () => _minLength, _minSize: () => _minSize, _multipleOf: () => _multipleOf, _nan: () => _nan, _nanoid: () => _nanoid, _nativeEnum: () => _nativeEnum, _negative: () => _negative, _never: () => _never, _nonnegative: () => _nonnegative, _nonoptional: () => _nonoptional, _nonpositive: () => _nonpositive, _normalize: () => _normalize, _null: () => _null2, _nullable: () => _nullable, _number: () => _number, _optional: () => _optional, _overwrite: () => _overwrite, _parse: () => _parse, _parseAsync: () => _parseAsync, _pipe: () => _pipe, _positive: () => _positive, _promise: () => _promise, _property: () => _property, _readonly: () => _readonly, _record: () => _record, _refine: () => _refine, _regex: () => _regex, _safeDecode: () => _safeDecode, _safeDecodeAsync: () => _safeDecodeAsync, _safeEncode: () => _safeEncode, _safeEncodeAsync: () => _safeEncodeAsync, _safeParse: () => _safeParse, _safeParseAsync: () => _safeParseAsync, _set: () => _set, _size: () => _size, _slugify: () => _slugify, _startsWith: () => _startsWith, _string: () => _string, _stringFormat: () => _stringFormat, _stringbool: () => _stringbool, _success: () => _success, _superRefine: () => _superRefine, _symbol: () => _symbol, _templateLiteral: () => _templateLiteral, _toLowerCase: () => _toLowerCase, _toUpperCase: () => _toUpperCase, _transform: () => _transform, _trim: () => _trim, _tuple: () => _tuple, _uint32: () => _uint32, _uint64: () => _uint64, _ulid: () => _ulid, _undefined: () => _undefined2, _union: () => _union, _unknown: () => _unknown, _uppercase: () => _uppercase, _url: () => _url, _uuid: () => _uuid, _uuidv4: () => _uuidv4, _uuidv6: () => _uuidv6, _uuidv7: () => _uuidv7, _void: () => _void, _xid: () => _xid, _xor: () => _xor, clone: () => clone, config: () => config2, createStandardJSONSchemaMethod: () => createStandardJSONSchemaMethod, createToJSONSchemaMethod: () => createToJSONSchemaMethod, decode: () => decode2, decodeAsync: () => decodeAsync, describe: () => describe, encode: () => encode3, encodeAsync: () => encodeAsync, extractDefs: () => extractDefs, finalize: () => finalize, flattenError: () => flattenError, formatError: () => formatError, globalConfig: () => globalConfig, globalRegistry: () => globalRegistry, initializeContext: () => initializeContext, isValidBase64: () => isValidBase64, isValidBase64URL: () => isValidBase64URL, isValidJWT: () => isValidJWT, locales: () => locales_exports, meta: () => meta, parse: () => parse, parseAsync: () => parseAsync, prettifyError: () => prettifyError, process: () => process2, regexes: () => regexes_exports, registry: () => registry, safeDecode: () => safeDecode, safeDecodeAsync: () => safeDecodeAsync, safeEncode: () => safeEncode, safeEncodeAsync: () => safeEncodeAsync, safeParse: () => safeParse, safeParseAsync: () => safeParseAsync, toDotPath: () => toDotPath, toJSONSchema: () => toJSONSchema, treeifyError: () => treeifyError, util: () => util_exports, version: () => version3 }); var init_core3 = __esm({ "../../node_modules/zod/v4/core/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core2(); init_parse(); init_errors4(); init_schemas(); init_checks2(); init_versions(); init_util3(); init_regexes(); init_locales(); init_registries(); init_doc(); init_api(); init_to_json_schema(); init_json_schema_processors(); init_json_schema_generator(); init_json_schema(); } }); // ../../node_modules/zod/v4/classic/checks.js var checks_exports2 = {}; __export(checks_exports2, { endsWith: () => _endsWith, gt: () => _gt, gte: () => _gte, includes: () => _includes, length: () => _length, lowercase: () => _lowercase, lt: () => _lt, lte: () => _lte, maxLength: () => _maxLength, maxSize: () => _maxSize, mime: () => _mime, minLength: () => _minLength, minSize: () => _minSize, multipleOf: () => _multipleOf, negative: () => _negative, nonnegative: () => _nonnegative, nonpositive: () => _nonpositive, normalize: () => _normalize, overwrite: () => _overwrite, positive: () => _positive, property: () => _property, regex: () => _regex, size: () => _size, slugify: () => _slugify, startsWith: () => _startsWith, toLowerCase: () => _toLowerCase, toUpperCase: () => _toUpperCase, trim: () => _trim, uppercase: () => _uppercase }); var init_checks3 = __esm({ "../../node_modules/zod/v4/classic/checks.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); } }); // ../../node_modules/zod/v4/classic/iso.js var iso_exports = {}; __export(iso_exports, { ZodISODate: () => ZodISODate, ZodISODateTime: () => ZodISODateTime, ZodISODuration: () => ZodISODuration, ZodISOTime: () => ZodISOTime, date: () => date3, datetime: () => datetime2, duration: () => duration2, time: () => time6 }); function datetime2(params) { return _isoDateTime(ZodISODateTime, params); } function date3(params) { return _isoDate(ZodISODate, params); } function time6(params) { return _isoTime(ZodISOTime, params); } function duration2(params) { return _isoDuration(ZodISODuration, params); } var ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration; var init_iso = __esm({ "../../node_modules/zod/v4/classic/iso.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); init_schemas2(); ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => { $ZodISODateTime.init(inst, def); ZodStringFormat.init(inst, def); }); __name(datetime2, "datetime"); ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => { $ZodISODate.init(inst, def); ZodStringFormat.init(inst, def); }); __name(date3, "date"); ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => { $ZodISOTime.init(inst, def); ZodStringFormat.init(inst, def); }); __name(time6, "time"); ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => { $ZodISODuration.init(inst, def); ZodStringFormat.init(inst, def); }); __name(duration2, "duration"); } }); // ../../node_modules/zod/v4/classic/errors.js var initializer2, ZodError, ZodRealError; var init_errors5 = __esm({ "../../node_modules/zod/v4/classic/errors.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); init_core3(); init_util3(); initializer2 = /* @__PURE__ */ __name((inst, issues) => { $ZodError.init(inst, issues); inst.name = "ZodError"; Object.defineProperties(inst, { format: { value: (mapper) => formatError(inst, mapper) // enumerable: false, }, flatten: { value: (mapper) => flattenError(inst, mapper) // enumerable: false, }, addIssue: { value: (issue2) => { inst.issues.push(issue2); inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); } // enumerable: false, }, addIssues: { value: (issues2) => { inst.issues.push(...issues2); inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); } // enumerable: false, }, isEmpty: { get() { return inst.issues.length === 0; } // enumerable: false, } }); }, "initializer"); ZodError = $constructor("ZodError", initializer2); ZodRealError = $constructor("ZodError", initializer2, { Parent: Error }); } }); // ../../node_modules/zod/v4/classic/parse.js var parse2, parseAsync2, safeParse2, safeParseAsync2, encode4, decode3, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2; var init_parse2 = __esm({ "../../node_modules/zod/v4/classic/parse.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); init_errors5(); parse2 = /* @__PURE__ */ _parse(ZodRealError); parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError); safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError); safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError); encode4 = /* @__PURE__ */ _encode(ZodRealError); decode3 = /* @__PURE__ */ _decode(ZodRealError); encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError); decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError); safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError); safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError); safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError); safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError); } }); // ../../node_modules/zod/v4/classic/schemas.js var schemas_exports2 = {}; __export(schemas_exports2, { ZodAny: () => ZodAny, ZodArray: () => ZodArray, ZodBase64: () => ZodBase64, ZodBase64URL: () => ZodBase64URL, ZodBigInt: () => ZodBigInt, ZodBigIntFormat: () => ZodBigIntFormat, ZodBoolean: () => ZodBoolean, ZodCIDRv4: () => ZodCIDRv4, ZodCIDRv6: () => ZodCIDRv6, ZodCUID: () => ZodCUID, ZodCUID2: () => ZodCUID2, ZodCatch: () => ZodCatch, ZodCodec: () => ZodCodec, ZodCustom: () => ZodCustom, ZodCustomStringFormat: () => ZodCustomStringFormat, ZodDate: () => ZodDate, ZodDefault: () => ZodDefault, ZodDiscriminatedUnion: () => ZodDiscriminatedUnion, ZodE164: () => ZodE164, ZodEmail: () => ZodEmail, ZodEmoji: () => ZodEmoji, ZodEnum: () => ZodEnum, ZodExactOptional: () => ZodExactOptional, ZodFile: () => ZodFile, ZodFunction: () => ZodFunction, ZodGUID: () => ZodGUID, ZodIPv4: () => ZodIPv4, ZodIPv6: () => ZodIPv6, ZodIntersection: () => ZodIntersection, ZodJWT: () => ZodJWT, ZodKSUID: () => ZodKSUID, ZodLazy: () => ZodLazy, ZodLiteral: () => ZodLiteral, ZodMAC: () => ZodMAC, ZodMap: () => ZodMap, ZodNaN: () => ZodNaN, ZodNanoID: () => ZodNanoID, ZodNever: () => ZodNever, ZodNonOptional: () => ZodNonOptional, ZodNull: () => ZodNull, ZodNullable: () => ZodNullable, ZodNumber: () => ZodNumber, ZodNumberFormat: () => ZodNumberFormat, ZodObject: () => ZodObject, ZodOptional: () => ZodOptional, ZodPipe: () => ZodPipe, ZodPrefault: () => ZodPrefault, ZodPromise: () => ZodPromise, ZodReadonly: () => ZodReadonly, ZodRecord: () => ZodRecord, ZodSet: () => ZodSet, ZodString: () => ZodString, ZodStringFormat: () => ZodStringFormat, ZodSuccess: () => ZodSuccess, ZodSymbol: () => ZodSymbol, ZodTemplateLiteral: () => ZodTemplateLiteral, ZodTransform: () => ZodTransform, ZodTuple: () => ZodTuple, ZodType: () => ZodType, ZodULID: () => ZodULID, ZodURL: () => ZodURL, ZodUUID: () => ZodUUID, ZodUndefined: () => ZodUndefined, ZodUnion: () => ZodUnion, ZodUnknown: () => ZodUnknown, ZodVoid: () => ZodVoid, ZodXID: () => ZodXID, ZodXor: () => ZodXor, _ZodString: () => _ZodString, _default: () => _default2, _function: () => _function, any: () => any, array: () => array, base64: () => base642, base64url: () => base64url2, bigint: () => bigint3, boolean: () => boolean2, catch: () => _catch2, check: () => check2, cidrv4: () => cidrv42, cidrv6: () => cidrv62, codec: () => codec, cuid: () => cuid3, cuid2: () => cuid22, custom: () => custom, date: () => date4, describe: () => describe2, discriminatedUnion: () => discriminatedUnion, e164: () => e1642, email: () => email2, emoji: () => emoji2, enum: () => _enum2, exactOptional: () => exactOptional, file: () => file, float32: () => float32, float64: () => float64, function: () => _function, guid: () => guid2, hash: () => hash, hex: () => hex2, hostname: () => hostname2, httpUrl: () => httpUrl, instanceof: () => _instanceof, int: () => int, int32: () => int32, int64: () => int64, intersection: () => intersection, ipv4: () => ipv42, ipv6: () => ipv62, json: () => json, jwt: () => jwt, keyof: () => keyof, ksuid: () => ksuid2, lazy: () => lazy2, literal: () => literal, looseObject: () => looseObject, looseRecord: () => looseRecord, mac: () => mac2, map: () => map, meta: () => meta2, nan: () => nan, nanoid: () => nanoid2, nativeEnum: () => nativeEnum, never: () => never, nonoptional: () => nonoptional, null: () => _null3, nullable: () => nullable, nullish: () => nullish2, number: () => number2, object: () => object, optional: () => optional, partialRecord: () => partialRecord, pipe: () => pipe, prefault: () => prefault, preprocess: () => preprocess, promise: () => promise, readonly: () => readonly, record: () => record, refine: () => refine, set: () => set, strictObject: () => strictObject, string: () => string2, stringFormat: () => stringFormat, stringbool: () => stringbool, success: () => success, superRefine: () => superRefine, symbol: () => symbol, templateLiteral: () => templateLiteral, transform: () => transform, tuple: () => tuple, uint32: () => uint32, uint64: () => uint64, ulid: () => ulid2, undefined: () => _undefined3, union: () => union2, unknown: () => unknown, url: () => url, uuid: () => uuid2, uuidv4: () => uuidv4, uuidv6: () => uuidv6, uuidv7: () => uuidv7, void: () => _void2, xid: () => xid2, xor: () => xor }); function string2(params) { return _string(ZodString, params); } function email2(params) { return _email(ZodEmail, params); } function guid2(params) { return _guid(ZodGUID, params); } function uuid2(params) { return _uuid(ZodUUID, params); } function uuidv4(params) { return _uuidv4(ZodUUID, params); } function uuidv6(params) { return _uuidv6(ZodUUID, params); } function uuidv7(params) { return _uuidv7(ZodUUID, params); } function url(params) { return _url(ZodURL, params); } function httpUrl(params) { return _url(ZodURL, { protocol: /^https?$/, hostname: regexes_exports.domain, ...util_exports.normalizeParams(params) }); } function emoji2(params) { return _emoji2(ZodEmoji, params); } function nanoid2(params) { return _nanoid(ZodNanoID, params); } function cuid3(params) { return _cuid(ZodCUID, params); } function cuid22(params) { return _cuid2(ZodCUID2, params); } function ulid2(params) { return _ulid(ZodULID, params); } function xid2(params) { return _xid(ZodXID, params); } function ksuid2(params) { return _ksuid(ZodKSUID, params); } function ipv42(params) { return _ipv4(ZodIPv4, params); } function mac2(params) { return _mac(ZodMAC, params); } function ipv62(params) { return _ipv6(ZodIPv6, params); } function cidrv42(params) { return _cidrv4(ZodCIDRv4, params); } function cidrv62(params) { return _cidrv6(ZodCIDRv6, params); } function base642(params) { return _base64(ZodBase64, params); } function base64url2(params) { return _base64url(ZodBase64URL, params); } function e1642(params) { return _e164(ZodE164, params); } function jwt(params) { return _jwt(ZodJWT, params); } function stringFormat(format2, fnOrRegex, _params = {}) { return _stringFormat(ZodCustomStringFormat, format2, fnOrRegex, _params); } function hostname2(_params) { return _stringFormat(ZodCustomStringFormat, "hostname", regexes_exports.hostname, _params); } function hex2(_params) { return _stringFormat(ZodCustomStringFormat, "hex", regexes_exports.hex, _params); } function hash(alg, params) { const enc = params?.enc ?? "hex"; const format2 = `${alg}_${enc}`; const regex = regexes_exports[format2]; if (!regex) throw new Error(`Unrecognized hash format: ${format2}`); return _stringFormat(ZodCustomStringFormat, format2, regex, params); } function number2(params) { return _number(ZodNumber, params); } function int(params) { return _int(ZodNumberFormat, params); } function float32(params) { return _float32(ZodNumberFormat, params); } function float64(params) { return _float64(ZodNumberFormat, params); } function int32(params) { return _int32(ZodNumberFormat, params); } function uint32(params) { return _uint32(ZodNumberFormat, params); } function boolean2(params) { return _boolean(ZodBoolean, params); } function bigint3(params) { return _bigint(ZodBigInt, params); } function int64(params) { return _int64(ZodBigIntFormat, params); } function uint64(params) { return _uint64(ZodBigIntFormat, params); } function symbol(params) { return _symbol(ZodSymbol, params); } function _undefined3(params) { return _undefined2(ZodUndefined, params); } function _null3(params) { return _null2(ZodNull, params); } function any() { return _any(ZodAny); } function unknown() { return _unknown(ZodUnknown); } function never(params) { return _never(ZodNever, params); } function _void2(params) { return _void(ZodVoid, params); } function date4(params) { return _date(ZodDate, params); } function array(element, params) { return _array(ZodArray, element, params); } function keyof(schema) { const shape = schema._zod.def.shape; return _enum2(Object.keys(shape)); } function object(shape, params) { const def = { type: "object", shape: shape ?? {}, ...util_exports.normalizeParams(params) }; return new ZodObject(def); } function strictObject(shape, params) { return new ZodObject({ type: "object", shape, catchall: never(), ...util_exports.normalizeParams(params) }); } function looseObject(shape, params) { return new ZodObject({ type: "object", shape, catchall: unknown(), ...util_exports.normalizeParams(params) }); } function union2(options, params) { return new ZodUnion({ type: "union", options, ...util_exports.normalizeParams(params) }); } function xor(options, params) { return new ZodXor({ type: "union", options, inclusive: false, ...util_exports.normalizeParams(params) }); } function discriminatedUnion(discriminator, options, params) { return new ZodDiscriminatedUnion({ type: "union", options, discriminator, ...util_exports.normalizeParams(params) }); } function intersection(left, right) { return new ZodIntersection({ type: "intersection", left, right }); } function tuple(items, _paramsOrRest, _params) { const hasRest = _paramsOrRest instanceof $ZodType; const params = hasRest ? _params : _paramsOrRest; const rest = hasRest ? _paramsOrRest : null; return new ZodTuple({ type: "tuple", items, rest, ...util_exports.normalizeParams(params) }); } function record(keyType, valueType, params) { return new ZodRecord({ type: "record", keyType, valueType, ...util_exports.normalizeParams(params) }); } function partialRecord(keyType, valueType, params) { const k2 = clone(keyType); k2._zod.values = void 0; return new ZodRecord({ type: "record", keyType: k2, valueType, ...util_exports.normalizeParams(params) }); } function looseRecord(keyType, valueType, params) { return new ZodRecord({ type: "record", keyType, valueType, mode: "loose", ...util_exports.normalizeParams(params) }); } function map(keyType, valueType, params) { return new ZodMap({ type: "map", keyType, valueType, ...util_exports.normalizeParams(params) }); } function set(valueType, params) { return new ZodSet({ type: "set", valueType, ...util_exports.normalizeParams(params) }); } function _enum2(values, params) { const entries = Array.isArray(values) ? Object.fromEntries(values.map((v3) => [v3, v3])) : values; return new ZodEnum({ type: "enum", entries, ...util_exports.normalizeParams(params) }); } function nativeEnum(entries, params) { return new ZodEnum({ type: "enum", entries, ...util_exports.normalizeParams(params) }); } function literal(value, params) { return new ZodLiteral({ type: "literal", values: Array.isArray(value) ? value : [value], ...util_exports.normalizeParams(params) }); } function file(params) { return _file(ZodFile, params); } function transform(fn) { return new ZodTransform({ type: "transform", transform: fn }); } function optional(innerType) { return new ZodOptional({ type: "optional", innerType }); } function exactOptional(innerType) { return new ZodExactOptional({ type: "optional", innerType }); } function nullable(innerType) { return new ZodNullable({ type: "nullable", innerType }); } function nullish2(innerType) { return optional(nullable(innerType)); } function _default2(innerType, defaultValue) { return new ZodDefault({ type: "default", innerType, get defaultValue() { return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue); } }); } function prefault(innerType, defaultValue) { return new ZodPrefault({ type: "prefault", innerType, get defaultValue() { return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue); } }); } function nonoptional(innerType, params) { return new ZodNonOptional({ type: "nonoptional", innerType, ...util_exports.normalizeParams(params) }); } function success(innerType) { return new ZodSuccess({ type: "success", innerType }); } function _catch2(innerType, catchValue) { return new ZodCatch({ type: "catch", innerType, catchValue: typeof catchValue === "function" ? catchValue : () => catchValue }); } function nan(params) { return _nan(ZodNaN, params); } function pipe(in_, out) { return new ZodPipe({ type: "pipe", in: in_, out // ...util.normalizeParams(params), }); } function codec(in_, out, params) { return new ZodCodec({ type: "pipe", in: in_, out, transform: params.decode, reverseTransform: params.encode }); } function readonly(innerType) { return new ZodReadonly({ type: "readonly", innerType }); } function templateLiteral(parts, params) { return new ZodTemplateLiteral({ type: "template_literal", parts, ...util_exports.normalizeParams(params) }); } function lazy2(getter) { return new ZodLazy({ type: "lazy", getter }); } function promise(innerType) { return new ZodPromise({ type: "promise", innerType }); } function _function(params) { return new ZodFunction({ type: "function", input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()), output: params?.output ?? unknown() }); } function check2(fn) { const ch2 = new $ZodCheck({ check: "custom" // ...util.normalizeParams(params), }); ch2._zod.check = fn; return ch2; } function custom(fn, _params) { return _custom(ZodCustom, fn ?? (() => true), _params); } function refine(fn, _params = {}) { return _refine(ZodCustom, fn, _params); } function superRefine(fn) { return _superRefine(fn); } function _instanceof(cls, params = {}) { const inst = new ZodCustom({ type: "custom", check: "custom", fn: (data) => data instanceof cls, abort: true, ...util_exports.normalizeParams(params) }); inst._zod.bag.Class = cls; inst._zod.check = (payload) => { if (!(payload.value instanceof cls)) { payload.issues.push({ code: "invalid_type", expected: cls.name, input: payload.value, inst, path: [...inst._zod.def.path ?? []] }); } }; return inst; } function json(params) { const jsonSchema = lazy2(() => { return union2([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]); }); return jsonSchema; } function preprocess(fn, schema) { return pipe(transform(fn), schema); } var ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodXor, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodCodec, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodFunction, ZodCustom, describe2, meta2, stringbool; var init_schemas2 = __esm({ "../../node_modules/zod/v4/classic/schemas.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); init_core3(); init_json_schema_processors(); init_to_json_schema(); init_checks3(); init_iso(); init_parse2(); ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { $ZodType.init(inst, def); Object.assign(inst["~standard"], { jsonSchema: { input: createStandardJSONSchemaMethod(inst, "input"), output: createStandardJSONSchemaMethod(inst, "output") } }); inst.toJSONSchema = createToJSONSchemaMethod(inst, {}); inst.def = def; inst.type = def.type; Object.defineProperty(inst, "_def", { value: def }); inst.check = (...checks) => { return inst.clone(util_exports.mergeDefs(def, { checks: [ ...def.checks ?? [], ...checks.map((ch2) => typeof ch2 === "function" ? { _zod: { check: ch2, def: { check: "custom" }, onattach: [] } } : ch2) ] }), { parent: true }); }; inst.with = inst.check; inst.clone = (def2, params) => clone(inst, def2, params); inst.brand = () => inst; inst.register = (reg, meta3) => { reg.add(inst, meta3); return inst; }; inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse }); inst.safeParse = (data, params) => safeParse2(inst, data, params); inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync }); inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params); inst.spa = inst.safeParseAsync; inst.encode = (data, params) => encode4(inst, data, params); inst.decode = (data, params) => decode3(inst, data, params); inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params); inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params); inst.safeEncode = (data, params) => safeEncode2(inst, data, params); inst.safeDecode = (data, params) => safeDecode2(inst, data, params); inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params); inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params); inst.refine = (check3, params) => inst.check(refine(check3, params)); inst.superRefine = (refinement) => inst.check(superRefine(refinement)); inst.overwrite = (fn) => inst.check(_overwrite(fn)); inst.optional = () => optional(inst); inst.exactOptional = () => exactOptional(inst); inst.nullable = () => nullable(inst); inst.nullish = () => optional(nullable(inst)); inst.nonoptional = (params) => nonoptional(inst, params); inst.array = () => array(inst); inst.or = (arg) => union2([inst, arg]); inst.and = (arg) => intersection(inst, arg); inst.transform = (tx) => pipe(inst, transform(tx)); inst.default = (def2) => _default2(inst, def2); inst.prefault = (def2) => prefault(inst, def2); inst.catch = (params) => _catch2(inst, params); inst.pipe = (target) => pipe(inst, target); inst.readonly = () => readonly(inst); inst.describe = (description) => { const cl2 = inst.clone(); globalRegistry.add(cl2, { description }); return cl2; }; Object.defineProperty(inst, "description", { get() { return globalRegistry.get(inst)?.description; }, configurable: true }); inst.meta = (...args) => { if (args.length === 0) { return globalRegistry.get(inst); } const cl2 = inst.clone(); globalRegistry.add(cl2, args[0]); return cl2; }; inst.isOptional = () => inst.safeParse(void 0).success; inst.isNullable = () => inst.safeParse(null).success; inst.apply = (fn) => fn(inst); return inst; }); _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { $ZodString.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params); const bag = inst._zod.bag; inst.format = bag.format ?? null; inst.minLength = bag.minimum ?? null; inst.maxLength = bag.maximum ?? null; inst.regex = (...args) => inst.check(_regex(...args)); inst.includes = (...args) => inst.check(_includes(...args)); inst.startsWith = (...args) => inst.check(_startsWith(...args)); inst.endsWith = (...args) => inst.check(_endsWith(...args)); inst.min = (...args) => inst.check(_minLength(...args)); inst.max = (...args) => inst.check(_maxLength(...args)); inst.length = (...args) => inst.check(_length(...args)); inst.nonempty = (...args) => inst.check(_minLength(1, ...args)); inst.lowercase = (params) => inst.check(_lowercase(params)); inst.uppercase = (params) => inst.check(_uppercase(params)); inst.trim = () => inst.check(_trim()); inst.normalize = (...args) => inst.check(_normalize(...args)); inst.toLowerCase = () => inst.check(_toLowerCase()); inst.toUpperCase = () => inst.check(_toUpperCase()); inst.slugify = () => inst.check(_slugify()); }); ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { $ZodString.init(inst, def); _ZodString.init(inst, def); inst.email = (params) => inst.check(_email(ZodEmail, params)); inst.url = (params) => inst.check(_url(ZodURL, params)); inst.jwt = (params) => inst.check(_jwt(ZodJWT, params)); inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params)); inst.guid = (params) => inst.check(_guid(ZodGUID, params)); inst.uuid = (params) => inst.check(_uuid(ZodUUID, params)); inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params)); inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params)); inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params)); inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params)); inst.guid = (params) => inst.check(_guid(ZodGUID, params)); inst.cuid = (params) => inst.check(_cuid(ZodCUID, params)); inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params)); inst.ulid = (params) => inst.check(_ulid(ZodULID, params)); inst.base64 = (params) => inst.check(_base64(ZodBase64, params)); inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params)); inst.xid = (params) => inst.check(_xid(ZodXID, params)); inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params)); inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params)); inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params)); inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params)); inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params)); inst.e164 = (params) => inst.check(_e164(ZodE164, params)); inst.datetime = (params) => inst.check(datetime2(params)); inst.date = (params) => inst.check(date3(params)); inst.time = (params) => inst.check(time6(params)); inst.duration = (params) => inst.check(duration2(params)); }); __name(string2, "string"); ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => { $ZodStringFormat.init(inst, def); _ZodString.init(inst, def); }); ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => { $ZodEmail.init(inst, def); ZodStringFormat.init(inst, def); }); __name(email2, "email"); ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => { $ZodGUID.init(inst, def); ZodStringFormat.init(inst, def); }); __name(guid2, "guid"); ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => { $ZodUUID.init(inst, def); ZodStringFormat.init(inst, def); }); __name(uuid2, "uuid"); __name(uuidv4, "uuidv4"); __name(uuidv6, "uuidv6"); __name(uuidv7, "uuidv7"); ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => { $ZodURL.init(inst, def); ZodStringFormat.init(inst, def); }); __name(url, "url"); __name(httpUrl, "httpUrl"); ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => { $ZodEmoji.init(inst, def); ZodStringFormat.init(inst, def); }); __name(emoji2, "emoji"); ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { $ZodNanoID.init(inst, def); ZodStringFormat.init(inst, def); }); __name(nanoid2, "nanoid"); ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => { $ZodCUID.init(inst, def); ZodStringFormat.init(inst, def); }); __name(cuid3, "cuid"); ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => { $ZodCUID2.init(inst, def); ZodStringFormat.init(inst, def); }); __name(cuid22, "cuid2"); ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => { $ZodULID.init(inst, def); ZodStringFormat.init(inst, def); }); __name(ulid2, "ulid"); ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => { $ZodXID.init(inst, def); ZodStringFormat.init(inst, def); }); __name(xid2, "xid"); ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => { $ZodKSUID.init(inst, def); ZodStringFormat.init(inst, def); }); __name(ksuid2, "ksuid"); ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => { $ZodIPv4.init(inst, def); ZodStringFormat.init(inst, def); }); __name(ipv42, "ipv4"); ZodMAC = /* @__PURE__ */ $constructor("ZodMAC", (inst, def) => { $ZodMAC.init(inst, def); ZodStringFormat.init(inst, def); }); __name(mac2, "mac"); ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => { $ZodIPv6.init(inst, def); ZodStringFormat.init(inst, def); }); __name(ipv62, "ipv6"); ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => { $ZodCIDRv4.init(inst, def); ZodStringFormat.init(inst, def); }); __name(cidrv42, "cidrv4"); ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => { $ZodCIDRv6.init(inst, def); ZodStringFormat.init(inst, def); }); __name(cidrv62, "cidrv6"); ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => { $ZodBase64.init(inst, def); ZodStringFormat.init(inst, def); }); __name(base642, "base64"); ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => { $ZodBase64URL.init(inst, def); ZodStringFormat.init(inst, def); }); __name(base64url2, "base64url"); ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => { $ZodE164.init(inst, def); ZodStringFormat.init(inst, def); }); __name(e1642, "e164"); ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => { $ZodJWT.init(inst, def); ZodStringFormat.init(inst, def); }); __name(jwt, "jwt"); ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => { $ZodCustomStringFormat.init(inst, def); ZodStringFormat.init(inst, def); }); __name(stringFormat, "stringFormat"); __name(hostname2, "hostname"); __name(hex2, "hex"); __name(hash, "hash"); ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => { $ZodNumber.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params); inst.gt = (value, params) => inst.check(_gt(value, params)); inst.gte = (value, params) => inst.check(_gte(value, params)); inst.min = (value, params) => inst.check(_gte(value, params)); inst.lt = (value, params) => inst.check(_lt(value, params)); inst.lte = (value, params) => inst.check(_lte(value, params)); inst.max = (value, params) => inst.check(_lte(value, params)); inst.int = (params) => inst.check(int(params)); inst.safe = (params) => inst.check(int(params)); inst.positive = (params) => inst.check(_gt(0, params)); inst.nonnegative = (params) => inst.check(_gte(0, params)); inst.negative = (params) => inst.check(_lt(0, params)); inst.nonpositive = (params) => inst.check(_lte(0, params)); inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params)); inst.step = (value, params) => inst.check(_multipleOf(value, params)); inst.finite = () => inst; const bag = inst._zod.bag; inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null; inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null; inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5); inst.isFinite = true; inst.format = bag.format ?? null; }); __name(number2, "number"); ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => { $ZodNumberFormat.init(inst, def); ZodNumber.init(inst, def); }); __name(int, "int"); __name(float32, "float32"); __name(float64, "float64"); __name(int32, "int32"); __name(uint32, "uint32"); ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { $ZodBoolean.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => booleanProcessor(inst, ctx, json2, params); }); __name(boolean2, "boolean"); ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => { $ZodBigInt.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params); inst.gte = (value, params) => inst.check(_gte(value, params)); inst.min = (value, params) => inst.check(_gte(value, params)); inst.gt = (value, params) => inst.check(_gt(value, params)); inst.gte = (value, params) => inst.check(_gte(value, params)); inst.min = (value, params) => inst.check(_gte(value, params)); inst.lt = (value, params) => inst.check(_lt(value, params)); inst.lte = (value, params) => inst.check(_lte(value, params)); inst.max = (value, params) => inst.check(_lte(value, params)); inst.positive = (params) => inst.check(_gt(BigInt(0), params)); inst.negative = (params) => inst.check(_lt(BigInt(0), params)); inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params)); inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params)); inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params)); const bag = inst._zod.bag; inst.minValue = bag.minimum ?? null; inst.maxValue = bag.maximum ?? null; inst.format = bag.format ?? null; }); __name(bigint3, "bigint"); ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => { $ZodBigIntFormat.init(inst, def); ZodBigInt.init(inst, def); }); __name(int64, "int64"); __name(uint64, "uint64"); ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => { $ZodSymbol.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => symbolProcessor(inst, ctx, json2, params); }); __name(symbol, "symbol"); ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => { $ZodUndefined.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => undefinedProcessor(inst, ctx, json2, params); }); __name(_undefined3, "_undefined"); ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => { $ZodNull.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => nullProcessor(inst, ctx, json2, params); }); __name(_null3, "_null"); ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => { $ZodAny.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => anyProcessor(inst, ctx, json2, params); }); __name(any, "any"); ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => { $ZodUnknown.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => unknownProcessor(inst, ctx, json2, params); }); __name(unknown, "unknown"); ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => { $ZodNever.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => neverProcessor(inst, ctx, json2, params); }); __name(never, "never"); ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => { $ZodVoid.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => voidProcessor(inst, ctx, json2, params); }); __name(_void2, "_void"); ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => { $ZodDate.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params); inst.min = (value, params) => inst.check(_gte(value, params)); inst.max = (value, params) => inst.check(_lte(value, params)); const c2 = inst._zod.bag; inst.minDate = c2.minimum ? new Date(c2.minimum) : null; inst.maxDate = c2.maximum ? new Date(c2.maximum) : null; }); __name(date4, "date"); ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { $ZodArray.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params); inst.element = def.element; inst.min = (minLength, params) => inst.check(_minLength(minLength, params)); inst.nonempty = (params) => inst.check(_minLength(1, params)); inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params)); inst.length = (len, params) => inst.check(_length(len, params)); inst.unwrap = () => inst.element; }); __name(array, "array"); __name(keyof, "keyof"); ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => { $ZodObjectJIT.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => objectProcessor(inst, ctx, json2, params); util_exports.defineLazy(inst, "shape", () => { return def.shape; }); inst.keyof = () => _enum2(Object.keys(inst._zod.def.shape)); inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall }); inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() }); inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() }); inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() }); inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 }); inst.extend = (incoming) => { return util_exports.extend(inst, incoming); }; inst.safeExtend = (incoming) => { return util_exports.safeExtend(inst, incoming); }; inst.merge = (other) => util_exports.merge(inst, other); inst.pick = (mask) => util_exports.pick(inst, mask); inst.omit = (mask) => util_exports.omit(inst, mask); inst.partial = (...args) => util_exports.partial(ZodOptional, inst, args[0]); inst.required = (...args) => util_exports.required(ZodNonOptional, inst, args[0]); }); __name(object, "object"); __name(strictObject, "strictObject"); __name(looseObject, "looseObject"); ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => { $ZodUnion.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params); inst.options = def.options; }); __name(union2, "union"); ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => { ZodUnion.init(inst, def); $ZodXor.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params); inst.options = def.options; }); __name(xor, "xor"); ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => { ZodUnion.init(inst, def); $ZodDiscriminatedUnion.init(inst, def); }); __name(discriminatedUnion, "discriminatedUnion"); ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => { $ZodIntersection.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => intersectionProcessor(inst, ctx, json2, params); }); __name(intersection, "intersection"); ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => { $ZodTuple.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => tupleProcessor(inst, ctx, json2, params); inst.rest = (rest) => inst.clone({ ...inst._zod.def, rest }); }); __name(tuple, "tuple"); ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => { $ZodRecord.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => recordProcessor(inst, ctx, json2, params); inst.keyType = def.keyType; inst.valueType = def.valueType; }); __name(record, "record"); __name(partialRecord, "partialRecord"); __name(looseRecord, "looseRecord"); ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => { $ZodMap.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => mapProcessor(inst, ctx, json2, params); inst.keyType = def.keyType; inst.valueType = def.valueType; inst.min = (...args) => inst.check(_minSize(...args)); inst.nonempty = (params) => inst.check(_minSize(1, params)); inst.max = (...args) => inst.check(_maxSize(...args)); inst.size = (...args) => inst.check(_size(...args)); }); __name(map, "map"); ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => { $ZodSet.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => setProcessor(inst, ctx, json2, params); inst.min = (...args) => inst.check(_minSize(...args)); inst.nonempty = (params) => inst.check(_minSize(1, params)); inst.max = (...args) => inst.check(_maxSize(...args)); inst.size = (...args) => inst.check(_size(...args)); }); __name(set, "set"); ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { $ZodEnum.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params); inst.enum = def.entries; inst.options = Object.values(def.entries); const keys = new Set(Object.keys(def.entries)); inst.extract = (values, params) => { const newEntries = {}; for (const value of values) { if (keys.has(value)) { newEntries[value] = def.entries[value]; } else throw new Error(`Key ${value} not found in enum`); } return new ZodEnum({ ...def, checks: [], ...util_exports.normalizeParams(params), entries: newEntries }); }; inst.exclude = (values, params) => { const newEntries = { ...def.entries }; for (const value of values) { if (keys.has(value)) { delete newEntries[value]; } else throw new Error(`Key ${value} not found in enum`); } return new ZodEnum({ ...def, checks: [], ...util_exports.normalizeParams(params), entries: newEntries }); }; }); __name(_enum2, "_enum"); __name(nativeEnum, "nativeEnum"); ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => { $ZodLiteral.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => literalProcessor(inst, ctx, json2, params); inst.values = new Set(def.values); Object.defineProperty(inst, "value", { get() { if (def.values.length > 1) { throw new Error("This schema contains multiple valid literal values. Use `.values` instead."); } return def.values[0]; } }); }); __name(literal, "literal"); ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => { $ZodFile.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => fileProcessor(inst, ctx, json2, params); inst.min = (size, params) => inst.check(_minSize(size, params)); inst.max = (size, params) => inst.check(_maxSize(size, params)); inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params)); }); __name(file, "file"); ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { $ZodTransform.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => transformProcessor(inst, ctx, json2, params); inst._zod.parse = (payload, _ctx) => { if (_ctx.direction === "backward") { throw new $ZodEncodeError(inst.constructor.name); } payload.addIssue = (issue2) => { if (typeof issue2 === "string") { payload.issues.push(util_exports.issue(issue2, payload.value, def)); } else { const _issue = issue2; if (_issue.fatal) _issue.continue = false; _issue.code ?? (_issue.code = "custom"); _issue.input ?? (_issue.input = payload.value); _issue.inst ?? (_issue.inst = inst); payload.issues.push(util_exports.issue(_issue)); } }; const output = def.transform(payload.value, payload); if (output instanceof Promise) { return output.then((output2) => { payload.value = output2; return payload; }); } payload.value = output; return payload; }; }); __name(transform, "transform"); ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => { $ZodOptional.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(optional, "optional"); ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => { $ZodExactOptional.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(exactOptional, "exactOptional"); ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => { $ZodNullable.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => nullableProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(nullable, "nullable"); __name(nullish2, "nullish"); ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => { $ZodDefault.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => defaultProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; inst.removeDefault = inst.unwrap; }); __name(_default2, "_default"); ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => { $ZodPrefault.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => prefaultProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(prefault, "prefault"); ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => { $ZodNonOptional.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => nonoptionalProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(nonoptional, "nonoptional"); ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => { $ZodSuccess.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => successProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(success, "success"); ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => { $ZodCatch.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => catchProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; inst.removeCatch = inst.unwrap; }); __name(_catch2, "_catch"); ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => { $ZodNaN.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => nanProcessor(inst, ctx, json2, params); }); __name(nan, "nan"); ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => { $ZodPipe.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => pipeProcessor(inst, ctx, json2, params); inst.in = def.in; inst.out = def.out; }); __name(pipe, "pipe"); ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => { ZodPipe.init(inst, def); $ZodCodec.init(inst, def); }); __name(codec, "codec"); ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => { $ZodReadonly.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => readonlyProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(readonly, "readonly"); ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => { $ZodTemplateLiteral.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => templateLiteralProcessor(inst, ctx, json2, params); }); __name(templateLiteral, "templateLiteral"); ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => { $ZodLazy.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => lazyProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.getter(); }); __name(lazy2, "lazy"); ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => { $ZodPromise.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => promiseProcessor(inst, ctx, json2, params); inst.unwrap = () => inst._zod.def.innerType; }); __name(promise, "promise"); ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => { $ZodFunction.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => functionProcessor(inst, ctx, json2, params); }); __name(_function, "_function"); ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => { $ZodCustom.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params); }); __name(check2, "check"); __name(custom, "custom"); __name(refine, "refine"); __name(superRefine, "superRefine"); describe2 = describe; meta2 = meta; __name(_instanceof, "_instanceof"); stringbool = /* @__PURE__ */ __name((...args) => _stringbool({ Codec: ZodCodec, Boolean: ZodBoolean, String: ZodString }, ...args), "stringbool"); __name(json, "json"); __name(preprocess, "preprocess"); } }); // ../../node_modules/zod/v4/classic/compat.js function setErrorMap(map2) { config2({ customError: map2 }); } function getErrorMap() { return config2().customError; } var ZodIssueCode, ZodFirstPartyTypeKind; var init_compat = __esm({ "../../node_modules/zod/v4/classic/compat.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); init_core3(); ZodIssueCode = { invalid_type: "invalid_type", too_big: "too_big", too_small: "too_small", invalid_format: "invalid_format", not_multiple_of: "not_multiple_of", unrecognized_keys: "unrecognized_keys", invalid_union: "invalid_union", invalid_key: "invalid_key", invalid_element: "invalid_element", invalid_value: "invalid_value", custom: "custom" }; __name(setErrorMap, "setErrorMap"); __name(getErrorMap, "getErrorMap"); (function(ZodFirstPartyTypeKind2) { })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); } }); // ../../node_modules/zod/v4/classic/from-json-schema.js function detectVersion(schema, defaultTarget) { const $schema = schema.$schema; if ($schema === "https://json-schema.org/draft/2020-12/schema") { return "draft-2020-12"; } if ($schema === "http://json-schema.org/draft-07/schema#") { return "draft-7"; } if ($schema === "http://json-schema.org/draft-04/schema#") { return "draft-4"; } return defaultTarget ?? "draft-2020-12"; } function resolveRef(ref, ctx) { if (!ref.startsWith("#")) { throw new Error("External $ref is not supported, only local refs (#/...) are allowed"); } const path = ref.slice(1).split("/").filter(Boolean); if (path.length === 0) { return ctx.rootSchema; } const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions"; if (path[0] === defsKey) { const key = path[1]; if (!key || !ctx.defs[key]) { throw new Error(`Reference not found: ${ref}`); } return ctx.defs[key]; } throw new Error(`Reference not found: ${ref}`); } function convertBaseSchema(schema, ctx) { if (schema.not !== void 0) { if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) { return z2.never(); } throw new Error("not is not supported in Zod (except { not: {} } for never)"); } if (schema.unevaluatedItems !== void 0) { throw new Error("unevaluatedItems is not supported"); } if (schema.unevaluatedProperties !== void 0) { throw new Error("unevaluatedProperties is not supported"); } if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) { throw new Error("Conditional schemas (if/then/else) are not supported"); } if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) { throw new Error("dependentSchemas and dependentRequired are not supported"); } if (schema.$ref) { const refPath = schema.$ref; if (ctx.refs.has(refPath)) { return ctx.refs.get(refPath); } if (ctx.processing.has(refPath)) { return z2.lazy(() => { if (!ctx.refs.has(refPath)) { throw new Error(`Circular reference not resolved: ${refPath}`); } return ctx.refs.get(refPath); }); } ctx.processing.add(refPath); const resolved = resolveRef(refPath, ctx); const zodSchema2 = convertSchema(resolved, ctx); ctx.refs.set(refPath, zodSchema2); ctx.processing.delete(refPath); return zodSchema2; } if (schema.enum !== void 0) { const enumValues = schema.enum; if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) { return z2.null(); } if (enumValues.length === 0) { return z2.never(); } if (enumValues.length === 1) { return z2.literal(enumValues[0]); } if (enumValues.every((v3) => typeof v3 === "string")) { return z2.enum(enumValues); } const literalSchemas = enumValues.map((v3) => z2.literal(v3)); if (literalSchemas.length < 2) { return literalSchemas[0]; } return z2.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]); } if (schema.const !== void 0) { return z2.literal(schema.const); } const type = schema.type; if (Array.isArray(type)) { const typeSchemas = type.map((t9) => { const typeSchema = { ...schema, type: t9 }; return convertBaseSchema(typeSchema, ctx); }); if (typeSchemas.length === 0) { return z2.never(); } if (typeSchemas.length === 1) { return typeSchemas[0]; } return z2.union(typeSchemas); } if (!type) { return z2.any(); } let zodSchema; switch (type) { case "string": { let stringSchema = z2.string(); if (schema.format) { const format2 = schema.format; if (format2 === "email") { stringSchema = stringSchema.check(z2.email()); } else if (format2 === "uri" || format2 === "uri-reference") { stringSchema = stringSchema.check(z2.url()); } else if (format2 === "uuid" || format2 === "guid") { stringSchema = stringSchema.check(z2.uuid()); } else if (format2 === "date-time") { stringSchema = stringSchema.check(z2.iso.datetime()); } else if (format2 === "date") { stringSchema = stringSchema.check(z2.iso.date()); } else if (format2 === "time") { stringSchema = stringSchema.check(z2.iso.time()); } else if (format2 === "duration") { stringSchema = stringSchema.check(z2.iso.duration()); } else if (format2 === "ipv4") { stringSchema = stringSchema.check(z2.ipv4()); } else if (format2 === "ipv6") { stringSchema = stringSchema.check(z2.ipv6()); } else if (format2 === "mac") { stringSchema = stringSchema.check(z2.mac()); } else if (format2 === "cidr") { stringSchema = stringSchema.check(z2.cidrv4()); } else if (format2 === "cidr-v6") { stringSchema = stringSchema.check(z2.cidrv6()); } else if (format2 === "base64") { stringSchema = stringSchema.check(z2.base64()); } else if (format2 === "base64url") { stringSchema = stringSchema.check(z2.base64url()); } else if (format2 === "e164") { stringSchema = stringSchema.check(z2.e164()); } else if (format2 === "jwt") { stringSchema = stringSchema.check(z2.jwt()); } else if (format2 === "emoji") { stringSchema = stringSchema.check(z2.emoji()); } else if (format2 === "nanoid") { stringSchema = stringSchema.check(z2.nanoid()); } else if (format2 === "cuid") { stringSchema = stringSchema.check(z2.cuid()); } else if (format2 === "cuid2") { stringSchema = stringSchema.check(z2.cuid2()); } else if (format2 === "ulid") { stringSchema = stringSchema.check(z2.ulid()); } else if (format2 === "xid") { stringSchema = stringSchema.check(z2.xid()); } else if (format2 === "ksuid") { stringSchema = stringSchema.check(z2.ksuid()); } } if (typeof schema.minLength === "number") { stringSchema = stringSchema.min(schema.minLength); } if (typeof schema.maxLength === "number") { stringSchema = stringSchema.max(schema.maxLength); } if (schema.pattern) { stringSchema = stringSchema.regex(new RegExp(schema.pattern)); } zodSchema = stringSchema; break; } case "number": case "integer": { let numberSchema = type === "integer" ? z2.number().int() : z2.number(); if (typeof schema.minimum === "number") { numberSchema = numberSchema.min(schema.minimum); } if (typeof schema.maximum === "number") { numberSchema = numberSchema.max(schema.maximum); } if (typeof schema.exclusiveMinimum === "number") { numberSchema = numberSchema.gt(schema.exclusiveMinimum); } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") { numberSchema = numberSchema.gt(schema.minimum); } if (typeof schema.exclusiveMaximum === "number") { numberSchema = numberSchema.lt(schema.exclusiveMaximum); } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") { numberSchema = numberSchema.lt(schema.maximum); } if (typeof schema.multipleOf === "number") { numberSchema = numberSchema.multipleOf(schema.multipleOf); } zodSchema = numberSchema; break; } case "boolean": { zodSchema = z2.boolean(); break; } case "null": { zodSchema = z2.null(); break; } case "object": { const shape = {}; const properties = schema.properties || {}; const requiredSet = new Set(schema.required || []); for (const [key, propSchema] of Object.entries(properties)) { const propZodSchema = convertSchema(propSchema, ctx); shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional(); } if (schema.propertyNames) { const keySchema = convertSchema(schema.propertyNames, ctx); const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z2.any(); if (Object.keys(shape).length === 0) { zodSchema = z2.record(keySchema, valueSchema); break; } const objectSchema2 = z2.object(shape).passthrough(); const recordSchema = z2.looseRecord(keySchema, valueSchema); zodSchema = z2.intersection(objectSchema2, recordSchema); break; } if (schema.patternProperties) { const patternProps = schema.patternProperties; const patternKeys = Object.keys(patternProps); const looseRecords = []; for (const pattern of patternKeys) { const patternValue = convertSchema(patternProps[pattern], ctx); const keySchema = z2.string().regex(new RegExp(pattern)); looseRecords.push(z2.looseRecord(keySchema, patternValue)); } const schemasToIntersect = []; if (Object.keys(shape).length > 0) { schemasToIntersect.push(z2.object(shape).passthrough()); } schemasToIntersect.push(...looseRecords); if (schemasToIntersect.length === 0) { zodSchema = z2.object({}).passthrough(); } else if (schemasToIntersect.length === 1) { zodSchema = schemasToIntersect[0]; } else { let result = z2.intersection(schemasToIntersect[0], schemasToIntersect[1]); for (let i2 = 2; i2 < schemasToIntersect.length; i2++) { result = z2.intersection(result, schemasToIntersect[i2]); } zodSchema = result; } break; } const objectSchema = z2.object(shape); if (schema.additionalProperties === false) { zodSchema = objectSchema.strict(); } else if (typeof schema.additionalProperties === "object") { zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx)); } else { zodSchema = objectSchema.passthrough(); } break; } case "array": { const prefixItems = schema.prefixItems; const items = schema.items; if (prefixItems && Array.isArray(prefixItems)) { const tupleItems = prefixItems.map((item) => convertSchema(item, ctx)); const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0; if (rest) { zodSchema = z2.tuple(tupleItems).rest(rest); } else { zodSchema = z2.tuple(tupleItems); } if (typeof schema.minItems === "number") { zodSchema = zodSchema.check(z2.minLength(schema.minItems)); } if (typeof schema.maxItems === "number") { zodSchema = zodSchema.check(z2.maxLength(schema.maxItems)); } } else if (Array.isArray(items)) { const tupleItems = items.map((item) => convertSchema(item, ctx)); const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0; if (rest) { zodSchema = z2.tuple(tupleItems).rest(rest); } else { zodSchema = z2.tuple(tupleItems); } if (typeof schema.minItems === "number") { zodSchema = zodSchema.check(z2.minLength(schema.minItems)); } if (typeof schema.maxItems === "number") { zodSchema = zodSchema.check(z2.maxLength(schema.maxItems)); } } else if (items !== void 0) { const element = convertSchema(items, ctx); let arraySchema = z2.array(element); if (typeof schema.minItems === "number") { arraySchema = arraySchema.min(schema.minItems); } if (typeof schema.maxItems === "number") { arraySchema = arraySchema.max(schema.maxItems); } zodSchema = arraySchema; } else { zodSchema = z2.array(z2.any()); } break; } default: throw new Error(`Unsupported type: ${type}`); } if (schema.description) { zodSchema = zodSchema.describe(schema.description); } if (schema.default !== void 0) { zodSchema = zodSchema.default(schema.default); } return zodSchema; } function convertSchema(schema, ctx) { if (typeof schema === "boolean") { return schema ? z2.any() : z2.never(); } let baseSchema = convertBaseSchema(schema, ctx); const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0; if (schema.anyOf && Array.isArray(schema.anyOf)) { const options = schema.anyOf.map((s2) => convertSchema(s2, ctx)); const anyOfUnion = z2.union(options); baseSchema = hasExplicitType ? z2.intersection(baseSchema, anyOfUnion) : anyOfUnion; } if (schema.oneOf && Array.isArray(schema.oneOf)) { const options = schema.oneOf.map((s2) => convertSchema(s2, ctx)); const oneOfUnion = z2.xor(options); baseSchema = hasExplicitType ? z2.intersection(baseSchema, oneOfUnion) : oneOfUnion; } if (schema.allOf && Array.isArray(schema.allOf)) { if (schema.allOf.length === 0) { baseSchema = hasExplicitType ? baseSchema : z2.any(); } else { let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx); const startIdx = hasExplicitType ? 0 : 1; for (let i2 = startIdx; i2 < schema.allOf.length; i2++) { result = z2.intersection(result, convertSchema(schema.allOf[i2], ctx)); } baseSchema = result; } } if (schema.nullable === true && ctx.version === "openapi-3.0") { baseSchema = z2.nullable(baseSchema); } if (schema.readOnly === true) { baseSchema = z2.readonly(baseSchema); } const extraMeta = {}; const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"]; for (const key of coreMetadataKeys) { if (key in schema) { extraMeta[key] = schema[key]; } } const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"]; for (const key of contentMetadataKeys) { if (key in schema) { extraMeta[key] = schema[key]; } } for (const key of Object.keys(schema)) { if (!RECOGNIZED_KEYS.has(key)) { extraMeta[key] = schema[key]; } } if (Object.keys(extraMeta).length > 0) { ctx.registry.add(baseSchema, extraMeta); } return baseSchema; } function fromJSONSchema(schema, params) { if (typeof schema === "boolean") { return schema ? z2.any() : z2.never(); } const version4 = detectVersion(schema, params?.defaultTarget); const defs = schema.$defs || schema.definitions || {}; const ctx = { version: version4, defs, refs: /* @__PURE__ */ new Map(), processing: /* @__PURE__ */ new Set(), rootSchema: schema, registry: params?.registry ?? globalRegistry }; return convertSchema(schema, ctx); } var z2, RECOGNIZED_KEYS; var init_from_json_schema = __esm({ "../../node_modules/zod/v4/classic/from-json-schema.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_registries(); init_checks3(); init_iso(); init_schemas2(); z2 = { ...schemas_exports2, ...checks_exports2, iso: iso_exports }; RECOGNIZED_KEYS = /* @__PURE__ */ new Set([ // Schema identification "$schema", "$ref", "$defs", "definitions", // Core schema keywords "$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor", // Type "type", "enum", "const", // Composition "anyOf", "oneOf", "allOf", "not", // Object "properties", "required", "additionalProperties", "patternProperties", "propertyNames", "minProperties", "maxProperties", // Array "items", "prefixItems", "additionalItems", "minItems", "maxItems", "uniqueItems", "contains", "minContains", "maxContains", // String "minLength", "maxLength", "pattern", "format", // Number "minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf", // Already handled metadata "description", "default", // Content "contentEncoding", "contentMediaType", "contentSchema", // Unsupported (error-throwing) "unevaluatedItems", "unevaluatedProperties", "if", "then", "else", "dependentSchemas", "dependentRequired", // OpenAPI "nullable", "readOnly" ]); __name(detectVersion, "detectVersion"); __name(resolveRef, "resolveRef"); __name(convertBaseSchema, "convertBaseSchema"); __name(convertSchema, "convertSchema"); __name(fromJSONSchema, "fromJSONSchema"); } }); // ../../node_modules/zod/v4/classic/coerce.js var coerce_exports = {}; __export(coerce_exports, { bigint: () => bigint4, boolean: () => boolean3, date: () => date5, number: () => number3, string: () => string3 }); function string3(params) { return _coercedString(ZodString, params); } function number3(params) { return _coercedNumber(ZodNumber, params); } function boolean3(params) { return _coercedBoolean(ZodBoolean, params); } function bigint4(params) { return _coercedBigint(ZodBigInt, params); } function date5(params) { return _coercedDate(ZodDate, params); } var init_coerce = __esm({ "../../node_modules/zod/v4/classic/coerce.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); init_schemas2(); __name(string3, "string"); __name(number3, "number"); __name(boolean3, "boolean"); __name(bigint4, "bigint"); __name(date5, "date"); } }); // ../../node_modules/zod/v4/classic/external.js var external_exports = {}; __export(external_exports, { $brand: () => $brand, $input: () => $input, $output: () => $output, NEVER: () => NEVER, TimePrecision: () => TimePrecision, ZodAny: () => ZodAny, ZodArray: () => ZodArray, ZodBase64: () => ZodBase64, ZodBase64URL: () => ZodBase64URL, ZodBigInt: () => ZodBigInt, ZodBigIntFormat: () => ZodBigIntFormat, ZodBoolean: () => ZodBoolean, ZodCIDRv4: () => ZodCIDRv4, ZodCIDRv6: () => ZodCIDRv6, ZodCUID: () => ZodCUID, ZodCUID2: () => ZodCUID2, ZodCatch: () => ZodCatch, ZodCodec: () => ZodCodec, ZodCustom: () => ZodCustom, ZodCustomStringFormat: () => ZodCustomStringFormat, ZodDate: () => ZodDate, ZodDefault: () => ZodDefault, ZodDiscriminatedUnion: () => ZodDiscriminatedUnion, ZodE164: () => ZodE164, ZodEmail: () => ZodEmail, ZodEmoji: () => ZodEmoji, ZodEnum: () => ZodEnum, ZodError: () => ZodError, ZodExactOptional: () => ZodExactOptional, ZodFile: () => ZodFile, ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind, ZodFunction: () => ZodFunction, ZodGUID: () => ZodGUID, ZodIPv4: () => ZodIPv4, ZodIPv6: () => ZodIPv6, ZodISODate: () => ZodISODate, ZodISODateTime: () => ZodISODateTime, ZodISODuration: () => ZodISODuration, ZodISOTime: () => ZodISOTime, ZodIntersection: () => ZodIntersection, ZodIssueCode: () => ZodIssueCode, ZodJWT: () => ZodJWT, ZodKSUID: () => ZodKSUID, ZodLazy: () => ZodLazy, ZodLiteral: () => ZodLiteral, ZodMAC: () => ZodMAC, ZodMap: () => ZodMap, ZodNaN: () => ZodNaN, ZodNanoID: () => ZodNanoID, ZodNever: () => ZodNever, ZodNonOptional: () => ZodNonOptional, ZodNull: () => ZodNull, ZodNullable: () => ZodNullable, ZodNumber: () => ZodNumber, ZodNumberFormat: () => ZodNumberFormat, ZodObject: () => ZodObject, ZodOptional: () => ZodOptional, ZodPipe: () => ZodPipe, ZodPrefault: () => ZodPrefault, ZodPromise: () => ZodPromise, ZodReadonly: () => ZodReadonly, ZodRealError: () => ZodRealError, ZodRecord: () => ZodRecord, ZodSet: () => ZodSet, ZodString: () => ZodString, ZodStringFormat: () => ZodStringFormat, ZodSuccess: () => ZodSuccess, ZodSymbol: () => ZodSymbol, ZodTemplateLiteral: () => ZodTemplateLiteral, ZodTransform: () => ZodTransform, ZodTuple: () => ZodTuple, ZodType: () => ZodType, ZodULID: () => ZodULID, ZodURL: () => ZodURL, ZodUUID: () => ZodUUID, ZodUndefined: () => ZodUndefined, ZodUnion: () => ZodUnion, ZodUnknown: () => ZodUnknown, ZodVoid: () => ZodVoid, ZodXID: () => ZodXID, ZodXor: () => ZodXor, _ZodString: () => _ZodString, _default: () => _default2, _function: () => _function, any: () => any, array: () => array, base64: () => base642, base64url: () => base64url2, bigint: () => bigint3, boolean: () => boolean2, catch: () => _catch2, check: () => check2, cidrv4: () => cidrv42, cidrv6: () => cidrv62, clone: () => clone, codec: () => codec, coerce: () => coerce_exports, config: () => config2, core: () => core_exports2, cuid: () => cuid3, cuid2: () => cuid22, custom: () => custom, date: () => date4, decode: () => decode3, decodeAsync: () => decodeAsync2, describe: () => describe2, discriminatedUnion: () => discriminatedUnion, e164: () => e1642, email: () => email2, emoji: () => emoji2, encode: () => encode4, encodeAsync: () => encodeAsync2, endsWith: () => _endsWith, enum: () => _enum2, exactOptional: () => exactOptional, file: () => file, flattenError: () => flattenError, float32: () => float32, float64: () => float64, formatError: () => formatError, fromJSONSchema: () => fromJSONSchema, function: () => _function, getErrorMap: () => getErrorMap, globalRegistry: () => globalRegistry, gt: () => _gt, gte: () => _gte, guid: () => guid2, hash: () => hash, hex: () => hex2, hostname: () => hostname2, httpUrl: () => httpUrl, includes: () => _includes, instanceof: () => _instanceof, int: () => int, int32: () => int32, int64: () => int64, intersection: () => intersection, ipv4: () => ipv42, ipv6: () => ipv62, iso: () => iso_exports, json: () => json, jwt: () => jwt, keyof: () => keyof, ksuid: () => ksuid2, lazy: () => lazy2, length: () => _length, literal: () => literal, locales: () => locales_exports, looseObject: () => looseObject, looseRecord: () => looseRecord, lowercase: () => _lowercase, lt: () => _lt, lte: () => _lte, mac: () => mac2, map: () => map, maxLength: () => _maxLength, maxSize: () => _maxSize, meta: () => meta2, mime: () => _mime, minLength: () => _minLength, minSize: () => _minSize, multipleOf: () => _multipleOf, nan: () => nan, nanoid: () => nanoid2, nativeEnum: () => nativeEnum, negative: () => _negative, never: () => never, nonnegative: () => _nonnegative, nonoptional: () => nonoptional, nonpositive: () => _nonpositive, normalize: () => _normalize, null: () => _null3, nullable: () => nullable, nullish: () => nullish2, number: () => number2, object: () => object, optional: () => optional, overwrite: () => _overwrite, parse: () => parse2, parseAsync: () => parseAsync2, partialRecord: () => partialRecord, pipe: () => pipe, positive: () => _positive, prefault: () => prefault, preprocess: () => preprocess, prettifyError: () => prettifyError, promise: () => promise, property: () => _property, readonly: () => readonly, record: () => record, refine: () => refine, regex: () => _regex, regexes: () => regexes_exports, registry: () => registry, safeDecode: () => safeDecode2, safeDecodeAsync: () => safeDecodeAsync2, safeEncode: () => safeEncode2, safeEncodeAsync: () => safeEncodeAsync2, safeParse: () => safeParse2, safeParseAsync: () => safeParseAsync2, set: () => set, setErrorMap: () => setErrorMap, size: () => _size, slugify: () => _slugify, startsWith: () => _startsWith, strictObject: () => strictObject, string: () => string2, stringFormat: () => stringFormat, stringbool: () => stringbool, success: () => success, superRefine: () => superRefine, symbol: () => symbol, templateLiteral: () => templateLiteral, toJSONSchema: () => toJSONSchema, toLowerCase: () => _toLowerCase, toUpperCase: () => _toUpperCase, transform: () => transform, treeifyError: () => treeifyError, trim: () => _trim, tuple: () => tuple, uint32: () => uint32, uint64: () => uint64, ulid: () => ulid2, undefined: () => _undefined3, union: () => union2, unknown: () => unknown, uppercase: () => _uppercase, url: () => url, util: () => util_exports, uuid: () => uuid2, uuidv4: () => uuidv4, uuidv6: () => uuidv6, uuidv7: () => uuidv7, void: () => _void2, xid: () => xid2, xor: () => xor }); var init_external = __esm({ "../../node_modules/zod/v4/classic/external.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_core3(); init_schemas2(); init_checks3(); init_errors5(); init_parse2(); init_compat(); init_core3(); init_en(); init_core3(); init_json_schema_processors(); init_from_json_schema(); init_locales(); init_iso(); init_iso(); init_coerce(); config2(en_default()); } }); // ../../node_modules/zod/index.js var init_zod = __esm({ "../../node_modules/zod/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_external(); init_external(); } }); // src/trpc/apis/admin-apis/apis/complaint.ts var complaintRouter; var init_complaint3 = __esm({ "src/trpc/apis/admin-apis/apis/complaint.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_s3_client(); init_dbService(); complaintRouter = router2({ getAll: protectedProcedure.input(external_exports.object({ cursor: external_exports.number().optional(), limit: external_exports.number().default(20) })).query(async ({ input }) => { const { cursor, limit } = input; const { complaints: complaintsData, hasMore } = await getComplaints(cursor, limit); const complaintsToReturn = hasMore ? complaintsData.slice(0, limit) : complaintsData; const complaintsWithSignedImages = await Promise.all( complaintsToReturn.map(async (c2) => { const signedImages = c2.images ? await generateSignedUrlsFromS3Urls(c2.images) : []; return { id: c2.id, text: c2.complaintBody, userId: c2.userId, userName: c2.userName, userMobile: c2.userMobile, orderId: c2.orderId, status: c2.isResolved ? "resolved" : "pending", createdAt: c2.createdAt, images: signedImages }; }) ); return { complaints: complaintsWithSignedImages, nextCursor: hasMore ? complaintsToReturn[complaintsToReturn.length - 1].id : void 0 }; }), resolve: protectedProcedure.input(external_exports.object({ id: external_exports.string(), response: external_exports.string().optional() })).mutation(async ({ input }) => { await resolveComplaint(parseInt(input.id), input.response); return { message: "Complaint resolved successfully" }; }) }); } }); // ../../node_modules/dayjs/dayjs.min.js var require_dayjs_min = __commonJS({ "../../node_modules/dayjs/dayjs.min.js"(exports, module) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); !function(t9, e2) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e2() : "function" == typeof define && define.amd ? define(e2) : (t9 = "undefined" != typeof globalThis ? globalThis : t9 || self).dayjs = e2(); }(exports, function() { "use strict"; var t9 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u5 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t10) { var e3 = ["th", "st", "nd", "rd"], n3 = t10 % 100; return "[" + t10 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]"; } }, m2 = /* @__PURE__ */ __name(function(t10, e3, n3) { var r3 = String(t10); return !r3 || r3.length >= e3 ? t10 : "" + Array(e3 + 1 - r3.length).join(n3) + t10; }, "m"), v3 = { s: m2, z: function(t10) { var e3 = -t10.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60; return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0"); }, m: /* @__PURE__ */ __name(function t10(e3, n3) { if (e3.date() < n3.date()) return -t10(n3, e3); var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u6 = e3.clone().add(r3 + (s3 ? -1 : 1), c2); return +(-(r3 + (n3 - i3) / (s3 ? i3 - u6 : u6 - i3)) || 0); }, "t"), a: function(t10) { return t10 < 0 ? Math.ceil(t10) || 0 : Math.floor(t10); }, p: function(t10) { return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u5, m: s2, s: i2, ms: r2, Q: f2 }[t10] || String(t10 || "").toLowerCase().replace(/s$/, ""); }, u: function(t10) { return void 0 === t10; } }, g2 = "en", D3 = {}; D3[g2] = M2; var p2 = "$isDayjsObject", S2 = /* @__PURE__ */ __name(function(t10) { return t10 instanceof _ || !(!t10 || !t10[p2]); }, "S"), w2 = /* @__PURE__ */ __name(function t10(e3, n3, r3) { var i3; if (!e3) return g2; if ("string" == typeof e3) { var s3 = e3.toLowerCase(); D3[s3] && (i3 = s3), n3 && (D3[s3] = n3, i3 = s3); var u6 = e3.split("-"); if (!i3 && u6.length > 1) return t10(u6[0]); } else { var a3 = e3.name; D3[a3] = e3, i3 = a3; } return !r3 && i3 && (g2 = i3), i3 || !r3 && g2; }, "t"), O2 = /* @__PURE__ */ __name(function(t10, e3) { if (S2(t10)) return t10.clone(); var n3 = "object" == typeof e3 ? e3 : {}; return n3.date = t10, n3.args = arguments, new _(n3); }, "O"), b2 = v3; b2.l = w2, b2.i = S2, b2.w = function(t10, e3) { return O2(t10, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset }); }; var _ = function() { function M3(t10) { this.$L = w2(t10.locale, null, true), this.parse(t10), this.$x = this.$x || t10.x || {}, this[p2] = true; } __name(M3, "M"); var m3 = M3.prototype; return m3.parse = function(t10) { this.$d = function(t11) { var e3 = t11.date, n3 = t11.utc; if (null === e3) return /* @__PURE__ */ new Date(NaN); if (b2.u(e3)) return /* @__PURE__ */ new Date(); if (e3 instanceof Date) return new Date(e3); if ("string" == typeof e3 && !/Z$/i.test(e3)) { var r3 = e3.match($); if (r3) { var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3); return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3); } } return new Date(e3); }(t10), this.init(); }, m3.init = function() { var t10 = this.$d; this.$y = t10.getFullYear(), this.$M = t10.getMonth(), this.$D = t10.getDate(), this.$W = t10.getDay(), this.$H = t10.getHours(), this.$m = t10.getMinutes(), this.$s = t10.getSeconds(), this.$ms = t10.getMilliseconds(); }, m3.$utils = function() { return b2; }, m3.isValid = function() { return !(this.$d.toString() === l2); }, m3.isSame = function(t10, e3) { var n3 = O2(t10); return this.startOf(e3) <= n3 && n3 <= this.endOf(e3); }, m3.isAfter = function(t10, e3) { return O2(t10) < this.startOf(e3); }, m3.isBefore = function(t10, e3) { return this.endOf(e3) < O2(t10); }, m3.$g = function(t10, e3, n3) { return b2.u(t10) ? this[e3] : this.set(n3, t10); }, m3.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m3.valueOf = function() { return this.$d.getTime(); }, m3.startOf = function(t10, e3) { var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t10), l3 = /* @__PURE__ */ __name(function(t11, e4) { var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t11) : new Date(n3.$y, e4, t11), n3); return r3 ? i3 : i3.endOf(a2); }, "l"), $2 = /* @__PURE__ */ __name(function(t11, e4) { return b2.w(n3.toDate()[t11].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3); }, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v5 = "set" + (this.$u ? "UTC" : ""); switch (f3) { case h2: return r3 ? l3(1, 0) : l3(31, 11); case c2: return r3 ? l3(1, M4) : l3(0, M4 + 1); case o2: var g3 = this.$locale().weekStart || 0, D4 = (y3 < g3 ? y3 + 7 : y3) - g3; return l3(r3 ? m4 - D4 : m4 + (6 - D4), M4); case a2: case d2: return $2(v5 + "Hours", 0); case u5: return $2(v5 + "Minutes", 1); case s2: return $2(v5 + "Seconds", 2); case i2: return $2(v5 + "Milliseconds", 3); default: return this.clone(); } }, m3.endOf = function(t10) { return this.startOf(t10, false); }, m3.$set = function(t10, e3) { var n3, o3 = b2.p(t10), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u5] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $2 = o3 === a2 ? this.$D + (e3 - this.$W) : e3; if (o3 === c2 || o3 === h2) { var y3 = this.clone().set(d2, 1); y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d; } else l3 && this.$d[l3]($2); return this.init(), this; }, m3.set = function(t10, e3) { return this.clone().$set(t10, e3); }, m3.get = function(t10) { return this[b2.p(t10)](); }, m3.add = function(r3, f3) { var d3, l3 = this; r3 = Number(r3); var $2 = b2.p(f3), y3 = /* @__PURE__ */ __name(function(t10) { var e3 = O2(l3); return b2.w(e3.date(e3.date() + Math.round(t10 * r3)), l3); }, "y"); if ($2 === c2) return this.set(c2, this.$M + r3); if ($2 === h2) return this.set(h2, this.$y + r3); if ($2 === a2) return y3(1); if ($2 === o2) return y3(7); var M4 = (d3 = {}, d3[s2] = e2, d3[u5] = n2, d3[i2] = t9, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4; return b2.w(m4, this); }, m3.subtract = function(t10, e3) { return this.add(-1 * t10, e3); }, m3.format = function(t10) { var e3 = this, n3 = this.$locale(); if (!this.isValid()) return n3.invalidDate || l2; var r3 = t10 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u6 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t11, n4, i4, s4) { return t11 && (t11[n4] || t11(e3, r3)) || i4[n4].slice(0, s4); }, "h"), d3 = /* @__PURE__ */ __name(function(t11) { return b2.s(s3 % 12 || 12, t11, "0"); }, "d"), $2 = f3 || function(t11, e4, n4) { var r4 = t11 < 12 ? "AM" : "PM"; return n4 ? r4.toLowerCase() : r4; }; return r3.replace(y2, function(t11, r4) { return r4 || function(t12) { switch (t12) { case "YY": return String(e3.$y).slice(-2); case "YYYY": return b2.s(e3.$y, 4, "0"); case "M": return a3 + 1; case "MM": return b2.s(a3 + 1, 2, "0"); case "MMM": return h3(n3.monthsShort, a3, c3, 3); case "MMMM": return h3(c3, a3); case "D": return e3.$D; case "DD": return b2.s(e3.$D, 2, "0"); case "d": return String(e3.$W); case "dd": return h3(n3.weekdaysMin, e3.$W, o3, 2); case "ddd": return h3(n3.weekdaysShort, e3.$W, o3, 3); case "dddd": return o3[e3.$W]; case "H": return String(s3); case "HH": return b2.s(s3, 2, "0"); case "h": return d3(1); case "hh": return d3(2); case "a": return $2(s3, u6, true); case "A": return $2(s3, u6, false); case "m": return String(u6); case "mm": return b2.s(u6, 2, "0"); case "s": return String(e3.$s); case "ss": return b2.s(e3.$s, 2, "0"); case "SSS": return b2.s(e3.$ms, 3, "0"); case "Z": return i3; } return null; }(t11) || i3.replace(":", ""); }); }, m3.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m3.diff = function(r3, d3, l3) { var $2, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v5 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D4 = /* @__PURE__ */ __name(function() { return b2.m(y3, m4); }, "D"); switch (M4) { case h2: $2 = D4() / 12; break; case c2: $2 = D4(); break; case f2: $2 = D4() / 3; break; case o2: $2 = (g3 - v5) / 6048e5; break; case a2: $2 = (g3 - v5) / 864e5; break; case u5: $2 = g3 / n2; break; case s2: $2 = g3 / e2; break; case i2: $2 = g3 / t9; break; default: $2 = g3; } return l3 ? $2 : b2.a($2); }, m3.daysInMonth = function() { return this.endOf(c2).$D; }, m3.$locale = function() { return D3[this.$L]; }, m3.locale = function(t10, e3) { if (!t10) return this.$L; var n3 = this.clone(), r3 = w2(t10, e3, true); return r3 && (n3.$L = r3), n3; }, m3.clone = function() { return b2.w(this.$d, this); }, m3.toDate = function() { return new Date(this.valueOf()); }, m3.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, m3.toISOString = function() { return this.$d.toISOString(); }, m3.toString = function() { return this.$d.toUTCString(); }, M3; }(), k2 = _.prototype; return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u5], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t10) { k2[t10[1]] = function(e3) { return this.$g(e3, t10[0], t10[1]); }; }), O2.extend = function(t10, e3) { return t10.$i || (t10(e3, _, O2), t10.$i = true), O2; }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t10) { return O2(1e3 * t10); }, O2.en = D3[g2], O2.Ls = D3, O2.p = {}, O2; }); } }); // src/trpc/apis/admin-apis/apis/coupon.ts var import_dayjs, createCouponBodySchema, validateCouponBodySchema, couponRouter; var init_coupon3 = __esm({ "src/trpc/apis/admin-apis/apis/coupon.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); import_dayjs = __toESM(require_dayjs_min()); init_dbService(); createCouponBodySchema = external_exports.object({ couponCode: external_exports.string().optional(), isUserBased: external_exports.boolean().optional(), discountPercent: external_exports.number().optional(), flatDiscount: external_exports.number().optional(), minOrder: external_exports.number().optional(), targetUser: external_exports.number().optional(), productIds: external_exports.array(external_exports.number()).optional().nullable(), applicableUsers: external_exports.array(external_exports.number()).optional(), applicableProducts: external_exports.array(external_exports.number()).optional(), maxValue: external_exports.number().optional(), isApplyForAll: external_exports.boolean().optional(), validTill: external_exports.string().optional(), maxLimitForUser: external_exports.number().optional(), exclusiveApply: external_exports.boolean().optional() }); validateCouponBodySchema = external_exports.object({ code: external_exports.string(), userId: external_exports.number(), orderAmount: external_exports.number() }); couponRouter = router2({ create: protectedProcedure.input(createCouponBodySchema).mutation(async ({ input, ctx }) => { const { couponCode, isUserBased, discountPercent, flatDiscount, minOrder, productIds, applicableUsers, applicableProducts, maxValue, isApplyForAll, validTill, maxLimitForUser, exclusiveApply } = input; if (!discountPercent && !flatDiscount || discountPercent && flatDiscount) { throw new Error("Either discountPercent or flatDiscount must be provided (but not both)"); } if (isUserBased && (!applicableUsers || applicableUsers.length === 0) && !isApplyForAll) { throw new Error("applicableUsers is required for user-based coupons (or set isApplyForAll to true)"); } if (isUserBased && isApplyForAll) { throw new Error("Cannot be both user-based and apply for all users"); } const staffUserId = ctx.staffUser?.id; if (!staffUserId) { throw new Error("Unauthorized"); } let finalCouponCode = couponCode; if (!finalCouponCode) { const timestamp = Date.now().toString().slice(-6); const random = Math.random().toString(36).substring(2, 8).toUpperCase(); finalCouponCode = `MF${timestamp}${random}`; } const codeExists = await checkCouponExists(finalCouponCode); if (codeExists) { throw new Error("Coupon code already exists"); } if (applicableUsers && applicableUsers.length > 0) { const usersExist = await checkUsersExist(applicableUsers); if (!usersExist) { throw new Error("Some applicable users not found"); } } const coupon = await createCouponWithRelations( { couponCode: finalCouponCode, isUserBased: isUserBased || false, discountPercent: discountPercent?.toString(), flatDiscount: flatDiscount?.toString(), minOrder: minOrder?.toString(), productIds: productIds || null, createdBy: staffUserId, maxValue: maxValue?.toString(), isApplyForAll: isApplyForAll || false, validTill: validTill ? (0, import_dayjs.default)(validTill).toDate() : void 0, maxLimitForUser, exclusiveApply: exclusiveApply || false }, applicableUsers, applicableProducts ); return coupon; }), getAll: protectedProcedure.input(external_exports.object({ cursor: external_exports.number().optional(), limit: external_exports.number().default(50), search: external_exports.string().optional() })).query(async ({ input }) => { const { cursor, limit, search } = input; const { coupons: couponsList, hasMore } = await getAllCoupons(cursor, limit, search); const nextCursor = hasMore ? couponsList[couponsList.length - 1].id : void 0; return { coupons: couponsList, nextCursor }; }), getById: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).query(async ({ input }) => { const couponId = input.id; const result = await getCouponById(couponId); if (!result) { throw new Error("Coupon not found"); } return { ...result, productIds: result.productIds || void 0, applicableUsers: result.applicableUsers.map((au2) => au2.user), applicableProducts: result.applicableProducts.map((ap2) => ap2.product) }; }), update: protectedProcedure.input(external_exports.object({ id: external_exports.number(), updates: createCouponBodySchema.extend({ isInvalidated: external_exports.boolean().optional() }) })).mutation(async ({ input }) => { const { id, updates } = input; if (updates.discountPercent !== void 0 && updates.flatDiscount !== void 0) { if (updates.discountPercent && updates.flatDiscount) { throw new Error("Cannot have both discountPercent and flatDiscount"); } } const updateData = {}; if (updates.couponCode !== void 0) updateData.couponCode = updates.couponCode; if (updates.isUserBased !== void 0) updateData.isUserBased = updates.isUserBased; if (updates.discountPercent !== void 0) updateData.discountPercent = updates.discountPercent?.toString(); if (updates.flatDiscount !== void 0) updateData.flatDiscount = updates.flatDiscount?.toString(); if (updates.minOrder !== void 0) updateData.minOrder = updates.minOrder?.toString(); if (updates.maxValue !== void 0) updateData.maxValue = updates.maxValue?.toString(); if (updates.isApplyForAll !== void 0) updateData.isApplyForAll = updates.isApplyForAll; if (updates.validTill !== void 0) updateData.validTill = updates.validTill ? (0, import_dayjs.default)(updates.validTill).toDate() : null; if (updates.maxLimitForUser !== void 0) updateData.maxLimitForUser = updates.maxLimitForUser; if (updates.exclusiveApply !== void 0) updateData.exclusiveApply = updates.exclusiveApply; if (updates.isInvalidated !== void 0) updateData.isInvalidated = updates.isInvalidated; if (updates.productIds !== void 0) updateData.productIds = updates.productIds; const coupon = await updateCouponWithRelations( id, updateData, updates.applicableUsers, updates.applicableProducts ); return coupon; }), delete: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).mutation(async ({ input }) => { const { id } = input; await invalidateCoupon(id); return { message: "Coupon invalidated successfully" }; }), validate: protectedProcedure.input(validateCouponBodySchema).query(async ({ input }) => { const { code, userId, orderAmount } = input; if (!code || typeof code !== "string") { return { valid: false, message: "Invalid coupon code" }; } const result = await validateCoupon(code, userId, orderAmount); return result; }), generateCancellationCoupon: protectedProcedure.input( external_exports.object({ orderId: external_exports.number() }) ).mutation(async ({ input, ctx }) => { const { orderId } = input; const staffUserId = ctx.staffUser?.id; if (!staffUserId) { throw new Error("Unauthorized"); } const order = await getOrderWithUser(orderId); if (!order) { throw new Error("Order not found"); } if (!order.user) { throw new Error("User not found for this order"); } const userNamePrefix = (order.user.name || order.user.mobile || "USR").substring(0, 3).toUpperCase(); const couponCode = `${userNamePrefix}${orderId}`; const codeExists = await checkCouponExists(couponCode); if (codeExists) { throw new Error("Coupon code already exists"); } const orderAmount = parseFloat(order.totalAmount); const coupon = await generateCancellationCoupon( orderId, staffUserId, order.userId, orderAmount, couponCode ); return coupon; }), getReservedCoupons: protectedProcedure.input(external_exports.object({ cursor: external_exports.number().optional(), limit: external_exports.number().default(50), search: external_exports.string().optional() })).query(async ({ input }) => { const { cursor, limit, search } = input; const { coupons: result, hasMore } = await getReservedCoupons(cursor, limit, search); const nextCursor = hasMore ? result[result.length - 1].id : void 0; return { coupons: result, nextCursor }; }), createReservedCoupon: protectedProcedure.input(createCouponBodySchema).mutation(async ({ input, ctx }) => { const { couponCode, isUserBased, discountPercent, flatDiscount, minOrder, productIds, applicableProducts, maxValue, validTill, maxLimitForUser, exclusiveApply } = input; if (!discountPercent && !flatDiscount || discountPercent && flatDiscount) { throw new Error("Either discountPercent or flatDiscount must be provided (but not both)"); } const staffUserId = ctx.staffUser?.id; if (!staffUserId) { throw new Error("Unauthorized"); } let secretCode = couponCode || `SECRET${Date.now().toString().slice(-6)}${Math.random().toString(36).substring(2, 8).toUpperCase()}`; const codeExists = await checkReservedCouponExists(secretCode); if (codeExists) { throw new Error("Secret code already exists"); } const coupon = await createReservedCouponWithProducts( { secretCode, couponCode: couponCode || `RESERVED${Date.now().toString().slice(-6)}`, discountPercent: discountPercent?.toString(), flatDiscount: flatDiscount?.toString(), minOrder: minOrder?.toString(), productIds, maxValue: maxValue?.toString(), validTill: validTill ? (0, import_dayjs.default)(validTill).toDate() : void 0, maxLimitForUser, exclusiveApply: exclusiveApply || false, createdBy: staffUserId }, applicableProducts ); return coupon; }), getUsersMiniInfo: protectedProcedure.input(external_exports.object({ search: external_exports.string().optional(), limit: external_exports.number().min(1).max(50).default(20), offset: external_exports.number().min(0).default(0) })).query(async ({ input }) => { const { search, limit, offset } = input; const result = await getUsersForCoupon(search, limit, offset); return result; }), createCoupon: protectedProcedure.input(external_exports.object({ mobile: external_exports.string().min(1, "Mobile number is required") })).mutation(async ({ input, ctx }) => { const { mobile } = input; const staffUserId = ctx.staffUser?.id; if (!staffUserId) { throw new Error("Unauthorized"); } const cleanMobile = mobile.replace(/\D/g, ""); if (cleanMobile.length !== 10) { throw new Error("Mobile number must be exactly 10 digits"); } const timestamp = Date.now().toString().slice(-6); const random = Math.random().toString(36).substring(2, 6).toUpperCase(); const couponCode = `MF${cleanMobile.slice(-4)}${timestamp}${random}`; const codeExists = await checkCouponExists(couponCode); if (codeExists) { throw new Error("Generated coupon code already exists - please try again"); } const { coupon, user } = await createCouponForUser(cleanMobile, couponCode, staffUserId); return { success: true, coupon: { id: coupon.id, couponCode: coupon.couponCode, userId: user.id, userMobile: user.mobile, discountPercent: 20, minOrder: 1e3, maxValue: 500, maxLimitForUser: 1 } }; }) }); } }); // ../../node_modules/unenv/dist/runtime/npm/node-fetch.mjs var node_fetch_exports = {}; __export(node_fetch_exports, { AbortController: () => AbortController2, AbortError: () => AbortError, FetchError: () => FetchError, Headers: () => Headers2, Request: () => Request2, Response: () => Response2, default: () => node_fetch_default, fetch: () => fetch2, isRedirect: () => isRedirect }); var fetch2, Headers2, Request2, Response2, AbortController2, FetchError, AbortError, redirectStatus, isRedirect, node_fetch_default; var init_node_fetch = __esm({ "../../node_modules/unenv/dist/runtime/npm/node-fetch.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); fetch2 = /* @__PURE__ */ __name((...args) => globalThis.fetch(...args), "fetch"); Headers2 = globalThis.Headers; Request2 = globalThis.Request; Response2 = globalThis.Response; AbortController2 = globalThis.AbortController; FetchError = Error; AbortError = Error; redirectStatus = /* @__PURE__ */ new Set([ 301, 302, 303, 307, 308 ]); isRedirect = /* @__PURE__ */ __name((code) => redirectStatus.has(code), "isRedirect"); fetch2.Promise = globalThis.Promise; fetch2.isRedirect = isRedirect; node_fetch_default = fetch2; } }); // required-unenv-alias:node-fetch var require_node_fetch = __commonJS({ "required-unenv-alias:node-fetch"(exports, module) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_node_fetch(); module.exports = Object.entries(node_fetch_exports).filter(([k2]) => k2 !== "default").reduce( (cjs, [k2, value]) => Object.defineProperty(cjs, k2, { value, enumerable: true }), "default" in node_fetch_exports ? node_fetch_default : {} ); } }); // node-built-in-modules:node:assert import libDefault from "node:assert"; var require_node_assert = __commonJS({ "node-built-in-modules:node:assert"(exports, module) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); module.exports = libDefault; } }); // node-built-in-modules:node:zlib import libDefault2 from "node:zlib"; var require_node_zlib = __commonJS({ "node-built-in-modules:node:zlib"(exports, module) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); module.exports = libDefault2; } }); // ../../node_modules/promise-limit/index.js var require_promise_limit = __commonJS({ "../../node_modules/promise-limit/index.js"(exports, module) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); function limiter(count4) { var outstanding = 0; var jobs = []; function remove() { outstanding--; if (outstanding < count4) { dequeue(); } } __name(remove, "remove"); function dequeue() { var job = jobs.shift(); semaphore.queue = jobs.length; if (job) { run2(job.fn).then(job.resolve).catch(job.reject); } } __name(dequeue, "dequeue"); function queue(fn) { return new Promise(function(resolve, reject) { jobs.push({ fn, resolve, reject }); semaphore.queue = jobs.length; }); } __name(queue, "queue"); function run2(fn) { outstanding++; try { return Promise.resolve(fn()).then(function(result) { remove(); return result; }, function(error50) { remove(); throw error50; }); } catch (err) { remove(); return Promise.reject(err); } } __name(run2, "run"); var semaphore = /* @__PURE__ */ __name(function(fn) { if (outstanding >= count4) { return queue(fn); } else { return run2(fn); } }, "semaphore"); return semaphore; } __name(limiter, "limiter"); function map2(items, mapper) { var failed = false; var limit = this; return Promise.all(items.map(function() { var args = arguments; return limit(function() { if (!failed) { return mapper.apply(void 0, args).catch(function(e2) { failed = true; throw e2; }); } }); })); } __name(map2, "map"); function addExtras(fn) { fn.queue = 0; fn.map = map2; return fn; } __name(addExtras, "addExtras"); module.exports = function(count4) { if (count4) { return addExtras(limiter(count4)); } else { return addExtras(function(fn) { return fn(); }); } }; } }); // ../../node_modules/err-code/index.js var require_err_code = __commonJS({ "../../node_modules/err-code/index.js"(exports, module) { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); function assign(obj, props) { for (const key in props) { Object.defineProperty(obj, key, { value: props[key], enumerable: true, configurable: true }); } return obj; } __name(assign, "assign"); function createError(err, code, props) { if (!err || typeof err === "string") { throw new TypeError("Please pass an Error to err-code"); } if (!props) { props = {}; } if (typeof code === "object") { props = code; code = void 0; } if (code != null) { props.code = code; } try { return assign(err, props); } catch (_) { props.message = err.message; props.stack = err.stack; const ErrClass = /* @__PURE__ */ __name(function() { }, "ErrClass"); ErrClass.prototype = Object.create(Object.getPrototypeOf(err)); return assign(new ErrClass(), props); } } __name(createError, "createError"); module.exports = createError; } }); // ../../node_modules/retry/lib/retry_operation.js var require_retry_operation = __commonJS({ "../../node_modules/retry/lib/retry_operation.js"(exports, module) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); function RetryOperation(timeouts, options) { if (typeof options === "boolean") { options = { forever: options }; } this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); this._timeouts = timeouts; this._options = options || {}; this._maxRetryTime = options && options.maxRetryTime || Infinity; this._fn = null; this._errors = []; this._attempts = 1; this._operationTimeout = null; this._operationTimeoutCb = null; this._timeout = null; this._operationStart = null; if (this._options.forever) { this._cachedTimeouts = this._timeouts.slice(0); } } __name(RetryOperation, "RetryOperation"); module.exports = RetryOperation; RetryOperation.prototype.reset = function() { this._attempts = 1; this._timeouts = this._originalTimeouts; }; RetryOperation.prototype.stop = function() { if (this._timeout) { clearTimeout(this._timeout); } this._timeouts = []; this._cachedTimeouts = null; }; RetryOperation.prototype.retry = function(err) { if (this._timeout) { clearTimeout(this._timeout); } if (!err) { return false; } var currentTime = (/* @__PURE__ */ new Date()).getTime(); if (err && currentTime - this._operationStart >= this._maxRetryTime) { this._errors.unshift(new Error("RetryOperation timeout occurred")); return false; } this._errors.push(err); var timeout = this._timeouts.shift(); if (timeout === void 0) { if (this._cachedTimeouts) { this._errors.splice(this._errors.length - 1, this._errors.length); this._timeouts = this._cachedTimeouts.slice(0); timeout = this._timeouts.shift(); } else { return false; } } var self2 = this; var timer = setTimeout(function() { self2._attempts++; if (self2._operationTimeoutCb) { self2._timeout = setTimeout(function() { self2._operationTimeoutCb(self2._attempts); }, self2._operationTimeout); if (self2._options.unref) { self2._timeout.unref(); } } self2._fn(self2._attempts); }, timeout); if (this._options.unref) { timer.unref(); } return true; }; RetryOperation.prototype.attempt = function(fn, timeoutOps) { this._fn = fn; if (timeoutOps) { if (timeoutOps.timeout) { this._operationTimeout = timeoutOps.timeout; } if (timeoutOps.cb) { this._operationTimeoutCb = timeoutOps.cb; } } var self2 = this; if (this._operationTimeoutCb) { this._timeout = setTimeout(function() { self2._operationTimeoutCb(); }, self2._operationTimeout); } this._operationStart = (/* @__PURE__ */ new Date()).getTime(); this._fn(this._attempts); }; RetryOperation.prototype.try = function(fn) { console.log("Using RetryOperation.try() is deprecated"); this.attempt(fn); }; RetryOperation.prototype.start = function(fn) { console.log("Using RetryOperation.start() is deprecated"); this.attempt(fn); }; RetryOperation.prototype.start = RetryOperation.prototype.try; RetryOperation.prototype.errors = function() { return this._errors; }; RetryOperation.prototype.attempts = function() { return this._attempts; }; RetryOperation.prototype.mainError = function() { if (this._errors.length === 0) { return null; } var counts = {}; var mainError = null; var mainErrorCount = 0; for (var i2 = 0; i2 < this._errors.length; i2++) { var error50 = this._errors[i2]; var message2 = error50.message; var count4 = (counts[message2] || 0) + 1; counts[message2] = count4; if (count4 >= mainErrorCount) { mainError = error50; mainErrorCount = count4; } } return mainError; }; } }); // ../../node_modules/retry/lib/retry.js var require_retry = __commonJS({ "../../node_modules/retry/lib/retry.js"(exports) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); var RetryOperation = require_retry_operation(); exports.operation = function(options) { var timeouts = exports.timeouts(options); return new RetryOperation(timeouts, { forever: options && options.forever, unref: options && options.unref, maxRetryTime: options && options.maxRetryTime }); }; exports.timeouts = function(options) { if (options instanceof Array) { return [].concat(options); } var opts = { retries: 10, factor: 2, minTimeout: 1 * 1e3, maxTimeout: Infinity, randomize: false }; for (var key in options) { opts[key] = options[key]; } if (opts.minTimeout > opts.maxTimeout) { throw new Error("minTimeout is greater than maxTimeout"); } var timeouts = []; for (var i2 = 0; i2 < opts.retries; i2++) { timeouts.push(this.createTimeout(i2, opts)); } if (options && options.forever && !timeouts.length) { timeouts.push(this.createTimeout(i2, opts)); } timeouts.sort(function(a2, b2) { return a2 - b2; }); return timeouts; }; exports.createTimeout = function(attempt, opts) { var random = opts.randomize ? Math.random() + 1 : 1; var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); timeout = Math.min(timeout, opts.maxTimeout); return timeout; }; exports.wrap = function(obj, options, methods) { if (options instanceof Array) { methods = options; options = null; } if (!methods) { methods = []; for (var key in obj) { if (typeof obj[key] === "function") { methods.push(key); } } } for (var i2 = 0; i2 < methods.length; i2++) { var method = methods[i2]; var original = obj[method]; obj[method] = (/* @__PURE__ */ __name(function retryWrapper(original2) { var op = exports.operation(options); var args = Array.prototype.slice.call(arguments, 1); var callback = args.pop(); args.push(function(err) { if (op.retry(err)) { return; } if (err) { arguments[0] = op.mainError(); } callback.apply(this, arguments); }); op.attempt(function() { original2.apply(obj, args); }); }, "retryWrapper")).bind(obj, original); obj[method].options = options; } }; } }); // ../../node_modules/retry/index.js var require_retry2 = __commonJS({ "../../node_modules/retry/index.js"(exports, module) { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); module.exports = require_retry(); } }); // ../../node_modules/promise-retry/index.js var require_promise_retry = __commonJS({ "../../node_modules/promise-retry/index.js"(exports, module) { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); var errcode = require_err_code(); var retry = require_retry2(); var hasOwn = Object.prototype.hasOwnProperty; function isRetryError(err) { return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried"); } __name(isRetryError, "isRetryError"); function promiseRetry(fn, options) { var temp; var operation2; if (typeof fn === "object" && typeof options === "function") { temp = options; options = fn; fn = temp; } operation2 = retry.operation(options); return new Promise(function(resolve, reject) { operation2.attempt(function(number4) { Promise.resolve().then(function() { return fn(function(err) { if (isRetryError(err)) { err = err.retried; } throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err }); }, number4); }).then(resolve, function(err) { if (isRetryError(err)) { err = err.retried; if (operation2.retry(err || new Error())) { return; } } reject(err); }); }); }); } __name(promiseRetry, "promiseRetry"); module.exports = promiseRetry; } }); // node_modules/expo-server-sdk/build/ExpoClientValues.js var require_ExpoClientValues = __commonJS({ "node_modules/expo-server-sdk/build/ExpoClientValues.js"(exports) { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); Object.defineProperty(exports, "__esModule", { value: true }); exports.requestRetryMinTimeout = exports.defaultConcurrentRequestLimit = exports.pushNotificationReceiptChunkLimit = exports.pushNotificationChunkLimit = exports.getReceiptsApiUrl = exports.sendApiUrl = void 0; var baseUrl = process.env["EXPO_BASE_URL"] || "https://exp.host"; exports.sendApiUrl = `${baseUrl}/--/api/v2/push/send`; exports.getReceiptsApiUrl = `${baseUrl}/--/api/v2/push/getReceipts`; exports.pushNotificationChunkLimit = 100; exports.pushNotificationReceiptChunkLimit = 300; exports.defaultConcurrentRequestLimit = 6; exports.requestRetryMinTimeout = 1e3; } }); // node_modules/expo-server-sdk/package.json var require_package = __commonJS({ "node_modules/expo-server-sdk/package.json"(exports, module) { module.exports = { name: "expo-server-sdk", version: "4.0.0", description: "Server-side library for working with Expo using Node.js", main: "build/ExpoClient.js", types: "build/ExpoClient.d.ts", files: [ "build" ], engines: { node: ">=20" }, scripts: { build: "yarn prepack", lint: "eslint", prepack: "tsc --project tsconfig.build.json", test: "jest", tsc: "tsc", watch: "tsc --watch" }, jest: { coverageDirectory: "/../coverage", coverageThreshold: { global: { branches: 100, functions: 100, lines: 100, statements: 0 } }, preset: "ts-jest", rootDir: "src", testEnvironment: "node" }, repository: { type: "git", url: "git+https://github.com/expo/expo-server-sdk-node.git" }, keywords: [ "expo", "push-notifications" ], author: "support@expo.dev", license: "MIT", bugs: { url: "https://github.com/expo/expo-server-sdk-node/issues" }, homepage: "https://github.com/expo/expo-server-sdk-node#readme", dependencies: { "node-fetch": "^2.6.0", "promise-limit": "^2.7.0", "promise-retry": "^2.0.1" }, devDependencies: { "@tsconfig/node20": "20.1.6", "@tsconfig/strictest": "2.0.5", "@types/node": "22.17.2", "@types/node-fetch": "2.6.12", "@types/promise-retry": "1.1.6", eslint: "9.33.0", "eslint-config-universe": "15.0.3", jest: "29.7.0", jiti: "2.4.2", msw: "2.10.5", prettier: "3.6.2", "ts-jest": "29.4.1", typescript: "5.9.2" }, packageManager: "yarn@4.9.2" }; } }); // node_modules/expo-server-sdk/build/ExpoClient.js var require_ExpoClient = __commonJS({ "node_modules/expo-server-sdk/build/ExpoClient.js"(exports) { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; var desc2 = Object.getOwnPropertyDescriptor(m2, k2); if (!desc2 || ("get" in desc2 ? !m2.__esModule : desc2.writable || desc2.configurable)) { desc2 = { enumerable: true, get: function() { return m2[k2]; } }; } Object.defineProperty(o2, k22, desc2); } : function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; o2[k22] = m2[k2]; }); var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v3) { Object.defineProperty(o2, "default", { enumerable: true, value: v3 }); } : function(o2, v3) { o2["default"] = v3; }); var __importStar = exports && exports.__importStar || function() { var ownKeys = /* @__PURE__ */ __name(function(o2) { ownKeys = Object.getOwnPropertyNames || function(o3) { var ar2 = []; for (var k2 in o3) if (Object.prototype.hasOwnProperty.call(o3, k2)) ar2[ar2.length] = k2; return ar2; }; return ownKeys(o2); }, "ownKeys"); return function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k2 = ownKeys(mod), i2 = 0; i2 < k2.length; i2++) if (k2[i2] !== "default") __createBinding(result, mod, k2[i2]); } __setModuleDefault(result, mod); return result; }; }(); var __importDefault = exports && exports.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Expo = void 0; var node_fetch_1 = __importStar(require_node_fetch()); var node_assert_1 = __importDefault(require_node_assert()); var node_zlib_1 = require_node_zlib(); var promise_limit_1 = __importDefault(require_promise_limit()); var promise_retry_1 = __importDefault(require_promise_retry()); var ExpoClientValues_1 = require_ExpoClientValues(); var _Expo = class { httpAgent; limitConcurrentRequests; accessToken; useFcmV1; retryMinTimeout; constructor(options = {}) { this.httpAgent = options.httpAgent; this.limitConcurrentRequests = (0, promise_limit_1.default)(options.maxConcurrentRequests ?? ExpoClientValues_1.defaultConcurrentRequestLimit); this.retryMinTimeout = options.retryMinTimeout ?? ExpoClientValues_1.requestRetryMinTimeout; this.accessToken = options.accessToken; this.useFcmV1 = options.useFcmV1; } /** * Returns `true` if the token is an Expo push token */ static isExpoPushToken(token) { return typeof token === "string" && ((token.startsWith("ExponentPushToken[") || token.startsWith("ExpoPushToken[")) && token.endsWith("]") || /^[a-z\d]{8}-[a-z\d]{4}-[a-z\d]{4}-[a-z\d]{4}-[a-z\d]{12}$/i.test(token)); } /** * Sends the given messages to their recipients via push notifications and returns an array of * push tickets. Each ticket corresponds to the message at its respective index (the nth receipt * is for the nth message) and contains a receipt ID. Later, after Expo attempts to deliver the * messages to the underlying push notification services, the receipts with those IDs will be * available for a period of time (approximately a day). * * There is a limit on the number of push notifications you can send at once. Use * `chunkPushNotifications` to divide an array of push notification messages into appropriately * sized chunks. */ async sendPushNotificationsAsync(messages) { const url2 = new URL(ExpoClientValues_1.sendApiUrl); if (this.useFcmV1 === false) { url2.searchParams.append("useFcmV1", String(this.useFcmV1)); } const actualMessagesCount = _Expo._getActualMessageCount(messages); const data = await this.limitConcurrentRequests(async () => { return await (0, promise_retry_1.default)(async (retry) => { try { return await this.requestAsync(url2.toString(), { httpMethod: "post", body: messages, shouldCompress(body) { return body.length > 1024; } }); } catch (e2) { if (e2.statusCode === 429) { return retry(e2); } throw e2; } }, { retries: 2, factor: 2, minTimeout: this.retryMinTimeout }); }); if (!Array.isArray(data) || data.length !== actualMessagesCount) { const apiError = new Error(`Expected Expo to respond with ${actualMessagesCount} ${actualMessagesCount === 1 ? "ticket" : "tickets"} but got ${data.length}`); apiError["data"] = data; throw apiError; } return data; } async getPushNotificationReceiptsAsync(receiptIds) { const data = await this.requestAsync(ExpoClientValues_1.getReceiptsApiUrl, { httpMethod: "post", body: { ids: receiptIds }, shouldCompress(body) { return body.length > 1024; } }); if (!data || typeof data !== "object" || Array.isArray(data)) { const apiError = new Error(`Expected Expo to respond with a map from receipt IDs to receipts but received data of another type`); apiError["data"] = data; throw apiError; } return data; } chunkPushNotifications(messages) { const chunks = []; let chunk = []; let chunkMessagesCount = 0; for (const message2 of messages) { if (Array.isArray(message2.to)) { let partialTo = []; for (const recipient of message2.to) { partialTo.push(recipient); chunkMessagesCount++; if (chunkMessagesCount >= ExpoClientValues_1.pushNotificationChunkLimit) { chunk.push({ ...message2, to: partialTo }); chunks.push(chunk); chunk = []; chunkMessagesCount = 0; partialTo = []; } } if (partialTo.length) { chunk.push({ ...message2, to: partialTo }); } } else { chunk.push(message2); chunkMessagesCount++; } if (chunkMessagesCount >= ExpoClientValues_1.pushNotificationChunkLimit) { chunks.push(chunk); chunk = []; chunkMessagesCount = 0; } } if (chunkMessagesCount) { chunks.push(chunk); } return chunks; } chunkPushNotificationReceiptIds(receiptIds) { return this.chunkItems(receiptIds, ExpoClientValues_1.pushNotificationReceiptChunkLimit); } chunkItems(items, chunkSize) { const chunks = []; let chunk = []; for (const item of items) { chunk.push(item); if (chunk.length >= chunkSize) { chunks.push(chunk); chunk = []; } } if (chunk.length) { chunks.push(chunk); } return chunks; } async requestAsync(url2, options) { let requestBody; const sdkVersion = require_package().version; const requestHeaders = new node_fetch_1.Headers({ Accept: "application/json", "Accept-Encoding": "gzip, deflate", "User-Agent": `expo-server-sdk-node/${sdkVersion}` }); if (this.accessToken) { requestHeaders.set("Authorization", `Bearer ${this.accessToken}`); } if (options.body != null) { const json2 = JSON.stringify(options.body); (0, node_assert_1.default)(json2 != null, `JSON request body must not be null`); if (options.shouldCompress(json2)) { requestBody = (0, node_zlib_1.gzipSync)(Buffer.from(json2)); requestHeaders.set("Content-Encoding", "gzip"); } else { requestBody = json2; } requestHeaders.set("Content-Type", "application/json"); } const response = await (0, node_fetch_1.default)(url2, { method: options.httpMethod, body: requestBody, headers: requestHeaders, agent: this.httpAgent }); if (response.status !== 200) { const apiError = await this.parseErrorResponseAsync(response); throw apiError; } const textBody = await response.text(); let result; try { result = JSON.parse(textBody); } catch { const apiError = await this.getTextResponseErrorAsync(response, textBody); throw apiError; } if (result.errors) { const apiError = this.getErrorFromResult(response, result); throw apiError; } return result.data; } async parseErrorResponseAsync(response) { const textBody = await response.text(); let result; try { result = JSON.parse(textBody); } catch { return await this.getTextResponseErrorAsync(response, textBody); } if (!result.errors || !Array.isArray(result.errors) || !result.errors.length) { const apiError = await this.getTextResponseErrorAsync(response, textBody); apiError["errorData"] = result; return apiError; } return this.getErrorFromResult(response, result); } async getTextResponseErrorAsync(response, text2) { const apiError = new Error(`Expo responded with an error with status code ${response.status}: ` + text2); apiError["statusCode"] = response.status; apiError["errorText"] = text2; return apiError; } /** * Returns an error for the first API error in the result, with an optional `others` field that * contains any other errors. */ getErrorFromResult(response, result) { const noErrorsMessage = `Expected at least one error from Expo`; (0, node_assert_1.default)(result.errors, noErrorsMessage); const [errorData, ...otherErrorData] = result.errors; node_assert_1.default.ok(errorData, noErrorsMessage); const error50 = this.getErrorFromResultError(errorData); if (otherErrorData.length) { error50["others"] = otherErrorData.map((data) => this.getErrorFromResultError(data)); } error50["statusCode"] = response.status; return error50; } /** * Returns an error for a single API error */ getErrorFromResultError(errorData) { const error50 = new Error(errorData.message); error50["code"] = errorData.code; if (errorData.details != null) { error50["details"] = errorData.details; } if (errorData.stack != null) { error50["serverStack"] = errorData.stack; } return error50; } static _getActualMessageCount(messages) { return messages.reduce((total, message2) => { if (Array.isArray(message2.to)) { total += message2.to.length; } else { total++; } return total; }, 0); } }; var Expo2 = _Expo; __name(Expo2, "Expo"); __publicField(Expo2, "pushNotificationChunkSizeLimit", ExpoClientValues_1.pushNotificationChunkLimit); __publicField(Expo2, "pushNotificationReceiptChunkSizeLimit", ExpoClientValues_1.pushNotificationReceiptChunkLimit); exports.Expo = Expo2; exports.default = Expo2; } }); // src/lib/const-strings.ts var ORDER_PLACED_MESSAGE, ORDER_PACKAGED_MESSAGE, ORDER_DELIVERED_MESSAGE, ORDER_CANCELLED_MESSAGE; var init_const_strings = __esm({ "src/lib/const-strings.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ORDER_PLACED_MESSAGE = "Your order has been placed successfully!"; ORDER_PACKAGED_MESSAGE = "Your order has been packaged and is ready for delivery."; ORDER_DELIVERED_MESSAGE = "Your order has been delivered."; ORDER_CANCELLED_MESSAGE = "Your order has been cancelled."; } }); // src/lib/notif-job.ts async function scheduleNotification(userId, payload, options) { const jobData = { userId, ...payload }; await notificationQueue.add("send-notification", jobData, options); } async function sendOrderPlacedNotification(userId, orderId) { await scheduleNotification(userId, { title: "Order Placed", body: ORDER_PLACED_MESSAGE, type: "order", orderId }); } async function sendOrderPackagedNotification(userId, orderId) { await scheduleNotification(userId, { title: "Order Packaged", body: ORDER_PACKAGED_MESSAGE, type: "order", orderId }); } async function sendOrderDeliveredNotification(userId, orderId) { await scheduleNotification(userId, { title: "Order Delivered", body: ORDER_DELIVERED_MESSAGE, type: "order", orderId }); } async function sendOrderCancelledNotification(userId, orderId) { await scheduleNotification(userId, { title: "Order Cancelled", body: ORDER_CANCELLED_MESSAGE, type: "order", orderId }); } var import_expo_server_sdk, notificationQueue; var init_notif_job = __esm({ "src/lib/notif-job.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); import_expo_server_sdk = __toESM(require_ExpoClient()); init_s3_client(); init_const_strings(); notificationQueue = {}; __name(scheduleNotification, "scheduleNotification"); __name(sendOrderPlacedNotification, "sendOrderPlacedNotification"); __name(sendOrderPackagedNotification, "sendOrderPackagedNotification"); __name(sendOrderDeliveredNotification, "sendOrderDeliveredNotification"); __name(sendOrderCancelledNotification, "sendOrderCancelledNotification"); } }); // src/lib/redis-client.ts var createClient, RedisClient, redisClient, redis_client_default; var init_redis_client = __esm({ "src/lib/redis-client.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_env_exporter(); createClient = /* @__PURE__ */ __name((args) => { }, "createClient"); RedisClient = class { // private client: RedisClientType; // private subscriberClient: RedisClientType | null = null; // private isConnected: boolean = false; // client; subscriberrlient; isConnected = false; constructor() { this.client = createClient({ url: redisUrl }); } async set(key, value, ttlSeconds) { if (ttlSeconds) { return await this.client.setEx(key, ttlSeconds, value); } else { return await this.client.set(key, value); } } async get(key) { return await this.client.get(key); } async exists(key) { const result = await this.client.exists(key); return result === 1; } async delete(key) { return await this.client.del(key); } async lPush(key, value) { return await this.client.lPush(key, value); } async KEYS(pattern) { return await this.client.KEYS(pattern); } async MGET(keys) { return await this.client.MGET(keys); } // Publish message to a channel async publish(channel2, message2) { return await this.client.publish(channel2, message2); } // Subscribe to a channel with callback async subscribe(channel2, callback) { console.log(`Subscribed to channel: ${channel2}`); } // Unsubscribe from a channel async unsubscribe(channel2) { } disconnect() { } get isClientConnected() { return this.isConnected; } }; __name(RedisClient, "RedisClient"); redisClient = new RedisClient(); redis_client_default = redisClient; } }); // ../../node_modules/axios/lib/helpers/bind.js function bind(fn, thisArg) { return /* @__PURE__ */ __name(function wrap() { return fn.apply(thisArg, arguments); }, "wrap"); } var init_bind = __esm({ "../../node_modules/axios/lib/helpers/bind.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(bind, "bind"); } }); // ../../node_modules/axios/lib/utils.js function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction2(val.constructor.isBuffer) && val.constructor.isBuffer(val); } function isArrayBufferView(val) { let result; if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { result = ArrayBuffer.isView(val); } else { result = val && val.buffer && isArrayBuffer2(val.buffer); } return result; } function getGlobal() { if (typeof globalThis !== "undefined") return globalThis; if (typeof self !== "undefined") return self; if (typeof window !== "undefined") return window; if (typeof global !== "undefined") return global; return {}; } function forEach(obj, fn, { allOwnKeys = false } = {}) { if (obj === null || typeof obj === "undefined") { return; } let i2; let l2; if (typeof obj !== "object") { obj = [obj]; } if (isArray(obj)) { for (i2 = 0, l2 = obj.length; i2 < l2; i2++) { fn.call(null, obj[i2], i2, obj); } } else { if (isBuffer(obj)) { return; } const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); const len = keys.length; let key; for (i2 = 0; i2 < len; i2++) { key = keys[i2]; fn.call(null, obj[key], key, obj); } } } function findKey(obj, key) { if (isBuffer(obj)) { return null; } key = key.toLowerCase(); const keys = Object.keys(obj); let i2 = keys.length; let _key2; while (i2-- > 0) { _key2 = keys[i2]; if (key === _key2.toLowerCase()) { return _key2; } } return null; } function merge3() { const { caseless, skipUndefined } = isContextDefined(this) && this || {}; const result = {}; const assignValue = /* @__PURE__ */ __name((val, key) => { if (key === "__proto__" || key === "constructor" || key === "prototype") { return; } const targetKey = caseless && findKey(result, key) || key; if (isPlainObject3(result[targetKey]) && isPlainObject3(val)) { result[targetKey] = merge3(result[targetKey], val); } else if (isPlainObject3(val)) { result[targetKey] = merge3({}, val); } else if (isArray(val)) { result[targetKey] = val.slice(); } else if (!skipUndefined || !isUndefined(val)) { result[targetKey] = val; } }, "assignValue"); for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) { arguments[i2] && forEach(arguments[i2], assignValue); } return result; } function isSpecCompliantForm(thing) { return !!(thing && isFunction2(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); } var toString, getPrototypeOf, iterator, toStringTag, kindOf, kindOfTest, typeOfTest, isArray, isUndefined, isArrayBuffer2, isString, isFunction2, isNumber, isObject4, isBoolean, isPlainObject3, isEmptyObject, isDate, isFile, isReactNativeBlob, isReactNative, isBlob, isFileList, isStream, G2, FormDataCtor, isFormData, isURLSearchParams, isReadableStream3, isRequest, isResponse, isHeaders, trim, _global, isContextDefined, extend2, stripBOM, inherits, toFlatObject, endsWith, toArray, isTypedArray, forEachEntry, matchAll, isHTMLForm, toCamelCase2, hasOwnProperty, isRegExp, reduceDescriptors, freezeMethods, toObjectSet, noop2, toFiniteNumber, toJSONObject, isAsyncFn, isThenable, _setImmediate, asap, isIterable, utils_default; var init_utils8 = __esm({ "../../node_modules/axios/lib/utils.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_bind(); ({ toString } = Object.prototype); ({ getPrototypeOf } = Object); ({ iterator, toStringTag } = Symbol); kindOf = ((cache3) => (thing) => { const str = toString.call(thing); return cache3[str] || (cache3[str] = str.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)); kindOfTest = /* @__PURE__ */ __name((type) => { type = type.toLowerCase(); return (thing) => kindOf(thing) === type; }, "kindOfTest"); typeOfTest = /* @__PURE__ */ __name((type) => (thing) => typeof thing === type, "typeOfTest"); ({ isArray } = Array); isUndefined = typeOfTest("undefined"); __name(isBuffer, "isBuffer"); isArrayBuffer2 = kindOfTest("ArrayBuffer"); __name(isArrayBufferView, "isArrayBufferView"); isString = typeOfTest("string"); isFunction2 = typeOfTest("function"); isNumber = typeOfTest("number"); isObject4 = /* @__PURE__ */ __name((thing) => thing !== null && typeof thing === "object", "isObject"); isBoolean = /* @__PURE__ */ __name((thing) => thing === true || thing === false, "isBoolean"); isPlainObject3 = /* @__PURE__ */ __name((val) => { if (kindOf(val) !== "object") { return false; } const prototype2 = getPrototypeOf(val); return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val); }, "isPlainObject"); isEmptyObject = /* @__PURE__ */ __name((val) => { if (!isObject4(val) || isBuffer(val)) { return false; } try { return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; } catch (e2) { return false; } }, "isEmptyObject"); isDate = kindOfTest("Date"); isFile = kindOfTest("File"); isReactNativeBlob = /* @__PURE__ */ __name((value) => { return !!(value && typeof value.uri !== "undefined"); }, "isReactNativeBlob"); isReactNative = /* @__PURE__ */ __name((formData) => formData && typeof formData.getParts !== "undefined", "isReactNative"); isBlob = kindOfTest("Blob"); isFileList = kindOfTest("FileList"); isStream = /* @__PURE__ */ __name((val) => isObject4(val) && isFunction2(val.pipe), "isStream"); __name(getGlobal, "getGlobal"); G2 = getGlobal(); FormDataCtor = typeof G2.FormData !== "undefined" ? G2.FormData : void 0; isFormData = /* @__PURE__ */ __name((thing) => { let kind; return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction2(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance kind === "object" && isFunction2(thing.toString) && thing.toString() === "[object FormData]")); }, "isFormData"); isURLSearchParams = kindOfTest("URLSearchParams"); [isReadableStream3, isRequest, isResponse, isHeaders] = [ "ReadableStream", "Request", "Response", "Headers" ].map(kindOfTest); trim = /* @__PURE__ */ __name((str) => { return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); }, "trim"); __name(forEach, "forEach"); __name(findKey, "findKey"); _global = (() => { if (typeof globalThis !== "undefined") return globalThis; return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; })(); isContextDefined = /* @__PURE__ */ __name((context2) => !isUndefined(context2) && context2 !== _global, "isContextDefined"); __name(merge3, "merge"); extend2 = /* @__PURE__ */ __name((a2, b2, thisArg, { allOwnKeys } = {}) => { forEach( b2, (val, key) => { if (thisArg && isFunction2(val)) { Object.defineProperty(a2, key, { value: bind(val, thisArg), writable: true, enumerable: true, configurable: true }); } else { Object.defineProperty(a2, key, { value: val, writable: true, enumerable: true, configurable: true }); } }, { allOwnKeys } ); return a2; }, "extend"); stripBOM = /* @__PURE__ */ __name((content) => { if (content.charCodeAt(0) === 65279) { content = content.slice(1); } return content; }, "stripBOM"); inherits = /* @__PURE__ */ __name((constructor, superConstructor, props, descriptors) => { constructor.prototype = Object.create(superConstructor.prototype, descriptors); Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, enumerable: false, configurable: true }); Object.defineProperty(constructor, "super", { value: superConstructor.prototype }); props && Object.assign(constructor.prototype, props); }, "inherits"); toFlatObject = /* @__PURE__ */ __name((sourceObj, destObj, filter2, propFilter) => { let props; let i2; let prop; const merged = {}; destObj = destObj || {}; if (sourceObj == null) return destObj; do { props = Object.getOwnPropertyNames(sourceObj); i2 = props.length; while (i2-- > 0) { prop = props[i2]; if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { destObj[prop] = sourceObj[prop]; merged[prop] = true; } } sourceObj = filter2 !== false && getPrototypeOf(sourceObj); } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype); return destObj; }, "toFlatObject"); endsWith = /* @__PURE__ */ __name((str, searchString, position) => { str = String(str); if (position === void 0 || position > str.length) { position = str.length; } position -= searchString.length; const lastIndex = str.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; }, "endsWith"); toArray = /* @__PURE__ */ __name((thing) => { if (!thing) return null; if (isArray(thing)) return thing; let i2 = thing.length; if (!isNumber(i2)) return null; const arr = new Array(i2); while (i2-- > 0) { arr[i2] = thing[i2]; } return arr; }, "toArray"); isTypedArray = ((TypedArray) => { return (thing) => { return TypedArray && thing instanceof TypedArray; }; })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); forEachEntry = /* @__PURE__ */ __name((obj, fn) => { const generator = obj && obj[iterator]; const _iterator = generator.call(obj); let result; while ((result = _iterator.next()) && !result.done) { const pair = result.value; fn.call(obj, pair[0], pair[1]); } }, "forEachEntry"); matchAll = /* @__PURE__ */ __name((regExp, str) => { let matches; const arr = []; while ((matches = regExp.exec(str)) !== null) { arr.push(matches); } return arr; }, "matchAll"); isHTMLForm = kindOfTest("HTMLFormElement"); toCamelCase2 = /* @__PURE__ */ __name((str) => { return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, /* @__PURE__ */ __name(function replacer(m2, p1, p2) { return p1.toUpperCase() + p2; }, "replacer")); }, "toCamelCase"); hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); isRegExp = kindOfTest("RegExp"); reduceDescriptors = /* @__PURE__ */ __name((obj, reducer) => { const descriptors = Object.getOwnPropertyDescriptors(obj); const reducedDescriptors = {}; forEach(descriptors, (descriptor, name) => { let ret; if ((ret = reducer(descriptor, name, obj)) !== false) { reducedDescriptors[name] = ret || descriptor; } }); Object.defineProperties(obj, reducedDescriptors); }, "reduceDescriptors"); freezeMethods = /* @__PURE__ */ __name((obj) => { reduceDescriptors(obj, (descriptor, name) => { if (isFunction2(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { return false; } const value = obj[name]; if (!isFunction2(value)) return; descriptor.enumerable = false; if ("writable" in descriptor) { descriptor.writable = false; return; } if (!descriptor.set) { descriptor.set = () => { throw Error("Can not rewrite read-only method '" + name + "'"); }; } }); }, "freezeMethods"); toObjectSet = /* @__PURE__ */ __name((arrayOrString, delimiter) => { const obj = {}; const define2 = /* @__PURE__ */ __name((arr) => { arr.forEach((value) => { obj[value] = true; }); }, "define"); isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter)); return obj; }, "toObjectSet"); noop2 = /* @__PURE__ */ __name(() => { }, "noop"); toFiniteNumber = /* @__PURE__ */ __name((value, defaultValue) => { return value != null && Number.isFinite(value = +value) ? value : defaultValue; }, "toFiniteNumber"); __name(isSpecCompliantForm, "isSpecCompliantForm"); toJSONObject = /* @__PURE__ */ __name((obj) => { const stack = new Array(10); const visit = /* @__PURE__ */ __name((source, i2) => { if (isObject4(source)) { if (stack.indexOf(source) >= 0) { return; } if (isBuffer(source)) { return source; } if (!("toJSON" in source)) { stack[i2] = source; const target = isArray(source) ? [] : {}; forEach(source, (value, key) => { const reducedValue = visit(value, i2 + 1); !isUndefined(reducedValue) && (target[key] = reducedValue); }); stack[i2] = void 0; return target; } } return source; }, "visit"); return visit(obj, 0); }, "toJSONObject"); isAsyncFn = kindOfTest("AsyncFunction"); isThenable = /* @__PURE__ */ __name((thing) => thing && (isObject4(thing) || isFunction2(thing)) && isFunction2(thing.then) && isFunction2(thing.catch), "isThenable"); _setImmediate = ((setImmediateSupported, postMessageSupported) => { if (setImmediateSupported) { return setImmediate; } return postMessageSupported ? ((token, callbacks) => { _global.addEventListener( "message", ({ source, data }) => { if (source === _global && data === token) { callbacks.length && callbacks.shift()(); } }, false ); return (cb2) => { callbacks.push(cb2); _global.postMessage(token, "*"); }; })(`axios@${Math.random()}`, []) : (cb2) => setTimeout(cb2); })(typeof setImmediate === "function", isFunction2(_global.postMessage)); asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; isIterable = /* @__PURE__ */ __name((thing) => thing != null && isFunction2(thing[iterator]), "isIterable"); utils_default = { isArray, isArrayBuffer: isArrayBuffer2, isBuffer, isFormData, isArrayBufferView, isString, isNumber, isBoolean, isObject: isObject4, isPlainObject: isPlainObject3, isEmptyObject, isReadableStream: isReadableStream3, isRequest, isResponse, isHeaders, isUndefined, isDate, isFile, isReactNativeBlob, isReactNative, isBlob, isRegExp, isFunction: isFunction2, isStream, isURLSearchParams, isTypedArray, isFileList, forEach, merge: merge3, extend: extend2, trim, stripBOM, inherits, toFlatObject, kindOf, kindOfTest, endsWith, toArray, forEachEntry, matchAll, isHTMLForm, hasOwnProperty, hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors, freezeMethods, toObjectSet, toCamelCase: toCamelCase2, noop: noop2, toFiniteNumber, findKey, global: _global, isContextDefined, isSpecCompliantForm, toJSONObject, isAsyncFn, isThenable, setImmediate: _setImmediate, asap, isIterable }; } }); // ../../node_modules/axios/lib/core/AxiosError.js var AxiosError, AxiosError_default; var init_AxiosError = __esm({ "../../node_modules/axios/lib/core/AxiosError.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); AxiosError = class extends Error { static from(error50, code, config3, request, response, customProps) { const axiosError = new AxiosError(error50.message, code || error50.code, config3, request, response); axiosError.cause = error50; axiosError.name = error50.name; if (error50.status != null && axiosError.status == null) { axiosError.status = error50.status; } customProps && Object.assign(axiosError, customProps); return axiosError; } /** * Create an Error with the specified message, config, error code, request and response. * * @param {string} message The error message. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [config] The config. * @param {Object} [request] The request. * @param {Object} [response] The response. * * @returns {Error} The created error. */ constructor(message2, code, config3, request, response) { super(message2); Object.defineProperty(this, "message", { value: message2, enumerable: true, writable: true, configurable: true }); this.name = "AxiosError"; this.isAxiosError = true; code && (this.code = code); config3 && (this.config = config3); request && (this.request = request); if (response) { this.response = response; this.status = response.status; } } toJSON() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: utils_default.toJSONObject(this.config), code: this.code, status: this.status }; } }; __name(AxiosError, "AxiosError"); AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION"; AxiosError.ECONNABORTED = "ECONNABORTED"; AxiosError.ETIMEDOUT = "ETIMEDOUT"; AxiosError.ERR_NETWORK = "ERR_NETWORK"; AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED"; AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; AxiosError.ERR_CANCELED = "ERR_CANCELED"; AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL"; AxiosError_default = AxiosError; } }); // ../../node_modules/axios/lib/helpers/null.js var null_default; var init_null = __esm({ "../../node_modules/axios/lib/helpers/null.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); null_default = null; } }); // ../../node_modules/axios/lib/helpers/toFormData.js function isVisitable(thing) { return utils_default.isPlainObject(thing) || utils_default.isArray(thing); } function removeBrackets(key) { return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; } function renderKey(path, key, dots) { if (!path) return key; return path.concat(key).map(/* @__PURE__ */ __name(function each(token, i2) { token = removeBrackets(token); return !dots && i2 ? "[" + token + "]" : token; }, "each")).join(dots ? "." : ""); } function isFlatArray(arr) { return utils_default.isArray(arr) && !arr.some(isVisitable); } function toFormData(obj, formData, options) { if (!utils_default.isObject(obj)) { throw new TypeError("target must be an object"); } formData = formData || new (null_default || FormData)(); options = utils_default.toFlatObject( options, { metaTokens: true, dots: false, indexes: false }, false, /* @__PURE__ */ __name(function defined(option, source) { return !utils_default.isUndefined(source[option]); }, "defined") ); const metaTokens = options.metaTokens; const visitor = options.visitor || defaultVisitor; const dots = options.dots; const indexes = options.indexes; const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; const useBlob = _Blob && utils_default.isSpecCompliantForm(formData); if (!utils_default.isFunction(visitor)) { throw new TypeError("visitor must be a function"); } function convertValue(value) { if (value === null) return ""; if (utils_default.isDate(value)) { return value.toISOString(); } if (utils_default.isBoolean(value)) { return value.toString(); } if (!useBlob && utils_default.isBlob(value)) { throw new AxiosError_default("Blob is not supported. Use a Buffer instead."); } if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) { return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); } return value; } __name(convertValue, "convertValue"); function defaultVisitor(value, key, path) { let arr = value; if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) { formData.append(renderKey(path, key, dots), convertValue(value)); return false; } if (value && !path && typeof value === "object") { if (utils_default.endsWith(key, "{}")) { key = metaTokens ? key : key.slice(0, -2); value = JSON.stringify(value); } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) { key = removeBrackets(key); arr.forEach(/* @__PURE__ */ __name(function each(el, index) { !(utils_default.isUndefined(el) || el === null) && formData.append( // eslint-disable-next-line no-nested-ternary indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", convertValue(el) ); }, "each")); return false; } } if (isVisitable(value)) { return true; } formData.append(renderKey(path, key, dots), convertValue(value)); return false; } __name(defaultVisitor, "defaultVisitor"); const stack = []; const exposedHelpers = Object.assign(predicates, { defaultVisitor, convertValue, isVisitable }); function build(value, path) { if (utils_default.isUndefined(value)) return; if (stack.indexOf(value) !== -1) { throw Error("Circular reference detected in " + path.join(".")); } stack.push(value); utils_default.forEach(value, /* @__PURE__ */ __name(function each(el, key) { const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers); if (result === true) { build(el, path ? path.concat(key) : [key]); } }, "each")); stack.pop(); } __name(build, "build"); if (!utils_default.isObject(obj)) { throw new TypeError("data must be an object"); } build(obj); return formData; } var predicates, toFormData_default; var init_toFormData = __esm({ "../../node_modules/axios/lib/helpers/toFormData.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_AxiosError(); init_null(); __name(isVisitable, "isVisitable"); __name(removeBrackets, "removeBrackets"); __name(renderKey, "renderKey"); __name(isFlatArray, "isFlatArray"); predicates = utils_default.toFlatObject(utils_default, {}, null, /* @__PURE__ */ __name(function filter(prop) { return /^is[A-Z]/.test(prop); }, "filter")); __name(toFormData, "toFormData"); toFormData_default = toFormData; } }); // ../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js function encode5(str) { const charMap = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, /* @__PURE__ */ __name(function replacer(match2) { return charMap[match2]; }, "replacer")); } function AxiosURLSearchParams(params, options) { this._pairs = []; params && toFormData_default(params, this, options); } var prototype, AxiosURLSearchParams_default; var init_AxiosURLSearchParams = __esm({ "../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_toFormData(); __name(encode5, "encode"); __name(AxiosURLSearchParams, "AxiosURLSearchParams"); prototype = AxiosURLSearchParams.prototype; prototype.append = /* @__PURE__ */ __name(function append(name, value) { this._pairs.push([name, value]); }, "append"); prototype.toString = /* @__PURE__ */ __name(function toString2(encoder2) { const _encode2 = encoder2 ? function(value) { return encoder2.call(this, value, encode5); } : encode5; return this._pairs.map(/* @__PURE__ */ __name(function each(pair) { return _encode2(pair[0]) + "=" + _encode2(pair[1]); }, "each"), "").join("&"); }, "toString"); AxiosURLSearchParams_default = AxiosURLSearchParams; } }); // ../../node_modules/axios/lib/helpers/buildURL.js function encode6(val) { return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); } function buildURL(url2, params, options) { if (!params) { return url2; } const _encode2 = options && options.encode || encode6; const _options = utils_default.isFunction(options) ? { serialize: options } : options; const serializeFn = _options && _options.serialize; let serializedParams; if (serializeFn) { serializedParams = serializeFn(params, _options); } else { serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode2); } if (serializedParams) { const hashmarkIndex = url2.indexOf("#"); if (hashmarkIndex !== -1) { url2 = url2.slice(0, hashmarkIndex); } url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams; } return url2; } var init_buildURL = __esm({ "../../node_modules/axios/lib/helpers/buildURL.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_AxiosURLSearchParams(); __name(encode6, "encode"); __name(buildURL, "buildURL"); } }); // ../../node_modules/axios/lib/core/InterceptorManager.js var InterceptorManager, InterceptorManager_default; var init_InterceptorManager = __esm({ "../../node_modules/axios/lib/core/InterceptorManager.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); InterceptorManager = class { constructor() { this.handlers = []; } /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * @param {Object} options The options for the interceptor, synchronous and runWhen * * @return {Number} An ID used to remove interceptor later */ use(fulfilled, rejected, options) { this.handlers.push({ fulfilled, rejected, synchronous: options ? options.synchronous : false, runWhen: options ? options.runWhen : null }); return this.handlers.length - 1; } /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` * * @returns {void} */ eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } } /** * Clear all interceptors from the stack * * @returns {void} */ clear() { if (this.handlers) { this.handlers = []; } } /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor * * @returns {void} */ forEach(fn) { utils_default.forEach(this.handlers, /* @__PURE__ */ __name(function forEachHandler(h2) { if (h2 !== null) { fn(h2); } }, "forEachHandler")); } }; __name(InterceptorManager, "InterceptorManager"); InterceptorManager_default = InterceptorManager; } }); // ../../node_modules/axios/lib/defaults/transitional.js var transitional_default; var init_transitional = __esm({ "../../node_modules/axios/lib/defaults/transitional.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); transitional_default = { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false, legacyInterceptorReqResOrdering: true }; } }); // ../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js var URLSearchParams_default; var init_URLSearchParams = __esm({ "../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AxiosURLSearchParams(); URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default; } }); // ../../node_modules/axios/lib/platform/browser/classes/FormData.js var FormData_default; var init_FormData = __esm({ "../../node_modules/axios/lib/platform/browser/classes/FormData.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); FormData_default = typeof FormData !== "undefined" ? FormData : null; } }); // ../../node_modules/axios/lib/platform/browser/classes/Blob.js var Blob_default; var init_Blob = __esm({ "../../node_modules/axios/lib/platform/browser/classes/Blob.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); Blob_default = typeof Blob !== "undefined" ? Blob : null; } }); // ../../node_modules/axios/lib/platform/browser/index.js var browser_default; var init_browser = __esm({ "../../node_modules/axios/lib/platform/browser/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_URLSearchParams(); init_FormData(); init_Blob(); browser_default = { isBrowser: true, classes: { URLSearchParams: URLSearchParams_default, FormData: FormData_default, Blob: Blob_default }, protocols: ["http", "https", "file", "blob", "url", "data"] }; } }); // ../../node_modules/axios/lib/platform/common/utils.js var utils_exports = {}; __export(utils_exports, { hasBrowserEnv: () => hasBrowserEnv, hasStandardBrowserEnv: () => hasStandardBrowserEnv, hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, navigator: () => _navigator, origin: () => origin }); var hasBrowserEnv, _navigator, hasStandardBrowserEnv, hasStandardBrowserWebWorkerEnv, origin; var init_utils9 = __esm({ "../../node_modules/axios/lib/platform/common/utils.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; _navigator = typeof navigator === "object" && navigator || void 0; hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); hasStandardBrowserWebWorkerEnv = (() => { return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; })(); origin = hasBrowserEnv && window.location.href || "http://localhost"; } }); // ../../node_modules/axios/lib/platform/index.js var platform_default; var init_platform = __esm({ "../../node_modules/axios/lib/platform/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_browser(); init_utils9(); platform_default = { ...utils_exports, ...browser_default }; } }); // ../../node_modules/axios/lib/helpers/toURLEncodedForm.js function toURLEncodedForm(data, options) { return toFormData_default(data, new platform_default.classes.URLSearchParams(), { visitor: function(value, key, path, helpers) { if (platform_default.isNode && utils_default.isBuffer(value)) { this.append(key, value.toString("base64")); return false; } return helpers.defaultVisitor.apply(this, arguments); }, ...options }); } var init_toURLEncodedForm = __esm({ "../../node_modules/axios/lib/helpers/toURLEncodedForm.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_toFormData(); init_platform(); __name(toURLEncodedForm, "toURLEncodedForm"); } }); // ../../node_modules/axios/lib/helpers/formDataToJSON.js function parsePropPath(name) { return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => { return match2[0] === "[]" ? "" : match2[1] || match2[0]; }); } function arrayToObject(arr) { const obj = {}; const keys = Object.keys(arr); let i2; const len = keys.length; let key; for (i2 = 0; i2 < len; i2++) { key = keys[i2]; obj[key] = arr[key]; } return obj; } function formDataToJSON(formData) { function buildPath(path, value, target, index) { let name = path[index++]; if (name === "__proto__") return true; const isNumericKey = Number.isFinite(+name); const isLast = index >= path.length; name = !name && utils_default.isArray(target) ? target.length : name; if (isLast) { if (utils_default.hasOwnProp(target, name)) { target[name] = [target[name], value]; } else { target[name] = value; } return !isNumericKey; } if (!target[name] || !utils_default.isObject(target[name])) { target[name] = []; } const result = buildPath(path, value, target[name], index); if (result && utils_default.isArray(target[name])) { target[name] = arrayToObject(target[name]); } return !isNumericKey; } __name(buildPath, "buildPath"); if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) { const obj = {}; utils_default.forEachEntry(formData, (name, value) => { buildPath(parsePropPath(name), value, obj, 0); }); return obj; } return null; } var formDataToJSON_default; var init_formDataToJSON = __esm({ "../../node_modules/axios/lib/helpers/formDataToJSON.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); __name(parsePropPath, "parsePropPath"); __name(arrayToObject, "arrayToObject"); __name(formDataToJSON, "formDataToJSON"); formDataToJSON_default = formDataToJSON; } }); // ../../node_modules/axios/lib/defaults/index.js function stringifySafely(rawValue, parser2, encoder2) { if (utils_default.isString(rawValue)) { try { (parser2 || JSON.parse)(rawValue); return utils_default.trim(rawValue); } catch (e2) { if (e2.name !== "SyntaxError") { throw e2; } } } return (encoder2 || JSON.stringify)(rawValue); } var defaults, defaults_default; var init_defaults = __esm({ "../../node_modules/axios/lib/defaults/index.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_AxiosError(); init_transitional(); init_toFormData(); init_toURLEncodedForm(); init_platform(); init_formDataToJSON(); __name(stringifySafely, "stringifySafely"); defaults = { transitional: transitional_default, adapter: ["xhr", "http", "fetch"], transformRequest: [ /* @__PURE__ */ __name(function transformRequest(data, headers) { const contentType = headers.getContentType() || ""; const hasJSONContentType = contentType.indexOf("application/json") > -1; const isObjectPayload = utils_default.isObject(data); if (isObjectPayload && utils_default.isHTMLForm(data)) { data = new FormData(data); } const isFormData2 = utils_default.isFormData(data); if (isFormData2) { return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data; } if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) { return data; } if (utils_default.isArrayBufferView(data)) { return data.buffer; } if (utils_default.isURLSearchParams(data)) { headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); return data.toString(); } let isFileList2; if (isObjectPayload) { if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { return toURLEncodedForm(data, this.formSerializer).toString(); } if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { const _FormData = this.env && this.env.FormData; return toFormData_default( isFileList2 ? { "files[]": data } : data, _FormData && new _FormData(), this.formSerializer ); } } if (isObjectPayload || hasJSONContentType) { headers.setContentType("application/json", false); return stringifySafely(data); } return data; }, "transformRequest") ], transformResponse: [ /* @__PURE__ */ __name(function transformResponse(data) { const transitional2 = this.transitional || defaults.transitional; const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing; const JSONRequested = this.responseType === "json"; if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) { return data; } if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { const silentJSONParsing = transitional2 && transitional2.silentJSONParsing; const strictJSONParsing = !silentJSONParsing && JSONRequested; try { return JSON.parse(data, this.parseReviver); } catch (e2) { if (strictJSONParsing) { if (e2.name === "SyntaxError") { throw AxiosError_default.from(e2, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response); } throw e2; } } } return data; }, "transformResponse") ], /** * A timeout in milliseconds to abort a request. If set to 0 (default) a * timeout is not created. */ timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", maxContentLength: -1, maxBodyLength: -1, env: { FormData: platform_default.classes.FormData, Blob: platform_default.classes.Blob }, validateStatus: /* @__PURE__ */ __name(function validateStatus(status) { return status >= 200 && status < 300; }, "validateStatus"), headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { defaults.headers[method] = {}; }); defaults_default = defaults; } }); // ../../node_modules/axios/lib/helpers/parseHeaders.js var ignoreDuplicateOf, parseHeaders_default; var init_parseHeaders = __esm({ "../../node_modules/axios/lib/helpers/parseHeaders.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); ignoreDuplicateOf = utils_default.toObjectSet([ "age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent" ]); parseHeaders_default = /* @__PURE__ */ __name((rawHeaders) => { const parsed = {}; let key; let val; let i2; rawHeaders && rawHeaders.split("\n").forEach(/* @__PURE__ */ __name(function parser2(line) { i2 = line.indexOf(":"); key = line.substring(0, i2).trim().toLowerCase(); val = line.substring(i2 + 1).trim(); if (!key || parsed[key] && ignoreDuplicateOf[key]) { return; } if (key === "set-cookie") { if (parsed[key]) { parsed[key].push(val); } else { parsed[key] = [val]; } } else { parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; } }, "parser")); return parsed; }, "default"); } }); // ../../node_modules/axios/lib/core/AxiosHeaders.js function normalizeHeader(header) { return header && String(header).trim().toLowerCase(); } function normalizeValue(value) { if (value === false || value == null) { return value; } return utils_default.isArray(value) ? value.map(normalizeValue) : String(value); } function parseTokens(str) { const tokens = /* @__PURE__ */ Object.create(null); const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let match2; while (match2 = tokensRE.exec(str)) { tokens[match2[1]] = match2[2]; } return tokens; } function matchHeaderValue(context2, value, header, filter2, isHeaderNameFilter) { if (utils_default.isFunction(filter2)) { return filter2.call(this, value, header); } if (isHeaderNameFilter) { value = header; } if (!utils_default.isString(value)) return; if (utils_default.isString(filter2)) { return value.indexOf(filter2) !== -1; } if (utils_default.isRegExp(filter2)) { return filter2.test(value); } } function formatHeader(header) { return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char, str) => { return char.toUpperCase() + str; }); } function buildAccessors(obj, header) { const accessorName = utils_default.toCamelCase(" " + header); ["get", "set", "has"].forEach((methodName) => { Object.defineProperty(obj, methodName + accessorName, { value: function(arg1, arg2, arg3) { return this[methodName].call(this, header, arg1, arg2, arg3); }, configurable: true }); }); } var $internals, isValidHeaderName, AxiosHeaders, AxiosHeaders_default; var init_AxiosHeaders = __esm({ "../../node_modules/axios/lib/core/AxiosHeaders.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_parseHeaders(); $internals = Symbol("internals"); __name(normalizeHeader, "normalizeHeader"); __name(normalizeValue, "normalizeValue"); __name(parseTokens, "parseTokens"); isValidHeaderName = /* @__PURE__ */ __name((str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), "isValidHeaderName"); __name(matchHeaderValue, "matchHeaderValue"); __name(formatHeader, "formatHeader"); __name(buildAccessors, "buildAccessors"); AxiosHeaders = class { constructor(headers) { headers && this.set(headers); } set(header, valueOrRewrite, rewrite) { const self2 = this; function setHeader(_value, _header, _rewrite) { const lHeader = normalizeHeader(_header); if (!lHeader) { throw new Error("header name must be a non-empty string"); } const key = utils_default.findKey(self2, lHeader); if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { self2[key || _header] = normalizeValue(_value); } } __name(setHeader, "setHeader"); const setHeaders = /* @__PURE__ */ __name((headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)), "setHeaders"); if (utils_default.isPlainObject(header) || header instanceof this.constructor) { setHeaders(header, valueOrRewrite); } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { setHeaders(parseHeaders_default(header), valueOrRewrite); } else if (utils_default.isObject(header) && utils_default.isIterable(header)) { let obj = {}, dest, key; for (const entry of header) { if (!utils_default.isArray(entry)) { throw TypeError("Object iterator must return a key-value pair"); } obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; } setHeaders(obj, valueOrRewrite); } else { header != null && setHeader(valueOrRewrite, header, rewrite); } return this; } get(header, parser2) { header = normalizeHeader(header); if (header) { const key = utils_default.findKey(this, header); if (key) { const value = this[key]; if (!parser2) { return value; } if (parser2 === true) { return parseTokens(value); } if (utils_default.isFunction(parser2)) { return parser2.call(this, value, key); } if (utils_default.isRegExp(parser2)) { return parser2.exec(value); } throw new TypeError("parser must be boolean|regexp|function"); } } } has(header, matcher) { header = normalizeHeader(header); if (header) { const key = utils_default.findKey(this, header); return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); } return false; } delete(header, matcher) { const self2 = this; let deleted = false; function deleteHeader(_header) { _header = normalizeHeader(_header); if (_header) { const key = utils_default.findKey(self2, _header); if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { delete self2[key]; deleted = true; } } } __name(deleteHeader, "deleteHeader"); if (utils_default.isArray(header)) { header.forEach(deleteHeader); } else { deleteHeader(header); } return deleted; } clear(matcher) { const keys = Object.keys(this); let i2 = keys.length; let deleted = false; while (i2--) { const key = keys[i2]; if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { delete this[key]; deleted = true; } } return deleted; } normalize(format2) { const self2 = this; const headers = {}; utils_default.forEach(this, (value, header) => { const key = utils_default.findKey(headers, header); if (key) { self2[key] = normalizeValue(value); delete self2[header]; return; } const normalized = format2 ? formatHeader(header) : String(header).trim(); if (normalized !== header) { delete self2[header]; } self2[normalized] = normalizeValue(value); headers[normalized] = true; }); return this; } concat(...targets) { return this.constructor.concat(this, ...targets); } toJSON(asStrings) { const obj = /* @__PURE__ */ Object.create(null); utils_default.forEach(this, (value, header) => { value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value); }); return obj; } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator](); } toString() { return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); } getSetCookie() { return this.get("set-cookie") || []; } get [Symbol.toStringTag]() { return "AxiosHeaders"; } static from(thing) { return thing instanceof this ? thing : new this(thing); } static concat(first, ...targets) { const computed = new this(first); targets.forEach((target) => computed.set(target)); return computed; } static accessor(header) { const internals = this[$internals] = this[$internals] = { accessors: {} }; const accessors = internals.accessors; const prototype2 = this.prototype; function defineAccessor(_header) { const lHeader = normalizeHeader(_header); if (!accessors[lHeader]) { buildAccessors(prototype2, _header); accessors[lHeader] = true; } } __name(defineAccessor, "defineAccessor"); utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); return this; } }; __name(AxiosHeaders, "AxiosHeaders"); AxiosHeaders.accessor([ "Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization" ]); utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { let mapped = key[0].toUpperCase() + key.slice(1); return { get: () => value, set(headerValue) { this[mapped] = headerValue; } }; }); utils_default.freezeMethods(AxiosHeaders); AxiosHeaders_default = AxiosHeaders; } }); // ../../node_modules/axios/lib/core/transformData.js function transformData(fns, response) { const config3 = this || defaults_default; const context2 = response || config3; const headers = AxiosHeaders_default.from(context2.headers); let data = context2.data; utils_default.forEach(fns, /* @__PURE__ */ __name(function transform2(fn) { data = fn.call(config3, data, headers.normalize(), response ? response.status : void 0); }, "transform")); headers.normalize(); return data; } var init_transformData = __esm({ "../../node_modules/axios/lib/core/transformData.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_defaults(); init_AxiosHeaders(); __name(transformData, "transformData"); } }); // ../../node_modules/axios/lib/cancel/isCancel.js function isCancel(value) { return !!(value && value.__CANCEL__); } var init_isCancel = __esm({ "../../node_modules/axios/lib/cancel/isCancel.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(isCancel, "isCancel"); } }); // ../../node_modules/axios/lib/cancel/CanceledError.js var CanceledError, CanceledError_default; var init_CanceledError = __esm({ "../../node_modules/axios/lib/cancel/CanceledError.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AxiosError(); CanceledError = class extends AxiosError_default { /** * A `CanceledError` is an object that is thrown when an operation is canceled. * * @param {string=} message The message. * @param {Object=} config The config. * @param {Object=} request The request. * * @returns {CanceledError} The created error. */ constructor(message2, config3, request) { super(message2 == null ? "canceled" : message2, AxiosError_default.ERR_CANCELED, config3, request); this.name = "CanceledError"; this.__CANCEL__ = true; } }; __name(CanceledError, "CanceledError"); CanceledError_default = CanceledError; } }); // ../../node_modules/axios/lib/core/settle.js function settle(resolve, reject, response) { const validateStatus2 = response.config.validateStatus; if (!response.status || !validateStatus2 || validateStatus2(response.status)) { resolve(response); } else { reject( new AxiosError_default( "Request failed with status code " + response.status, [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response ) ); } } var init_settle = __esm({ "../../node_modules/axios/lib/core/settle.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_AxiosError(); __name(settle, "settle"); } }); // ../../node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url2) { const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2); return match2 && match2[1] || ""; } var init_parseProtocol = __esm({ "../../node_modules/axios/lib/helpers/parseProtocol.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(parseProtocol, "parseProtocol"); } }); // ../../node_modules/axios/lib/helpers/speedometer.js function speedometer(samplesCount, min) { samplesCount = samplesCount || 10; const bytes = new Array(samplesCount); const timestamps = new Array(samplesCount); let head = 0; let tail = 0; let firstSampleTS; min = min !== void 0 ? min : 1e3; return /* @__PURE__ */ __name(function push(chunkLength) { const now = Date.now(); const startedAt = timestamps[tail]; if (!firstSampleTS) { firstSampleTS = now; } bytes[head] = chunkLength; timestamps[head] = now; let i2 = tail; let bytesCount = 0; while (i2 !== head) { bytesCount += bytes[i2++]; i2 = i2 % samplesCount; } head = (head + 1) % samplesCount; if (head === tail) { tail = (tail + 1) % samplesCount; } if (now - firstSampleTS < min) { return; } const passed = startedAt && now - startedAt; return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; }, "push"); } var speedometer_default; var init_speedometer = __esm({ "../../node_modules/axios/lib/helpers/speedometer.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(speedometer, "speedometer"); speedometer_default = speedometer; } }); // ../../node_modules/axios/lib/helpers/throttle.js function throttle(fn, freq) { let timestamp = 0; let threshold = 1e3 / freq; let lastArgs; let timer; const invoke = /* @__PURE__ */ __name((args, now = Date.now()) => { timestamp = now; lastArgs = null; if (timer) { clearTimeout(timer); timer = null; } fn(...args); }, "invoke"); const throttled = /* @__PURE__ */ __name((...args) => { const now = Date.now(); const passed = now - timestamp; if (passed >= threshold) { invoke(args, now); } else { lastArgs = args; if (!timer) { timer = setTimeout(() => { timer = null; invoke(lastArgs); }, threshold - passed); } } }, "throttled"); const flush2 = /* @__PURE__ */ __name(() => lastArgs && invoke(lastArgs), "flush"); return [throttled, flush2]; } var throttle_default; var init_throttle = __esm({ "../../node_modules/axios/lib/helpers/throttle.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(throttle, "throttle"); throttle_default = throttle; } }); // ../../node_modules/axios/lib/helpers/progressEventReducer.js var progressEventReducer, progressEventDecorator, asyncDecorator; var init_progressEventReducer = __esm({ "../../node_modules/axios/lib/helpers/progressEventReducer.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_speedometer(); init_throttle(); init_utils8(); progressEventReducer = /* @__PURE__ */ __name((listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = speedometer_default(50, 250); return throttle_default((e2) => { const loaded = e2.loaded; const total = e2.lengthComputable ? e2.total : void 0; const progressBytes = loaded - bytesNotified; const rate = _speedometer(progressBytes); const inRange = loaded <= total; bytesNotified = loaded; const data = { loaded, total, progress: total ? loaded / total : void 0, bytes: progressBytes, rate: rate ? rate : void 0, estimated: rate && total && inRange ? (total - loaded) / rate : void 0, event: e2, lengthComputable: total != null, [isDownloadStream ? "download" : "upload"]: true }; listener(data); }, freq); }, "progressEventReducer"); progressEventDecorator = /* @__PURE__ */ __name((total, throttled) => { const lengthComputable = total != null; return [ (loaded) => throttled[0]({ lengthComputable, total, loaded }), throttled[1] ]; }, "progressEventDecorator"); asyncDecorator = /* @__PURE__ */ __name((fn) => (...args) => utils_default.asap(() => fn(...args)), "asyncDecorator"); } }); // ../../node_modules/axios/lib/helpers/isURLSameOrigin.js var isURLSameOrigin_default; var init_isURLSameOrigin = __esm({ "../../node_modules/axios/lib/helpers/isURLSameOrigin.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_platform(); isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin2, isMSIE) => (url2) => { url2 = new URL(url2, platform_default.origin); return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port); })( new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent) ) : () => true; } }); // ../../node_modules/axios/lib/helpers/cookies.js var cookies_default; var init_cookies = __esm({ "../../node_modules/axios/lib/helpers/cookies.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_platform(); cookies_default = platform_default.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { write(name, value, expires, path, domain3, secure, sameSite) { if (typeof document === "undefined") return; const cookie = [`${name}=${encodeURIComponent(value)}`]; if (utils_default.isNumber(expires)) { cookie.push(`expires=${new Date(expires).toUTCString()}`); } if (utils_default.isString(path)) { cookie.push(`path=${path}`); } if (utils_default.isString(domain3)) { cookie.push(`domain=${domain3}`); } if (secure === true) { cookie.push("secure"); } if (utils_default.isString(sameSite)) { cookie.push(`SameSite=${sameSite}`); } document.cookie = cookie.join("; "); }, read(name) { if (typeof document === "undefined") return null; const match2 = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); return match2 ? decodeURIComponent(match2[1]) : null; }, remove(name) { this.write(name, "", Date.now() - 864e5, "/"); } } ) : ( // Non-standard browser env (web workers, react-native) lack needed support. { write() { }, read() { return null; }, remove() { } } ); } }); // ../../node_modules/axios/lib/helpers/isAbsoluteURL.js function isAbsoluteURL(url2) { if (typeof url2 !== "string") { return false; } return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2); } var init_isAbsoluteURL = __esm({ "../../node_modules/axios/lib/helpers/isAbsoluteURL.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(isAbsoluteURL, "isAbsoluteURL"); } }); // ../../node_modules/axios/lib/helpers/combineURLs.js function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; } var init_combineURLs = __esm({ "../../node_modules/axios/lib/helpers/combineURLs.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(combineURLs, "combineURLs"); } }); // ../../node_modules/axios/lib/core/buildFullPath.js function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { let isRelativeUrl = !isAbsoluteURL(requestedURL); if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { return combineURLs(baseURL, requestedURL); } return requestedURL; } var init_buildFullPath = __esm({ "../../node_modules/axios/lib/core/buildFullPath.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_isAbsoluteURL(); init_combineURLs(); __name(buildFullPath, "buildFullPath"); } }); // ../../node_modules/axios/lib/core/mergeConfig.js function mergeConfig(config1, config22) { config22 = config22 || {}; const config3 = {}; function getMergedValue(target, source, prop, caseless) { if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) { return utils_default.merge.call({ caseless }, target, source); } else if (utils_default.isPlainObject(source)) { return utils_default.merge({}, source); } else if (utils_default.isArray(source)) { return source.slice(); } return source; } __name(getMergedValue, "getMergedValue"); function mergeDeepProperties(a2, b2, prop, caseless) { if (!utils_default.isUndefined(b2)) { return getMergedValue(a2, b2, prop, caseless); } else if (!utils_default.isUndefined(a2)) { return getMergedValue(void 0, a2, prop, caseless); } } __name(mergeDeepProperties, "mergeDeepProperties"); function valueFromConfig2(a2, b2) { if (!utils_default.isUndefined(b2)) { return getMergedValue(void 0, b2); } } __name(valueFromConfig2, "valueFromConfig2"); function defaultToConfig2(a2, b2) { if (!utils_default.isUndefined(b2)) { return getMergedValue(void 0, b2); } else if (!utils_default.isUndefined(a2)) { return getMergedValue(void 0, a2); } } __name(defaultToConfig2, "defaultToConfig2"); function mergeDirectKeys(a2, b2, prop) { if (prop in config22) { return getMergedValue(a2, b2); } else if (prop in config1) { return getMergedValue(void 0, a2); } } __name(mergeDirectKeys, "mergeDirectKeys"); const mergeMap = { url: valueFromConfig2, method: valueFromConfig2, data: valueFromConfig2, baseURL: defaultToConfig2, transformRequest: defaultToConfig2, transformResponse: defaultToConfig2, paramsSerializer: defaultToConfig2, timeout: defaultToConfig2, timeoutMessage: defaultToConfig2, withCredentials: defaultToConfig2, withXSRFToken: defaultToConfig2, adapter: defaultToConfig2, responseType: defaultToConfig2, xsrfCookieName: defaultToConfig2, xsrfHeaderName: defaultToConfig2, onUploadProgress: defaultToConfig2, onDownloadProgress: defaultToConfig2, decompress: defaultToConfig2, maxContentLength: defaultToConfig2, maxBodyLength: defaultToConfig2, beforeRedirect: defaultToConfig2, transport: defaultToConfig2, httpAgent: defaultToConfig2, httpsAgent: defaultToConfig2, cancelToken: defaultToConfig2, socketPath: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, headers: (a2, b2, prop) => mergeDeepProperties(headersToObject(a2), headersToObject(b2), prop, true) }; utils_default.forEach(Object.keys({ ...config1, ...config22 }), /* @__PURE__ */ __name(function computeConfigValue(prop) { if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; const merge4 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; const configValue = merge4(config1[prop], config22[prop], prop); utils_default.isUndefined(configValue) && merge4 !== mergeDirectKeys || (config3[prop] = configValue); }, "computeConfigValue")); return config3; } var headersToObject; var init_mergeConfig = __esm({ "../../node_modules/axios/lib/core/mergeConfig.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_AxiosHeaders(); headersToObject = /* @__PURE__ */ __name((thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing, "headersToObject"); __name(mergeConfig, "mergeConfig"); } }); // ../../node_modules/axios/lib/helpers/resolveConfig.js var resolveConfig_default; var init_resolveConfig = __esm({ "../../node_modules/axios/lib/helpers/resolveConfig.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_platform(); init_utils8(); init_isURLSameOrigin(); init_cookies(); init_buildFullPath(); init_mergeConfig(); init_AxiosHeaders(); init_buildURL(); resolveConfig_default = /* @__PURE__ */ __name((config3) => { const newConfig = mergeConfig({}, config3); let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; newConfig.headers = headers = AxiosHeaders_default.from(headers); newConfig.url = buildURL( buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config3.params, config3.paramsSerializer ); if (auth) { headers.set( "Authorization", "Basic " + btoa( (auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "") ) ); } if (utils_default.isFormData(data)) { if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) { headers.setContentType(void 0); } else if (utils_default.isFunction(data.getHeaders)) { const formHeaders = data.getHeaders(); const allowedHeaders = ["content-type", "content-length"]; Object.entries(formHeaders).forEach(([key, val]) => { if (allowedHeaders.includes(key.toLowerCase())) { headers.set(key, val); } }); } } if (platform_default.hasStandardBrowserEnv) { withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) { const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); if (xsrfValue) { headers.set(xsrfHeaderName, xsrfValue); } } } return newConfig; }, "default"); } }); // ../../node_modules/axios/lib/adapters/xhr.js var isXHRAdapterSupported, xhr_default; var init_xhr = __esm({ "../../node_modules/axios/lib/adapters/xhr.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_settle(); init_transitional(); init_AxiosError(); init_CanceledError(); init_parseProtocol(); init_platform(); init_AxiosHeaders(); init_progressEventReducer(); init_resolveConfig(); isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; xhr_default = isXHRAdapterSupported && function(config3) { return new Promise(/* @__PURE__ */ __name(function dispatchXhrRequest(resolve, reject) { const _config = resolveConfig_default(config3); let requestData = _config.data; const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize(); let { responseType, onUploadProgress, onDownloadProgress } = _config; let onCanceled; let uploadThrottled, downloadThrottled; let flushUpload, flushDownload; function done() { flushUpload && flushUpload(); flushDownload && flushDownload(); _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); _config.signal && _config.signal.removeEventListener("abort", onCanceled); } __name(done, "done"); let request = new XMLHttpRequest(); request.open(_config.method.toUpperCase(), _config.url, true); request.timeout = _config.timeout; function onloadend() { if (!request) { return; } const responseHeaders = AxiosHeaders_default.from( "getAllResponseHeaders" in request && request.getAllResponseHeaders() ); const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; const response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config3, request }; settle( /* @__PURE__ */ __name(function _resolve(value) { resolve(value); done(); }, "_resolve"), /* @__PURE__ */ __name(function _reject(err) { reject(err); done(); }, "_reject"), response ); request = null; } __name(onloadend, "onloadend"); if ("onloadend" in request) { request.onloadend = onloadend; } else { request.onreadystatechange = /* @__PURE__ */ __name(function handleLoad() { if (!request || request.readyState !== 4) { return; } if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { return; } setTimeout(onloadend); }, "handleLoad"); } request.onabort = /* @__PURE__ */ __name(function handleAbort() { if (!request) { return; } reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config3, request)); request = null; }, "handleAbort"); request.onerror = /* @__PURE__ */ __name(function handleError(event) { const msg = event && event.message ? event.message : "Network Error"; const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config3, request); err.event = event || null; reject(err); request = null; }, "handleError"); request.ontimeout = /* @__PURE__ */ __name(function handleTimeout() { let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; const transitional2 = _config.transitional || transitional_default; if (_config.timeoutErrorMessage) { timeoutErrorMessage = _config.timeoutErrorMessage; } reject( new AxiosError_default( timeoutErrorMessage, transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED, config3, request ) ); request = null; }, "handleTimeout"); requestData === void 0 && requestHeaders.setContentType(null); if ("setRequestHeader" in request) { utils_default.forEach(requestHeaders.toJSON(), /* @__PURE__ */ __name(function setRequestHeader(val, key) { request.setRequestHeader(key, val); }, "setRequestHeader")); } if (!utils_default.isUndefined(_config.withCredentials)) { request.withCredentials = !!_config.withCredentials; } if (responseType && responseType !== "json") { request.responseType = _config.responseType; } if (onDownloadProgress) { [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); request.addEventListener("progress", downloadThrottled); } if (onUploadProgress && request.upload) { [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); request.upload.addEventListener("progress", uploadThrottled); request.upload.addEventListener("loadend", flushUpload); } if (_config.cancelToken || _config.signal) { onCanceled = /* @__PURE__ */ __name((cancel) => { if (!request) { return; } reject(!cancel || cancel.type ? new CanceledError_default(null, config3, request) : cancel); request.abort(); request = null; }, "onCanceled"); _config.cancelToken && _config.cancelToken.subscribe(onCanceled); if (_config.signal) { _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); } } const protocol = parseProtocol(_config.url); if (protocol && platform_default.protocols.indexOf(protocol) === -1) { reject( new AxiosError_default( "Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config3 ) ); return; } request.send(requestData || null); }, "dispatchXhrRequest")); }; } }); // ../../node_modules/axios/lib/helpers/composeSignals.js var composeSignals, composeSignals_default; var init_composeSignals = __esm({ "../../node_modules/axios/lib/helpers/composeSignals.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_CanceledError(); init_AxiosError(); init_utils8(); composeSignals = /* @__PURE__ */ __name((signals, timeout) => { const { length } = signals = signals ? signals.filter(Boolean) : []; if (timeout || length) { let controller = new AbortController(); let aborted2; const onabort = /* @__PURE__ */ __name(function(reason) { if (!aborted2) { aborted2 = true; unsubscribe(); const err = reason instanceof Error ? reason : this.reason; controller.abort( err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err) ); } }, "onabort"); let timer = timeout && setTimeout(() => { timer = null; onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT)); }, timeout); const unsubscribe = /* @__PURE__ */ __name(() => { if (signals) { timer && clearTimeout(timer); timer = null; signals.forEach((signal2) => { signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); }); signals = null; } }, "unsubscribe"); signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); const { signal } = controller; signal.unsubscribe = () => utils_default.asap(unsubscribe); return signal; } }, "composeSignals"); composeSignals_default = composeSignals; } }); // ../../node_modules/axios/lib/helpers/trackStream.js var streamChunk, readBytes, readStream, trackStream; var init_trackStream = __esm({ "../../node_modules/axios/lib/helpers/trackStream.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); streamChunk = /* @__PURE__ */ __name(function* (chunk, chunkSize) { let len = chunk.byteLength; if (!chunkSize || len < chunkSize) { yield chunk; return; } let pos = 0; let end; while (pos < len) { end = pos + chunkSize; yield chunk.slice(pos, end); pos = end; } }, "streamChunk"); readBytes = /* @__PURE__ */ __name(async function* (iterable, chunkSize) { for await (const chunk of readStream(iterable)) { yield* streamChunk(chunk, chunkSize); } }, "readBytes"); readStream = /* @__PURE__ */ __name(async function* (stream) { if (stream[Symbol.asyncIterator]) { yield* stream; return; } const reader = stream.getReader(); try { for (; ; ) { const { done, value } = await reader.read(); if (done) { break; } yield value; } } finally { await reader.cancel(); } }, "readStream"); trackStream = /* @__PURE__ */ __name((stream, chunkSize, onProgress, onFinish) => { const iterator2 = readBytes(stream, chunkSize); let bytes = 0; let done; let _onFinish = /* @__PURE__ */ __name((e2) => { if (!done) { done = true; onFinish && onFinish(e2); } }, "_onFinish"); return new ReadableStream( { async pull(controller) { try { const { done: done2, value } = await iterator2.next(); if (done2) { _onFinish(); controller.close(); return; } let len = value.byteLength; if (onProgress) { let loadedBytes = bytes += len; onProgress(loadedBytes); } controller.enqueue(new Uint8Array(value)); } catch (err) { _onFinish(err); throw err; } }, cancel(reason) { _onFinish(reason); return iterator2.return(); } }, { highWaterMark: 2 } ); }, "trackStream"); } }); // ../../node_modules/axios/lib/adapters/fetch.js var DEFAULT_CHUNK_SIZE, isFunction3, globalFetchAPI, ReadableStream2, TextEncoder2, test, factory, seedCache, getFetch, adapter; var init_fetch2 = __esm({ "../../node_modules/axios/lib/adapters/fetch.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_platform(); init_utils8(); init_AxiosError(); init_composeSignals(); init_trackStream(); init_AxiosHeaders(); init_progressEventReducer(); init_resolveConfig(); init_settle(); DEFAULT_CHUNK_SIZE = 64 * 1024; ({ isFunction: isFunction3 } = utils_default); globalFetchAPI = (({ Request: Request3, Response: Response3 }) => ({ Request: Request3, Response: Response3 }))(utils_default.global); ({ ReadableStream: ReadableStream2, TextEncoder: TextEncoder2 } = utils_default.global); test = /* @__PURE__ */ __name((fn, ...args) => { try { return !!fn(...args); } catch (e2) { return false; } }, "test"); factory = /* @__PURE__ */ __name((env2) => { env2 = utils_default.merge.call( { skipUndefined: true }, globalFetchAPI, env2 ); const { fetch: envFetch, Request: Request3, Response: Response3 } = env2; const isFetchSupported = envFetch ? isFunction3(envFetch) : typeof fetch === "function"; const isRequestSupported = isFunction3(Request3); const isResponseSupported = isFunction3(Response3); if (!isFetchSupported) { return false; } const isReadableStreamSupported = isFetchSupported && isFunction3(ReadableStream2); const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? ((encoder2) => (str) => encoder2.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request3(str).arrayBuffer())); const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { let duplexAccessed = false; const hasContentType = new Request3(platform_default.origin, { body: new ReadableStream2(), method: "POST", get duplex() { duplexAccessed = true; return "half"; } }).headers.has("Content-Type"); return duplexAccessed && !hasContentType; }); const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response3("").body)); const resolvers = { stream: supportsResponseStream && ((res) => res.body) }; isFetchSupported && (() => { ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { !resolvers[type] && (resolvers[type] = (res, config3) => { let method = res && res[type]; if (method) { return method.call(res); } throw new AxiosError_default( `Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config3 ); }); }); })(); const getBodyLength = /* @__PURE__ */ __name(async (body) => { if (body == null) { return 0; } if (utils_default.isBlob(body)) { return body.size; } if (utils_default.isSpecCompliantForm(body)) { const _request = new Request3(platform_default.origin, { method: "POST", body }); return (await _request.arrayBuffer()).byteLength; } if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) { return body.byteLength; } if (utils_default.isURLSearchParams(body)) { body = body + ""; } if (utils_default.isString(body)) { return (await encodeText(body)).byteLength; } }, "getBodyLength"); const resolveBodyLength = /* @__PURE__ */ __name(async (headers, body) => { const length = utils_default.toFiniteNumber(headers.getContentLength()); return length == null ? getBodyLength(body) : length; }, "resolveBodyLength"); return async (config3) => { let { url: url2, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions } = resolveConfig_default(config3); let _fetch = envFetch || fetch; responseType = responseType ? (responseType + "").toLowerCase() : "text"; let composedSignal = composeSignals_default( [signal, cancelToken && cancelToken.toAbortSignal()], timeout ); let request = null; const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { composedSignal.unsubscribe(); }); let requestContentLength; try { if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { let _request = new Request3(url2, { method: "POST", body: data, duplex: "half" }); let contentTypeHeader; if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { headers.setContentType(contentTypeHeader); } if (_request.body) { const [onProgress, flush2] = progressEventDecorator( requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)) ); data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush2); } } if (!utils_default.isString(withCredentials)) { withCredentials = withCredentials ? "include" : "omit"; } const isCredentialsSupported = isRequestSupported && "credentials" in Request3.prototype; const resolvedOptions = { ...fetchOptions, signal: composedSignal, method: method.toUpperCase(), headers: headers.normalize().toJSON(), body: data, duplex: "half", credentials: isCredentialsSupported ? withCredentials : void 0 }; request = isRequestSupported && new Request3(url2, resolvedOptions); let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions)); const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { const options = {}; ["status", "statusText", "headers"].forEach((prop) => { options[prop] = response[prop]; }); const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length")); const [onProgress, flush2] = onDownloadProgress && progressEventDecorator( responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true) ) || []; response = new Response3( trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { flush2 && flush2(); unsubscribe && unsubscribe(); }), options ); } responseType = responseType || "text"; let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"]( response, config3 ); !isStreamResponse && unsubscribe && unsubscribe(); return await new Promise((resolve, reject) => { settle(resolve, reject, { data: responseData, headers: AxiosHeaders_default.from(response.headers), status: response.status, statusText: response.statusText, config: config3, request }); }); } catch (err) { unsubscribe && unsubscribe(); if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { throw Object.assign( new AxiosError_default( "Network Error", AxiosError_default.ERR_NETWORK, config3, request, err && err.response ), { cause: err.cause || err } ); } throw AxiosError_default.from(err, err && err.code, config3, request, err && err.response); } }; }, "factory"); seedCache = /* @__PURE__ */ new Map(); getFetch = /* @__PURE__ */ __name((config3) => { let env2 = config3 && config3.env || {}; const { fetch: fetch3, Request: Request3, Response: Response3 } = env2; const seeds = [Request3, Response3, fetch3]; let len = seeds.length, i2 = len, seed, target, map2 = seedCache; while (i2--) { seed = seeds[i2]; target = map2.get(seed); target === void 0 && map2.set(seed, target = i2 ? /* @__PURE__ */ new Map() : factory(env2)); map2 = target; } return target; }, "getFetch"); adapter = getFetch(); } }); // ../../node_modules/axios/lib/adapters/adapters.js function getAdapter(adapters, config3) { adapters = utils_default.isArray(adapters) ? adapters : [adapters]; const { length } = adapters; let nameOrAdapter; let adapter2; const rejectedReasons = {}; for (let i2 = 0; i2 < length; i2++) { nameOrAdapter = adapters[i2]; let id; adapter2 = nameOrAdapter; if (!isResolvedHandle(nameOrAdapter)) { adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; if (adapter2 === void 0) { throw new AxiosError_default(`Unknown adapter '${id}'`); } } if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config3)))) { break; } rejectedReasons[id || "#" + i2] = adapter2; } if (!adapter2) { const reasons = Object.entries(rejectedReasons).map( ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") ); let s2 = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; throw new AxiosError_default( `There is no suitable adapter to dispatch the request ` + s2, "ERR_NOT_SUPPORT" ); } return adapter2; } var knownAdapters, renderReason, isResolvedHandle, adapters_default; var init_adapters = __esm({ "../../node_modules/axios/lib/adapters/adapters.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_null(); init_xhr(); init_fetch2(); init_AxiosError(); knownAdapters = { http: null_default, xhr: xhr_default, fetch: { get: getFetch } }; utils_default.forEach(knownAdapters, (fn, value) => { if (fn) { try { Object.defineProperty(fn, "name", { value }); } catch (e2) { } Object.defineProperty(fn, "adapterName", { value }); } }); renderReason = /* @__PURE__ */ __name((reason) => `- ${reason}`, "renderReason"); isResolvedHandle = /* @__PURE__ */ __name((adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false, "isResolvedHandle"); __name(getAdapter, "getAdapter"); adapters_default = { /** * Resolve an adapter from a list of adapter names or functions. * @type {Function} */ getAdapter, /** * Exposes all known adapters * @type {Object} */ adapters: knownAdapters }; } }); // ../../node_modules/axios/lib/core/dispatchRequest.js function throwIfCancellationRequested(config3) { if (config3.cancelToken) { config3.cancelToken.throwIfRequested(); } if (config3.signal && config3.signal.aborted) { throw new CanceledError_default(null, config3); } } function dispatchRequest(config3) { throwIfCancellationRequested(config3); config3.headers = AxiosHeaders_default.from(config3.headers); config3.data = transformData.call(config3, config3.transformRequest); if (["post", "put", "patch"].indexOf(config3.method) !== -1) { config3.headers.setContentType("application/x-www-form-urlencoded", false); } const adapter2 = adapters_default.getAdapter(config3.adapter || defaults_default.adapter, config3); return adapter2(config3).then( /* @__PURE__ */ __name(function onAdapterResolution(response) { throwIfCancellationRequested(config3); response.data = transformData.call(config3, config3.transformResponse, response); response.headers = AxiosHeaders_default.from(response.headers); return response; }, "onAdapterResolution"), /* @__PURE__ */ __name(function onAdapterRejection(reason) { if (!isCancel(reason)) { throwIfCancellationRequested(config3); if (reason && reason.response) { reason.response.data = transformData.call( config3, config3.transformResponse, reason.response ); reason.response.headers = AxiosHeaders_default.from(reason.response.headers); } } return Promise.reject(reason); }, "onAdapterRejection") ); } var init_dispatchRequest = __esm({ "../../node_modules/axios/lib/core/dispatchRequest.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_transformData(); init_isCancel(); init_defaults(); init_CanceledError(); init_AxiosHeaders(); init_adapters(); __name(throwIfCancellationRequested, "throwIfCancellationRequested"); __name(dispatchRequest, "dispatchRequest"); } }); // ../../node_modules/axios/lib/env/data.js var VERSION; var init_data = __esm({ "../../node_modules/axios/lib/env/data.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); VERSION = "1.13.6"; } }); // ../../node_modules/axios/lib/helpers/validator.js function assertOptions(options, schema, allowUnknown) { if (typeof options !== "object") { throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); let i2 = keys.length; while (i2-- > 0) { const opt = keys[i2]; const validator = schema[opt]; if (validator) { const value = options[opt]; const result = value === void 0 || validator(value, opt, options); if (result !== true) { throw new AxiosError_default( "option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE ); } continue; } if (allowUnknown !== true) { throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION); } } } var validators, deprecatedWarnings, validator_default; var init_validator = __esm({ "../../node_modules/axios/lib/helpers/validator.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_data(); init_AxiosError(); validators = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => { validators[type] = /* @__PURE__ */ __name(function validator(thing) { return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type; }, "validator"); }); deprecatedWarnings = {}; validators.transitional = /* @__PURE__ */ __name(function transitional(validator, version4, message2) { function formatMessage(opt, desc2) { return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc2 + (message2 ? ". " + message2 : ""); } __name(formatMessage, "formatMessage"); return (value, opt, opts) => { if (validator === false) { throw new AxiosError_default( formatMessage(opt, " has been removed" + (version4 ? " in " + version4 : "")), AxiosError_default.ERR_DEPRECATED ); } if (version4 && !deprecatedWarnings[opt]) { deprecatedWarnings[opt] = true; console.warn( formatMessage( opt, " has been deprecated since v" + version4 + " and will be removed in the near future" ) ); } return validator ? validator(value, opt, opts) : true; }; }, "transitional"); validators.spelling = /* @__PURE__ */ __name(function spelling(correctSpelling) { return (value, opt) => { console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); return true; }; }, "spelling"); __name(assertOptions, "assertOptions"); validator_default = { assertOptions, validators }; } }); // ../../node_modules/axios/lib/core/Axios.js var validators2, Axios, Axios_default; var init_Axios = __esm({ "../../node_modules/axios/lib/core/Axios.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_buildURL(); init_InterceptorManager(); init_dispatchRequest(); init_mergeConfig(); init_buildFullPath(); init_validator(); init_AxiosHeaders(); init_transitional(); validators2 = validator_default.validators; Axios = class { constructor(instanceConfig) { this.defaults = instanceConfig || {}; this.interceptors = { request: new InterceptorManager_default(), response: new InterceptorManager_default() }; } /** * Dispatch a request * * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) * @param {?Object} config * * @returns {Promise} The Promise to be fulfilled */ async request(configOrUrl, config3) { try { return await this._request(configOrUrl, config3); } catch (err) { if (err instanceof Error) { let dummy = {}; Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; try { if (!err.stack) { err.stack = stack; } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { err.stack += "\n" + stack; } } catch (e2) { } } throw err; } } _request(configOrUrl, config3) { if (typeof configOrUrl === "string") { config3 = config3 || {}; config3.url = configOrUrl; } else { config3 = configOrUrl || {}; } config3 = mergeConfig(this.defaults, config3); const { transitional: transitional2, paramsSerializer, headers } = config3; if (transitional2 !== void 0) { validator_default.assertOptions( transitional2, { silentJSONParsing: validators2.transitional(validators2.boolean), forcedJSONParsing: validators2.transitional(validators2.boolean), clarifyTimeoutError: validators2.transitional(validators2.boolean), legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean) }, false ); } if (paramsSerializer != null) { if (utils_default.isFunction(paramsSerializer)) { config3.paramsSerializer = { serialize: paramsSerializer }; } else { validator_default.assertOptions( paramsSerializer, { encode: validators2.function, serialize: validators2.function }, true ); } } if (config3.allowAbsoluteUrls !== void 0) { } else if (this.defaults.allowAbsoluteUrls !== void 0) { config3.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; } else { config3.allowAbsoluteUrls = true; } validator_default.assertOptions( config3, { baseUrl: validators2.spelling("baseURL"), withXsrfToken: validators2.spelling("withXSRFToken") }, true ); config3.method = (config3.method || this.defaults.method || "get").toLowerCase(); let contextHeaders = headers && utils_default.merge(headers.common, headers[config3.method]); headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => { delete headers[method]; }); config3.headers = AxiosHeaders_default.concat(contextHeaders, headers); const requestInterceptorChain = []; let synchronousRequestInterceptors = true; this.interceptors.request.forEach(/* @__PURE__ */ __name(function unshiftRequestInterceptors(interceptor) { if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config3) === false) { return; } synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; const transitional3 = config3.transitional || transitional_default; const legacyInterceptorReqResOrdering = transitional3 && transitional3.legacyInterceptorReqResOrdering; if (legacyInterceptorReqResOrdering) { requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); } else { requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); } }, "unshiftRequestInterceptors")); const responseInterceptorChain = []; this.interceptors.response.forEach(/* @__PURE__ */ __name(function pushResponseInterceptors(interceptor) { responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); }, "pushResponseInterceptors")); let promise2; let i2 = 0; let len; if (!synchronousRequestInterceptors) { const chain = [dispatchRequest.bind(this), void 0]; chain.unshift(...requestInterceptorChain); chain.push(...responseInterceptorChain); len = chain.length; promise2 = Promise.resolve(config3); while (i2 < len) { promise2 = promise2.then(chain[i2++], chain[i2++]); } return promise2; } len = requestInterceptorChain.length; let newConfig = config3; while (i2 < len) { const onFulfilled = requestInterceptorChain[i2++]; const onRejected = requestInterceptorChain[i2++]; try { newConfig = onFulfilled(newConfig); } catch (error50) { onRejected.call(this, error50); break; } } try { promise2 = dispatchRequest.call(this, newConfig); } catch (error50) { return Promise.reject(error50); } i2 = 0; len = responseInterceptorChain.length; while (i2 < len) { promise2 = promise2.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]); } return promise2; } getUri(config3) { config3 = mergeConfig(this.defaults, config3); const fullPath = buildFullPath(config3.baseURL, config3.url, config3.allowAbsoluteUrls); return buildURL(fullPath, config3.params, config3.paramsSerializer); } }; __name(Axios, "Axios"); utils_default.forEach(["delete", "get", "head", "options"], /* @__PURE__ */ __name(function forEachMethodNoData(method) { Axios.prototype[method] = function(url2, config3) { return this.request( mergeConfig(config3 || {}, { method, url: url2, data: (config3 || {}).data }) ); }; }, "forEachMethodNoData")); utils_default.forEach(["post", "put", "patch"], /* @__PURE__ */ __name(function forEachMethodWithData(method) { function generateHTTPMethod(isForm) { return /* @__PURE__ */ __name(function httpMethod(url2, data, config3) { return this.request( mergeConfig(config3 || {}, { method, headers: isForm ? { "Content-Type": "multipart/form-data" } : {}, url: url2, data }) ); }, "httpMethod"); } __name(generateHTTPMethod, "generateHTTPMethod"); Axios.prototype[method] = generateHTTPMethod(); Axios.prototype[method + "Form"] = generateHTTPMethod(true); }, "forEachMethodWithData")); Axios_default = Axios; } }); // ../../node_modules/axios/lib/cancel/CancelToken.js var CancelToken, CancelToken_default; var init_CancelToken = __esm({ "../../node_modules/axios/lib/cancel/CancelToken.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_CanceledError(); CancelToken = class { constructor(executor) { if (typeof executor !== "function") { throw new TypeError("executor must be a function."); } let resolvePromise; this.promise = new Promise(/* @__PURE__ */ __name(function promiseExecutor(resolve) { resolvePromise = resolve; }, "promiseExecutor")); const token = this; this.promise.then((cancel) => { if (!token._listeners) return; let i2 = token._listeners.length; while (i2-- > 0) { token._listeners[i2](cancel); } token._listeners = null; }); this.promise.then = (onfulfilled) => { let _resolve; const promise2 = new Promise((resolve) => { token.subscribe(resolve); _resolve = resolve; }).then(onfulfilled); promise2.cancel = /* @__PURE__ */ __name(function reject() { token.unsubscribe(_resolve); }, "reject"); return promise2; }; executor(/* @__PURE__ */ __name(function cancel(message2, config3, request) { if (token.reason) { return; } token.reason = new CanceledError_default(message2, config3, request); resolvePromise(token.reason); }, "cancel")); } /** * Throws a `CanceledError` if cancellation has been requested. */ throwIfRequested() { if (this.reason) { throw this.reason; } } /** * Subscribe to the cancel signal */ subscribe(listener) { if (this.reason) { listener(this.reason); return; } if (this._listeners) { this._listeners.push(listener); } else { this._listeners = [listener]; } } /** * Unsubscribe from the cancel signal */ unsubscribe(listener) { if (!this._listeners) { return; } const index = this._listeners.indexOf(listener); if (index !== -1) { this._listeners.splice(index, 1); } } toAbortSignal() { const controller = new AbortController(); const abort2 = /* @__PURE__ */ __name((err) => { controller.abort(err); }, "abort"); this.subscribe(abort2); controller.signal.unsubscribe = () => this.unsubscribe(abort2); return controller.signal; } /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. */ static source() { let cancel; const token = new CancelToken(/* @__PURE__ */ __name(function executor(c2) { cancel = c2; }, "executor")); return { token, cancel }; } }; __name(CancelToken, "CancelToken"); CancelToken_default = CancelToken; } }); // ../../node_modules/axios/lib/helpers/spread.js function spread(callback) { return /* @__PURE__ */ __name(function wrap(arr) { return callback.apply(null, arr); }, "wrap"); } var init_spread = __esm({ "../../node_modules/axios/lib/helpers/spread.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(spread, "spread"); } }); // ../../node_modules/axios/lib/helpers/isAxiosError.js function isAxiosError(payload) { return utils_default.isObject(payload) && payload.isAxiosError === true; } var init_isAxiosError = __esm({ "../../node_modules/axios/lib/helpers/isAxiosError.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); __name(isAxiosError, "isAxiosError"); } }); // ../../node_modules/axios/lib/helpers/HttpStatusCode.js var HttpStatusCode, HttpStatusCode_default; var init_HttpStatusCode = __esm({ "../../node_modules/axios/lib/helpers/HttpStatusCode.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); HttpStatusCode = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, WebServerIsDown: 521, ConnectionTimedOut: 522, OriginIsUnreachable: 523, TimeoutOccurred: 524, SslHandshakeFailed: 525, InvalidSslCertificate: 526 }; Object.entries(HttpStatusCode).forEach(([key, value]) => { HttpStatusCode[value] = key; }); HttpStatusCode_default = HttpStatusCode; } }); // ../../node_modules/axios/lib/axios.js function createInstance(defaultConfig) { const context2 = new Axios_default(defaultConfig); const instance = bind(Axios_default.prototype.request, context2); utils_default.extend(instance, Axios_default.prototype, context2, { allOwnKeys: true }); utils_default.extend(instance, context2, null, { allOwnKeys: true }); instance.create = /* @__PURE__ */ __name(function create(instanceConfig) { return createInstance(mergeConfig(defaultConfig, instanceConfig)); }, "create"); return instance; } var axios, axios_default; var init_axios = __esm({ "../../node_modules/axios/lib/axios.js"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils8(); init_bind(); init_Axios(); init_mergeConfig(); init_defaults(); init_formDataToJSON(); init_CanceledError(); init_CancelToken(); init_isCancel(); init_data(); init_toFormData(); init_AxiosError(); init_spread(); init_isAxiosError(); init_AxiosHeaders(); init_adapters(); init_HttpStatusCode(); __name(createInstance, "createInstance"); axios = createInstance(defaults_default); axios.Axios = Axios_default; axios.CanceledError = CanceledError_default; axios.CancelToken = CancelToken_default; axios.isCancel = isCancel; axios.VERSION = VERSION; axios.toFormData = toFormData_default; axios.AxiosError = AxiosError_default; axios.Cancel = axios.CanceledError; axios.all = /* @__PURE__ */ __name(function all(promises) { return Promise.all(promises); }, "all"); axios.spread = spread; axios.isAxiosError = isAxiosError; axios.mergeConfig = mergeConfig; axios.AxiosHeaders = AxiosHeaders_default; axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing); axios.getAdapter = adapters_default.getAdapter; axios.HttpStatusCode = HttpStatusCode_default; axios.default = axios; axios_default = axios; } }); // ../../node_modules/axios/index.js var Axios2, AxiosError2, CanceledError2, isCancel2, CancelToken2, VERSION2, all2, Cancel, isAxiosError2, spread2, toFormData2, AxiosHeaders2, HttpStatusCode2, formToJSON, getAdapter2, mergeConfig2; var init_axios2 = __esm({ "../../node_modules/axios/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_axios(); ({ Axios: Axios2, AxiosError: AxiosError2, CanceledError: CanceledError2, isCancel: isCancel2, CancelToken: CancelToken2, VERSION: VERSION2, all: all2, Cancel, isAxiosError: isAxiosError2, spread: spread2, toFormData: toFormData2, AxiosHeaders: AxiosHeaders2, HttpStatusCode: HttpStatusCode2, formToJSON, getAdapter: getAdapter2, mergeConfig: mergeConfig2 } = axios_default); } }); // src/lib/telegram-service.ts var BOT_TOKEN, TELEGRAM_API_URL; var init_telegram_service = __esm({ "src/lib/telegram-service.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_env_exporter(); BOT_TOKEN = telegramBotToken; TELEGRAM_API_URL = `https://api.telegram.org/bot${BOT_TOKEN}`; } }); // src/lib/post-order-handler.ts var ORDER_CHANNEL, CANCELLED_CHANNEL, publishOrder, publishFormattedOrder, publishCancellation; var init_post_order_handler = __esm({ "src/lib/post-order-handler.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dbService(); init_redis_client(); init_telegram_service(); ORDER_CHANNEL = "orders:placed"; CANCELLED_CHANNEL = "orders:cancelled"; publishOrder = /* @__PURE__ */ __name(async (orderDetails) => { try { const message2 = JSON.stringify(orderDetails); await redis_client_default.publish(ORDER_CHANNEL, message2); return true; } catch (error50) { console.error("Failed to publish order:", error50); return false; } }, "publishOrder"); publishFormattedOrder = /* @__PURE__ */ __name(async (createdOrders, ordersBySlot) => { try { const orderIds = createdOrders.map((order) => order.id); return await publishOrder({ orderIds }); } catch (error50) { console.error("Failed to format and publish order:", error50); return false; } }, "publishFormattedOrder"); publishCancellation = /* @__PURE__ */ __name(async (orderId, cancelledBy, reason) => { try { const message2 = { orderId, cancelledBy, reason, cancelledAt: (/* @__PURE__ */ new Date()).toISOString() }; await redis_client_default.publish(CANCELLED_CHANNEL, JSON.stringify(message2)); console.log("Cancellation published to Redis:", orderId); return true; } catch (error50) { console.error("Failed to publish cancellation:", error50); return false; } }, "publishCancellation"); } }); // src/stores/user-negativity-store.ts async function getMultipleUserNegativityScores(userIds) { try { if (userIds.length === 0) return {}; const result = {}; for (const userId of userIds) { result[userId] = await getUserNegativityScore(userId); } return result; } catch (error50) { console.error("Error getting multiple user negativity scores:", error50); return {}; } } async function recomputeUserNegativityScore(userId) { try { const totalScore = await getUserNegativityScore(userId); } catch (error50) { console.error(`Error recomputing negativity score for user ${userId}:`, error50); throw error50; } } var init_user_negativity_store = __esm({ "src/stores/user-negativity-store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dbService(); __name(getMultipleUserNegativityScores, "getMultipleUserNegativityScores"); __name(recomputeUserNegativityScore, "recomputeUserNegativityScore"); } }); // src/trpc/apis/admin-apis/apis/order.ts var updateOrderNotesSchema, getOrderDetailsSchema, updatePackagedSchema, updateDeliveredSchema, updateOrderItemPackagingSchema, getSlotOrdersSchema, getAllOrdersSchema, orderRouter; var init_order3 = __esm({ "src/trpc/apis/admin-apis/apis/order.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_notif_job(); init_post_order_handler(); init_user_negativity_store(); init_dbService(); updateOrderNotesSchema = external_exports.object({ orderId: external_exports.number(), adminNotes: external_exports.string() }); getOrderDetailsSchema = external_exports.object({ orderId: external_exports.number() }); updatePackagedSchema = external_exports.object({ orderId: external_exports.string(), isPackaged: external_exports.boolean() }); updateDeliveredSchema = external_exports.object({ orderId: external_exports.string(), isDelivered: external_exports.boolean() }); updateOrderItemPackagingSchema = external_exports.object({ orderItemId: external_exports.number(), isPackaged: external_exports.boolean().optional(), isPackageVerified: external_exports.boolean().optional() }); getSlotOrdersSchema = external_exports.object({ slotId: external_exports.string() }); getAllOrdersSchema = external_exports.object({ cursor: external_exports.number().optional(), limit: external_exports.number().default(20), slotId: external_exports.number().optional().nullable(), packagedFilter: external_exports.enum(["all", "packaged", "not_packaged"]).optional().default("all"), deliveredFilter: external_exports.enum(["all", "delivered", "not_delivered"]).optional().default("all"), cancellationFilter: external_exports.enum(["all", "cancelled", "not_cancelled"]).optional().default("all"), flashDeliveryFilter: external_exports.enum(["all", "flash", "regular"]).optional().default("all") }); orderRouter = router2({ updateNotes: protectedProcedure.input(updateOrderNotesSchema).mutation(async ({ input }) => { const { orderId, adminNotes } = input; const result = await updateOrderNotes(orderId, adminNotes || null); if (!result) { throw new Error("Order not found"); } return result; }), getOrderDetails: protectedProcedure.input(getOrderDetailsSchema).query(async ({ input }) => { const { orderId } = input; const orderDetails = await getOrderDetails(orderId); if (!orderDetails) { throw new Error("Order not found"); } return orderDetails; }), updatePackaged: protectedProcedure.input(updatePackagedSchema).mutation(async ({ input }) => { const { orderId, isPackaged } = input; const result = await updateOrderPackaged(orderId, isPackaged); if (result.userId) await sendOrderPackagedNotification(result.userId, orderId); return { success: true, userId: result.userId }; }), updateDelivered: protectedProcedure.input(updateDeliveredSchema).mutation(async ({ input }) => { const { orderId, isDelivered } = input; const result = await updateOrderDelivered(orderId, isDelivered); if (result.userId) await sendOrderDeliveredNotification(result.userId, orderId); return { success: true, userId: result.userId }; }), updateOrderItemPackaging: protectedProcedure.input(updateOrderItemPackagingSchema).mutation(async ({ input }) => { const { orderItemId, isPackaged, isPackageVerified } = input; const result = await updateOrderItemPackaging(orderItemId, isPackaged, isPackageVerified); if (!result.updated) { throw new ApiError("Order item not found", 404); } return result; }), removeDeliveryCharge: protectedProcedure.input(external_exports.object({ orderId: external_exports.number() })).mutation(async ({ input }) => { const { orderId } = input; const result = await removeDeliveryCharge(orderId); if (!result) { throw new Error("Order not found"); } return result; }), getSlotOrders: protectedProcedure.input(getSlotOrdersSchema).query(async ({ input }) => { const { slotId } = input; const result = await getSlotOrders(slotId); return result; }), updateAddressCoords: protectedProcedure.input( external_exports.object({ addressId: external_exports.number(), latitude: external_exports.number(), longitude: external_exports.number() }) ).mutation(async ({ input }) => { const { addressId, latitude, longitude } = input; const result = await updateAddressCoords(addressId, latitude, longitude); if (!result.success) { throw new ApiError("Address not found", 404); } return result; }), getAll: protectedProcedure.input(getAllOrdersSchema).query(async ({ input }) => { try { const result = await getAllOrders(input); const userIds = [...new Set(result.orders.map((order) => order.userId))]; const negativityScores = await getMultipleUserNegativityScores(userIds); const orders3 = result.orders.map((order) => { const { userId, userNegativityScore, ...rest } = order; return { ...rest, userNegativityScore: negativityScores[userId] || 0 }; }); return { orders: orders3, nextCursor: result.nextCursor }; } catch (e2) { console.log({ e: e2 }); } }), rebalanceSlots: protectedProcedure.input(external_exports.object({ slotIds: external_exports.array(external_exports.number()).min(1).max(50) })).mutation(async ({ input }) => { const slotIds = input.slotIds; const result = await rebalanceSlots(slotIds); return result; }), cancelOrder: protectedProcedure.input(external_exports.object({ orderId: external_exports.number(), reason: external_exports.string().min(1, "Cancellation reason is required") })).mutation(async ({ input }) => { const { orderId, reason } = input; const result = await cancelOrder(orderId, reason); if (!result.success) { if (result.error === "order_not_found") { throw new ApiError(result.message, 404); } if (result.error === "status_not_found") { throw new ApiError(result.message, 400); } if (result.error === "already_cancelled") { throw new ApiError(result.message, 400); } if (result.error === "already_delivered") { throw new ApiError(result.message, 400); } throw new ApiError(result.message, 400); } if (result.orderId) { await publishCancellation(result.orderId, "admin", reason); } return { success: true, message: result.message }; }) }); } }); // src/trpc/apis/admin-apis/apis/vendor-snippets.ts var import_dayjs2, createSnippetSchema, updateSnippetSchema, toApiDate, vendorSnippetsRouter; var init_vendor_snippets2 = __esm({ "src/trpc/apis/admin-apis/apis/vendor-snippets.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); import_dayjs2 = __toESM(require_dayjs_min()); init_env_exporter(); init_dbService(); createSnippetSchema = external_exports.object({ snippetCode: external_exports.string().min(1, "Snippet code is required"), slotId: external_exports.number().optional(), productIds: external_exports.array(external_exports.number().int().positive()).min(1, "At least one product is required"), validTill: external_exports.string().optional(), isPermanent: external_exports.boolean().default(false) }); updateSnippetSchema = external_exports.object({ id: external_exports.number().int().positive(), updates: createSnippetSchema.partial().extend({ snippetCode: external_exports.string().min(1).optional(), productIds: external_exports.array(external_exports.number().int().positive()).optional(), isPermanent: external_exports.boolean().default(false) }) }); toApiDate = /* @__PURE__ */ __name((value) => { if (value instanceof Date) { return Number.isNaN(value.getTime()) ? "" : value.toISOString(); } if (typeof value === "number") { const date6 = new Date(value); return Number.isNaN(date6.getTime()) ? "" : date6.toISOString(); } if (typeof value === "string") { const date6 = new Date(value); return Number.isNaN(date6.getTime()) ? value : date6.toISOString(); } return ""; }, "toApiDate"); vendorSnippetsRouter = router2({ create: protectedProcedure.input(createSnippetSchema).mutation(async ({ input, ctx }) => { const { snippetCode, slotId, productIds, validTill, isPermanent } = input; const staffUserId = ctx.staffUser?.id; if (!staffUserId) { throw new Error("Unauthorized"); } if (slotId) { const slot = await getVendorSlotById(slotId); if (!slot) { throw new Error("Invalid slot ID"); } } const products = await getProductsByIds(productIds); if (products.length !== productIds.length) { throw new Error("One or more invalid product IDs"); } const existingSnippet = await checkVendorSnippetExists(snippetCode); if (existingSnippet) { throw new Error("Snippet code already exists"); } const result = await createVendorSnippet({ snippetCode, slotId, productIds, isPermanent, validTill: validTill ? new Date(validTill) : void 0 }); return result; }), getAll: protectedProcedure.query(async () => { console.log("from the vendor snipptes methods"); try { const result = await getAllVendorSnippets(); const snippetsWithProducts = await Promise.all( result.map(async (snippet) => { const products = await getProductsByIds(snippet.productIds); return { ...snippet, accessUrl: `${appUrl}/vendor-order-list?id=${snippet.snippetCode}`, products }; }) ); return snippetsWithProducts; } catch (e2) { console.log(e2); } return []; }), getById: protectedProcedure.input(external_exports.object({ id: external_exports.number().int().positive() })).query(async ({ input }) => { const { id } = input; const result = await getVendorSnippetById(id); if (!result) { throw new Error("Vendor snippet not found"); } return result; }), update: protectedProcedure.input(updateSnippetSchema).mutation(async ({ input }) => { const { id, updates } = input; const existingSnippet = await getVendorSnippetById(id); if (!existingSnippet) { throw new Error("Vendor snippet not found"); } if (updates.slotId) { const slot = await getVendorSlotById(updates.slotId); if (!slot) { throw new Error("Invalid slot ID"); } } if (updates.productIds) { const products = await getProductsByIds(updates.productIds); if (products.length !== updates.productIds.length) { throw new Error("One or more invalid product IDs"); } } if (updates.snippetCode && updates.snippetCode !== existingSnippet.snippetCode) { const duplicateSnippet = await checkVendorSnippetExists(updates.snippetCode); if (duplicateSnippet) { throw new Error("Snippet code already exists"); } } const updateData = { ...updates, validTill: updates.validTill !== void 0 ? updates.validTill ? new Date(updates.validTill) : null : void 0 }; const result = await updateVendorSnippet(id, updateData); if (!result) { throw new Error("Failed to update vendor snippet"); } return result; }), delete: protectedProcedure.input(external_exports.object({ id: external_exports.number().int().positive() })).mutation(async ({ input }) => { const { id } = input; const result = await deleteVendorSnippet(id); if (!result) { throw new Error("Vendor snippet not found"); } return { message: "Vendor snippet deleted successfully" }; }), getOrdersBySnippet: publicProcedure.input(external_exports.object({ snippetCode: external_exports.string().min(1, "Snippet code is required") })).query(async ({ input }) => { const { snippetCode } = input; const snippet = await getVendorSnippetByCode(snippetCode); if (!snippet) { throw new Error("Vendor snippet not found"); } if (snippet.validTill && new Date(snippet.validTill) < /* @__PURE__ */ new Date()) { throw new Error("Vendor snippet has expired"); } if (!snippet.slotId) { throw new Error("Vendor snippet not associated with a slot"); } const matchingOrders = await getVendorOrdersBySlotId(snippet.slotId); const filteredOrders = matchingOrders.filter((order) => { const status = order.orderStatus; if (status[0].isCancelled) return false; const orderProductIds = order.orderItems.map((item) => item.productId); return snippet.productIds.some((productId) => orderProductIds.includes(productId)); }); const formattedOrders = filteredOrders.map((order) => { const attachedOrderItems = order.orderItems.filter( (item) => snippet.productIds.includes(item.productId) ); const products = attachedOrderItems.map((item) => ({ orderItemId: item.id, productId: item.productId, productName: item.product.name, quantity: parseFloat(item.quantity), productSize: item.product.productQuantity, price: parseFloat((item.price ?? 0).toString()), unit: item.product.unit?.shortNotation || "unit", subtotal: parseFloat((item.price ?? 0).toString()) * parseFloat(item.quantity), is_packaged: item.is_packaged, is_package_verified: item.is_package_verified })); const orderTotal = products.reduce((sum2, p2) => sum2 + p2.subtotal, 0); return { orderId: `ORD${order.id}`, orderDate: toApiDate(order.createdAt), customerName: order.user.name || "", totalAmount: orderTotal, slotInfo: order.slot ? { time: toApiDate(order.slot.deliveryTime), sequence: order.slot.deliverySequence } : null, products, matchedProducts: snippet.productIds, // All snippet products are considered matched snippetCode: snippet.snippetCode }; }); return { success: true, data: formattedOrders, snippet: { id: snippet.id, snippetCode: snippet.snippetCode, slotId: snippet.slotId, productIds: snippet.productIds, validTill: toApiDate(snippet.validTill) || null, createdAt: toApiDate(snippet.createdAt), isPermanent: snippet.isPermanent } }; }), getVendorOrders: protectedProcedure.query(async () => { const vendorOrders = await getVendorOrders(); return vendorOrders.map((order) => ({ id: order.id, status: "pending", orderDate: toApiDate(order.createdAt), totalQuantity: order.orderItems.reduce((sum2, item) => sum2 + parseFloat(item.quantity || "0"), 0), products: order.orderItems.map((item) => ({ name: item.product.name, quantity: parseFloat(item.quantity || "0"), unit: item.product.unit?.shortNotation || "unit" })) })); }), getUpcomingSlots: publicProcedure.query(async () => { const threeHoursAgo = (0, import_dayjs2.default)().subtract(3, "hour").toDate(); const slots = await getSlotsAfterDate(threeHoursAgo); return { success: true, data: slots.map((slot) => ({ id: slot.id, deliveryTime: toApiDate(slot.deliveryTime), freezeTime: toApiDate(slot.freezeTime), deliverySequence: slot.deliverySequence })) }; }), getOrdersBySnippetAndSlot: publicProcedure.input(external_exports.object({ snippetCode: external_exports.string().min(1, "Snippet code is required"), slotId: external_exports.number().int().positive("Valid slot ID is required") })).query(async ({ input }) => { const { snippetCode, slotId } = input; const snippet = await getVendorSnippetByCode(snippetCode); const slot = await getVendorSlotById(slotId); if (!snippet) { throw new Error("Vendor snippet not found"); } if (!slot) { throw new Error("Slot not found"); } const matchingOrders = await getVendorOrdersBySlotId(slotId); const filteredOrders = matchingOrders.filter((order) => { const status = order.orderStatus; if (status[0]?.isCancelled) return false; const orderProductIds = order.orderItems.map((item) => item.productId); return snippet.productIds.some((productId) => orderProductIds.includes(productId)); }); const formattedOrders = filteredOrders.map((order) => { const attachedOrderItems = order.orderItems.filter( (item) => snippet.productIds.includes(item.productId) ); const products = attachedOrderItems.map((item) => ({ orderItemId: item.id, productId: item.productId, productName: item.product.name, quantity: parseFloat(item.quantity), price: parseFloat((item.price ?? 0).toString()), unit: item.product.unit?.shortNotation || "unit", subtotal: parseFloat((item.price ?? 0).toString()) * parseFloat(item.quantity), productSize: item.product.productQuantity, is_packaged: item.is_packaged, is_package_verified: item.is_package_verified })); const orderTotal = products.reduce((sum2, p2) => sum2 + p2.subtotal, 0); return { orderId: `ORD${order.id}`, orderDate: toApiDate(order.createdAt), customerName: order.user.name || "", totalAmount: orderTotal, slotInfo: order.slot ? { time: toApiDate(order.slot.deliveryTime), sequence: order.slot.deliverySequence } : null, products, matchedProducts: snippet.productIds, snippetCode: snippet.snippetCode }; }); return { success: true, data: formattedOrders, snippet: { id: snippet.id, snippetCode: snippet.snippetCode, slotId: snippet.slotId, productIds: snippet.productIds, validTill: toApiDate(snippet.validTill) || null, createdAt: toApiDate(snippet.createdAt), isPermanent: snippet.isPermanent }, selectedSlot: { id: slot.id, deliveryTime: toApiDate(slot.deliveryTime), freezeTime: toApiDate(slot.freezeTime), deliverySequence: slot.deliverySequence } }; }), updateOrderItemPackaging: publicProcedure.input(external_exports.object({ orderItemId: external_exports.number().int().positive("Valid order item ID required"), is_packaged: external_exports.boolean() })).mutation(async ({ input, ctx }) => { const { orderItemId, is_packaged } = input; const result = await updateVendorOrderItemPackaging(orderItemId, is_packaged); if (!result.success) { throw new Error(result.message); } return result; }) }); } }); // src/lib/roles-manager.ts var ROLE_NAMES, defaultRole, RoleManager, roleManager, roles_manager_default; var init_roles_manager = __esm({ "src/lib/roles-manager.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); ROLE_NAMES = { ADMIN: "admin", GENERAL_USER: "gen_user", HOSPITAL_ADMIN: "hospital_admin", DOCTOR: "doctor", RECEPTIONIST: "receptionist" }; defaultRole = ROLE_NAMES.GENERAL_USER; RoleManager = class { roles = /* @__PURE__ */ new Map(); rolesByName = /* @__PURE__ */ new Map(); isInitialized = false; constructor() { } /** * Fetch all roles from the database and cache them * This should be called during application startup */ async fetchRoles() { try { } catch (error50) { console.error("[RoleManager] Error fetching roles:", error50); throw error50; } } /** * Get all roles from cache * If not initialized, fetches roles from DB first */ async getRoles() { if (!this.isInitialized) { await this.fetchRoles(); } return Array.from(this.roles.values()); } /** * Get role by ID * @param id Role ID */ async getRoleById(id) { if (!this.isInitialized) { await this.fetchRoles(); } return this.roles.get(id); } /** * Get role by name * @param name Role name */ async getRoleByName(name) { if (!this.isInitialized) { await this.fetchRoles(); } return this.rolesByName.get(name); } /** * Check if a role exists by name * @param name Role name */ async roleExists(name) { if (!this.isInitialized) { await this.fetchRoles(); } return this.rolesByName.has(name); } /** * Get business roles (roles that are not 'admin' or 'gen_user') */ async getBusinessRoles() { if (!this.isInitialized) { await this.fetchRoles(); } return Array.from(this.roles.values()).filter( (role) => role.name !== ROLE_NAMES.ADMIN && role.name !== ROLE_NAMES.GENERAL_USER ); } /** * Force refresh the roles cache */ async refreshRoles() { await this.fetchRoles(); } }; __name(RoleManager, "RoleManager"); roleManager = new RoleManager(); roles_manager_default = roleManager; } }); // src/lib/const-keys.ts var CONST_KEYS, CONST_KEYS_ARRAY; var init_const_keys = __esm({ "src/lib/const-keys.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); CONST_KEYS = { minRegularOrderValue: "minRegularOrderValue", freeDeliveryThreshold: "freeDeliveryThreshold", deliveryCharge: "deliveryCharge", flashFreeDeliveryThreshold: "flashFreeDeliveryThreshold", flashDeliveryCharge: "flashDeliveryCharge", platformFeePercent: "platformFeePercent", taxRate: "taxRate", tester: "tester", minOrderAmountForCoupon: "minOrderAmountForCoupon", maxCouponDiscount: "maxCouponDiscount", flashDeliverySlotId: "flashDeliverySlotId", readableOrderId: "readableOrderId", versionNum: "versionNum", playStoreUrl: "playStoreUrl", appStoreUrl: "appStoreUrl", popularItems: "popularItems", allItemsOrder: "allItemsOrder", isFlashDeliveryEnabled: "isFlashDeliveryEnabled", supportMobile: "supportMobile", supportEmail: "supportEmail" }; CONST_KEYS_ARRAY = Object.values(CONST_KEYS); } }); // src/lib/const-store.ts var computeConstants, getConstant, getConstants, getAllConstValues; var init_const_store = __esm({ "src/lib/const-store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dbService(); init_const_keys(); computeConstants = /* @__PURE__ */ __name(async () => { try { console.log("Computing constants from database..."); const constants2 = await getAllKeyValStore(); console.log(`Computed ${constants2.length} constants from DB`); } catch (error50) { console.error("Failed to compute constants:", error50); throw error50; } }, "computeConstants"); getConstant = /* @__PURE__ */ __name(async (key) => { const constants2 = await getAllKeyValStore(); const entry = constants2.find((c2) => c2.key === key); if (!entry) { return null; } return entry.value; }, "getConstant"); getConstants = /* @__PURE__ */ __name(async (keys) => { const constants2 = await getAllKeyValStore(); const constantsMap = new Map(constants2.map((c2) => [c2.key, c2.value])); const result = {}; for (const key of keys) { const value = constantsMap.get(key); result[key] = value !== void 0 ? value : null; } return result; }, "getConstants"); getAllConstValues = /* @__PURE__ */ __name(async () => { const constants2 = await getAllKeyValStore(); const constantsMap = new Map(constants2.map((c2) => [c2.key, c2.value])); const result = {}; for (const key of CONST_KEYS_ARRAY) { result[key] = constantsMap.get(key) ?? null; } return result; }, "getAllConstValues"); } }); // src/stores/slot-store.ts async function transformSlotToStoreSlot(slot) { return { id: slot.id, deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, isActive: slot.isActive, isCapacityFull: slot.isCapacityFull, products: slot.productSlots.map((productSlot) => ({ id: productSlot.product.id, name: productSlot.product.name, productQuantity: productSlot.product.productQuantity, shortDescription: productSlot.product.shortDescription, price: productSlot.product.price.toString(), marketPrice: productSlot.product.marketPrice?.toString() || null, unit: productSlot.product.unit?.shortNotation || null, images: scaffoldAssetUrl( productSlot.product.images || [] ), isOutOfStock: productSlot.product.isOutOfStock, storeId: productSlot.product.storeId, nextDeliveryDate: slot.deliveryTime })) }; } function extractSlotInfo(slot) { return { id: slot.id, deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, isCapacityFull: slot.isCapacityFull }; } async function fetchAllTransformedSlots() { const slots = await getAllSlotsWithProductsForCache(); return Promise.all(slots.map(transformSlotToStoreSlot)); } async function initializeSlotStore() { try { console.log("Initializing slot store in Redis..."); const slots = await getAllSlotsWithProductsForCache(); const slotsWithProducts = await Promise.all( slots.map(async (slot) => ({ id: slot.id, deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, isActive: slot.isActive, isCapacityFull: slot.isCapacityFull, products: await Promise.all( slot.productSlots.map(async (productSlot) => ({ id: productSlot.product.id, name: productSlot.product.name, productQuantity: productSlot.product.productQuantity, shortDescription: productSlot.product.shortDescription, price: productSlot.product.price.toString(), marketPrice: productSlot.product.marketPrice?.toString() || null, unit: productSlot.product.unit?.shortNotation || null, images: scaffoldAssetUrl( productSlot.product.images || [] ), isOutOfStock: productSlot.product.isOutOfStock, storeId: productSlot.product.storeId, nextDeliveryDate: slot.deliveryTime })) ) })) ); const productSlotsMap = {}; for (const slot of slotsWithProducts) { for (const product of slot.products) { if (!productSlotsMap[product.id]) { productSlotsMap[product.id] = []; } productSlotsMap[product.id].push({ id: slot.id, deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, isCapacityFull: slot.isCapacityFull }); } } console.log("Slot store initialized successfully"); } catch (error50) { console.error("Error initializing slot store:", error50); } } async function getSlotById(slotId) { try { const slots = await getAllSlotsWithProductsForCache(); const slot = slots.find((s2) => s2.id === slotId); if (!slot) return null; return transformSlotToStoreSlot(slot); } catch (error50) { console.error(`Error getting slot ${slotId}:`, error50); return null; } } async function getAllSlots() { try { return fetchAllTransformedSlots(); } catch (error50) { console.error("Error getting all slots:", error50); return []; } } async function getMultipleProductsSlots(productIds) { try { if (productIds.length === 0) return {}; const slots = await getAllSlotsWithProductsForCache(); const productIdSet = new Set(productIds); const result = {}; for (const productId of productIds) { result[productId] = []; } for (const slot of slots) { const slotInfo = extractSlotInfo(slot); for (const productSlot of slot.productSlots) { const pid2 = productSlot.product.id; if (productIdSet.has(pid2) && !slot.isCapacityFull) { result[pid2].push(slotInfo); } } } return result; } catch (error50) { console.error("Error getting products slots:", error50); return {}; } } var init_slot_store = __esm({ "src/stores/slot-store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dbService(); init_s3_client(); __name(transformSlotToStoreSlot, "transformSlotToStoreSlot"); __name(extractSlotInfo, "extractSlotInfo"); __name(fetchAllTransformedSlots, "fetchAllTransformedSlots"); __name(initializeSlotStore, "initializeSlotStore"); __name(getSlotById, "getSlotById"); __name(getAllSlots, "getAllSlots"); __name(getMultipleProductsSlots, "getMultipleProductsSlots"); } }); // src/stores/banner-store.ts async function initializeBannerStore() { try { console.log("Initializing banner store in Redis..."); const banners = await getAllBannersForCache(); console.log("Banner store initialized successfully"); } catch (error50) { console.error("Error initializing banner store:", error50); } } var init_banner_store = __esm({ "src/stores/banner-store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dbService(); init_s3_client(); __name(initializeBannerStore, "initializeBannerStore"); } }); // ../../node_modules/@turf/helpers/dist/esm/index.js function feature(geom, properties, options = {}) { const feat = { type: "Feature" }; if (options.id === 0 || options.id) { feat.id = options.id; } if (options.bbox) { feat.bbox = options.bbox; } feat.properties = properties || {}; feat.geometry = geom; return feat; } function point(coordinates, properties, options = {}) { if (!coordinates) { throw new Error("coordinates is required"); } if (!Array.isArray(coordinates)) { throw new Error("coordinates must be an Array"); } if (coordinates.length < 2) { throw new Error("coordinates must be at least 2 numbers long"); } if (!isNumber2(coordinates[0]) || !isNumber2(coordinates[1])) { throw new Error("coordinates must contain numbers"); } const geom = { type: "Point", coordinates }; return feature(geom, properties, options); } function polygon(coordinates, properties, options = {}) { for (const ring of coordinates) { if (ring.length < 4) { throw new Error( "Each LinearRing of a Polygon must have 4 or more Positions." ); } if (ring[ring.length - 1].length !== ring[0].length) { throw new Error("First and last Position are not equivalent."); } for (let j2 = 0; j2 < ring[ring.length - 1].length; j2++) { if (ring[ring.length - 1][j2] !== ring[0][j2]) { throw new Error("First and last Position are not equivalent."); } } } const geom = { type: "Polygon", coordinates }; return feature(geom, properties, options); } function isNumber2(num) { return !isNaN(num) && num !== null && !Array.isArray(num); } var earthRadius, factors; var init_esm = __esm({ "../../node_modules/@turf/helpers/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); earthRadius = 63710088e-1; factors = { centimeters: earthRadius * 100, centimetres: earthRadius * 100, degrees: 360 / (2 * Math.PI), feet: earthRadius * 3.28084, inches: earthRadius * 39.37, kilometers: earthRadius / 1e3, kilometres: earthRadius / 1e3, meters: earthRadius, metres: earthRadius, miles: earthRadius / 1609.344, millimeters: earthRadius * 1e3, millimetres: earthRadius * 1e3, nauticalmiles: earthRadius / 1852, radians: 1, yards: earthRadius * 1.0936 }; __name(feature, "feature"); __name(point, "point"); __name(polygon, "polygon"); __name(isNumber2, "isNumber"); } }); // ../../node_modules/@turf/invariant/dist/esm/index.js function getCoord(coord) { if (!coord) { throw new Error("coord is required"); } if (!Array.isArray(coord)) { if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") { return [...coord.geometry.coordinates]; } if (coord.type === "Point") { return [...coord.coordinates]; } } if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) { return [...coord]; } throw new Error("coord must be GeoJSON Point or an Array of numbers"); } function getGeom(geojson) { if (geojson.type === "Feature") { return geojson.geometry; } return geojson; } var init_esm2 = __esm({ "../../node_modules/@turf/invariant/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(getCoord, "getCoord"); __name(getGeom, "getGeom"); } }); // ../../node_modules/@turf/meta/dist/esm/index.js var init_esm3 = __esm({ "../../node_modules/@turf/meta/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/robust-predicates/esm/util.js function sum(elen, e2, flen, f2, h2) { let Q2, Qnew, hh2, bvirt; let enow = e2[0]; let fnow = f2[0]; let eindex = 0; let findex = 0; if (fnow > enow === fnow > -enow) { Q2 = enow; enow = e2[++eindex]; } else { Q2 = fnow; fnow = f2[++findex]; } let hindex = 0; if (eindex < elen && findex < flen) { if (fnow > enow === fnow > -enow) { Qnew = enow + Q2; hh2 = Q2 - (Qnew - enow); enow = e2[++eindex]; } else { Qnew = fnow + Q2; hh2 = Q2 - (Qnew - fnow); fnow = f2[++findex]; } Q2 = Qnew; if (hh2 !== 0) { h2[hindex++] = hh2; } while (eindex < elen && findex < flen) { if (fnow > enow === fnow > -enow) { Qnew = Q2 + enow; bvirt = Qnew - Q2; hh2 = Q2 - (Qnew - bvirt) + (enow - bvirt); enow = e2[++eindex]; } else { Qnew = Q2 + fnow; bvirt = Qnew - Q2; hh2 = Q2 - (Qnew - bvirt) + (fnow - bvirt); fnow = f2[++findex]; } Q2 = Qnew; if (hh2 !== 0) { h2[hindex++] = hh2; } } } while (eindex < elen) { Qnew = Q2 + enow; bvirt = Qnew - Q2; hh2 = Q2 - (Qnew - bvirt) + (enow - bvirt); enow = e2[++eindex]; Q2 = Qnew; if (hh2 !== 0) { h2[hindex++] = hh2; } } while (findex < flen) { Qnew = Q2 + fnow; bvirt = Qnew - Q2; hh2 = Q2 - (Qnew - bvirt) + (fnow - bvirt); fnow = f2[++findex]; Q2 = Qnew; if (hh2 !== 0) { h2[hindex++] = hh2; } } if (Q2 !== 0 || hindex === 0) { h2[hindex++] = Q2; } return hindex; } function estimate(elen, e2) { let Q2 = e2[0]; for (let i2 = 1; i2 < elen; i2++) Q2 += e2[i2]; return Q2; } function vec(n2) { return new Float64Array(n2); } var epsilon, splitter, resulterrbound; var init_util4 = __esm({ "../../node_modules/robust-predicates/esm/util.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); epsilon = 11102230246251565e-32; splitter = 134217729; resulterrbound = (3 + 8 * epsilon) * epsilon; __name(sum, "sum"); __name(estimate, "estimate"); __name(vec, "vec"); } }); // ../../node_modules/robust-predicates/esm/orient2d.js function orient2dadapt(ax2, ay2, bx2, by2, cx2, cy2, detsum) { let acxtail, acytail, bcxtail, bcytail; let bvirt, c2, ahi, alo, bhi, blo, _i2, _j, _0, s1, s0, t12, t02, u32; const acx = ax2 - cx2; const bcx = bx2 - cx2; const acy = ay2 - cy2; const bcy = by2 - cy2; s1 = acx * bcy; c2 = splitter * acx; ahi = c2 - (c2 - acx); alo = acx - ahi; c2 = splitter * bcy; bhi = c2 - (c2 - bcy); blo = bcy - bhi; s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo); t12 = acy * bcx; c2 = splitter * acy; ahi = c2 - (c2 - acy); alo = acy - ahi; c2 = splitter * bcx; bhi = c2 - (c2 - bcx); blo = bcx - bhi; t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo); _i2 = s0 - t02; bvirt = s0 - _i2; B2[0] = s0 - (_i2 + bvirt) + (bvirt - t02); _j = s1 + _i2; bvirt = _j - s1; _0 = s1 - (_j - bvirt) + (_i2 - bvirt); _i2 = _0 - t12; bvirt = _0 - _i2; B2[1] = _0 - (_i2 + bvirt) + (bvirt - t12); u32 = _j + _i2; bvirt = u32 - _j; B2[2] = _j - (u32 - bvirt) + (_i2 - bvirt); B2[3] = u32; let det = estimate(4, B2); let errbound = ccwerrboundB * detsum; if (det >= errbound || -det >= errbound) { return det; } bvirt = ax2 - acx; acxtail = ax2 - (acx + bvirt) + (bvirt - cx2); bvirt = bx2 - bcx; bcxtail = bx2 - (bcx + bvirt) + (bvirt - cx2); bvirt = ay2 - acy; acytail = ay2 - (acy + bvirt) + (bvirt - cy2); bvirt = by2 - bcy; bcytail = by2 - (bcy + bvirt) + (bvirt - cy2); if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) { return det; } errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det); det += acx * bcytail + bcy * acxtail - (acy * bcxtail + bcx * acytail); if (det >= errbound || -det >= errbound) return det; s1 = acxtail * bcy; c2 = splitter * acxtail; ahi = c2 - (c2 - acxtail); alo = acxtail - ahi; c2 = splitter * bcy; bhi = c2 - (c2 - bcy); blo = bcy - bhi; s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo); t12 = acytail * bcx; c2 = splitter * acytail; ahi = c2 - (c2 - acytail); alo = acytail - ahi; c2 = splitter * bcx; bhi = c2 - (c2 - bcx); blo = bcx - bhi; t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo); _i2 = s0 - t02; bvirt = s0 - _i2; u2[0] = s0 - (_i2 + bvirt) + (bvirt - t02); _j = s1 + _i2; bvirt = _j - s1; _0 = s1 - (_j - bvirt) + (_i2 - bvirt); _i2 = _0 - t12; bvirt = _0 - _i2; u2[1] = _0 - (_i2 + bvirt) + (bvirt - t12); u32 = _j + _i2; bvirt = u32 - _j; u2[2] = _j - (u32 - bvirt) + (_i2 - bvirt); u2[3] = u32; const C1len = sum(4, B2, 4, u2, C1); s1 = acx * bcytail; c2 = splitter * acx; ahi = c2 - (c2 - acx); alo = acx - ahi; c2 = splitter * bcytail; bhi = c2 - (c2 - bcytail); blo = bcytail - bhi; s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo); t12 = acy * bcxtail; c2 = splitter * acy; ahi = c2 - (c2 - acy); alo = acy - ahi; c2 = splitter * bcxtail; bhi = c2 - (c2 - bcxtail); blo = bcxtail - bhi; t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo); _i2 = s0 - t02; bvirt = s0 - _i2; u2[0] = s0 - (_i2 + bvirt) + (bvirt - t02); _j = s1 + _i2; bvirt = _j - s1; _0 = s1 - (_j - bvirt) + (_i2 - bvirt); _i2 = _0 - t12; bvirt = _0 - _i2; u2[1] = _0 - (_i2 + bvirt) + (bvirt - t12); u32 = _j + _i2; bvirt = u32 - _j; u2[2] = _j - (u32 - bvirt) + (_i2 - bvirt); u2[3] = u32; const C2len = sum(C1len, C1, 4, u2, C2); s1 = acxtail * bcytail; c2 = splitter * acxtail; ahi = c2 - (c2 - acxtail); alo = acxtail - ahi; c2 = splitter * bcytail; bhi = c2 - (c2 - bcytail); blo = bcytail - bhi; s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo); t12 = acytail * bcxtail; c2 = splitter * acytail; ahi = c2 - (c2 - acytail); alo = acytail - ahi; c2 = splitter * bcxtail; bhi = c2 - (c2 - bcxtail); blo = bcxtail - bhi; t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo); _i2 = s0 - t02; bvirt = s0 - _i2; u2[0] = s0 - (_i2 + bvirt) + (bvirt - t02); _j = s1 + _i2; bvirt = _j - s1; _0 = s1 - (_j - bvirt) + (_i2 - bvirt); _i2 = _0 - t12; bvirt = _0 - _i2; u2[1] = _0 - (_i2 + bvirt) + (bvirt - t12); u32 = _j + _i2; bvirt = u32 - _j; u2[2] = _j - (u32 - bvirt) + (_i2 - bvirt); u2[3] = u32; const Dlen = sum(C2len, C2, 4, u2, D2); return D2[Dlen - 1]; } function orient2d(ax2, ay2, bx2, by2, cx2, cy2) { const detleft = (ay2 - cy2) * (bx2 - cx2); const detright = (ax2 - cx2) * (by2 - cy2); const det = detleft - detright; const detsum = Math.abs(detleft + detright); if (Math.abs(det) >= ccwerrboundA * detsum) return det; return -orient2dadapt(ax2, ay2, bx2, by2, cx2, cy2, detsum); } var ccwerrboundA, ccwerrboundB, ccwerrboundC, B2, C1, C2, D2, u2; var init_orient2d = __esm({ "../../node_modules/robust-predicates/esm/orient2d.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util4(); ccwerrboundA = (3 + 16 * epsilon) * epsilon; ccwerrboundB = (2 + 12 * epsilon) * epsilon; ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon; B2 = vec(4); C1 = vec(8); C2 = vec(12); D2 = vec(16); u2 = vec(4); __name(orient2dadapt, "orient2dadapt"); __name(orient2d, "orient2d"); } }); // ../../node_modules/robust-predicates/esm/orient3d.js var o3derrboundA, o3derrboundB, o3derrboundC, bc2, ca2, ab2, at_b, at_c, bt_c, bt_a, ct_a, ct_b, bct, cat, abt, u3, _8, _8b, _16, _12, fin, fin2; var init_orient3d = __esm({ "../../node_modules/robust-predicates/esm/orient3d.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util4(); o3derrboundA = (7 + 56 * epsilon) * epsilon; o3derrboundB = (3 + 28 * epsilon) * epsilon; o3derrboundC = (26 + 288 * epsilon) * epsilon * epsilon; bc2 = vec(4); ca2 = vec(4); ab2 = vec(4); at_b = vec(4); at_c = vec(4); bt_c = vec(4); bt_a = vec(4); ct_a = vec(4); ct_b = vec(4); bct = vec(8); cat = vec(8); abt = vec(8); u3 = vec(4); _8 = vec(8); _8b = vec(8); _16 = vec(8); _12 = vec(12); fin = vec(192); fin2 = vec(192); } }); // ../../node_modules/robust-predicates/esm/incircle.js var iccerrboundA, iccerrboundB, iccerrboundC, bc3, ca3, ab3, aa2, bb2, cc2, u4, v2, axtbc, aytbc, bxtca, bytca, cxtab, cytab, abt2, bct2, cat2, abtt, bctt, catt, _82, _162, _16b, _16c, _32, _32b, _48, _64, fin3, fin22; var init_incircle = __esm({ "../../node_modules/robust-predicates/esm/incircle.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util4(); iccerrboundA = (10 + 96 * epsilon) * epsilon; iccerrboundB = (4 + 48 * epsilon) * epsilon; iccerrboundC = (44 + 576 * epsilon) * epsilon * epsilon; bc3 = vec(4); ca3 = vec(4); ab3 = vec(4); aa2 = vec(4); bb2 = vec(4); cc2 = vec(4); u4 = vec(4); v2 = vec(4); axtbc = vec(8); aytbc = vec(8); bxtca = vec(8); bytca = vec(8); cxtab = vec(8); cytab = vec(8); abt2 = vec(8); bct2 = vec(8); cat2 = vec(8); abtt = vec(4); bctt = vec(4); catt = vec(4); _82 = vec(8); _162 = vec(16); _16b = vec(16); _16c = vec(16); _32 = vec(32); _32b = vec(32); _48 = vec(48); _64 = vec(64); fin3 = vec(1152); fin22 = vec(1152); } }); // ../../node_modules/robust-predicates/esm/insphere.js var isperrboundA, isperrboundB, isperrboundC, ab4, bc4, cd2, de, ea, ac2, bd2, ce2, da, eb, abc, bcd, cde, dea, eab, abd, bce, cda, deb, eac, adet, bdet, cdet, ddet, edet, abdet, cddet, cdedet, deter, _83, _8b2, _8c, _163, _24, _482, _48b, _96, _192, _384x, _384y, _384z, _768, xdet, ydet, zdet, fin4; var init_insphere = __esm({ "../../node_modules/robust-predicates/esm/insphere.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_util4(); isperrboundA = (16 + 224 * epsilon) * epsilon; isperrboundB = (5 + 72 * epsilon) * epsilon; isperrboundC = (71 + 1408 * epsilon) * epsilon * epsilon; ab4 = vec(4); bc4 = vec(4); cd2 = vec(4); de = vec(4); ea = vec(4); ac2 = vec(4); bd2 = vec(4); ce2 = vec(4); da = vec(4); eb = vec(4); abc = vec(24); bcd = vec(24); cde = vec(24); dea = vec(24); eab = vec(24); abd = vec(24); bce = vec(24); cda = vec(24); deb = vec(24); eac = vec(24); adet = vec(1152); bdet = vec(1152); cdet = vec(1152); ddet = vec(1152); edet = vec(1152); abdet = vec(2304); cddet = vec(2304); cdedet = vec(3456); deter = vec(5760); _83 = vec(8); _8b2 = vec(8); _8c = vec(8); _163 = vec(16); _24 = vec(24); _482 = vec(48); _48b = vec(48); _96 = vec(96); _192 = vec(192); _384x = vec(384); _384y = vec(384); _384z = vec(384); _768 = vec(768); xdet = vec(96); ydet = vec(96); zdet = vec(96); fin4 = vec(1152); } }); // ../../node_modules/robust-predicates/index.js var init_robust_predicates = __esm({ "../../node_modules/robust-predicates/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_orient2d(); init_orient3d(); init_incircle(); init_insphere(); } }); // ../../node_modules/point-in-polygon-hao/dist/esm/index.js function pointInPolygon(p2, polygon3) { var i2; var ii2; var k2 = 0; var f2; var u1; var v1; var u22; var v22; var currentP; var nextP; var x2 = p2[0]; var y2 = p2[1]; var numContours = polygon3.length; for (i2 = 0; i2 < numContours; i2++) { ii2 = 0; var contour = polygon3[i2]; var contourLen = contour.length - 1; currentP = contour[0]; if (currentP[0] !== contour[contourLen][0] && currentP[1] !== contour[contourLen][1]) { throw new Error("First and last coordinates in a ring must be the same"); } u1 = currentP[0] - x2; v1 = currentP[1] - y2; for (ii2; ii2 < contourLen; ii2++) { nextP = contour[ii2 + 1]; u22 = nextP[0] - x2; v22 = nextP[1] - y2; if (v1 === 0 && v22 === 0) { if (u22 <= 0 && u1 >= 0 || u1 <= 0 && u22 >= 0) { return 0; } } else if (v22 >= 0 && v1 <= 0 || v22 <= 0 && v1 >= 0) { f2 = orient2d(u1, u22, v1, v22, 0, 0); if (f2 === 0) { return 0; } if (f2 > 0 && v22 > 0 && v1 <= 0 || f2 < 0 && v22 <= 0 && v1 > 0) { k2++; } } currentP = nextP; v1 = v22; u1 = u22; } } if (k2 % 2 === 0) { return false; } return true; } var init_esm4 = __esm({ "../../node_modules/point-in-polygon-hao/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_robust_predicates(); __name(pointInPolygon, "pointInPolygon"); } }); // ../../node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js function booleanPointInPolygon(point2, polygon3, options = {}) { if (!point2) { throw new Error("point is required"); } if (!polygon3) { throw new Error("polygon is required"); } const pt = getCoord(point2); const geom = getGeom(polygon3); const type = geom.type; const bbox = polygon3.bbox; let polys = geom.coordinates; if (bbox && inBBox(pt, bbox) === false) { return false; } if (type === "Polygon") { polys = [polys]; } let result = false; for (var i2 = 0; i2 < polys.length; ++i2) { const polyResult = pointInPolygon(pt, polys[i2]); if (polyResult === 0) return options.ignoreBoundary ? false : true; else if (polyResult) result = true; } return result; } function inBBox(pt, bbox) { return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1]; } var init_esm5 = __esm({ "../../node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_esm4(); init_esm2(); __name(booleanPointInPolygon, "booleanPointInPolygon"); __name(inBBox, "inBBox"); } }); // ../../node_modules/@turf/clone/dist/esm/index.js var init_esm6 = __esm({ "../../node_modules/@turf/clone/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@turf/clusters/dist/esm/index.js var init_esm7 = __esm({ "../../node_modules/@turf/clusters/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.js var init_esm8 = __esm({ "../../node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@turf/projection/dist/esm/index.js var init_esm9 = __esm({ "../../node_modules/@turf/projection/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@turf/quadrat-analysis/dist/esm/index.js var init_esm10 = __esm({ "../../node_modules/@turf/quadrat-analysis/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@turf/random/dist/esm/index.js var init_esm11 = __esm({ "../../node_modules/@turf/random/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../node_modules/@turf/turf/dist/esm/index.js var init_esm12 = __esm({ "../../node_modules/@turf/turf/dist/esm/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_esm5(); init_esm6(); init_esm7(); init_esm(); init_esm2(); init_esm3(); init_esm8(); init_esm9(); init_esm10(); init_esm11(); } }); // src/lib/mbnr-geojson.ts var mbnrGeoJson; var init_mbnr_geojson = __esm({ "src/lib/mbnr-geojson.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); mbnrGeoJson = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "coordinates": [ [ [ 78.0540565157155, 16.750355644371382 ], [ 78.02147549424018, 16.72066473405593 ], [ 78.03026125246384, 16.71696749930787 ], [ 78.0438058450269, 16.72191442229257 ], [ 78.01378723066603, 16.729427120762438 ], [ 78.01192390645633, 16.767270033080678 ], [ 77.98897480599248, 16.78383139678816 ], [ 77.98650506846502, 16.779477610410623 ], [ 77.99211289459566, 16.764294442899583 ], [ 77.9917733766166, 16.760247911187193 ], [ 77.9871626670851, 16.762487176781022 ], [ 77.98216269568468, 16.762520539253813 ], [ 77.9728079653313, 16.75895746646411 ], [ 77.97076993211158, 16.749241850772236 ], [ 77.97290869571145, 16.714289841456335 ], [ 77.98673742913684, 16.716189282573396 ], [ 78.00286970994557, 16.718191131206893 ], [ 78.02757966423519, 16.720603921728966 ], [ 78.01653780770818, 16.73184590223127 ], [ 78.0064695230268, 16.760236966033375 ], [ 78.0148831108591, 16.760801801995825 ], [ 78.01488756695255, 16.75827980335133 ], [ 78.0244311364159, 16.744778942163208 ], [ 78.03342267256608, 16.760773251410058 ], [ 78.05078586709863, 16.763902127913653 ], [ 78.0540565157155, 16.750355644371382 ] ] ], "type": "Polygon" } } ] }; } }); // src/trpc/apis/common-apis/common-trpc-index.ts async function scaffoldEssentialConsts() { const consts = await getAllConstValues(); return { freeDeliveryThreshold: consts[CONST_KEYS.freeDeliveryThreshold] ?? 200, deliveryCharge: consts[CONST_KEYS.deliveryCharge] ?? 0, flashFreeDeliveryThreshold: consts[CONST_KEYS.flashFreeDeliveryThreshold] ?? 500, flashDeliveryCharge: consts[CONST_KEYS.flashDeliveryCharge] ?? 69, popularItems: consts[CONST_KEYS.popularItems] ?? "5,3,2,4,1", versionNum: consts[CONST_KEYS.versionNum] ?? "1.1.0", playStoreUrl: consts[CONST_KEYS.playStoreUrl] ?? "https://play.google.com/store/apps/details?id=in.freshyo.app", appStoreUrl: consts[CONST_KEYS.appStoreUrl] ?? "https://apps.apple.com/in/app/freshyo/id6756889077", webViewHtml: null, isWebviewClosable: true, isFlashDeliveryEnabled: consts[CONST_KEYS.isFlashDeliveryEnabled] ?? true, supportMobile: consts[CONST_KEYS.supportMobile] ?? "", supportEmail: consts[CONST_KEYS.supportEmail] ?? "", assetsDomain, apiCacheKey }; } var polygon2, commonApiRouter; var init_common_trpc_index = __esm({ "src/trpc/apis/common-apis/common-trpc-index.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_common3(); init_dbService(); init_esm12(); init_zod(); init_mbnr_geojson(); init_s3_client(); init_api_error(); init_const_store(); init_const_keys(); init_env_exporter(); polygon2 = polygon(mbnrGeoJson.features[0].geometry.coordinates); __name(scaffoldEssentialConsts, "scaffoldEssentialConsts"); commonApiRouter = router2({ product: commonRouter, getStoresSummary: publicProcedure.query(async () => { const stores = await getStoresSummary(); return { stores }; }), checkLocationInPolygon: publicProcedure.input(external_exports.object({ lat: external_exports.number().min(-90).max(90), lng: external_exports.number().min(-180).max(180) })).query(({ input }) => { try { const { lat, lng } = input; const point2 = point([lng, lat]); const isInside = booleanPointInPolygon(point2, polygon2); return { isInside }; } catch (error50) { throw new Error("Invalid coordinates or polygon data"); } }), generateUploadUrls: protectedProcedure.input(external_exports.object({ contextString: external_exports.enum(["review", "review_response", "product_info", "notification", "store", "complaint", "profile", "tags"]), mimeTypes: external_exports.array(external_exports.string()) })).mutation(async ({ input }) => { const { contextString, mimeTypes } = input; const uploadUrls = []; const keys = []; for (const mimeType of mimeTypes) { let folder; if (contextString === "review") { folder = "review-images"; } else if (contextString === "product_info") { folder = "product-images"; } else if (contextString === "store") { folder = "store-images"; } else if (contextString === "review_response") { folder = "review-response-images"; } else if (contextString === "complaint") { folder = "complaint-images"; } else if (contextString === "profile") { folder = "profile-images"; } else if (contextString === "tags") { folder = "tags"; } else { folder = ""; } const extension = mimeType === "image/jpeg" ? ".jpg" : mimeType === "image/png" ? ".png" : mimeType === "image/gif" ? ".gif" : ".jpg"; const key = `${folder}/${Date.now()}${extension}`; try { const uploadUrl = await generateUploadUrl(key, mimeType); uploadUrls.push(uploadUrl); keys.push(key); } catch (error50) { console.error("Error generating upload URL:", error50); throw new ApiError("Failed to generate upload URL", 500); } } return { uploadUrls }; }), healthCheck: publicProcedure.query(async () => { const result = await healthCheck(); return result; }), essentialConsts: publicProcedure.query(async () => { const response = await scaffoldEssentialConsts(); return response; }) }); } }); // src/trpc/apis/user-apis/apis/stores.ts async function scaffoldStores() { const storesData = await getStoreSummaries(); const storesWithDetails = storesData.map((store) => { const signedImageUrl = store.imageUrl ? scaffoldAssetUrl(store.imageUrl) : null; const sampleProducts = store.sampleProducts.map((product) => ({ id: product.id, name: product.name, signedImageUrl: product.images && product.images.length > 0 ? scaffoldAssetUrl(product.images[0]) : null })); return { id: store.id, name: store.name, description: store.description, signedImageUrl, productCount: store.productCount, sampleProducts }; }); return { stores: storesWithDetails }; } async function scaffoldStoreWithProducts(storeId) { const storeDetail = await getStoreDetail(storeId); if (!storeDetail) { throw new ApiError("Store not found", 404); } const signedImageUrl = storeDetail.store.imageUrl ? scaffoldAssetUrl(storeDetail.store.imageUrl) : null; const productsWithSignedUrls = storeDetail.products.map((product) => ({ id: product.id, name: product.name, shortDescription: product.shortDescription, price: product.price, marketPrice: product.marketPrice, incrementStep: product.incrementStep, unit: product.unit, unitNotation: product.unitNotation, images: scaffoldAssetUrl(product.images || []), isOutOfStock: product.isOutOfStock, productQuantity: product.productQuantity })); const tags = await getTagsByStoreId(storeId); return { store: { id: storeDetail.store.id, name: storeDetail.store.name, description: storeDetail.store.description, signedImageUrl }, products: productsWithSignedUrls, tags: tags.map((tag2) => ({ id: tag2.id, tagName: tag2.tagName, tagDescription: tag2.tagDescription, imageUrl: tag2.imageUrl, productIds: tag2.productIds })) }; } var storesRouter; var init_stores2 = __esm({ "src/trpc/apis/user-apis/apis/stores.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_s3_client(); init_api_error(); init_product_tag_store(); init_dbService(); __name(scaffoldStores, "scaffoldStores"); __name(scaffoldStoreWithProducts, "scaffoldStoreWithProducts"); storesRouter = router2({ getStores: publicProcedure.query(async () => { const response = await scaffoldStores(); return response; }), getStoreWithProducts: publicProcedure.input(external_exports.object({ storeId: external_exports.number() })).query(async ({ input }) => { const { storeId } = input; const response = await scaffoldStoreWithProducts(storeId); return response; }) }); } }); // src/trpc/apis/user-apis/apis/slots.ts async function getSlotData(slotId) { const slot = await getSlotById(slotId); if (!slot) { return null; } const currentTime = /* @__PURE__ */ new Date(); if ((0, import_dayjs3.default)(slot.freezeTime).isBefore(currentTime)) { return null; } return { deliveryTime: slot.deliveryTime, freezeTime: slot.freezeTime, slotId: slot.id, products: slot.products.filter((product) => !product.isOutOfStock) }; } async function scaffoldSlotsWithProducts() { const allSlots = await getAllSlots(); const currentTime = /* @__PURE__ */ new Date(); const validSlots = allSlots.filter((slot) => { return (0, import_dayjs3.default)(slot.freezeTime).isAfter(currentTime) && (0, import_dayjs3.default)(slot.deliveryTime).isAfter(currentTime) && !slot.isCapacityFull; }).sort((a2, b2) => (0, import_dayjs3.default)(a2.deliveryTime).valueOf() - (0, import_dayjs3.default)(b2.deliveryTime).valueOf()); const productAvailability = await getProductAvailability(); return { slots: validSlots, productAvailability, count: validSlots.length }; } var import_dayjs3, slotsRouter; var init_slots3 = __esm({ "src/trpc/apis/user-apis/apis/slots.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_slot_store(); import_dayjs3 = __toESM(require_dayjs_min()); init_dbService(); __name(getSlotData, "getSlotData"); __name(scaffoldSlotsWithProducts, "scaffoldSlotsWithProducts"); slotsRouter = router2({ getSlots: publicProcedure.query(async () => { const slots = await getActiveSlotsList(); return { slots, count: slots.length }; }), getSlotsWithProducts: publicProcedure.query(async () => { const response = await scaffoldSlotsWithProducts(); return response; }), getSlotById: publicProcedure.input(external_exports.object({ slotId: external_exports.number() })).query(async ({ input }) => { return await getSlotData(input.slotId); }) }); } }); // src/trpc/apis/user-apis/apis/banners.ts async function scaffoldBanners() { const banners = await getActiveBanners(); const bannersWithSignedUrls = banners.map((banner) => ({ ...banner, imageUrl: banner.imageUrl ? scaffoldAssetUrl(banner.imageUrl) : banner.imageUrl })); return { banners: bannersWithSignedUrls }; } var bannerRouter; var init_banners2 = __esm({ "src/trpc/apis/user-apis/apis/banners.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_s3_client(); init_dbService(); __name(scaffoldBanners, "scaffoldBanners"); bannerRouter = router2({ getBanners: publicProcedure.query(async () => { const response = await scaffoldBanners(); return response; }) }); } }); // ../../packages/shared/types/index.ts var init_types7 = __esm({ "../../packages/shared/types/index.ts"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); } }); // ../../packages/shared/index.ts var CACHE_FILENAMES; var init_shared4 = __esm({ "../../packages/shared/index.ts"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_types7(); CACHE_FILENAMES = { products: "products.json", stores: "stores.json", slots: "slots.json", essentialConsts: "essential-consts.json", banners: "banners.json" }; } }); // src/lib/retry.ts async function retryWithExponentialBackoff(fn, maxRetries = 3, delayMs = 1e3) { let lastError; for (let attempt = 1; attempt <= maxRetries; attempt++) { try { return await fn(); } catch (error50) { lastError = error50 instanceof Error ? error50 : new Error(String(error50)); if (attempt < maxRetries) { console.log(`Attempt ${attempt} failed, retrying in ${delayMs}ms...`); await new Promise((resolve) => setTimeout(resolve, delayMs)); delayMs *= 2; } } } throw lastError; } var init_retry3 = __esm({ "src/lib/retry.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); __name(retryWithExponentialBackoff, "retryWithExponentialBackoff"); } }); // src/lib/cloud_cache.ts function constructCacheUrl(path) { return `${assetsDomain}${apiCacheKey}/${path}`; } async function createAllCacheFiles() { console.log("Starting creation of all cache files..."); const [ productsKey, essentialConstsKey, storesKey, slotsKey, bannersKey, individualStoreKeys ] = await Promise.all([ createProductsFileInternal(), createEssentialConstsFileInternal(), createStoresFileInternal(), createSlotsFileInternal(), createBannersFileInternal(), createAllStoresFilesInternal() ]); const urls = [ constructCacheUrl(CACHE_FILENAMES.products), constructCacheUrl(CACHE_FILENAMES.essentialConsts), constructCacheUrl(CACHE_FILENAMES.stores), constructCacheUrl(CACHE_FILENAMES.slots), constructCacheUrl(CACHE_FILENAMES.banners), ...individualStoreKeys.map((_, index) => constructCacheUrl(`stores/${index + 1}.json`)) ]; try { await retryWithExponentialBackoff(() => clearUrlCache(urls)); console.log(`Cache purged for all ${urls.length} files`); } catch (error50) { console.error(`Failed to purge cache for all files after 3 retries`, error50); } console.log("All cache files created successfully"); return { products: productsKey, essentialConsts: essentialConstsKey, stores: storesKey, slots: slotsKey, banners: bannersKey, individualStores: individualStoreKeys }; } async function createProductsFileInternal() { const productsData = await scaffoldProducts(); const jsonContent = JSON.stringify(productsData, null, 2); const buffer = Buffer.from(jsonContent, "utf-8"); return await imageUploadS3(buffer, "application/json", `${apiCacheKey}/${CACHE_FILENAMES.products}`); } async function createEssentialConstsFileInternal() { const essentialConstsData = await scaffoldEssentialConsts(); const jsonContent = JSON.stringify(essentialConstsData, null, 2); const buffer = Buffer.from(jsonContent, "utf-8"); return await imageUploadS3(buffer, "application/json", `${apiCacheKey}/${CACHE_FILENAMES.essentialConsts}`); } async function createStoresFileInternal() { const storesData = await scaffoldStores(); const jsonContent = JSON.stringify(storesData, null, 2); const buffer = Buffer.from(jsonContent, "utf-8"); return await imageUploadS3(buffer, "application/json", `${apiCacheKey}/${CACHE_FILENAMES.stores}`); } async function createSlotsFileInternal() { const slotsData = await scaffoldSlotsWithProducts(); const jsonContent = JSON.stringify(slotsData, null, 2); const buffer = Buffer.from(jsonContent, "utf-8"); return await imageUploadS3(buffer, "application/json", `${apiCacheKey}/${CACHE_FILENAMES.slots}`); } async function createBannersFileInternal() { const bannersData = await scaffoldBanners(); const jsonContent = JSON.stringify(bannersData, null, 2); const buffer = Buffer.from(jsonContent, "utf-8"); return await imageUploadS3(buffer, "application/json", `${apiCacheKey}/${CACHE_FILENAMES.banners}`); } async function createAllStoresFilesInternal() { const stores = await getStoresSummary(); const results = []; for (const store of stores) { const storeData = await scaffoldStoreWithProducts(store.id); const jsonContent = JSON.stringify(storeData, null, 2); const buffer = Buffer.from(jsonContent, "utf-8"); const s3Key = await imageUploadS3(buffer, "application/json", `${apiCacheKey}/stores/${store.id}.json`); results.push(s3Key); } console.log(`Created ${results.length} store cache files`); return results; } async function clearUrlCache(urls) { if (!cloudflareApiToken || !cloudflareZoneId) { console.warn("Cloudflare credentials not configured, skipping cache clear"); return { success: false, errors: ["Cloudflare credentials not configured"] }; } try { const response = await axios_default.post( `https://api.cloudflare.com/client/v4/zones/${cloudflareZoneId}/purge_cache`, { files: urls }, { headers: { "Authorization": `Bearer ${cloudflareApiToken}`, "Content-Type": "application/json" } } ); const result = response.data; if (!result.success) { const errorMessages = result.errors?.map((e2) => e2.message) || ["Unknown error"]; console.error(`Cloudflare cache purge failed for URLs: ${urls.join(", ")}`, errorMessages); return { success: false, errors: errorMessages }; } console.log(`Successfully purged ${urls.length} URLs from Cloudflare cache: ${urls.join(", ")}`); return { success: true }; } catch (error50) { console.log(error50); const errorMessage = error50 instanceof Error ? error50.message : "Unknown error"; console.error(`Error clearing Cloudflare cache for URLs: ${urls.join(", ")}`, errorMessage); return { success: false, errors: [errorMessage] }; } } var init_cloud_cache = __esm({ "src/lib/cloud_cache.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_axios2(); init_common3(); init_common_trpc_index(); init_stores2(); init_slots3(); init_banners2(); init_stores2(); init_dbService(); init_s3_client(); init_env_exporter(); init_shared4(); init_retry3(); __name(constructCacheUrl, "constructCacheUrl"); __name(createAllCacheFiles, "createAllCacheFiles"); __name(createProductsFileInternal, "createProductsFileInternal"); __name(createEssentialConstsFileInternal, "createEssentialConstsFileInternal"); __name(createStoresFileInternal, "createStoresFileInternal"); __name(createSlotsFileInternal, "createSlotsFileInternal"); __name(createBannersFileInternal, "createBannersFileInternal"); __name(createAllStoresFilesInternal, "createAllStoresFilesInternal"); __name(clearUrlCache, "clearUrlCache"); } }); // src/stores/store-initializer.ts var STORE_INIT_DELAY_MS, storeInitializationTimeout, initializeAllStores, scheduleStoreInitialization; var init_store_initializer = __esm({ "src/stores/store-initializer.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_roles_manager(); init_const_store(); init_product_store(); init_product_tag_store(); init_slot_store(); init_banner_store(); init_cloud_cache(); STORE_INIT_DELAY_MS = 3 * 60 * 1e3; storeInitializationTimeout = null; initializeAllStores = /* @__PURE__ */ __name(async () => { try { console.log("Starting application stores initialization..."); await Promise.all([ roles_manager_default.fetchRoles(), computeConstants(), initializeProducts(), initializeProductTagStore(), initializeSlotStore(), initializeBannerStore() ]); console.log("All application stores initialized successfully"); createAllCacheFiles().catch((error50) => { console.error("Failed to regenerate cache files during store initialization:", error50); }); } catch (error50) { console.error("Application stores initialization failed:", error50); throw error50; } }, "initializeAllStores"); scheduleStoreInitialization = /* @__PURE__ */ __name(() => { if (storeInitializationTimeout) { clearTimeout(storeInitializationTimeout); storeInitializationTimeout = null; } storeInitializationTimeout = setTimeout(() => { storeInitializationTimeout = null; initializeAllStores().catch((error50) => { console.error("Scheduled store initialization failed:", error50); }); }, STORE_INIT_DELAY_MS); }, "scheduleStoreInitialization"); } }); // src/trpc/apis/admin-apis/apis/slots.ts var cachedSequenceSchema, createSlotSchema, getSlotByIdSchema, updateSlotSchema, deleteSlotSchema, getDeliverySequenceSchema, updateDeliverySequenceSchema, slotsRouter2; var init_slots4 = __esm({ "src/trpc/apis/admin-apis/apis/slots.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_dist3(); init_zod(); init_api_error(); init_env_exporter(); init_store_initializer(); init_dbService(); cachedSequenceSchema = external_exports.record(external_exports.string(), external_exports.array(external_exports.number())); createSlotSchema = external_exports.object({ deliveryTime: external_exports.string(), freezeTime: external_exports.string(), isActive: external_exports.boolean().optional(), productIds: external_exports.array(external_exports.number()).optional(), vendorSnippets: external_exports.array(external_exports.object({ name: external_exports.string().min(1), productIds: external_exports.array(external_exports.number().int().positive()).min(1), validTill: external_exports.string().optional() })).optional(), groupIds: external_exports.array(external_exports.number()).optional() }); getSlotByIdSchema = external_exports.object({ id: external_exports.number() }); updateSlotSchema = external_exports.object({ id: external_exports.number(), deliveryTime: external_exports.string(), freezeTime: external_exports.string(), isActive: external_exports.boolean().optional(), productIds: external_exports.array(external_exports.number()).optional(), vendorSnippets: external_exports.array(external_exports.object({ name: external_exports.string().min(1), productIds: external_exports.array(external_exports.number().int().positive()).min(1), validTill: external_exports.string().optional() })).optional(), groupIds: external_exports.array(external_exports.number()).optional() }); deleteSlotSchema = external_exports.object({ id: external_exports.number() }); getDeliverySequenceSchema = external_exports.object({ id: external_exports.string() }); updateDeliverySequenceSchema = external_exports.object({ id: external_exports.number(), // deliverySequence: z.array(z.number()), deliverySequence: external_exports.any() }); slotsRouter2 = router2({ // Exact replica of GET /av/slots getAll: protectedProcedure.query(async ({ ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const slots = await getActiveSlotsWithProducts(); return { slots, count: slots.length }; }), // Exact replica of POST /av/products/slots/product-ids getSlotsProductIds: protectedProcedure.input(external_exports.object({ slotIds: external_exports.array(external_exports.number()) })).query(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const { slotIds } = input; if (!Array.isArray(slotIds)) { throw new TRPCError({ code: "BAD_REQUEST", message: "slotIds must be an array" }); } const result = await getSlotsProductIds(slotIds); return result; }), // Exact replica of PUT /av/products/slots/:slotId/products updateSlotProducts: protectedProcedure.input( external_exports.object({ slotId: external_exports.number(), productIds: external_exports.array(external_exports.number()) }) ).mutation(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const { slotId, productIds } = input; if (!Array.isArray(productIds)) { throw new TRPCError({ code: "BAD_REQUEST", message: "productIds must be an array" }); } const result = await updateSlotProducts(String(slotId), productIds.map(String)); scheduleStoreInitialization(); return { message: result.message, added: result.added, removed: result.removed }; }), createSlot: protectedProcedure.input(createSlotSchema).mutation(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const { deliveryTime, freezeTime, isActive, productIds, vendorSnippets: snippets, groupIds } = input; if (!deliveryTime || !freezeTime) { throw new ApiError("Delivery time and orders close time are required", 400); } const result = await createSlotWithRelations({ deliveryTime, freezeTime, isActive, productIds, vendorSnippets: snippets, groupIds }); scheduleStoreInitialization(); return result; }), getSlots: protectedProcedure.query(async ({ ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const slots = await getActiveSlots(); return { slots, count: slots.length }; }), getSlotById: protectedProcedure.input(getSlotByIdSchema).query(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const { id } = input; const slot = await getSlotByIdWithRelations(id); if (!slot) { throw new ApiError("Slot not found", 404); } return { slot: { ...slot, vendorSnippets: slot.vendorSnippets.map((snippet) => ({ ...snippet, accessUrl: `${appUrl}/vendor-order-list?id=${snippet.snippetCode}` })) } }; }), updateSlot: protectedProcedure.input(updateSlotSchema).mutation(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } try { const { id, deliveryTime, freezeTime, isActive, productIds, vendorSnippets: snippets, groupIds } = input; if (!deliveryTime || !freezeTime) { throw new ApiError("Delivery time and orders close time are required", 400); } const result = await updateSlotWithRelations({ id, deliveryTime, freezeTime, isActive, productIds, vendorSnippets: snippets, groupIds }); if (!result) { throw new ApiError("Slot not found", 404); } scheduleStoreInitialization(); return result; } catch (e2) { console.log(e2); throw new ApiError("Unable to Update Slot"); } }), deleteSlot: protectedProcedure.input(deleteSlotSchema).mutation(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const { id } = input; const deletedSlot = await deleteSlotById(id); if (!deletedSlot) { throw new ApiError("Slot not found", 404); } scheduleStoreInitialization(); return { message: "Slot deleted successfully" }; }), getDeliverySequence: protectedProcedure.input(getDeliverySequenceSchema).query(async ({ input, ctx }) => { const { id } = input; const slotId = parseInt(id); const slot = await getSlotDeliverySequence(slotId); if (!slot) { throw new ApiError("Slot not found", 404); } const sequence = slot.deliverySequence || {}; return { deliverySequence: sequence }; }), updateDeliverySequence: protectedProcedure.input(updateDeliverySequenceSchema).mutation(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const { id, deliverySequence } = input; const updatedSlot = await updateSlotDeliverySequence(id, deliverySequence); if (!updatedSlot) { throw new ApiError("Slot not found", 404); } return { slot: updatedSlot, message: "Delivery sequence updated successfully" }; }), updateSlotCapacity: protectedProcedure.input(external_exports.object({ slotId: external_exports.number(), isCapacityFull: external_exports.boolean() })).mutation(async ({ input, ctx }) => { if (!ctx.staffUser?.id) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Access denied" }); } const { slotId, isCapacityFull } = input; const result = await updateSlotCapacity(slotId, isCapacityFull); if (!result) { throw new ApiError("Slot not found", 404); } scheduleStoreInitialization(); return result; }) }); } }); // src/trpc/apis/admin-apis/apis/product.ts var productRouter; var init_product3 = __esm({ "src/trpc/apis/admin-apis/apis/product.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_s3_client(); init_store_initializer(); init_dbService(); productRouter = router2({ getProducts: protectedProcedure.query(async () => { const products = await getAllProducts(); const productsWithSignedUrls = await Promise.all( products.map(async (product) => ({ ...product, images: await generateSignedUrlsFromS3Urls(product.images || []) })) ); return { products: productsWithSignedUrls, count: productsWithSignedUrls.length }; }), getProductById: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).query(async ({ input }) => { const { id } = input; const product = await getProductById(id); if (!product) { throw new ApiError("Product not found", 404); } const productWithSignedUrls = { ...product, images: await generateSignedUrlsFromS3Urls(product.images || []) }; return { product: productWithSignedUrls }; }), deleteProduct: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).mutation(async ({ input }) => { const { id } = input; const deletedProduct = await deleteProduct(id); if (!deletedProduct) { throw new ApiError("Product not found", 404); } scheduleStoreInitialization(); return { message: "Product deleted successfully" }; }), toggleOutOfStock: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).mutation(async ({ input }) => { const { id } = input; const updatedProduct = await toggleProductOutOfStock(id); if (!updatedProduct) { throw new ApiError("Product not found", 404); } scheduleStoreInitialization(); return { product: updatedProduct, message: `Product marked as ${updatedProduct.isOutOfStock ? "out of stock" : "in stock"}` }; }), createProduct: protectedProcedure.input(external_exports.object({ name: external_exports.string().min(1, "Name is required"), shortDescription: external_exports.string().optional(), longDescription: external_exports.string().optional(), unitId: external_exports.number().min(1, "Unit is required"), storeId: external_exports.number().min(1, "Store is required"), price: external_exports.number().positive("Price must be positive"), marketPrice: external_exports.number().optional(), incrementStep: external_exports.number().optional().default(1), productQuantity: external_exports.number().optional().default(1), isSuspended: external_exports.boolean().optional().default(false), isFlashAvailable: external_exports.boolean().optional().default(false), flashPrice: external_exports.number().optional(), uploadUrls: external_exports.array(external_exports.string()).optional().default([]), deals: external_exports.array(external_exports.object({ quantity: external_exports.number(), price: external_exports.number(), validTill: external_exports.string() })).optional(), tagIds: external_exports.array(external_exports.number()).optional().default([]) })).mutation(async ({ input }) => { const { name, shortDescription, longDescription, unitId, storeId, price, marketPrice, incrementStep, productQuantity, isSuspended, isFlashAvailable, flashPrice, uploadUrls, deals, tagIds } = input; const existingProduct = await checkProductExistsByName(name.trim()); if (existingProduct) { throw new ApiError("A product with this name already exists", 400); } const unitExists = await checkUnitExists(unitId); if (!unitExists) { throw new ApiError("Invalid unit ID", 400); } const imageKeys = uploadUrls.map((url2) => extractKeyFromPresignedUrl(url2)); const newProduct = await createProduct({ name, shortDescription, longDescription, unitId, storeId, price: price.toString(), marketPrice: marketPrice?.toString(), incrementStep, productQuantity, isSuspended, isFlashAvailable, flashPrice: flashPrice?.toString(), images: imageKeys }); let createdDeals = []; if (deals && deals.length > 0) { createdDeals = await createSpecialDealsForProduct(newProduct.id, deals); } if (tagIds.length > 0) { await replaceProductTags(newProduct.id, tagIds); } if (uploadUrls.length > 0) { await Promise.all(uploadUrls.map((url2) => claimUploadUrl(url2))); } scheduleStoreInitialization(); return { product: newProduct, deals: createdDeals, message: "Product created successfully" }; }), updateProduct: protectedProcedure.input(external_exports.object({ id: external_exports.number(), name: external_exports.string().min(1, "Name is required"), shortDescription: external_exports.string().optional(), longDescription: external_exports.string().optional(), unitId: external_exports.number().min(1, "Unit is required"), storeId: external_exports.number().min(1, "Store is required"), price: external_exports.number().positive("Price must be positive"), marketPrice: external_exports.number().optional(), incrementStep: external_exports.number().optional().default(1), productQuantity: external_exports.number().optional().default(1), isSuspended: external_exports.boolean().optional().default(false), isFlashAvailable: external_exports.boolean().optional().default(false), flashPrice: external_exports.number().nullable().optional(), uploadUrls: external_exports.array(external_exports.string()).optional().default([]), imagesToDelete: external_exports.array(external_exports.string()).optional().default([]), deals: external_exports.array(external_exports.object({ quantity: external_exports.number(), price: external_exports.number(), validTill: external_exports.string() })).optional(), tagIds: external_exports.array(external_exports.number()).optional().default([]) })).mutation(async ({ input }) => { const { id, name, shortDescription, longDescription, unitId, storeId, price, marketPrice, incrementStep, productQuantity, isSuspended, isFlashAvailable, flashPrice, uploadUrls, imagesToDelete, deals, tagIds } = input; const unitExists = await checkUnitExists(unitId); if (!unitExists) { throw new ApiError("Invalid unit ID", 400); } const currentImages = await getProductImagesById(id); if (!currentImages) { throw new ApiError("Product not found", 404); } let updatedImages = currentImages || []; if (imagesToDelete.length > 0) { const imagesToRemove = updatedImages.filter((img) => imagesToDelete.includes(img)); await deleteImageUtil({ keys: imagesToRemove }); updatedImages = updatedImages.filter((img) => !imagesToRemove.includes(img)); } const newImageKeys = uploadUrls.map((url2) => extractKeyFromPresignedUrl(url2)); const finalImages = [...updatedImages, ...newImageKeys]; const updatedProduct = await updateProduct(id, { name, shortDescription, longDescription, unitId, storeId, price: price.toString(), marketPrice: marketPrice?.toString(), incrementStep, productQuantity, isSuspended, isFlashAvailable, flashPrice: flashPrice?.toString() ?? null, images: finalImages }); if (!updatedProduct) { throw new ApiError("Product not found", 404); } if (deals && deals.length > 0) { await updateProductDeals(id, deals); } if (tagIds.length > 0) { await replaceProductTags(id, tagIds); } if (uploadUrls.length > 0) { await Promise.all(uploadUrls.map((url2) => claimUploadUrl(url2))); } scheduleStoreInitialization(); return { product: updatedProduct, message: "Product updated successfully" }; }), updateSlotProducts: protectedProcedure.input(external_exports.object({ slotId: external_exports.string(), productIds: external_exports.array(external_exports.string()) })).mutation(async ({ input }) => { const { slotId, productIds } = input; if (!Array.isArray(productIds)) { throw new ApiError("productIds must be an array", 400); } const result = await updateSlotProducts(slotId, productIds); scheduleStoreInitialization(); return { message: "Slot products updated successfully", added: result.added, removed: result.removed }; }), getSlotProductIds: protectedProcedure.input(external_exports.object({ slotId: external_exports.string() })).query(async ({ input }) => { const { slotId } = input; const productIds = await getSlotProductIds(slotId); return { productIds }; }), getSlotsProductIds: protectedProcedure.input(external_exports.object({ slotIds: external_exports.array(external_exports.number()) })).query(async ({ input }) => { const { slotIds } = input; if (!Array.isArray(slotIds)) { throw new ApiError("slotIds must be an array", 400); } const result = await getSlotsProductIds(slotIds); return result; }), getProductReviews: protectedProcedure.input(external_exports.object({ productId: external_exports.number().int().positive(), limit: external_exports.number().int().min(1).max(50).optional().default(10), offset: external_exports.number().int().min(0).optional().default(0) })).query(async ({ input }) => { const { productId, limit, offset } = input; const { reviews, totalCount } = await getProductReviews(productId, limit, offset); const reviewsWithSignedUrls = await Promise.all( reviews.map(async (review) => ({ ...review, signedImageUrls: await generateSignedUrlsFromS3Urls(review.imageUrls || []), signedAdminImageUrls: await generateSignedUrlsFromS3Urls(review.adminResponseImages || []) })) ); const hasMore = offset + limit < totalCount; return { reviews: reviewsWithSignedUrls, hasMore }; }), respondToReview: protectedProcedure.input(external_exports.object({ reviewId: external_exports.number().int().positive(), adminResponse: external_exports.string().optional(), adminResponseImages: external_exports.array(external_exports.string()).optional().default([]), uploadUrls: external_exports.array(external_exports.string()).optional().default([]) })).mutation(async ({ input }) => { const { reviewId, adminResponse, adminResponseImages, uploadUrls } = input; const updatedReview = await respondToReview(reviewId, adminResponse, adminResponseImages); if (!updatedReview) { throw new ApiError("Review not found", 404); } if (uploadUrls && uploadUrls.length > 0) { await Promise.all(uploadUrls.map((url2) => claimUploadUrl(url2))); } return { success: true, review: updatedReview }; }), getGroups: protectedProcedure.query(async () => { const groups = await getAllProductGroups(); return { groups: groups.map((group6) => ({ ...group6, products: group6.memberships.map((m2) => ({ ...m2.product, images: m2.product.images || null })), productCount: group6.memberships.length })) }; }), createGroup: protectedProcedure.input(external_exports.object({ group_name: external_exports.string().min(1), description: external_exports.string().optional(), product_ids: external_exports.array(external_exports.number()).default([]) })).mutation(async ({ input }) => { const { group_name, description, product_ids } = input; const newGroup = await createProductGroup(group_name, description, product_ids); scheduleStoreInitialization(); return { group: newGroup, message: "Group created successfully" }; }), updateGroup: protectedProcedure.input(external_exports.object({ id: external_exports.number(), group_name: external_exports.string().optional(), description: external_exports.string().optional(), product_ids: external_exports.array(external_exports.number()).optional() })).mutation(async ({ input }) => { const { id, group_name, description, product_ids } = input; const updatedGroup = await updateProductGroup(id, group_name, description, product_ids); if (!updatedGroup) { throw new ApiError("Group not found", 404); } scheduleStoreInitialization(); return { group: updatedGroup, message: "Group updated successfully" }; }), deleteGroup: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).mutation(async ({ input }) => { const { id } = input; const deletedGroup = await deleteProductGroup(id); if (!deletedGroup) { throw new ApiError("Group not found", 404); } scheduleStoreInitialization(); return { message: "Group deleted successfully" }; }), updateProductPrices: protectedProcedure.input(external_exports.object({ updates: external_exports.array(external_exports.object({ productId: external_exports.number(), price: external_exports.number().optional(), marketPrice: external_exports.number().nullable().optional(), flashPrice: external_exports.number().nullable().optional(), isFlashAvailable: external_exports.boolean().optional() })) })).mutation(async ({ input }) => { const { updates } = input; if (updates.length === 0) { throw new ApiError("No updates provided", 400); } const result = await updateProductPrices(updates); if (result.invalidIds.length > 0) { throw new ApiError(`Invalid product IDs: ${result.invalidIds.join(", ")}`, 400); } scheduleStoreInitialization(); return { message: `Updated prices for ${result.updatedCount} product(s)`, updatedCount: result.updatedCount }; }), getProductTags: protectedProcedure.query(async () => { const tags = await getAllProductTagInfos(); const tagsWithSignedUrls = await Promise.all( tags.map(async (tag2) => ({ ...tag2, imageUrl: tag2.imageUrl ? await generateSignedUrlFromS3Url(tag2.imageUrl) : null })) ); return { tags: tagsWithSignedUrls, message: "Tags retrieved successfully" }; }), getProductTagById: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).query(async ({ input }) => { const tag2 = await getProductTagInfoById(input.id); if (!tag2) { throw new ApiError("Tag not found", 404); } const tagWithSignedUrl = { ...tag2, imageUrl: tag2.imageUrl ? await generateSignedUrlFromS3Url(tag2.imageUrl) : null }; return { tag: tagWithSignedUrl, message: "Tag retrieved successfully" }; }), createProductTag: protectedProcedure.input(external_exports.object({ tagName: external_exports.string().min(1, "Tag name is required"), tagDescription: external_exports.string().optional(), imageUrl: external_exports.string().optional().nullable(), isDashboardTag: external_exports.boolean().optional().default(false), relatedStores: external_exports.array(external_exports.number()).optional().default([]), uploadUrls: external_exports.array(external_exports.string()).optional().default([]) })).mutation(async ({ input }) => { const { tagName, tagDescription, imageUrl, isDashboardTag, relatedStores, uploadUrls } = input; const existingTag = await checkProductTagExistsByName(tagName.trim()); if (existingTag) { throw new ApiError("A tag with this name already exists", 400); } const createdTag = await createProductTag({ tagName: tagName.trim(), tagDescription, imageUrl: imageUrl ?? null, isDashboardTag, relatedStores }); if (uploadUrls.length > 0) { await Promise.all(uploadUrls.map((url2) => claimUploadUrl(url2))); } scheduleStoreInitialization(); const { products, ...createdTagInfo } = createdTag; return { tag: { ...createdTagInfo, imageUrl: createdTagInfo.imageUrl ? await generateSignedUrlFromS3Url(createdTagInfo.imageUrl) : null }, message: "Tag created successfully" }; }), updateProductTag: protectedProcedure.input(external_exports.object({ id: external_exports.number(), tagName: external_exports.string().min(1).optional(), tagDescription: external_exports.string().optional().nullable(), imageUrl: external_exports.string().optional().nullable(), isDashboardTag: external_exports.boolean().optional(), relatedStores: external_exports.array(external_exports.number()).optional(), uploadUrls: external_exports.array(external_exports.string()).optional().default([]) })).mutation(async ({ input }) => { const { id, tagName, tagDescription, imageUrl, isDashboardTag, relatedStores, uploadUrls } = input; const currentTag = await getProductTagInfoById(id); if (!currentTag) { throw new ApiError("Tag not found", 404); } if (imageUrl !== void 0 && imageUrl !== currentTag.imageUrl) { if (currentTag.imageUrl) { await deleteImageUtil({ keys: [currentTag.imageUrl] }); } } const updatedTag = await updateProductTag(id, { tagName: tagName?.trim(), tagDescription: tagDescription ?? void 0, imageUrl: imageUrl ?? void 0, isDashboardTag, relatedStores }); if (uploadUrls.length > 0) { await Promise.all(uploadUrls.map((url2) => claimUploadUrl(url2))); } scheduleStoreInitialization(); const { products, ...updatedTagInfo } = updatedTag; return { tag: { ...updatedTagInfo, imageUrl: updatedTagInfo.imageUrl ? await generateSignedUrlFromS3Url(updatedTagInfo.imageUrl) : null }, message: "Tag updated successfully" }; }), deleteProductTag: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).mutation(async ({ input }) => { const tag2 = await getProductTagInfoById(input.id); if (!tag2) { throw new ApiError("Tag not found", 404); } if (tag2.imageUrl) { await deleteImageUtil({ keys: [tag2.imageUrl] }); } await deleteProductTag(input.id); scheduleStoreInitialization(); return { message: "Tag deleted successfully" }; }) }); } }); // ../../node_modules/unenv/dist/runtime/node/internal/crypto/web.mjs var subtle; var init_web = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/crypto/web.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); subtle = globalThis.crypto?.subtle; } }); // ../../node_modules/unenv/dist/runtime/node/internal/crypto/node.mjs var webcrypto, createCipher, createDecipher, pseudoRandomBytes, createCipheriv, createDecipheriv, createECDH, createSign, createVerify, diffieHellman, getCipherInfo, privateDecrypt, privateEncrypt, publicDecrypt, publicEncrypt, sign2, verify2, hash2, Cipher, Cipheriv, Decipher, Decipheriv, ECDH, Sign, Verify; var init_node3 = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/crypto/node.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_utils(); webcrypto = new Proxy(globalThis.crypto, { get(_, key) { if (key === "CryptoKey") { return globalThis.CryptoKey; } if (typeof globalThis.crypto[key] === "function") { return globalThis.crypto[key].bind(globalThis.crypto); } return globalThis.crypto[key]; } }); createCipher = /* @__PURE__ */ notImplemented("crypto.createCipher"); createDecipher = /* @__PURE__ */ notImplemented("crypto.createDecipher"); pseudoRandomBytes = /* @__PURE__ */ notImplemented("crypto.pseudoRandomBytes"); createCipheriv = /* @__PURE__ */ notImplemented("crypto.createCipheriv"); createDecipheriv = /* @__PURE__ */ notImplemented("crypto.createDecipheriv"); createECDH = /* @__PURE__ */ notImplemented("crypto.createECDH"); createSign = /* @__PURE__ */ notImplemented("crypto.createSign"); createVerify = /* @__PURE__ */ notImplemented("crypto.createVerify"); diffieHellman = /* @__PURE__ */ notImplemented("crypto.diffieHellman"); getCipherInfo = /* @__PURE__ */ notImplemented("crypto.getCipherInfo"); privateDecrypt = /* @__PURE__ */ notImplemented("crypto.privateDecrypt"); privateEncrypt = /* @__PURE__ */ notImplemented("crypto.privateEncrypt"); publicDecrypt = /* @__PURE__ */ notImplemented("crypto.publicDecrypt"); publicEncrypt = /* @__PURE__ */ notImplemented("crypto.publicEncrypt"); sign2 = /* @__PURE__ */ notImplemented("crypto.sign"); verify2 = /* @__PURE__ */ notImplemented("crypto.verify"); hash2 = /* @__PURE__ */ notImplemented("crypto.hash"); Cipher = /* @__PURE__ */ notImplementedClass("crypto.Cipher"); Cipheriv = /* @__PURE__ */ notImplementedClass( "crypto.Cipheriv" // @ts-expect-error not typed yet ); Decipher = /* @__PURE__ */ notImplementedClass("crypto.Decipher"); Decipheriv = /* @__PURE__ */ notImplementedClass( "crypto.Decipheriv" // @ts-expect-error not typed yet ); ECDH = /* @__PURE__ */ notImplementedClass("crypto.ECDH"); Sign = /* @__PURE__ */ notImplementedClass("crypto.Sign"); Verify = /* @__PURE__ */ notImplementedClass("crypto.Verify"); } }); // ../../node_modules/unenv/dist/runtime/node/internal/crypto/constants.mjs var SSL_OP_ALL, SSL_OP_ALLOW_NO_DHE_KEX, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_CISCO_ANYCONNECT, SSL_OP_COOKIE_EXCHANGE, SSL_OP_CRYPTOPRO_TLSEXT_BUG, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS, SSL_OP_LEGACY_SERVER_CONNECT, SSL_OP_NO_COMPRESSION, SSL_OP_NO_ENCRYPT_THEN_MAC, SSL_OP_NO_QUERY_MTU, SSL_OP_NO_RENEGOTIATION, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION, SSL_OP_NO_SSLv2, SSL_OP_NO_SSLv3, SSL_OP_NO_TICKET, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2, SSL_OP_NO_TLSv1_3, SSL_OP_PRIORITIZE_CHACHA, SSL_OP_TLS_ROLLBACK_BUG, ENGINE_METHOD_RSA, ENGINE_METHOD_DSA, ENGINE_METHOD_DH, ENGINE_METHOD_RAND, ENGINE_METHOD_EC, ENGINE_METHOD_CIPHERS, ENGINE_METHOD_DIGESTS, ENGINE_METHOD_PKEY_METHS, ENGINE_METHOD_PKEY_ASN1_METHS, ENGINE_METHOD_ALL, ENGINE_METHOD_NONE, DH_CHECK_P_NOT_SAFE_PRIME, DH_CHECK_P_NOT_PRIME, DH_UNABLE_TO_CHECK_GENERATOR, DH_NOT_SUITABLE_GENERATOR, RSA_PKCS1_PADDING, RSA_NO_PADDING, RSA_PKCS1_OAEP_PADDING, RSA_X931_PADDING, RSA_PKCS1_PSS_PADDING, RSA_PSS_SALTLEN_DIGEST, RSA_PSS_SALTLEN_MAX_SIGN, RSA_PSS_SALTLEN_AUTO, POINT_CONVERSION_COMPRESSED, POINT_CONVERSION_UNCOMPRESSED, POINT_CONVERSION_HYBRID, defaultCoreCipherList, defaultCipherList, OPENSSL_VERSION_NUMBER, TLS1_VERSION, TLS1_1_VERSION, TLS1_2_VERSION, TLS1_3_VERSION; var init_constants16 = __esm({ "../../node_modules/unenv/dist/runtime/node/internal/crypto/constants.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); SSL_OP_ALL = 2147485776; SSL_OP_ALLOW_NO_DHE_KEX = 1024; SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = 262144; SSL_OP_CIPHER_SERVER_PREFERENCE = 4194304; SSL_OP_CISCO_ANYCONNECT = 32768; SSL_OP_COOKIE_EXCHANGE = 8192; SSL_OP_CRYPTOPRO_TLSEXT_BUG = 2147483648; SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 2048; SSL_OP_LEGACY_SERVER_CONNECT = 4; SSL_OP_NO_COMPRESSION = 131072; SSL_OP_NO_ENCRYPT_THEN_MAC = 524288; SSL_OP_NO_QUERY_MTU = 4096; SSL_OP_NO_RENEGOTIATION = 1073741824; SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 65536; SSL_OP_NO_SSLv2 = 0; SSL_OP_NO_SSLv3 = 33554432; SSL_OP_NO_TICKET = 16384; SSL_OP_NO_TLSv1 = 67108864; SSL_OP_NO_TLSv1_1 = 268435456; SSL_OP_NO_TLSv1_2 = 134217728; SSL_OP_NO_TLSv1_3 = 536870912; SSL_OP_PRIORITIZE_CHACHA = 2097152; SSL_OP_TLS_ROLLBACK_BUG = 8388608; ENGINE_METHOD_RSA = 1; ENGINE_METHOD_DSA = 2; ENGINE_METHOD_DH = 4; ENGINE_METHOD_RAND = 8; ENGINE_METHOD_EC = 2048; ENGINE_METHOD_CIPHERS = 64; ENGINE_METHOD_DIGESTS = 128; ENGINE_METHOD_PKEY_METHS = 512; ENGINE_METHOD_PKEY_ASN1_METHS = 1024; ENGINE_METHOD_ALL = 65535; ENGINE_METHOD_NONE = 0; DH_CHECK_P_NOT_SAFE_PRIME = 2; DH_CHECK_P_NOT_PRIME = 1; DH_UNABLE_TO_CHECK_GENERATOR = 4; DH_NOT_SUITABLE_GENERATOR = 8; RSA_PKCS1_PADDING = 1; RSA_NO_PADDING = 3; RSA_PKCS1_OAEP_PADDING = 4; RSA_X931_PADDING = 5; RSA_PKCS1_PSS_PADDING = 6; RSA_PSS_SALTLEN_DIGEST = -1; RSA_PSS_SALTLEN_MAX_SIGN = -2; RSA_PSS_SALTLEN_AUTO = -2; POINT_CONVERSION_COMPRESSED = 2; POINT_CONVERSION_UNCOMPRESSED = 4; POINT_CONVERSION_HYBRID = 6; defaultCoreCipherList = ""; defaultCipherList = ""; OPENSSL_VERSION_NUMBER = 0; TLS1_VERSION = 0; TLS1_1_VERSION = 0; TLS1_2_VERSION = 0; TLS1_3_VERSION = 0; } }); // ../../node_modules/unenv/dist/runtime/node/crypto.mjs var constants; var init_crypto2 = __esm({ "../../node_modules/unenv/dist/runtime/node/crypto.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_constants16(); init_web(); init_node3(); constants = { OPENSSL_VERSION_NUMBER, SSL_OP_ALL, SSL_OP_ALLOW_NO_DHE_KEX, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_CISCO_ANYCONNECT, SSL_OP_COOKIE_EXCHANGE, SSL_OP_CRYPTOPRO_TLSEXT_BUG, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS, SSL_OP_LEGACY_SERVER_CONNECT, SSL_OP_NO_COMPRESSION, SSL_OP_NO_ENCRYPT_THEN_MAC, SSL_OP_NO_QUERY_MTU, SSL_OP_NO_RENEGOTIATION, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION, SSL_OP_NO_SSLv2, SSL_OP_NO_SSLv3, SSL_OP_NO_TICKET, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2, SSL_OP_NO_TLSv1_3, SSL_OP_PRIORITIZE_CHACHA, SSL_OP_TLS_ROLLBACK_BUG, ENGINE_METHOD_RSA, ENGINE_METHOD_DSA, ENGINE_METHOD_DH, ENGINE_METHOD_RAND, ENGINE_METHOD_EC, ENGINE_METHOD_CIPHERS, ENGINE_METHOD_DIGESTS, ENGINE_METHOD_PKEY_METHS, ENGINE_METHOD_PKEY_ASN1_METHS, ENGINE_METHOD_ALL, ENGINE_METHOD_NONE, DH_CHECK_P_NOT_SAFE_PRIME, DH_CHECK_P_NOT_PRIME, DH_UNABLE_TO_CHECK_GENERATOR, DH_NOT_SUITABLE_GENERATOR, RSA_PKCS1_PADDING, RSA_NO_PADDING, RSA_PKCS1_OAEP_PADDING, RSA_X931_PADDING, RSA_PKCS1_PSS_PADDING, RSA_PSS_SALTLEN_DIGEST, RSA_PSS_SALTLEN_MAX_SIGN, RSA_PSS_SALTLEN_AUTO, defaultCoreCipherList, TLS1_VERSION, TLS1_1_VERSION, TLS1_2_VERSION, TLS1_3_VERSION, POINT_CONVERSION_COMPRESSED, POINT_CONVERSION_UNCOMPRESSED, POINT_CONVERSION_HYBRID, defaultCipherList }; } }); // ../../node_modules/@cloudflare/unenv-preset/dist/runtime/node/crypto.mjs var workerdCrypto, Certificate, DiffieHellman, DiffieHellmanGroup, Hash, Hmac, KeyObject, X509Certificate, checkPrime, checkPrimeSync, createDiffieHellman, createDiffieHellmanGroup, createHash, createHmac, createPrivateKey, createPublicKey, createSecretKey, generateKey, generateKeyPair, generateKeyPairSync, generateKeySync, generatePrime, generatePrimeSync, getCiphers, getCurves, getDiffieHellman, getFips, getHashes, hkdf, hkdfSync, pbkdf2, pbkdf2Sync, randomBytes, randomFill, randomFillSync, randomInt, randomUUID2, scrypt, scryptSync, secureHeapUsed, setEngine, setFips, subtle2, timingSafeEqual, getRandomValues, webcrypto2, fips, crypto_default; var init_crypto3 = __esm({ "../../node_modules/@cloudflare/unenv-preset/dist/runtime/node/crypto.mjs"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_crypto2(); workerdCrypto = process.getBuiltinModule("node:crypto"); ({ Certificate, DiffieHellman, DiffieHellmanGroup, Hash, Hmac, KeyObject, X509Certificate, checkPrime, checkPrimeSync, createDiffieHellman, createDiffieHellmanGroup, createHash, createHmac, createPrivateKey, createPublicKey, createSecretKey, generateKey, generateKeyPair, generateKeyPairSync, generateKeySync, generatePrime, generatePrimeSync, getCiphers, getCurves, getDiffieHellman, getFips, getHashes, hkdf, hkdfSync, pbkdf2, pbkdf2Sync, randomBytes, randomFill, randomFillSync, randomInt, randomUUID: randomUUID2, scrypt, scryptSync, secureHeapUsed, setEngine, setFips, subtle: subtle2, timingSafeEqual } = workerdCrypto); getRandomValues = workerdCrypto.getRandomValues.bind( workerdCrypto.webcrypto ); webcrypto2 = { // @ts-expect-error unenv has unknown type CryptoKey: webcrypto.CryptoKey, getRandomValues, randomUUID: randomUUID2, subtle: subtle2 }; fips = workerdCrypto.fips; crypto_default = { /** * manually unroll unenv-polyfilled-symbols to make it tree-shakeable */ Certificate, Cipher, Cipheriv, Decipher, Decipheriv, ECDH, Sign, Verify, X509Certificate, // @ts-expect-error @types/node is out of date - this is a bug in typings constants, // @ts-expect-error unenv has unknown type createCipheriv, // @ts-expect-error unenv has unknown type createDecipheriv, // @ts-expect-error unenv has unknown type createECDH, // @ts-expect-error unenv has unknown type createSign, // @ts-expect-error unenv has unknown type createVerify, // @ts-expect-error unenv has unknown type diffieHellman, // @ts-expect-error unenv has unknown type getCipherInfo, // @ts-expect-error unenv has unknown type hash: hash2, // @ts-expect-error unenv has unknown type privateDecrypt, // @ts-expect-error unenv has unknown type privateEncrypt, // @ts-expect-error unenv has unknown type publicDecrypt, // @ts-expect-error unenv has unknown type publicEncrypt, scrypt, scryptSync, // @ts-expect-error unenv has unknown type sign: sign2, // @ts-expect-error unenv has unknown type verify: verify2, // default-only export from unenv // @ts-expect-error unenv has unknown type createCipher, // @ts-expect-error unenv has unknown type createDecipher, // @ts-expect-error unenv has unknown type pseudoRandomBytes, /** * manually unroll workerd-polyfilled-symbols to make it tree-shakeable */ DiffieHellman, DiffieHellmanGroup, Hash, Hmac, KeyObject, checkPrime, checkPrimeSync, createDiffieHellman, createDiffieHellmanGroup, createHash, createHmac, createPrivateKey, createPublicKey, createSecretKey, generateKey, generateKeyPair, generateKeyPairSync, generateKeySync, generatePrime, generatePrimeSync, getCiphers, getCurves, getDiffieHellman, getFips, getHashes, getRandomValues, hkdf, hkdfSync, pbkdf2, pbkdf2Sync, randomBytes, randomFill, randomFillSync, randomInt, randomUUID: randomUUID2, secureHeapUsed, setEngine, setFips, subtle: subtle2, timingSafeEqual, // default-only export from workerd fips, // special-cased deep merged symbols webcrypto: webcrypto2 }; } }); // ../../node_modules/bcryptjs/index.js function randomBytes2(len) { try { return crypto.getRandomValues(new Uint8Array(len)); } catch { } try { return crypto_default.randomBytes(len); } catch { } if (!randomFallback) { throw Error( "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative" ); } return randomFallback(len); } function setRandomFallback(random) { randomFallback = random; } function genSaltSync(rounds, seed_length) { rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; if (typeof rounds !== "number") throw Error( "Illegal arguments: " + typeof rounds + ", " + typeof seed_length ); if (rounds < 4) rounds = 4; else if (rounds > 31) rounds = 31; var salt = []; salt.push("$2b$"); if (rounds < 10) salt.push("0"); salt.push(rounds.toString()); salt.push("$"); salt.push(base64_encode(randomBytes2(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); return salt.join(""); } function genSalt(rounds, seed_length, callback) { if (typeof seed_length === "function") callback = seed_length, seed_length = void 0; if (typeof rounds === "function") callback = rounds, rounds = void 0; if (typeof rounds === "undefined") rounds = GENSALT_DEFAULT_LOG2_ROUNDS; else if (typeof rounds !== "number") throw Error("illegal arguments: " + typeof rounds); function _async(callback2) { nextTick2(function() { try { callback2(null, genSaltSync(rounds)); } catch (err) { callback2(err); } }); } __name(_async, "_async"); if (callback) { if (typeof callback !== "function") throw Error("Illegal callback: " + typeof callback); _async(callback); } else return new Promise(function(resolve, reject) { _async(function(err, res) { if (err) { reject(err); return; } resolve(res); }); }); } function hashSync(password, salt) { if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS; if (typeof salt === "number") salt = genSaltSync(salt); if (typeof password !== "string" || typeof salt !== "string") throw Error("Illegal arguments: " + typeof password + ", " + typeof salt); return _hash(password, salt); } function hash3(password, salt, callback, progressCallback) { function _async(callback2) { if (typeof password === "string" && typeof salt === "number") genSalt(salt, function(err, salt2) { _hash(password, salt2, callback2, progressCallback); }); else if (typeof password === "string" && typeof salt === "string") _hash(password, salt, callback2, progressCallback); else nextTick2( callback2.bind( this, Error("Illegal arguments: " + typeof password + ", " + typeof salt) ) ); } __name(_async, "_async"); if (callback) { if (typeof callback !== "function") throw Error("Illegal callback: " + typeof callback); _async(callback); } else return new Promise(function(resolve, reject) { _async(function(err, res) { if (err) { reject(err); return; } resolve(res); }); }); } function safeStringCompare(known, unknown2) { var diff = known.length ^ unknown2.length; for (var i2 = 0; i2 < known.length; ++i2) { diff |= known.charCodeAt(i2) ^ unknown2.charCodeAt(i2); } return diff === 0; } function compareSync(password, hash4) { if (typeof password !== "string" || typeof hash4 !== "string") throw Error("Illegal arguments: " + typeof password + ", " + typeof hash4); if (hash4.length !== 60) return false; return safeStringCompare( hashSync(password, hash4.substring(0, hash4.length - 31)), hash4 ); } function compare(password, hashValue, callback, progressCallback) { function _async(callback2) { if (typeof password !== "string" || typeof hashValue !== "string") { nextTick2( callback2.bind( this, Error( "Illegal arguments: " + typeof password + ", " + typeof hashValue ) ) ); return; } if (hashValue.length !== 60) { nextTick2(callback2.bind(this, null, false)); return; } hash3( password, hashValue.substring(0, 29), function(err, comp) { if (err) callback2(err); else callback2(null, safeStringCompare(comp, hashValue)); }, progressCallback ); } __name(_async, "_async"); if (callback) { if (typeof callback !== "function") throw Error("Illegal callback: " + typeof callback); _async(callback); } else return new Promise(function(resolve, reject) { _async(function(err, res) { if (err) { reject(err); return; } resolve(res); }); }); } function getRounds(hash4) { if (typeof hash4 !== "string") throw Error("Illegal arguments: " + typeof hash4); return parseInt(hash4.split("$")[2], 10); } function getSalt(hash4) { if (typeof hash4 !== "string") throw Error("Illegal arguments: " + typeof hash4); if (hash4.length !== 60) throw Error("Illegal hash length: " + hash4.length + " != 60"); return hash4.substring(0, 29); } function truncates(password) { if (typeof password !== "string") throw Error("Illegal arguments: " + typeof password); return utf8Length(password) > 72; } function utf8Length(string4) { var len = 0, c2 = 0; for (var i2 = 0; i2 < string4.length; ++i2) { c2 = string4.charCodeAt(i2); if (c2 < 128) len += 1; else if (c2 < 2048) len += 2; else if ((c2 & 64512) === 55296 && (string4.charCodeAt(i2 + 1) & 64512) === 56320) { ++i2; len += 4; } else len += 3; } return len; } function utf8Array(string4) { var offset = 0, c1, c2; var buffer = new Array(utf8Length(string4)); for (var i2 = 0, k2 = string4.length; i2 < k2; ++i2) { c1 = string4.charCodeAt(i2); if (c1 < 128) { buffer[offset++] = c1; } else if (c1 < 2048) { buffer[offset++] = c1 >> 6 | 192; buffer[offset++] = c1 & 63 | 128; } else if ((c1 & 64512) === 55296 && ((c2 = string4.charCodeAt(i2 + 1)) & 64512) === 56320) { c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); ++i2; buffer[offset++] = c1 >> 18 | 240; buffer[offset++] = c1 >> 12 & 63 | 128; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } else { buffer[offset++] = c1 >> 12 | 224; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } } return buffer; } function base64_encode(b2, len) { var off2 = 0, rs = [], c1, c2; if (len <= 0 || len > b2.length) throw Error("Illegal len: " + len); while (off2 < len) { c1 = b2[off2++] & 255; rs.push(BASE64_CODE[c1 >> 2 & 63]); c1 = (c1 & 3) << 4; if (off2 >= len) { rs.push(BASE64_CODE[c1 & 63]); break; } c2 = b2[off2++] & 255; c1 |= c2 >> 4 & 15; rs.push(BASE64_CODE[c1 & 63]); c1 = (c2 & 15) << 2; if (off2 >= len) { rs.push(BASE64_CODE[c1 & 63]); break; } c2 = b2[off2++] & 255; c1 |= c2 >> 6 & 3; rs.push(BASE64_CODE[c1 & 63]); rs.push(BASE64_CODE[c2 & 63]); } return rs.join(""); } function base64_decode(s2, len) { var off2 = 0, slen = s2.length, olen = 0, rs = [], c1, c2, c3, c4, o2, code; if (len <= 0) throw Error("Illegal len: " + len); while (off2 < slen - 1 && olen < len) { code = s2.charCodeAt(off2++); c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; code = s2.charCodeAt(off2++); c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; if (c1 == -1 || c2 == -1) break; o2 = c1 << 2 >>> 0; o2 |= (c2 & 48) >> 4; rs.push(String.fromCharCode(o2)); if (++olen >= len || off2 >= slen) break; code = s2.charCodeAt(off2++); c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; if (c3 == -1) break; o2 = (c2 & 15) << 4 >>> 0; o2 |= (c3 & 60) >> 2; rs.push(String.fromCharCode(o2)); if (++olen >= len || off2 >= slen) break; code = s2.charCodeAt(off2++); c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; o2 = (c3 & 3) << 6 >>> 0; o2 |= c4; rs.push(String.fromCharCode(o2)); ++olen; } var res = []; for (off2 = 0; off2 < olen; off2++) res.push(rs[off2].charCodeAt(0)); return res; } function _encipher(lr, off2, P2, S2) { var n2, l2 = lr[off2], r2 = lr[off2 + 1]; l2 ^= P2[0]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[1]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[2]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[3]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[4]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[5]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[6]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[7]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[8]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[9]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[10]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[11]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[12]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[13]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[14]; n2 = S2[l2 >>> 24]; n2 += S2[256 | l2 >> 16 & 255]; n2 ^= S2[512 | l2 >> 8 & 255]; n2 += S2[768 | l2 & 255]; r2 ^= n2 ^ P2[15]; n2 = S2[r2 >>> 24]; n2 += S2[256 | r2 >> 16 & 255]; n2 ^= S2[512 | r2 >> 8 & 255]; n2 += S2[768 | r2 & 255]; l2 ^= n2 ^ P2[16]; lr[off2] = r2 ^ P2[BLOWFISH_NUM_ROUNDS + 1]; lr[off2 + 1] = l2; return lr; } function _streamtoword(data, offp) { for (var i2 = 0, word = 0; i2 < 4; ++i2) word = word << 8 | data[offp] & 255, offp = (offp + 1) % data.length; return { key: word, offp }; } function _key(key, P2, S2) { var offset = 0, lr = [0, 0], plen = P2.length, slen = S2.length, sw; for (var i2 = 0; i2 < plen; i2++) sw = _streamtoword(key, offset), offset = sw.offp, P2[i2] = P2[i2] ^ sw.key; for (i2 = 0; i2 < plen; i2 += 2) lr = _encipher(lr, 0, P2, S2), P2[i2] = lr[0], P2[i2 + 1] = lr[1]; for (i2 = 0; i2 < slen; i2 += 2) lr = _encipher(lr, 0, P2, S2), S2[i2] = lr[0], S2[i2 + 1] = lr[1]; } function _ekskey(data, key, P2, S2) { var offp = 0, lr = [0, 0], plen = P2.length, slen = S2.length, sw; for (var i2 = 0; i2 < plen; i2++) sw = _streamtoword(key, offp), offp = sw.offp, P2[i2] = P2[i2] ^ sw.key; offp = 0; for (i2 = 0; i2 < plen; i2 += 2) sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P2, S2), P2[i2] = lr[0], P2[i2 + 1] = lr[1]; for (i2 = 0; i2 < slen; i2 += 2) sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P2, S2), S2[i2] = lr[0], S2[i2 + 1] = lr[1]; } function _crypt(b2, salt, rounds, callback, progressCallback) { var cdata = C_ORIG.slice(), clen = cdata.length, err; if (rounds < 4 || rounds > 31) { err = Error("Illegal number of rounds (4-31): " + rounds); if (callback) { nextTick2(callback.bind(this, err)); return; } else throw err; } if (salt.length !== BCRYPT_SALT_LEN) { err = Error( "Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN ); if (callback) { nextTick2(callback.bind(this, err)); return; } else throw err; } rounds = 1 << rounds >>> 0; var P2, S2, i2 = 0, j2; if (typeof Int32Array === "function") { P2 = new Int32Array(P_ORIG); S2 = new Int32Array(S_ORIG); } else { P2 = P_ORIG.slice(); S2 = S_ORIG.slice(); } _ekskey(salt, b2, P2, S2); function next() { if (progressCallback) progressCallback(i2 / rounds); if (i2 < rounds) { var start = Date.now(); for (; i2 < rounds; ) { i2 = i2 + 1; _key(b2, P2, S2); _key(salt, P2, S2); if (Date.now() - start > MAX_EXECUTION_TIME) break; } } else { for (i2 = 0; i2 < 64; i2++) for (j2 = 0; j2 < clen >> 1; j2++) _encipher(cdata, j2 << 1, P2, S2); var ret = []; for (i2 = 0; i2 < clen; i2++) ret.push((cdata[i2] >> 24 & 255) >>> 0), ret.push((cdata[i2] >> 16 & 255) >>> 0), ret.push((cdata[i2] >> 8 & 255) >>> 0), ret.push((cdata[i2] & 255) >>> 0); if (callback) { callback(null, ret); return; } else return ret; } if (callback) nextTick2(next); } __name(next, "next"); if (typeof callback !== "undefined") { next(); } else { var res; while (true) if (typeof (res = next()) !== "undefined") return res || []; } } function _hash(password, salt, callback, progressCallback) { var err; if (typeof password !== "string" || typeof salt !== "string") { err = Error("Invalid string / salt: Not a string"); if (callback) { nextTick2(callback.bind(this, err)); return; } else throw err; } var minor, offset; if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") { err = Error("Invalid salt version: " + salt.substring(0, 2)); if (callback) { nextTick2(callback.bind(this, err)); return; } else throw err; } if (salt.charAt(2) === "$") minor = String.fromCharCode(0), offset = 3; else { minor = salt.charAt(2); if (minor !== "a" && minor !== "b" && minor !== "y" || salt.charAt(3) !== "$") { err = Error("Invalid salt revision: " + salt.substring(2, 4)); if (callback) { nextTick2(callback.bind(this, err)); return; } else throw err; } offset = 4; } if (salt.charAt(offset + 2) > "$") { err = Error("Missing salt rounds"); if (callback) { nextTick2(callback.bind(this, err)); return; } else throw err; } var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), rounds = r1 + r2, real_salt = salt.substring(offset + 3, offset + 25); password += minor >= "a" ? "\0" : ""; var passwordb = utf8Array(password), saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); function finish(bytes) { var res = []; res.push("$2"); if (minor >= "a") res.push(minor); res.push("$"); if (rounds < 10) res.push("0"); res.push(rounds.toString()); res.push("$"); res.push(base64_encode(saltb, saltb.length)); res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); return res.join(""); } __name(finish, "finish"); if (typeof callback == "undefined") return finish(_crypt(passwordb, saltb, rounds)); else { _crypt( passwordb, saltb, rounds, function(err2, bytes) { if (err2) callback(err2, null); else callback(null, finish(bytes)); }, progressCallback ); } } function encodeBase642(bytes, length) { return base64_encode(bytes, length); } function decodeBase642(string4, length) { return base64_decode(string4, length); } var randomFallback, nextTick2, BASE64_CODE, BASE64_INDEX, BCRYPT_SALT_LEN, GENSALT_DEFAULT_LOG2_ROUNDS, BLOWFISH_NUM_ROUNDS, MAX_EXECUTION_TIME, P_ORIG, S_ORIG, C_ORIG, bcryptjs_default; var init_bcryptjs = __esm({ "../../node_modules/bcryptjs/index.js"() { init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_crypto3(); randomFallback = null; __name(randomBytes2, "randomBytes"); __name(setRandomFallback, "setRandomFallback"); __name(genSaltSync, "genSaltSync"); __name(genSalt, "genSalt"); __name(hashSync, "hashSync"); __name(hash3, "hash"); __name(safeStringCompare, "safeStringCompare"); __name(compareSync, "compareSync"); __name(compare, "compare"); __name(getRounds, "getRounds"); __name(getSalt, "getSalt"); __name(truncates, "truncates"); nextTick2 = typeof setImmediate === "function" ? setImmediate : typeof scheduler === "object" && typeof scheduler.postTask === "function" ? scheduler.postTask.bind(scheduler) : setTimeout; __name(utf8Length, "utf8Length"); __name(utf8Array, "utf8Array"); BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""); BASE64_INDEX = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1 ]; __name(base64_encode, "base64_encode"); __name(base64_decode, "base64_decode"); BCRYPT_SALT_LEN = 16; GENSALT_DEFAULT_LOG2_ROUNDS = 10; BLOWFISH_NUM_ROUNDS = 16; MAX_EXECUTION_TIME = 100; P_ORIG = [ 608135816, 2242054355, 320440878, 57701188, 2752067618, 698298832, 137296536, 3964562569, 1160258022, 953160567, 3193202383, 887688300, 3232508343, 3380367581, 1065670069, 3041331479, 2450970073, 2306472731 ]; S_ORIG = [ 3509652390, 2564797868, 805139163, 3491422135, 3101798381, 1780907670, 3128725573, 4046225305, 614570311, 3012652279, 134345442, 2240740374, 1667834072, 1901547113, 2757295779, 4103290238, 227898511, 1921955416, 1904987480, 2182433518, 2069144605, 3260701109, 2620446009, 720527379, 3318853667, 677414384, 3393288472, 3101374703, 2390351024, 1614419982, 1822297739, 2954791486, 3608508353, 3174124327, 2024746970, 1432378464, 3864339955, 2857741204, 1464375394, 1676153920, 1439316330, 715854006, 3033291828, 289532110, 2706671279, 2087905683, 3018724369, 1668267050, 732546397, 1947742710, 3462151702, 2609353502, 2950085171, 1814351708, 2050118529, 680887927, 999245976, 1800124847, 3300911131, 1713906067, 1641548236, 4213287313, 1216130144, 1575780402, 4018429277, 3917837745, 3693486850, 3949271944, 596196993, 3549867205, 258830323, 2213823033, 772490370, 2760122372, 1774776394, 2652871518, 566650946, 4142492826, 1728879713, 2882767088, 1783734482, 3629395816, 2517608232, 2874225571, 1861159788, 326777828, 3124490320, 2130389656, 2716951837, 967770486, 1724537150, 2185432712, 2364442137, 1164943284, 2105845187, 998989502, 3765401048, 2244026483, 1075463327, 1455516326, 1322494562, 910128902, 469688178, 1117454909, 936433444, 3490320968, 3675253459, 1240580251, 122909385, 2157517691, 634681816, 4142456567, 3825094682, 3061402683, 2540495037, 79693498, 3249098678, 1084186820, 1583128258, 426386531, 1761308591, 1047286709, 322548459, 995290223, 1845252383, 2603652396, 3431023940, 2942221577, 3202600964, 3727903485, 1712269319, 422464435, 3234572375, 1170764815, 3523960633, 3117677531, 1434042557, 442511882, 3600875718, 1076654713, 1738483198, 4213154764, 2393238008, 3677496056, 1014306527, 4251020053, 793779912, 2902807211, 842905082, 4246964064, 1395751752, 1040244610, 2656851899, 3396308128, 445077038, 3742853595, 3577915638, 679411651, 2892444358, 2354009459, 1767581616, 3150600392, 3791627101, 3102740896, 284835224, 4246832056, 1258075500, 768725851, 2589189241, 3069724005, 3532540348, 1274779536, 3789419226, 2764799539, 1660621633, 3471099624, 4011903706, 913787905, 3497959166, 737222580, 2514213453, 2928710040, 3937242737, 1804850592, 3499020752, 2949064160, 2386320175, 2390070455, 2415321851, 4061277028, 2290661394, 2416832540, 1336762016, 1754252060, 3520065937, 3014181293, 791618072, 3188594551, 3933548030, 2332172193, 3852520463, 3043980520, 413987798, 3465142937, 3030929376, 4245938359, 2093235073, 3534596313, 375366246, 2157278981, 2479649556, 555357303, 3870105701, 2008414854, 3344188149, 4221384143, 3956125452, 2067696032, 3594591187, 2921233993, 2428461, 544322398, 577241275, 1471733935, 610547355, 4027169054, 1432588573, 1507829418, 2025931657, 3646575487, 545086370, 48609733, 2200306550, 1653985193, 298326376, 1316178497, 3007786442, 2064951626, 458293330, 2589141269, 3591329599, 3164325604, 727753846, 2179363840, 146436021, 1461446943, 4069977195, 705550613, 3059967265, 3887724982, 4281599278, 3313849956, 1404054877, 2845806497, 146425753, 1854211946, 1266315497, 3048417604, 3681880366, 3289982499, 290971e4, 1235738493, 2632868024, 2414719590, 3970600049, 1771706367, 1449415276, 3266420449, 422970021, 1963543593, 2690192192, 3826793022, 1062508698, 1531092325, 1804592342, 2583117782, 2714934279, 4024971509, 1294809318, 4028980673, 1289560198, 2221992742, 1669523910, 35572830, 157838143, 1052438473, 1016535060, 1802137761, 1753167236, 1386275462, 3080475397, 2857371447, 1040679964, 2145300060, 2390574316, 1461121720, 2956646967, 4031777805, 4028374788, 33600511, 2920084762, 1018524850, 629373528, 3691585981, 3515945977, 2091462646, 2486323059, 586499841, 988145025, 935516892, 3367335476, 2599673255, 2839830854, 265290510, 3972581182, 2759138881, 3795373465, 1005194799, 847297441, 406762289, 1314163512, 1332590856, 1866599683, 4127851711, 750260880, 613907577, 1450815602, 3165620655, 3734664991, 3650291728, 3012275730, 3704569646, 1427272223, 778793252, 1343938022, 2676280711, 2052605720, 1946737175, 3164576444, 3914038668, 3967478842, 3682934266, 1661551462, 3294938066, 4011595847, 840292616, 3712170807, 616741398, 312560963, 711312465, 1351876610, 322626781, 1910503582, 271666773, 2175563734, 1594956187, 70604529, 3617834859, 1007753275, 1495573769, 4069517037, 2549218298, 2663038764, 504708206, 2263041392, 3941167025, 2249088522, 1514023603, 1998579484, 1312622330, 694541497, 2582060303, 2151582166, 1382467621, 776784248, 2618340202, 3323268794, 2497899128, 2784771155, 503983604, 4076293799, 907881277, 423175695, 432175456, 1378068232, 4145222326, 3954048622, 3938656102, 3820766613, 2793130115, 2977904593, 26017576, 3274890735, 3194772133, 1700274565, 1756076034, 4006520079, 3677328699, 720338349, 1533947780, 354530856, 688349552, 3973924725, 1637815568, 332179504, 3949051286, 53804574, 2852348879, 3044236432, 1282449977, 3583942155, 3416972820, 4006381244, 1617046695, 2628476075, 3002303598, 1686838959, 431878346, 2686675385, 1700445008, 1080580658, 1009431731, 832498133, 3223435511, 2605976345, 2271191193, 2516031870, 1648197032, 4164389018, 2548247927, 300782431, 375919233, 238389289, 3353747414, 2531188641, 2019080857, 1475708069, 455242339, 2609103871, 448939670, 3451063019, 1395535956, 2413381860, 1841049896, 1491858159, 885456874, 4264095073, 4001119347, 1565136089, 3898914787, 1108368660, 540939232, 1173283510, 2745871338, 3681308437, 4207628240, 3343053890, 4016749493, 1699691293, 1103962373, 3625875870, 2256883143, 3830138730, 1031889488, 3479347698, 1535977030, 4236805024, 3251091107, 2132092099, 1774941330, 1199868427, 1452454533, 157007616, 2904115357, 342012276, 595725824, 1480756522, 206960106, 497939518, 591360097, 863170706, 2375253569, 3596610801, 1814182875, 2094937945, 3421402208, 1082520231, 3463918190, 2785509508, 435703966, 3908032597, 1641649973, 2842273706, 3305899714, 1510255612, 2148256476, 2655287854, 3276092548, 4258621189, 236887753, 3681803219, 274041037, 1734335097, 3815195456, 3317970021, 1899903192, 1026095262, 4050517792, 356393447, 2410691914, 3873677099, 3682840055, 3913112168, 2491498743, 4132185628, 2489919796, 1091903735, 1979897079, 3170134830, 3567386728, 3557303409, 857797738, 1136121015, 1342202287, 507115054, 2535736646, 337727348, 3213592640, 1301675037, 2528481711, 1895095763, 1721773893, 3216771564, 62756741, 2142006736, 835421444, 2531993523, 1442658625, 3659876326, 2882144922, 676362277, 1392781812, 170690266, 3921047035, 1759253602, 3611846912, 1745797284, 664899054, 1329594018, 3901205900, 3045908486, 2062866102, 2865634940, 3543621612, 3464012697, 1080764994, 553557557, 3656615353, 3996768171, 991055499, 499776247, 1265440854, 648242737, 3940784050, 980351604, 3713745714, 1749149687, 3396870395, 4211799374, 3640570775, 1161844396, 3125318951, 1431517754, 545492359, 4268468663, 3499529547, 1437099964, 2702547544, 3433638243, 2581715763, 2787789398, 1060185593, 1593081372, 2418618748, 4260947970, 69676912, 2159744348, 86519011, 2512459080, 3838209314, 1220612927, 3339683548, 133810670, 1090789135, 1078426020, 1569222167, 845107691, 3583754449, 4072456591, 1091646820, 628848692, 1613405280, 3757631651, 526609435, 236106946, 48312990, 2942717905, 3402727701, 1797494240, 859738849, 992217954, 4005476642, 2243076622, 3870952857, 3732016268, 765654824, 3490871365, 2511836413, 1685915746, 3888969200, 1414112111, 2273134842, 3281911079, 4080962846, 172450625, 2569994100, 980381355, 4109958455, 2819808352, 2716589560, 2568741196, 3681446669, 3329971472, 1835478071, 660984891, 3704678404, 4045999559, 3422617507, 3040415634, 1762651403, 1719377915, 3470491036, 2693910283, 3642056355, 3138596744, 1364962596, 2073328063, 1983633131, 926494387, 3423689081, 2150032023, 4096667949, 1749200295, 3328846651, 309677260, 2016342300, 1779581495, 3079819751, 111262694, 1274766160, 443224088, 298511866, 1025883608, 3806446537, 1145181785, 168956806, 3641502830, 3584813610, 1689216846, 3666258015, 3200248200, 1692713982, 2646376535, 4042768518, 1618508792, 1610833997, 3523052358, 4130873264, 2001055236, 3610705100, 2202168115, 4028541809, 2961195399, 1006657119, 2006996926, 3186142756, 1430667929, 3210227297, 1314452623, 4074634658, 4101304120, 2273951170, 1399257539, 3367210612, 3027628629, 1190975929, 2062231137, 2333990788, 2221543033, 2438960610, 1181637006, 548689776, 2362791313, 3372408396, 3104550113, 3145860560, 296247880, 1970579870, 3078560182, 3769228297, 1714227617, 3291629107, 3898220290, 166772364, 1251581989, 493813264, 448347421, 195405023, 2709975567, 677966185, 3703036547, 1463355134, 2715995803, 1338867538, 1343315457, 2802222074, 2684532164, 233230375, 2599980071, 2000651841, 3277868038, 1638401717, 4028070440, 3237316320, 6314154, 819756386, 300326615, 590932579, 1405279636, 3267499572, 3150704214, 2428286686, 3959192993, 3461946742, 1862657033, 1266418056, 963775037, 2089974820, 2263052895, 1917689273, 448879540, 3550394620, 3981727096, 150775221, 3627908307, 1303187396, 508620638, 2975983352, 2726630617, 1817252668, 1876281319, 1457606340, 908771278, 3720792119, 3617206836, 2455994898, 1729034894, 1080033504, 976866871, 3556439503, 2881648439, 1522871579, 1555064734, 1336096578, 3548522304, 2579274686, 3574697629, 3205460757, 3593280638, 3338716283, 3079412587, 564236357, 2993598910, 1781952180, 1464380207, 3163844217, 3332601554, 1699332808, 1393555694, 1183702653, 3581086237, 1288719814, 691649499, 2847557200, 2895455976, 3193889540, 2717570544, 1781354906, 1676643554, 2592534050, 3230253752, 1126444790, 2770207658, 2633158820, 2210423226, 2615765581, 2414155088, 3127139286, 673620729, 2805611233, 1269405062, 4015350505, 3341807571, 4149409754, 1057255273, 2012875353, 2162469141, 2276492801, 2601117357, 993977747, 3918593370, 2654263191, 753973209, 36408145, 2530585658, 25011837, 3520020182, 2088578344, 530523599, 2918365339, 1524020338, 1518925132, 3760827505, 3759777254, 1202760957, 3985898139, 3906192525, 674977740, 4174734889, 2031300136, 2019492241, 3983892565, 4153806404, 3822280332, 352677332, 2297720250, 60907813, 90501309, 3286998549, 1016092578, 2535922412, 2839152426, 457141659, 509813237, 4120667899, 652014361, 1966332200, 2975202805, 55981186, 2327461051, 676427537, 3255491064, 2882294119, 3433927263, 1307055953, 942726286, 933058658, 2468411793, 3933900994, 4215176142, 1361170020, 2001714738, 2830558078, 3274259782, 1222529897, 1679025792, 2729314320, 3714953764, 1770335741, 151462246, 3013232138, 1682292957, 1483529935, 471910574, 1539241949, 458788160, 3436315007, 1807016891, 3718408830, 978976581, 1043663428, 3165965781, 1927990952, 4200891579, 2372276910, 3208408903, 3533431907, 1412390302, 2931980059, 4132332400, 1947078029, 3881505623, 4168226417, 2941484381, 1077988104, 1320477388, 886195818, 18198404, 3786409e3, 2509781533, 112762804, 3463356488, 1866414978, 891333506, 18488651, 661792760, 1628790961, 3885187036, 3141171499, 876946877, 2693282273, 1372485963, 791857591, 2686433993, 3759982718, 3167212022, 3472953795, 2716379847, 445679433, 3561995674, 3504004811, 3574258232, 54117162, 3331405415, 2381918588, 3769707343, 4154350007, 1140177722, 4074052095, 668550556, 3214352940, 367459370, 261225585, 2610173221, 4209349473, 3468074219, 3265815641, 314222801, 3066103646, 3808782860, 282218597, 3406013506, 3773591054, 379116347, 1285071038, 846784868, 2669647154, 3771962079, 3550491691, 2305946142, 453669953, 1268987020, 3317592352, 3279303384, 3744833421, 2610507566, 3859509063, 266596637, 3847019092, 517658769, 3462560207, 3443424879, 370717030, 4247526661, 2224018117, 4143653529, 4112773975, 2788324899, 2477274417, 1456262402, 2901442914, 1517677493, 1846949527, 2295493580, 3734397586, 2176403920, 1280348187, 1908823572, 3871786941, 846861322, 1172426758, 3287448474, 3383383037, 1655181056, 3139813346, 901632758, 1897031941, 2986607138, 3066810236, 3447102507, 1393639104, 373351379, 950779232, 625454576, 3124240540, 4148612726, 2007998917, 544563296, 2244738638, 2330496472, 2058025392, 1291430526, 424198748, 50039436, 29584100, 3605783033, 2429876329, 2791104160, 1057563949, 3255363231, 3075367218, 3463963227, 1469046755, 985887462 ]; C_ORIG = [ 1332899944, 1700884034, 1701343084, 1684370003, 1668446532, 1869963892 ]; __name(_encipher, "_encipher"); __name(_streamtoword, "_streamtoword"); __name(_key, "_key"); __name(_ekskey, "_ekskey"); __name(_crypt, "_crypt"); __name(_hash, "_hash"); __name(encodeBase642, "encodeBase64"); __name(decodeBase642, "decodeBase64"); bcryptjs_default = { setRandomFallback, genSaltSync, genSalt, hashSync, hash: hash3, compareSync, compare, getRounds, getSalt, truncates, encodeBase64: encodeBase642, decodeBase64: decodeBase642 }; } }); // src/trpc/apis/admin-apis/apis/staff-user.ts var staffUserRouter; var init_staff_user2 = __esm({ "src/trpc/apis/admin-apis/apis/staff-user.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_bcryptjs(); init_webapi(); init_env_exporter(); init_api_error(); init_dbService(); staffUserRouter = router2({ login: publicProcedure.input(external_exports.object({ name: external_exports.string(), password: external_exports.string() })).mutation(async ({ input }) => { const { name, password } = input; if (!name || !password) { throw new ApiError("Name and password are required", 400); } const staff = await getStaffUserByName(name); if (!staff) { throw new ApiError("Invalid credentials", 401); } const isPasswordValid = await bcryptjs_default.compare(password, staff.password); if (!isPasswordValid) { throw new ApiError("Invalid credentials", 401); } const token = await new SignJWT({ staffId: staff.id, name: staff.name }).setProtectedHeader({ alg: "HS256" }).setExpirationTime("30d").sign(getEncodedJwtSecret()); return { message: "Login successful", token, staff: { id: staff.id, name: staff.name } }; }), getStaff: protectedProcedure.query(async ({ ctx }) => { const staff = await getAllStaff(); const transformedStaff = staff.map((user) => ({ id: user.id, name: user.name, role: user.role ? { id: user.role.id, name: user.role.roleName } : null, permissions: user.role?.rolePermissions.map((rp) => ({ id: rp.permission.id, name: rp.permission.permissionName })) || [] })); return { staff: transformedStaff }; }), getUsers: protectedProcedure.input(external_exports.object({ cursor: external_exports.number().optional(), limit: external_exports.number().default(20), search: external_exports.string().optional() })).query(async ({ input }) => { const { cursor, limit, search } = input; const { users: usersToReturn, hasMore } = await getAllUsers(cursor, limit, search); const formattedUsers = usersToReturn.map((user) => ({ id: user.id, name: user.name, email: user.email, mobile: user.mobile, image: user.userDetails?.profileImage || null })); return { users: formattedUsers, nextCursor: hasMore ? usersToReturn[usersToReturn.length - 1].id : void 0 }; }), getUserDetails: protectedProcedure.input(external_exports.object({ userId: external_exports.number() })).query(async ({ input }) => { const { userId } = input; const user = await getUserWithDetails(userId); if (!user) { throw new ApiError("User not found", 404); } const lastOrder = user.orders[0]; return { id: user.id, name: user.name, email: user.email, mobile: user.mobile, addedOn: user.createdAt, lastOrdered: lastOrder?.createdAt || null, isSuspended: user.userDetails?.isSuspended || false }; }), updateUserSuspension: protectedProcedure.input(external_exports.object({ userId: external_exports.number(), isSuspended: external_exports.boolean() })).mutation(async ({ input }) => { const { userId, isSuspended } = input; await upsertUserSuspension(userId, isSuspended); return { success: true }; }), createStaffUser: protectedProcedure.input(external_exports.object({ name: external_exports.string().min(1, "Name is required"), password: external_exports.string().min(6, "Password must be at least 6 characters"), roleId: external_exports.number().int().positive("Role is required") })).mutation(async ({ input, ctx }) => { const { name, password, roleId } = input; const existingUser = await checkStaffUserExists(name); if (existingUser) { throw new ApiError("Staff user with this name already exists", 409); } const roleExists = await checkStaffRoleExists(roleId); if (!roleExists) { throw new ApiError("Invalid role selected", 400); } const hashedPassword = await bcryptjs_default.hash(password, 12); const newUser = await createStaffUser(name, hashedPassword, roleId); return { success: true, user: { id: newUser.id, name: newUser.name } }; }), getRoles: protectedProcedure.query(async ({ ctx }) => { const roles = await getAllRoles(); return { roles: roles.map((role) => ({ id: role.id, name: role.roleName })) }; }) }); } }); // src/trpc/apis/admin-apis/apis/store.ts var storeRouter; var init_store2 = __esm({ "src/trpc/apis/admin-apis/apis/store.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_s3_client(); init_store_initializer(); init_dbService(); storeRouter = router2({ getStores: protectedProcedure.query(async ({ ctx }) => { const stores = await getAllStores(); await Promise.all(stores.map(async (store) => { if (store.imageUrl) store.imageUrl = await generateSignedUrlFromS3Url(store.imageUrl); })).catch((e2) => { throw new ApiError("Unable to find store image urls"); }); return { stores, count: stores.length }; }), getStoreById: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).query(async ({ input, ctx }) => { const { id } = input; const store = await getStoreById(id); if (!store) { throw new ApiError("Store not found", 404); } store.imageUrl = await generateSignedUrlFromS3Url(store.imageUrl); return { store }; }), createStore: protectedProcedure.input(external_exports.object({ name: external_exports.string().min(1, "Name is required"), description: external_exports.string().optional(), imageUrl: external_exports.string().optional(), owner: external_exports.number().min(1, "Owner is required"), products: external_exports.array(external_exports.number()).optional() })).mutation(async ({ input, ctx }) => { const { name, description, imageUrl, owner, products } = input; const imageKey = imageUrl ? extractKeyFromPresignedUrl(imageUrl) : void 0; const newStore = await createStore( { name, description, imageUrl: imageKey, owner }, products ); scheduleStoreInitialization(); return { store: newStore, message: "Store created successfully" }; }), updateStore: protectedProcedure.input(external_exports.object({ id: external_exports.number(), name: external_exports.string().min(1, "Name is required"), description: external_exports.string().optional(), imageUrl: external_exports.string().optional(), owner: external_exports.number().min(1, "Owner is required"), products: external_exports.array(external_exports.number()).optional() })).mutation(async ({ input, ctx }) => { const { id, name, description, imageUrl, owner, products } = input; const existingStore = await getStoreById(id); if (!existingStore) { throw new ApiError("Store not found", 404); } const oldImageKey = existingStore.imageUrl; const newImageKey = imageUrl ? extractKeyFromPresignedUrl(imageUrl) : oldImageKey; if (oldImageKey && (newImageKey && newImageKey !== oldImageKey || !newImageKey)) { try { await deleteImageUtil({ keys: [oldImageKey] }); } catch (error50) { console.error("Failed to delete old image:", error50); } } const updatedStore = await updateStore( id, { name, description, imageUrl: newImageKey, owner }, products ); scheduleStoreInitialization(); return { store: updatedStore, message: "Store updated successfully" }; }), deleteStore: protectedProcedure.input(external_exports.object({ storeId: external_exports.number() })).mutation(async ({ input, ctx }) => { const { storeId } = input; const result = await deleteStore(storeId); scheduleStoreInitialization(); return result; }) }); } }); // src/trpc/apis/admin-apis/apis/payments.ts var initiateRefundSchema, adminPaymentsRouter; var init_payments2 = __esm({ "src/trpc/apis/admin-apis/apis/payments.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); initiateRefundSchema = external_exports.object({ orderId: external_exports.number(), refundPercent: external_exports.number().min(0).max(100).optional(), refundAmount: external_exports.number().min(0).optional() }).refine( (data) => { const hasPercent = data.refundPercent !== void 0; const hasAmount = data.refundAmount !== void 0; return hasPercent && !hasAmount || !hasPercent && hasAmount; }, { message: "Provide either refundPercent or refundAmount, not both or neither" } ); adminPaymentsRouter = router2({ initiateRefund: protectedProcedure.input(initiateRefundSchema).mutation(async ({ input }) => { return {}; }) }); } }); // src/trpc/apis/admin-apis/apis/banner.ts var bannerRouter2; var init_banner2 = __esm({ "src/trpc/apis/admin-apis/apis/banner.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_zod(); init_trpc_index(); init_s3_client(); init_api_error(); init_store_initializer(); init_dbService(); bannerRouter2 = router2({ // Get all banners getBanners: protectedProcedure.query(async () => { try { const banners = await getBanners(); const bannersWithSignedUrls = await Promise.all( banners.map(async (banner) => { try { return { ...banner, imageUrl: banner.imageUrl ? await generateSignedUrlFromS3Url(banner.imageUrl) : banner.imageUrl, // Ensure productIds is always an array productIds: banner.productIds || [] }; } catch (error50) { console.error(`Failed to generate signed URL for banner ${banner.id}:`, error50); return { ...banner, imageUrl: banner.imageUrl, // Keep original on error // Ensure productIds is always an array productIds: banner.productIds || [] }; } }) ); return { banners: bannersWithSignedUrls }; } catch (e2) { console.log(e2); throw new ApiError(e2.message); } }), // Get single banner by ID getBanner: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).query(async ({ input }) => { const banner = await getBannerById(input.id); if (banner) { try { if (banner.imageUrl) { banner.imageUrl = await generateSignedUrlFromS3Url(banner.imageUrl); } } catch (error50) { console.error(`Failed to generate signed URL for banner ${banner.id}:`, error50); } if (!banner.productIds) { banner.productIds = []; } } return banner; }), // Create new banner createBanner: protectedProcedure.input(external_exports.object({ name: external_exports.string().min(1), imageUrl: external_exports.string().url(), description: external_exports.string().optional(), productIds: external_exports.array(external_exports.number()).optional(), redirectUrl: external_exports.string().url().optional() // serialNum removed completely })).mutation(async ({ input }) => { try { const imageUrl = extractKeyFromPresignedUrl(input.imageUrl); const banner = await createBanner({ name: input.name, imageUrl, description: input.description ?? null, productIds: input.productIds || [], redirectUrl: input.redirectUrl ?? null, serialNum: 999, // Default value, not used isActive: false // Default to inactive }); scheduleStoreInitialization(); return banner; } catch (error50) { console.error("Error creating banner:", error50); throw error50; } }), // Update banner updateBanner: protectedProcedure.input(external_exports.object({ id: external_exports.number(), name: external_exports.string().min(1).optional(), imageUrl: external_exports.string().url().optional(), description: external_exports.string().optional(), productIds: external_exports.array(external_exports.number()).optional(), redirectUrl: external_exports.string().url().optional(), serialNum: external_exports.number().nullable().optional(), isActive: external_exports.boolean().optional() })).mutation(async ({ input }) => { try { const { id, ...updateData } = input; const processedData = { ...updateData, ...updateData.imageUrl && { imageUrl: extractKeyFromPresignedUrl(updateData.imageUrl) } }; if ("serialNum" in processedData && processedData.serialNum === null) { processedData.serialNum = null; } const banner = await updateBanner(id, processedData); scheduleStoreInitialization(); return banner; } catch (error50) { console.error("Error updating banner:", error50); throw error50; } }), // Delete banner deleteBanner: protectedProcedure.input(external_exports.object({ id: external_exports.number() })).mutation(async ({ input }) => { await deleteBanner(input.id); scheduleStoreInitialization(); return { success: true }; }) }); } }); // src/trpc/apis/admin-apis/apis/user.ts var userRouter; var init_user3 = __esm({ "src/trpc/apis/admin-apis/apis/user.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_notif_job(); init_user_negativity_store(); init_dbService(); userRouter = { createUserByMobile: protectedProcedure.input(external_exports.object({ mobile: external_exports.string().min(1, "Mobile number is required") })).mutation(async ({ input }) => { const cleanMobile = input.mobile.replace(/\D/g, ""); if (cleanMobile.length !== 10) { throw new ApiError("Mobile number must be exactly 10 digits", 400); } const existingUser = await getUserByMobile(cleanMobile); if (existingUser) { throw new ApiError("User with this mobile number already exists", 409); } const newUser = await createUserByMobile(cleanMobile); return { success: true, data: newUser }; }), getEssentials: protectedProcedure.query(async () => { const count4 = await getUnresolvedComplaintsCount(); return { unresolvedComplaints: count4 }; }), getAllUsers: protectedProcedure.input(external_exports.object({ limit: external_exports.number().min(1).max(100).default(50), cursor: external_exports.number().optional(), search: external_exports.string().optional() })).query(async ({ input }) => { const { limit, cursor, search } = input; const { users: usersToReturn, hasMore } = await getAllUsersWithFilters(limit, cursor, search); const userIds = usersToReturn.map((u5) => u5.id); const orderCounts = await getOrderCountsByUserIds(userIds); const lastOrders = await getLastOrdersByUserIds(userIds); const suspensionStatuses = await getSuspensionStatusesByUserIds(userIds); const orderCountMap = new Map(orderCounts.map((o2) => [o2.userId, o2.totalOrders])); const lastOrderMap = new Map(lastOrders.map((o2) => [o2.userId, o2.lastOrderDate])); const suspensionMap = new Map(suspensionStatuses.map((s2) => [s2.userId, s2.isSuspended])); const usersWithStats = usersToReturn.map((user) => ({ ...user, totalOrders: orderCountMap.get(user.id) || 0, lastOrderDate: lastOrderMap.get(user.id) || null, isSuspended: suspensionMap.get(user.id) ?? false })); const nextCursor = hasMore ? usersToReturn[usersToReturn.length - 1].id : void 0; return { users: usersWithStats, nextCursor, hasMore }; }), getUserDetails: protectedProcedure.input(external_exports.object({ userId: external_exports.number() })).query(async ({ input }) => { const { userId } = input; const user = await getUserBasicInfo(userId); if (!user) { throw new ApiError("User not found", 404); } const isSuspended = await getUserSuspensionStatus(userId); const userOrders = await getUserOrders(userId); const orderIds = userOrders.map((o2) => o2.id); const orderStatuses = await getOrderStatusesByOrderIds(orderIds); const itemCounts = await getItemCountsByOrderIds(orderIds); const statusMap = new Map(orderStatuses.map((s2) => [s2.orderId, s2])); const itemCountMap = new Map(itemCounts.map((c2) => [c2.orderId, c2.itemCount])); const getStatus = /* @__PURE__ */ __name((status) => { if (!status) return "pending"; if (status.isCancelled) return "cancelled"; if (status.isDelivered) return "delivered"; return "pending"; }, "getStatus"); const ordersWithDetails = userOrders.map((order) => { const status = statusMap.get(order.id); return { id: order.id, readableId: order.readableId, totalAmount: order.totalAmount, createdAt: order.createdAt, isFlashDelivery: order.isFlashDelivery, status: getStatus(status), itemCount: itemCountMap.get(order.id) || 0 }; }); return { user: { ...user, isSuspended }, orders: ordersWithDetails }; }), updateUserSuspension: protectedProcedure.input(external_exports.object({ userId: external_exports.number(), isSuspended: external_exports.boolean() })).mutation(async ({ input }) => { const { userId, isSuspended } = input; await upsertUserSuspension(userId, isSuspended); return { success: true, message: `User ${isSuspended ? "suspended" : "unsuspended"} successfully` }; }), getUsersForNotification: protectedProcedure.input(external_exports.object({ search: external_exports.string().optional() })).query(async ({ input }) => { const { search } = input; const usersList = await searchUsers(search); const eligibleUsers = await getAllNotifCreds(); const eligibleSet = new Set(eligibleUsers.map((u5) => u5.userId)); return { users: usersList.map((user) => ({ id: user.id, name: user.name, mobile: user.mobile, isEligibleForNotif: eligibleSet.has(user.id) })) }; }), sendNotification: protectedProcedure.input(external_exports.object({ userIds: external_exports.array(external_exports.number()).default([]), title: external_exports.string().min(1, "Title is required"), text: external_exports.string().min(1, "Message is required"), imageUrl: external_exports.string().optional() })).mutation(async ({ input }) => { const { userIds, title: title2, text: text2, imageUrl } = input; let tokens = []; if (userIds.length === 0) { const loggedInTokens = await getAllNotifCreds(); const unloggedTokens = await getAllUnloggedTokens(); tokens = [ ...loggedInTokens.map((t9) => t9.token), ...unloggedTokens.map((t9) => t9.token) ]; } else { const userTokens = await getNotifTokensByUserIds(userIds); tokens = userTokens.map((t9) => t9.token); } let queuedCount = 0; for (const token of tokens) { try { await notificationQueue.add("send-admin-notification", { token, title: title2, body: text2, imageUrl: imageUrl || null }, { attempts: 3, backoff: { type: "exponential", delay: 2e3 } }); queuedCount++; } catch (error50) { console.error(`Failed to queue notification for token:`, error50); } } return { success: true, message: `Notification queued for ${queuedCount} users` }; }), getUserIncidents: protectedProcedure.input(external_exports.object({ userId: external_exports.number() })).query(async ({ input }) => { const { userId } = input; const incidents = await getUserIncidentsWithRelations(userId); return { incidents: incidents.map((incident) => ({ id: incident.id, userId: incident.userId, orderId: incident.orderId, dateAdded: incident.dateAdded, adminComment: incident.adminComment, addedBy: incident.addedBy?.name || "Unknown", negativityScore: incident.negativityScore, orderStatus: incident.order?.orderStatus?.[0]?.isCancelled ? "cancelled" : "active" })) }; }), addUserIncident: protectedProcedure.input(external_exports.object({ userId: external_exports.number(), orderId: external_exports.number().optional(), adminComment: external_exports.string().optional(), negativityScore: external_exports.number().optional() })).mutation(async ({ input, ctx }) => { const { userId, orderId, adminComment, negativityScore } = input; const adminUserId = ctx.staffUser?.id; if (!adminUserId) { throw new ApiError("Admin user not authenticated", 401); } const incident = await createUserIncident( userId, orderId, adminComment, adminUserId, negativityScore ); recomputeUserNegativityScore(userId); return { success: true, data: incident }; }) }; } }); // src/trpc/apis/admin-apis/apis/const.ts var constRouter; var init_const2 = __esm({ "src/trpc/apis/admin-apis/apis/const.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_const_store(); init_const_keys(); init_dbService(); constRouter = router2({ getConstants: protectedProcedure.query(async () => { const constants2 = await getAllConstants(); return constants2; }), updateConstants: protectedProcedure.input(external_exports.object({ constants: external_exports.array(external_exports.object({ key: external_exports.string(), value: external_exports.any() })) })).mutation(async ({ input }) => { const { constants: constants2 } = input; const validKeys = Object.values(CONST_KEYS); const invalidKeys = constants2.filter((c2) => !validKeys.includes(c2.key)).map((c2) => c2.key); if (invalidKeys.length > 0) { throw new Error(`Invalid constant keys: ${invalidKeys.join(", ")}`); } await upsertConstants(constants2); await computeConstants(); return { success: true, updatedCount: constants2.length, keys: constants2.map((c2) => c2.key) }; }) }); } }); // src/trpc/apis/admin-apis/apis/admin-trpc-index.ts var adminRouter; var init_admin_trpc_index = __esm({ "src/trpc/apis/admin-apis/apis/admin-trpc-index.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_complaint3(); init_coupon3(); init_order3(); init_vendor_snippets2(); init_slots4(); init_product3(); init_staff_user2(); init_store2(); init_payments2(); init_banner2(); init_user3(); init_const2(); adminRouter = router2({ complaint: complaintRouter, coupon: couponRouter, order: orderRouter, vendorSnippets: vendorSnippetsRouter, slots: slotsRouter2, product: productRouter, staffUser: staffUserRouter, store: storeRouter, payments: adminPaymentsRouter, banner: bannerRouter2, user: userRouter, const: constRouter }); } }); // src/lib/license-util.ts async function extractCoordsFromRedirectUrl(url2) { try { await axios_default.get(url2, { maxRedirects: 0 }); return null; } catch (error50) { if (error50.response?.status === 302 || error50.response?.status === 301) { const redirectUrl = error50.response.headers.location; const coordsMatch = redirectUrl.match(/!3d([-\d.]+)!4d([-\d.]+)/); if (coordsMatch) { return { latitude: coordsMatch[1], longitude: coordsMatch[2] }; } } return null; } } var init_license_util = __esm({ "src/lib/license-util.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_axios2(); __name(extractCoordsFromRedirectUrl, "extractCoordsFromRedirectUrl"); } }); // src/trpc/apis/user-apis/apis/address.ts var addressRouter; var init_address2 = __esm({ "src/trpc/apis/user-apis/apis/address.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_license_util(); init_dbService(); addressRouter = router2({ getDefaultAddress: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; const defaultAddress = await getDefaultAddress(userId); return { success: true, data: defaultAddress }; }), getUserAddresses: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; const userAddresses = await getUserAddresses(userId); return { success: true, data: userAddresses }; }), createAddress: protectedProcedure.input(external_exports.object({ name: external_exports.string().min(1, "Name is required"), phone: external_exports.string().min(1, "Phone is required"), addressLine1: external_exports.string().min(1, "Address line 1 is required"), addressLine2: external_exports.string().optional(), city: external_exports.string().min(1, "City is required"), state: external_exports.string().min(1, "State is required"), pincode: external_exports.string().min(1, "Pincode is required"), isDefault: external_exports.boolean().optional(), latitude: external_exports.number().optional(), longitude: external_exports.number().optional(), googleMapsUrl: external_exports.string().optional() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { name, phone, addressLine1, addressLine2, city, state, pincode, isDefault, googleMapsUrl } = input; let { latitude, longitude } = input; if (googleMapsUrl && latitude === void 0 && longitude === void 0) { const coords = await extractCoordsFromRedirectUrl(googleMapsUrl); if (coords) { latitude = Number(coords.latitude); longitude = Number(coords.longitude); } } if (!name || !phone || !addressLine1 || !city || !state || !pincode) { throw new Error("Missing required fields"); } if (isDefault) { await clearDefaultAddress(userId); } const newAddress = await createUserAddress({ userId, name, phone, addressLine1, addressLine2, city, state, pincode, isDefault: isDefault || false, latitude, longitude, googleMapsUrl }); return { success: true, data: newAddress }; }), updateAddress: protectedProcedure.input(external_exports.object({ id: external_exports.number().int().positive(), name: external_exports.string().min(1, "Name is required"), phone: external_exports.string().min(1, "Phone is required"), addressLine1: external_exports.string().min(1, "Address line 1 is required"), addressLine2: external_exports.string().optional(), city: external_exports.string().min(1, "City is required"), state: external_exports.string().min(1, "State is required"), pincode: external_exports.string().min(1, "Pincode is required"), isDefault: external_exports.boolean().optional(), latitude: external_exports.number().optional(), longitude: external_exports.number().optional(), googleMapsUrl: external_exports.string().optional() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { id, name, phone, addressLine1, addressLine2, city, state, pincode, isDefault, googleMapsUrl } = input; let { latitude, longitude } = input; if (googleMapsUrl && latitude === void 0 && longitude === void 0) { const coords = await extractCoordsFromRedirectUrl(googleMapsUrl); if (coords) { latitude = Number(coords.latitude); longitude = Number(coords.longitude); } } const existingAddress = await getUserAddressById(userId, id); if (!existingAddress) { throw new Error("Address not found"); } if (isDefault) { await clearDefaultAddress(userId); } const updatedAddress = await updateUserAddress({ userId, addressId: id, name, phone, addressLine1, addressLine2, city, state, pincode, isDefault: isDefault || false, googleMapsUrl, latitude, longitude }); return { success: true, data: updatedAddress }; }), deleteAddress: protectedProcedure.input(external_exports.object({ id: external_exports.number().int().positive() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { id } = input; const existingAddress = await getUserAddressById(userId, id); if (!existingAddress) { throw new Error("Address not found or does not belong to user"); } const hasOngoingOrders = await hasOngoingOrdersForAddress(id); if (hasOngoingOrders) { throw new Error("Address is attached to an ongoing order. Please cancel the order first."); } if (existingAddress.isDefault) { throw new Error("Cannot delete default address. Please set another address as default first."); } const deleted = await deleteUserAddress(userId, id); if (!deleted) { throw new Error("Address not found or does not belong to user"); } return { success: true, message: "Address deleted successfully" }; }) }); } }); // src/lib/otp-utils.ts function getOtpCreds(mobile) { const authKey = otpStore.get(mobile); return authKey || null; } async function verifyOtpUtil(mobile, otp, verifId) { const reqUrl = `https://cpaas.messagecentral.com/verification/v3/validateOtp?&verificationId=${verifId}&code=${otp}`; const resp = await fetch(reqUrl, { method: "GET", headers: { authToken: otpSenderAuthToken } }); const rawData = await resp.json(); if (rawData.data?.verificationStatus === "VERIFICATION_COMPLETED") { return true; } return false; } var otpStore, setOtpCreds, sendOtp; var init_otp_utils = __esm({ "src/lib/otp-utils.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_api_error(); init_env_exporter(); otpStore = /* @__PURE__ */ new Map(); setOtpCreds = /* @__PURE__ */ __name((phone, verificationId) => { otpStore.set(phone, verificationId); }, "setOtpCreds"); __name(getOtpCreds, "getOtpCreds"); sendOtp = /* @__PURE__ */ __name(async (phone) => { if (!phone) { throw new ApiError("Phone number is required", 400); } const reqUrl = `https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=${phone}&timeout=300`; const resp = await fetch(reqUrl, { headers: { authToken: otpSenderAuthToken }, method: "POST" }); const data = await resp.json(); if (data.message === "SUCCESS") { setOtpCreds(phone, data.data.verificationId); return { success: true, message: "OTP sent successfully", verificationId: data.data.verificationId }; } if (data.message === "REQUEST_ALREADY_EXISTS") { return { success: true, message: "OTP already sent. Last OTP is still valid" }; } throw new ApiError("Error while sending OTP. Please try again", 500); }, "sendOtp"); __name(verifyOtpUtil, "verifyOtpUtil"); } }); // src/trpc/apis/user-apis/apis/auth.ts var generateToken, authRouter; var init_auth4 = __esm({ "src/trpc/apis/user-apis/apis/auth.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_bcryptjs(); init_webapi(); init_s3_client(); init_api_error(); init_env_exporter(); init_otp_utils(); init_dbService(); generateToken = /* @__PURE__ */ __name(async (userId) => { return await new SignJWT({ userId }).setProtectedHeader({ alg: "HS256" }).setExpirationTime("7d").sign(getEncodedJwtSecret()); }, "generateToken"); authRouter = router2({ login: publicProcedure.input(external_exports.object({ identifier: external_exports.string().min(1, "Email/mobile is required"), password: external_exports.string().min(1, "Password is required") })).mutation(async ({ input }) => { const { identifier, password } = input; if (!identifier || !password) { throw new ApiError("Email/mobile and password are required", 400); } const user = await getUserByEmail(identifier.toLowerCase()); let foundUser = user || null; if (!foundUser) { const userByMobile = await getUserByMobile2(identifier); foundUser = userByMobile || null; } if (!foundUser) { throw new ApiError("Invalid credentials", 401); } const userCredentials = await getUserCreds(foundUser.id); if (!userCredentials) { throw new ApiError("Account setup incomplete. Please contact support.", 401); } const userDetail = await getUserDetails(foundUser.id); const profileImageSignedUrl = userDetail?.profileImage ? await generateSignedUrlFromS3Url(userDetail.profileImage) : null; const isPasswordValid = await bcryptjs_default.compare(password, userCredentials.userPassword); if (!isPasswordValid) { throw new ApiError("Invalid credentials", 401); } const token = await generateToken(foundUser.id); const response = { token, user: { id: foundUser.id, name: foundUser.name, email: foundUser.email, mobile: foundUser.mobile, createdAt: foundUser.createdAt.toISOString(), profileImage: profileImageSignedUrl, bio: userDetail?.bio || null, dateOfBirth: userDetail?.dateOfBirth ? new Date(userDetail.dateOfBirth).toISOString() : null, gender: userDetail?.gender || null, occupation: userDetail?.occupation || null } }; return { success: true, data: response }; }), register: publicProcedure.input(external_exports.object({ name: external_exports.string().min(1, "Name is required"), email: external_exports.string().email("Invalid email format"), mobile: external_exports.string().min(1, "Mobile is required"), password: external_exports.string().min(1, "Password is required"), profileImageUrl: external_exports.string().nullable().optional() })).mutation(async ({ input }) => { const { name, email: email3, mobile, password, profileImageUrl } = input; if (!name || !email3 || !mobile || !password) { throw new ApiError("All fields are required", 400); } const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(email3)) { throw new ApiError("Invalid email format", 400); } const cleanMobile = mobile.replace(/\D/g, ""); if (cleanMobile.length !== 10 || !/^[6-9]/.test(cleanMobile)) { throw new ApiError("Invalid mobile number", 400); } const existingEmail = await getUserByEmail(email3.toLowerCase()); if (existingEmail) { throw new ApiError("Email already registered", 409); } const existingMobile = await getUserByMobile2(cleanMobile); if (existingMobile) { throw new ApiError("Mobile number already registered", 409); } const hashedPassword = await bcryptjs_default.hash(password, 12); const newUser = await createUserWithProfile({ name: name.trim(), email: email3.toLowerCase().trim(), mobile: cleanMobile, hashedPassword, profileImage: profileImageUrl ?? null }); const token = await generateToken(newUser.id); const profileImageSignedUrl = profileImageUrl ? await generateSignedUrlFromS3Url(profileImageUrl) : null; const response = { token, user: { id: newUser.id, name: newUser.name, email: newUser.email, mobile: newUser.mobile, createdAt: newUser.createdAt.toISOString(), profileImage: profileImageSignedUrl } }; return { success: true, data: response }; }), sendOtp: publicProcedure.input(external_exports.object({ mobile: external_exports.string() })).mutation(async ({ input }) => { return await sendOtp(input.mobile); }), verifyOtp: publicProcedure.input(external_exports.object({ mobile: external_exports.string(), otp: external_exports.string() })).mutation(async ({ input }) => { const verificationId = getOtpCreds(input.mobile); if (!verificationId) { throw new ApiError("OTP not sent or expired", 400); } const isVerified = await verifyOtpUtil(input.mobile, input.otp, verificationId); if (!isVerified) { throw new ApiError("Invalid OTP", 400); } let user = await getUserByMobile2(input.mobile); if (!user) { user = await createUserWithMobile(input.mobile); } const token = await generateToken(user.id); return { success: true, token, user: { id: user.id, name: user.name, email: user.email, mobile: user.mobile, createdAt: user.createdAt.toISOString(), profileImage: null } }; }), updatePassword: protectedProcedure.input(external_exports.object({ password: external_exports.string().min(6, "Password must be at least 6 characters") })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; if (!userId) { throw new ApiError("User not authenticated", 401); } const hashedPassword = await bcryptjs_default.hash(input.password, 10); await upsertUserPassword(userId, hashedPassword); return { success: true, message: "Password updated successfully" }; }), updateProfile: protectedProcedure.input(external_exports.object({ name: external_exports.string().min(1).optional(), email: external_exports.string().email("Invalid email format").optional(), mobile: external_exports.string().min(1).optional(), password: external_exports.string().min(6, "Password must be at least 6 characters").optional(), bio: external_exports.string().optional().nullable(), dateOfBirth: external_exports.string().optional().nullable(), gender: external_exports.string().optional().nullable(), occupation: external_exports.string().optional().nullable(), profileImageUrl: external_exports.string().optional().nullable() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; if (!userId) { throw new ApiError("User not authenticated", 401); } const { name, email: email3, mobile, password, bio, dateOfBirth, gender, occupation, profileImageUrl } = input; if (email3) { const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(email3)) { throw new ApiError("Invalid email format", 400); } } if (mobile) { const cleanMobile = mobile.replace(/\D/g, ""); if (cleanMobile.length !== 10 || !/^[6-9]/.test(cleanMobile)) { throw new ApiError("Invalid mobile number", 400); } } if (email3) { const existingEmail = await getUserByEmail(email3.toLowerCase()); if (existingEmail && existingEmail.id !== userId) { throw new ApiError("Email already registered", 409); } } if (mobile) { const cleanMobile = mobile.replace(/\D/g, ""); const existingMobile = await getUserByMobile2(cleanMobile); if (existingMobile && existingMobile.id !== userId) { throw new ApiError("Mobile number already registered", 409); } } let hashedPassword; if (password) { hashedPassword = await bcryptjs_default.hash(password, 12); } const updatedUser = await updateUserProfile(userId, { name: name?.trim(), email: email3?.toLowerCase().trim(), mobile: mobile?.replace(/\D/g, ""), hashedPassword, profileImage: profileImageUrl ?? void 0, bio: bio ?? void 0, dateOfBirth: dateOfBirth ? new Date(dateOfBirth) : void 0, gender: gender ?? void 0, occupation: occupation ?? void 0 }); const userDetail = await getUserDetailsByUserId(userId); const profileImageSignedUrl = userDetail?.profileImage ? await generateSignedUrlFromS3Url(userDetail.profileImage) : null; const authHeader = ctx.req.header("authorization"); const token = authHeader?.replace("Bearer ", "") || ""; const response = { token, user: { id: updatedUser.id, name: updatedUser.name, email: updatedUser.email, mobile: updatedUser.mobile, createdAt: updatedUser.createdAt?.toISOString?.() || (/* @__PURE__ */ new Date()).toISOString(), profileImage: profileImageSignedUrl, bio: userDetail?.bio || null, dateOfBirth: userDetail?.dateOfBirth ? new Date(userDetail.dateOfBirth).toISOString() : null, gender: userDetail?.gender || null, occupation: userDetail?.occupation || null } }; return { success: true, data: response }; }), getProfile: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; if (!userId) { throw new ApiError("User not authenticated", 401); } const user = await getUserById(userId); if (!user) { throw new ApiError("User not found", 404); } return { success: true, data: { id: user.id, name: user.name, email: user.email, mobile: user.mobile } }; }), deleteAccount: protectedProcedure.input(external_exports.object({ mobile: external_exports.string().min(10, "Mobile number is required") })).mutation(async ({ ctx, input }) => { const userId = ctx.user.userId; const { mobile } = input; if (!userId) { throw new ApiError("User not authenticated", 401); } const existingUser = await getUserById(userId); if (!existingUser) { throw new ApiError("User not found", 404); } if (existingUser.id !== userId) { throw new ApiError("Unauthorized: Cannot delete another user's account", 403); } const cleanInputMobile = mobile.replace(/\D/g, ""); const cleanUserMobile = existingUser.mobile?.replace(/\D/g, ""); if (cleanInputMobile !== cleanUserMobile) { throw new ApiError("Mobile number does not match your registered number", 400); } await deleteUserAccount(userId); return { success: true, message: "Account deleted successfully" }; }) }); } }); // src/trpc/apis/user-apis/apis/cart.ts var getCartData, cartRouter; var init_cart2 = __esm({ "src/trpc/apis/user-apis/apis/cart.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_s3_client(); init_slot_store(); init_dbService(); getCartData = /* @__PURE__ */ __name(async (userId) => { const cartItemsWithProducts = await getCartItemsWithProducts(userId); const cartWithSignedUrls = cartItemsWithProducts.map((item) => ({ ...item, product: { ...item.product, images: scaffoldAssetUrl(item.product.images || []) } })); const totalAmount = cartWithSignedUrls.reduce((sum2, item) => sum2 + item.subtotal, 0); return { items: cartWithSignedUrls, totalItems: cartWithSignedUrls.length, totalAmount }; }, "getCartData"); cartRouter = router2({ getCart: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; return await getCartData(userId); }), addToCart: protectedProcedure.input(external_exports.object({ productId: external_exports.number().int().positive(), quantity: external_exports.number().int().positive() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { productId, quantity } = input; if (!productId || !quantity || quantity <= 0) { throw new ApiError("Product ID and positive quantity required", 400); } const product = await getProductById2(productId); if (!product) { throw new ApiError("Product not found", 404); } const existingItem = await getCartItemByUserProduct(userId, productId); if (existingItem) { await incrementCartItemQuantity(existingItem.id, quantity); } else { await insertCartItem(userId, productId, quantity); } return await getCartData(userId); }), updateCartItem: protectedProcedure.input(external_exports.object({ itemId: external_exports.number().int().positive(), quantity: external_exports.number().int().min(0) })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { itemId, quantity } = input; if (!quantity || quantity <= 0) { throw new ApiError("Positive quantity required", 400); } const updated = await updateCartItemQuantity(userId, itemId, quantity); if (!updated) { throw new ApiError("Cart item not found", 404); } return await getCartData(userId); }), removeFromCart: protectedProcedure.input(external_exports.object({ itemId: external_exports.number().int().positive() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { itemId } = input; const deleted = await deleteCartItem(userId, itemId); if (!deleted) { throw new ApiError("Cart item not found", 404); } return await getCartData(userId); }), clearCart: protectedProcedure.mutation(async ({ ctx }) => { const userId = ctx.user.userId; await clearUserCart(userId); return { items: [], totalItems: 0, totalAmount: 0, message: "Cart cleared successfully" }; }), // Original DB-based getCartSlots (commented out) // getCartSlots: publicProcedure // .input(z.object({ // productIds: z.array(z.number().int().positive()) // })) // .query(async ({ input }) => { // const { productIds } = input; // // if (productIds.length === 0) { // return {}; // } // // // Get slots for these products where freeze time is after current time // const slotsData = await db // .select({ // productId: productSlots.productId, // slotId: deliverySlotInfo.id, // deliveryTime: deliverySlotInfo.deliveryTime, // freezeTime: deliverySlotInfo.freezeTime, // isActive: deliverySlotInfo.isActive, // }) // .from(productSlots) // .innerJoin(deliverySlotInfo, eq(productSlots.slotId, deliverySlotInfo.id)) // .where(and( // inArray(productSlots.productId, productIds), // gt(deliverySlotInfo.freezeTime, sql`NOW()`), // eq(deliverySlotInfo.isActive, true) // )); // // // Group by productId // const result: Record = {}; // slotsData.forEach(slot => { // if (!result[slot.productId]) { // result[slot.productId] = []; // } // result[slot.productId].push({ // id: slot.slotId, // deliveryTime: slot.deliveryTime, // freezeTime: slot.freezeTime, // }); // }); // // return result; // }), // Cache-based getCartSlots getCartSlots: publicProcedure.input(external_exports.object({ productIds: external_exports.array(external_exports.number().int().positive()) })).query(async ({ input }) => { const { productIds } = input; if (productIds.length === 0) { return {}; } return await getMultipleProductsSlots(productIds); }) }); } }); // src/trpc/apis/user-apis/apis/complaint.ts var complaintRouter2; var init_complaint4 = __esm({ "src/trpc/apis/user-apis/apis/complaint.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_dbService(); complaintRouter2 = router2({ getAll: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; const userComplaints = await getUserComplaints(userId); return { complaints: userComplaints }; }), raise: protectedProcedure.input(external_exports.object({ orderId: external_exports.string().optional(), complaintBody: external_exports.string().min(1, "Complaint body is required"), imageUrls: external_exports.array(external_exports.string()).optional() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { orderId, complaintBody, imageUrls } = input; let orderIdNum = null; if (orderId) { const readableIdMatch = orderId.match(/^ORD(\d+)$/); if (readableIdMatch) { orderIdNum = parseInt(readableIdMatch[1]); } } await createComplaint( userId, orderIdNum, complaintBody.trim(), imageUrls && imageUrls.length > 0 ? imageUrls : null ); return { success: true, message: "Complaint raised successfully" }; }) }); } }); // src/trpc/apis/user-apis/apis/order.ts var toApiDate2, placeOrderUtil, orderRouter2; var init_order4 = __esm({ "src/trpc/apis/user-apis/apis/order.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_dbService(); init_common3(); init_s3_client(); init_api_error(); init_notif_job(); init_const_store(); init_post_order_handler(); toApiDate2 = /* @__PURE__ */ __name((value) => { if (value instanceof Date) { return Number.isNaN(value.getTime()) ? "" : value.toISOString(); } if (typeof value === "number") { const date6 = new Date(value); return Number.isNaN(date6.getTime()) ? "" : date6.toISOString(); } if (typeof value === "string") { const date6 = new Date(value); return Number.isNaN(date6.getTime()) ? value : date6.toISOString(); } return ""; }, "toApiDate"); placeOrderUtil = /* @__PURE__ */ __name(async (params) => { const { userId, selectedItems, addressId, paymentMethod, couponId, userNotes } = params; const constants2 = await getConstants([ CONST_KEYS.minRegularOrderValue, CONST_KEYS.deliveryCharge, CONST_KEYS.flashFreeDeliveryThreshold, CONST_KEYS.flashDeliveryCharge ]); const isFlashDelivery = params.isFlash; const minOrderValue2 = (isFlashDelivery ? constants2[CONST_KEYS.flashFreeDeliveryThreshold] : constants2[CONST_KEYS.minRegularOrderValue]) || 0; const deliveryCharge2 = (isFlashDelivery ? constants2[CONST_KEYS.flashDeliveryCharge] : constants2[CONST_KEYS.deliveryCharge]) || 0; const orderGroupId = `${Date.now()}-${userId}`; const address = await getAddressByIdAndUser(addressId, userId); if (!address) { throw new ApiError("Invalid address", 400); } const ordersBySlot = /* @__PURE__ */ new Map(); for (const item of selectedItems) { const product = await getProductById4(item.productId); if (!product) { throw new ApiError(`Product ${item.productId} not found`, 400); } if (!ordersBySlot.has(item.slotId)) { ordersBySlot.set(item.slotId, []); } ordersBySlot.get(item.slotId).push({ ...item, product }); } if (params.isFlash) { for (const item of selectedItems) { const product = await getProductById4(item.productId); if (!product?.isFlashAvailable) { throw new ApiError(`Product ${item.productId} is not available for flash delivery`, 400); } } } let totalAmount = 0; for (const [slotId, items] of ordersBySlot) { const orderTotal = items.reduce( (sum2, item) => { if (!item.product) return sum2; const basePrice = params.isFlash ? item.product.flashPrice ?? item.product.price : item.product.price; const itemPrice = parseFloat((basePrice ?? 0).toString()); return sum2 + itemPrice * item.quantity; }, 0 ); totalAmount += orderTotal; } const appliedCoupon = await validateAndGetCoupon(couponId, userId, totalAmount); const expectedDeliveryCharge = totalAmount < minOrderValue2 ? deliveryCharge2 : 0; const totalWithDelivery = totalAmount + expectedDeliveryCharge; const ordersData = []; let isFirstOrder = true; for (const [slotId, items] of ordersBySlot) { const subOrderTotal = items.reduce( (sum2, item) => { if (!item.product) return sum2; const basePrice = params.isFlash ? item.product.flashPrice ?? item.product.price : item.product.price; const itemPrice = parseFloat((basePrice ?? 0).toString()); return sum2 + itemPrice * item.quantity; }, 0 ); const subOrderTotalWithDelivery = subOrderTotal + expectedDeliveryCharge; const orderGroupProportion = subOrderTotal / totalAmount; const orderTotalAmount = isFirstOrder ? subOrderTotalWithDelivery : subOrderTotal; const { finalOrderTotal: finalOrderAmount } = applyDiscountToOrder( orderTotalAmount, appliedCoupon, orderGroupProportion ); const order = { userId, addressId, slotId: params.isFlash ? null : slotId, isCod: paymentMethod === "cod", isOnlinePayment: paymentMethod === "online", paymentInfoId: null, totalAmount: finalOrderAmount.toString(), deliveryCharge: isFirstOrder ? expectedDeliveryCharge.toString() : "0", readableId: -1, userNotes: userNotes || null, orderGroupId, orderGroupProportion: orderGroupProportion.toString(), isFlashDelivery: params.isFlash }; const validItems = items.filter( (item) => item.product !== null && item.product !== void 0 ); const orderItemsData = validItems.map( (item) => { const basePrice = params.isFlash ? item.product.flashPrice ?? item.product.price : item.product.price; const priceString = (basePrice ?? 0).toString(); return { orderId: 0, productId: item.productId, quantity: item.quantity.toString(), price: priceString, discountedPrice: priceString }; } ); const orderStatusData = { userId, orderId: 0, paymentStatus: paymentMethod === "cod" ? "cod" : "pending" }; ordersData.push({ order, orderItems: orderItemsData, orderStatus: orderStatusData }); isFirstOrder = false; } const createdOrders = await placeOrderTransaction({ userId, ordersData, paymentMethod, totalWithDelivery }); await deleteCartItemsForOrder( userId, selectedItems.map((item) => item.productId) ); if (appliedCoupon && createdOrders.length > 0) { await recordCouponUsage( userId, appliedCoupon.id, createdOrders[0].id ); } for (const order of createdOrders) { sendOrderPlacedNotification(userId, order.id.toString()); } await publishFormattedOrder(createdOrders, ordersBySlot); return { success: true, data: createdOrders }; }, "placeOrderUtil"); orderRouter2 = router2({ placeOrder: protectedProcedure.input( external_exports.object({ selectedItems: external_exports.array( external_exports.object({ productId: external_exports.number().int().positive(), quantity: external_exports.number().int().positive(), slotId: external_exports.union([external_exports.number().int(), external_exports.null()]) }) ), addressId: external_exports.number().int().positive(), paymentMethod: external_exports.enum(["online", "cod"]), couponId: external_exports.number().int().positive().optional(), userNotes: external_exports.string().optional(), isFlashDelivery: external_exports.boolean().optional().default(false) }) ).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const isSuspended = await checkUserSuspended(userId); if (isSuspended) { throw new ApiError("Unable to place order", 403); } const { selectedItems, addressId, paymentMethod, couponId, userNotes, isFlashDelivery } = input; if (isFlashDelivery) { const isFlashDeliveryEnabled = await getConstant(CONST_KEYS.isFlashDeliveryEnabled); if (!isFlashDeliveryEnabled) { throw new ApiError("Flash delivery is currently unavailable. Please opt for scheduled delivery.", 403); } } if (!isFlashDelivery) { const slotIds = [...new Set(selectedItems.filter((i2) => i2.slotId !== null).map((i2) => i2.slotId))]; for (const slotId of slotIds) { const isCapacityFull = await getSlotCapacityStatus(slotId); if (isCapacityFull) { throw new ApiError("Selected delivery slot is at full capacity. Please choose another slot.", 403); } } } let processedItems = selectedItems; if (isFlashDelivery) { processedItems = selectedItems.map((item) => ({ ...item, slotId: null })); } return await placeOrderUtil({ userId, selectedItems: processedItems, addressId, paymentMethod, couponId, userNotes, isFlash: isFlashDelivery }); }), getOrders: protectedProcedure.input( external_exports.object({ page: external_exports.number().min(1).default(1), pageSize: external_exports.number().min(1).max(50).default(10) }).optional() ).query(async ({ input, ctx }) => { const { page = 1, pageSize = 10 } = input || {}; const userId = ctx.user.userId; const offset = (page - 1) * pageSize; const totalCount = await getOrderCount(userId); const userOrders = await getOrdersWithRelations(userId, offset, pageSize); const mappedOrders = await Promise.all( userOrders.map(async (order) => { const status = order.orderStatus[0]; const refund = order.refunds[0]; let deliveryStatus; let orderStatus3; const allItemsPackaged = order.orderItems.every( (item) => item.is_packaged ); if (status?.isCancelled) { deliveryStatus = "cancelled"; orderStatus3 = "cancelled"; } else if (status?.isDelivered) { deliveryStatus = "success"; orderStatus3 = "success"; } else if (allItemsPackaged) { deliveryStatus = "packaged"; orderStatus3 = "success"; } else { deliveryStatus = "pending"; orderStatus3 = "success"; } const paymentMode = order.isCod ? "CoD" : "Online"; const paymentStatus = status?.paymentStatus || "pending"; const refundStatus = refund?.refundStatus || "none"; const refundAmount = refund?.refundAmount ? parseFloat(refund.refundAmount.toString()) : null; const items = await Promise.all( order.orderItems.map(async (item) => { const signedImages = item.product.images ? scaffoldAssetUrl( item.product.images ) : []; return { productName: item.product.name, quantity: parseFloat(item.quantity), price: parseFloat(item.price.toString()), discountedPrice: parseFloat( item.discountedPrice?.toString() || item.price.toString() ), amount: parseFloat(item.price.toString()) * parseFloat(item.quantity), image: signedImages[0] || null }; }) ); return { id: order.id, orderId: `ORD${order.id}`, orderDate: toApiDate2(order.createdAt), deliveryStatus, deliveryDate: toApiDate2(order.slot?.deliveryTime) || void 0, orderStatus: orderStatus3, cancelReason: status?.cancelReason || null, paymentMode, totalAmount: Number(order.totalAmount), deliveryCharge: Number(order.deliveryCharge), paymentStatus, refundStatus, refundAmount, userNotes: order.userNotes || null, items, isFlashDelivery: order.isFlashDelivery, createdAt: toApiDate2(order.createdAt) }; }) ); return { success: true, data: mappedOrders, pagination: { page, pageSize, totalCount, totalPages: Math.ceil(totalCount / pageSize) } }; }), getOrderById: protectedProcedure.input(external_exports.object({ orderId: external_exports.string() })).query(async ({ input, ctx }) => { const { orderId } = input; const userId = ctx.user.userId; const order = await getOrderByIdWithRelations(parseInt(orderId), userId); if (!order) { throw new Error("Order not found"); } const couponUsageData = await getCouponUsageForOrder(order.id); let couponData = null; if (couponUsageData.length > 0) { let totalDiscountAmount = 0; const orderTotal = parseFloat(order.totalAmount.toString()); for (const usage of couponUsageData) { let discountAmount = 0; if (usage.coupon.discountPercent) { discountAmount = orderTotal * parseFloat(usage.coupon.discountPercent.toString()) / 100; } else if (usage.coupon.flatDiscount) { discountAmount = parseFloat(usage.coupon.flatDiscount.toString()); } if (usage.coupon.maxValue && discountAmount > parseFloat(usage.coupon.maxValue.toString())) { discountAmount = parseFloat(usage.coupon.maxValue.toString()); } totalDiscountAmount += discountAmount; } couponData = { couponCode: couponUsageData.map((u5) => u5.coupon.couponCode).join(", "), couponDescription: `${couponUsageData.length} coupons applied`, discountAmount: totalDiscountAmount }; } const status = order.orderStatus[0]; const refund = order.refunds[0]; let deliveryStatus; let orderStatusResult; const allItemsPackaged = order.orderItems.every( (item) => item.is_packaged ); if (status?.isCancelled) { deliveryStatus = "cancelled"; orderStatusResult = "cancelled"; } else if (status?.isDelivered) { deliveryStatus = "success"; orderStatusResult = "success"; } else if (allItemsPackaged) { deliveryStatus = "packaged"; orderStatusResult = "success"; } else { deliveryStatus = "pending"; orderStatusResult = "success"; } const paymentMode = order.isCod ? "CoD" : "Online"; const paymentStatus = status?.paymentStatus || "pending"; const refundStatus = refund?.refundStatus || "none"; const refundAmount = refund?.refundAmount ? parseFloat(refund.refundAmount.toString()) : null; const items = await Promise.all( order.orderItems.map(async (item) => { const signedImages = item.product.images ? scaffoldAssetUrl( item.product.images ) : []; return { productName: item.product.name, quantity: parseFloat(item.quantity), price: parseFloat(item.price.toString()), discountedPrice: parseFloat( item.discountedPrice?.toString() || item.price.toString() ), amount: parseFloat(item.price.toString()) * parseFloat(item.quantity), image: signedImages[0] || null }; }) ); return { id: order.id, orderId: `ORD${order.id}`, orderDate: toApiDate2(order.createdAt), deliveryStatus, deliveryDate: toApiDate2(order.slot?.deliveryTime) || void 0, orderStatus: orderStatusResult, cancellationStatus: orderStatusResult, cancelReason: status?.cancelReason || null, paymentMode, paymentStatus, refundStatus, refundAmount, userNotes: order.userNotes || null, items, couponCode: couponData?.couponCode || null, couponDescription: couponData?.couponDescription || null, discountAmount: couponData?.discountAmount || null, orderAmount: parseFloat(order.totalAmount.toString()), isFlashDelivery: order.isFlashDelivery, createdAt: toApiDate2(order.createdAt), totalAmount: parseFloat(order.totalAmount.toString()), deliveryCharge: parseFloat(order.deliveryCharge.toString()) }; }), cancelOrder: protectedProcedure.input( external_exports.object({ id: external_exports.number(), reason: external_exports.string().min(1, "Cancellation reason is required") }) ).mutation(async ({ input, ctx }) => { try { const userId = ctx.user.userId; const { id, reason } = input; const order = await getOrderBasic(id); if (!order) { console.error("Order not found:", id); throw new ApiError("Order not found", 404); } if (order.userId !== userId) { console.error("Order does not belong to user:", { orderId: id, orderUserId: order.userId, requestUserId: userId }); throw new ApiError("Order not found", 404); } const status = order.orderStatus[0]; if (!status) { console.error("Order status not found for order:", id); throw new ApiError("Order status not found", 400); } if (status.isCancelled) { console.error("Order is already cancelled:", id); throw new ApiError("Order is already cancelled", 400); } if (status.isDelivered) { console.error("Cannot cancel delivered order:", id); throw new ApiError("Cannot cancel delivered order", 400); } await cancelOrderTransaction(id, status.id, reason, order.isCod); await sendOrderCancelledNotification(userId, id.toString()); await publishCancellation(id, "user", reason); return { success: true, message: "Order cancelled successfully" }; } catch (e2) { console.log(e2); throw new ApiError("failed to cancel order"); } }), updateUserNotes: protectedProcedure.input( external_exports.object({ id: external_exports.number(), userNotes: external_exports.string() }) ).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { id, userNotes } = input; const order = await getOrderBasic(id); if (!order) { console.error("Order not found:", id); throw new ApiError("Order not found", 404); } if (order.userId !== userId) { console.error("Order does not belong to user:", { orderId: id, orderUserId: order.userId, requestUserId: userId }); throw new ApiError("Order not found", 404); } const status = order.orderStatus[0]; if (!status) { console.error("Order status not found for order:", id); throw new ApiError("Order status not found", 400); } if (status.isDelivered) { console.error("Cannot update notes for delivered order:", id); throw new ApiError("Cannot update notes for delivered order", 400); } if (status.isCancelled) { console.error("Cannot update notes for cancelled order:", id); throw new ApiError("Cannot update notes for cancelled order", 400); } await updateOrderNotes2(id, userNotes); return { success: true, message: "Notes updated successfully" }; }), getRecentlyOrderedProducts: protectedProcedure.input( external_exports.object({ limit: external_exports.number().min(1).max(50).default(20) }).optional() ).query(async ({ input, ctx }) => { const { limit = 20 } = input || {}; const userId = ctx.user.userId; const thirtyDaysAgo = /* @__PURE__ */ new Date(); thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30); const recentOrderIds = await getRecentlyDeliveredOrderIds(userId, 10, thirtyDaysAgo); if (recentOrderIds.length === 0) { return { success: true, products: [] }; } const productIds = await getProductIdsFromOrders(recentOrderIds); if (productIds.length === 0) { return { success: true, products: [] }; } const productsWithUnits = await getProductsForRecentOrders(productIds, limit); const formattedProducts = await Promise.all( productsWithUnits.map(async (product) => { const nextDeliveryDate = await getNextDeliveryDate(product.id); return { id: product.id, name: product.name, shortDescription: product.shortDescription, price: product.price, unit: product.unitShortNotation, incrementStep: product.incrementStep, isOutOfStock: product.isOutOfStock, nextDeliveryDate: nextDeliveryDate ? nextDeliveryDate.toISOString() : null, images: scaffoldAssetUrl( product.images || [] ) }; }) ); return { success: true, products: formattedProducts }; }) }); } }); // src/trpc/apis/user-apis/apis/product.ts var import_dayjs4, signProductImages, productRouter2; var init_product4 = __esm({ "src/trpc/apis/user-apis/apis/product.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_s3_client(); init_api_error(); init_product_store(); import_dayjs4 = __toESM(require_dayjs_min()); init_dbService(); signProductImages = /* @__PURE__ */ __name((product) => ({ ...product, images: scaffoldAssetUrl(product.images || []) }), "signProductImages"); productRouter2 = router2({ getProductDetails: publicProcedure.input(external_exports.object({ id: external_exports.string().regex(/^\d+$/, "Invalid product ID") })).query(async ({ input }) => { const { id } = input; const productId = parseInt(id); if (isNaN(productId)) { throw new Error("Invalid product ID"); } console.log("from the api to get product details"); const cachedProduct = await getProductById5(productId); if (cachedProduct) { const currentTime = /* @__PURE__ */ new Date(); const filteredSlots = cachedProduct.deliverySlots.filter( (slot) => (0, import_dayjs4.default)(slot.freezeTime).isAfter(currentTime) && !slot.isCapacityFull ); return { ...cachedProduct, deliverySlots: filteredSlots }; } const productData = await getProductDetailById(productId); if (!productData) { throw new Error("Product not found"); } return signProductImages(productData); }), getProductReviews: publicProcedure.input(external_exports.object({ productId: external_exports.number().int().positive(), limit: external_exports.number().int().min(1).max(50).optional().default(10), offset: external_exports.number().int().min(0).optional().default(0) })).query(async ({ input }) => { const { productId, limit, offset } = input; const { reviews, totalCount } = await getProductReviews2(productId, limit, offset); const reviewsWithSignedUrls = reviews.map((review) => ({ ...review, signedImageUrls: scaffoldAssetUrl(review.imageUrls || []) })); const hasMore = offset + limit < totalCount; return { reviews: reviewsWithSignedUrls, hasMore }; }), createReview: protectedProcedure.input(external_exports.object({ productId: external_exports.number().int().positive(), reviewBody: external_exports.string().min(1, "Review body is required"), ratings: external_exports.number().int().min(1).max(5), imageUrls: external_exports.array(external_exports.string()).optional().default([]), uploadUrls: external_exports.array(external_exports.string()).optional().default([]) })).mutation(async ({ input, ctx }) => { const { productId, reviewBody, ratings, imageUrls, uploadUrls } = input; const userId = ctx.user.userId; const product = await getProductById3(productId); if (!product) { throw new ApiError("Product not found", 404); } const imageKeys = uploadUrls.map((item) => extractKeyFromPresignedUrl(item)); const newReview = await createProductReview(userId, productId, reviewBody, ratings, imageKeys); if (uploadUrls && uploadUrls.length > 0) { try { await Promise.all(uploadUrls.map((url2) => claimUploadUrl(url2))); } catch (error50) { console.error("Error claiming upload URLs:", error50); } } return { success: true, review: newReview }; }), getAllProductsSummary: publicProcedure.query(async () => { const allCachedProducts = await getAllProducts2(); const transformedProducts = allCachedProducts.map((product) => ({ ...product, images: product.images || [], deliverySlots: [], specialDeals: [] })); return transformedProducts; }) }); } }); // src/trpc/apis/user-apis/apis/user.ts var userRouter2; var init_user4 = __esm({ "src/trpc/apis/user-apis/apis/user.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_env_exporter(); init_s3_client(); init_dbService(); userRouter2 = router2({ getSelfData: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; if (!userId) { throw new ApiError("User not authenticated", 401); } const user = await getUserById2(userId); if (!user) { throw new ApiError("User not found", 404); } const userDetail = await getUserDetailByUserId(userId); const profileImageSignedUrl = userDetail?.profileImage ? await generateSignedUrlFromS3Url(userDetail.profileImage) : null; return { success: true, data: { user: { id: user.id, name: user.name, email: user.email, mobile: user.mobile, profileImage: profileImageSignedUrl, bio: userDetail?.bio || null, dateOfBirth: userDetail?.dateOfBirth ? new Date(userDetail.dateOfBirth).toISOString() : null, gender: userDetail?.gender || null, occupation: userDetail?.occupation || null } } }; }), checkProfileComplete: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; if (!userId) { throw new ApiError("User not authenticated", 401); } const result = await getUserWithCreds(userId); if (!result) { throw new ApiError("User not found", 404); } return { isComplete: !!(result.user.name && result.user.email && result.creds) }; }), savePushToken: publicProcedure.input(external_exports.object({ token: external_exports.string() })).mutation(async ({ input, ctx }) => { const { token } = input; const userId = ctx.user?.userId; if (userId) { await upsertNotifCred(userId, token); await deleteUnloggedToken(token); } else { const existing = await getUnloggedToken(token); if (existing) { await upsertUnloggedToken(token); } else { await upsertUnloggedToken(token); } } return { success: true }; }) }); } }); // src/trpc/apis/user-apis/apis/coupon.ts var generateCouponDescription, userCouponRouter; var init_coupon4 = __esm({ "src/trpc/apis/user-apis/apis/coupon.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_dbService(); generateCouponDescription = /* @__PURE__ */ __name((coupon) => { let desc2 = ""; if (coupon.discountPercent) { desc2 += `${coupon.discountPercent}% off`; } else if (coupon.flatDiscount) { desc2 += `\u20B9${coupon.flatDiscount} off`; } if (coupon.minOrder) { desc2 += ` on orders above \u20B9${coupon.minOrder}`; } if (coupon.maxValue) { desc2 += ` (max discount \u20B9${coupon.maxValue})`; } return desc2; }, "generateCouponDescription"); userCouponRouter = router2({ getEligible: protectedProcedure.query(async ({ ctx }) => { try { const userId = ctx.user.userId; const allCoupons = await getActiveCouponsWithRelations(userId); const applicableCoupons = allCoupons.filter((coupon) => { if (!coupon.isUserBased) return true; const applicableUsers = coupon.applicableUsers || []; return applicableUsers.some((au2) => au2.userId === userId); }); return { success: true, data: applicableCoupons }; } catch (e2) { console.log(e2); throw new ApiError("Unable to get coupons"); } }), getProductCoupons: protectedProcedure.input(external_exports.object({ productId: external_exports.number().int().positive() })).query(async ({ input, ctx }) => { const userId = ctx.user.userId; const { productId } = input; const allCoupons = await getActiveCouponsWithRelations(userId); const applicableCoupons = allCoupons.filter((coupon) => { const applicableUsers = coupon.applicableUsers || []; const userApplicable = !coupon.isUserBased || applicableUsers.some((au2) => au2.userId === userId); const applicableProducts = coupon.applicableProducts || []; const productApplicable = applicableProducts.length === 0 || applicableProducts.some((ap2) => ap2.productId === productId); return userApplicable && productApplicable; }); return { success: true, data: applicableCoupons }; }), getMyCoupons: protectedProcedure.query(async ({ ctx }) => { const userId = ctx.user.userId; const allCoupons = await getAllCouponsWithRelations(userId); const applicableCoupons = allCoupons.filter((coupon) => { const isNotInvalidated = !coupon.isInvalidated; const applicableUsers = coupon.applicableUsers || []; const isApplicable = coupon.isApplyForAll || applicableUsers.some((au2) => au2.userId === userId); const isNotExpired = !coupon.validTill || new Date(coupon.validTill) > /* @__PURE__ */ new Date(); return isNotInvalidated && isApplicable && isNotExpired; }); const personalCoupons = []; const generalCoupons = []; applicableCoupons.forEach((coupon) => { const usageCount = coupon.usages.length; const isExpired = false; const isUsedUp = Boolean(coupon.maxLimitForUser && usageCount >= coupon.maxLimitForUser); const couponDisplay = { id: coupon.id, code: coupon.couponCode, discountType: coupon.discountPercent ? "percentage" : "flat", discountValue: parseFloat(coupon.discountPercent || coupon.flatDiscount || "0"), maxValue: coupon.maxValue ? parseFloat(coupon.maxValue) : void 0, minOrder: coupon.minOrder ? parseFloat(coupon.minOrder) : void 0, description: generateCouponDescription(coupon), validTill: coupon.validTill ? new Date(coupon.validTill) : void 0, usageCount, maxLimitForUser: coupon.maxLimitForUser ? parseInt(coupon.maxLimitForUser.toString()) : void 0, isExpired, isUsedUp }; if ((coupon.applicableUsers || []).some((au2) => au2.userId === userId) && !coupon.isApplyForAll) { personalCoupons.push(couponDisplay); } else if (coupon.isApplyForAll) { generalCoupons.push(couponDisplay); } }); return { success: true, data: { personal: personalCoupons, general: generalCoupons } }; }), redeemReservedCoupon: protectedProcedure.input(external_exports.object({ secretCode: external_exports.string() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { secretCode } = input; const reservedCoupon = await getReservedCouponByCode(secretCode); if (!reservedCoupon) { throw new ApiError("Invalid or already redeemed coupon code", 400); } if (reservedCoupon.redeemedBy === userId) { throw new ApiError("You have already redeemed this coupon", 400); } const couponResult = await redeemReservedCoupon(userId, reservedCoupon); return { success: true, coupon: couponResult }; }) }); } }); // src/lib/payments-utils.ts var RazorpayPaymentService; var init_payments_utils = __esm({ "src/lib/payments-utils.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); RazorpayPaymentService = class { // private static instance = new Razorpay({ // key_id: razorpayId, // key_secret: razorpaySecret, // }); // static async createOrder(orderId, amount) { } static async insertPaymentRecord(orderId, razorpayOrder, tx) { } static async initiateRefund(paymentId, amount) { } static async fetchRefund(refundId) { } }; __name(RazorpayPaymentService, "RazorpayPaymentService"); } }); // src/trpc/apis/user-apis/apis/payments.ts var paymentRouter; var init_payments3 = __esm({ "src/trpc/apis/user-apis/apis/payments.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_api_error(); init_crypto3(); init_env_exporter(); init_payments_utils(); init_dbService(); paymentRouter = router2({ createRazorpayOrder: protectedProcedure.input(external_exports.object({ orderId: external_exports.string() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { orderId } = input; const order = await getOrderById(parseInt(orderId)); if (!order) { throw new ApiError("Order not found", 404); } if (order.userId !== userId) { throw new ApiError("Order does not belong to user", 403); } const existingPayment = await getPaymentByOrderId(parseInt(orderId)); if (existingPayment && existingPayment.status === "pending") { return { razorpayOrderId: existingPayment.merchantOrderId, key: razorpayId }; } if (order.totalAmount === null) { throw new ApiError("Order total is missing", 400); } const razorpayOrder = await RazorpayPaymentService.createOrder(parseInt(orderId), order.totalAmount); await RazorpayPaymentService.insertPaymentRecord(parseInt(orderId), razorpayOrder); return { razorpayOrderId: 0, key: razorpayId }; }), verifyPayment: protectedProcedure.input(external_exports.object({ razorpay_payment_id: external_exports.string(), razorpay_order_id: external_exports.string(), razorpay_signature: external_exports.string() })).mutation(async ({ input, ctx }) => { const { razorpay_payment_id, razorpay_order_id, razorpay_signature } = input; const expectedSignature = crypto_default.createHmac("sha256", razorpaySecret).update(razorpay_order_id + "|" + razorpay_payment_id).digest("hex"); if (expectedSignature !== razorpay_signature) { throw new ApiError("Invalid payment signature", 400); } const currentPayment = await getPaymentByMerchantOrderId(razorpay_order_id); if (!currentPayment) { throw new ApiError("Payment record not found", 404); } const updatedPayload = { ...currentPayment.payload || {}, payment_id: razorpay_payment_id, signature: razorpay_signature }; const updatedPayment = await updatePaymentSuccess(razorpay_order_id, updatedPayload); if (!updatedPayment) { throw new ApiError("Payment record not found", 404); } await updateOrderPaymentStatus(updatedPayment.orderId, "success"); return { success: true, message: "Payment verified successfully" }; }), markPaymentFailed: protectedProcedure.input(external_exports.object({ merchantOrderId: external_exports.string() })).mutation(async ({ input, ctx }) => { const userId = ctx.user.userId; const { merchantOrderId } = input; const payment = await getPaymentByMerchantOrderId(merchantOrderId); if (!payment) { throw new ApiError("Payment not found", 404); } const order = await getOrderById(payment.orderId); if (!order || order.userId !== userId) { throw new ApiError("Payment does not belong to user", 403); } await markPaymentFailed(payment.id); return { success: true, message: "Payment marked as failed" }; }) }); } }); // src/trpc/apis/user-apis/apis/file-upload.ts var fileUploadRouter; var init_file_upload = __esm({ "src/trpc/apis/user-apis/apis/file-upload.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_s3_client(); init_api_error(); fileUploadRouter = router2({ generateUploadUrls: protectedProcedure.input(external_exports.object({ contextString: external_exports.enum(["review", "product_info", "notification", "complaint", "profile", "tags"]), mimeTypes: external_exports.array(external_exports.string()) })).mutation(async ({ input }) => { const { contextString, mimeTypes } = input; const uploadUrls = []; const keys = []; for (const mimeType of mimeTypes) { let folder; if (contextString === "review") { folder = "review-images"; } else if (contextString === "product_info") { folder = "product-images"; } else if (contextString === "notification") { folder = "notification-images"; } else if (contextString === "complaint") { folder = "complaint-images"; } else if (contextString === "profile") { folder = "profile-images"; } else if (contextString === "tags") { folder = "tags"; } else { folder = ""; } const extension = mimeType === "image/jpeg" ? ".jpg" : mimeType === "image/png" ? ".png" : mimeType === "image/gif" ? ".gif" : ".jpg"; const key = `${folder}/${Date.now()}${extension}`; try { const uploadUrl = await generateUploadUrl(key, mimeType); uploadUrls.push(uploadUrl); keys.push(key); } catch (error50) { console.error("Error generating upload URL:", error50); throw new ApiError("Failed to generate upload URL", 500); } } return { uploadUrls }; }) }); } }); // src/trpc/apis/user-apis/apis/tags.ts var tagsRouter; var init_tags = __esm({ "src/trpc/apis/user-apis/apis/tags.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_product_tag_store(); tagsRouter = router2({ getTagsByStore: publicProcedure.input(external_exports.object({ storeId: external_exports.number() })).query(async ({ input }) => { const { storeId } = input; const tags = await getTagsByStoreId(storeId); return { tags: tags.map((tag2) => ({ id: tag2.id, tagName: tag2.tagName, tagDescription: tag2.tagDescription, imageUrl: tag2.imageUrl, productIds: tag2.productIds })) }; }) }); } }); // src/trpc/apis/user-apis/apis/user-trpc-index.ts var userRouter3; var init_user_trpc_index = __esm({ "src/trpc/apis/user-apis/apis/user-trpc-index.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_address2(); init_auth4(); init_banners2(); init_cart2(); init_complaint4(); init_order4(); init_product4(); init_slots3(); init_user4(); init_coupon4(); init_payments3(); init_stores2(); init_file_upload(); init_tags(); userRouter3 = router2({ address: addressRouter, auth: authRouter, banner: bannerRouter, cart: cartRouter, complaint: complaintRouter2, order: orderRouter2, product: productRouter2, slots: slotsRouter, user: userRouter2, coupon: userCouponRouter, payment: paymentRouter, stores: storesRouter, fileUpload: fileUploadRouter, tags: tagsRouter }); } }); // src/trpc/router.ts var appRouter; var init_router5 = __esm({ "src/trpc/router.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_trpc_index(); init_zod(); init_admin_trpc_index(); init_user_trpc_index(); init_common_trpc_index(); appRouter = router2({ hello: publicProcedure.input(external_exports.object({ name: external_exports.string() })).query(({ input }) => { return { greeting: `Hello ${input.name}!` }; }), admin: adminRouter, user: userRouter3, common: commonApiRouter }); } }); // src/app.ts var app_exports = {}; __export(app_exports, { createApp: () => createApp }); var createApp; var init_app = __esm({ "src/app.ts"() { "use strict"; init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); init_dist(); init_cors(); init_logger(); init_dist2(); init_dbService(); init_main_router(); init_router5(); init_dist3(); init_webapi(); init_env_exporter(); createApp = /* @__PURE__ */ __name(() => { const app = new Hono2(); app.use(cors({ origin: "http://localhost:5174", allowMethods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], allowHeaders: ["Origin", "X-Requested-With", "Content-Type", "Accept", "Authorization"], credentials: true })); app.use(logger()); app.use("/api/trpc/*", trpcServer({ router: appRouter, createContext: async ({ req }) => { let user = null; let staffUser = null; const authHeader = req.headers.get("authorization"); if (authHeader?.startsWith("Bearer ")) { const token = authHeader.substring(7); try { const { payload } = await jwtVerify(token, getEncodedJwtSecret()); const decoded = payload; if (decoded.staffId) { const staff = await getStaffUserById(decoded.staffId); if (staff) { user = staffUser; staffUser = { id: staff.id, name: staff.name }; } } else { user = decoded; const suspended = await isUserSuspended(user.userId); if (suspended) { throw new TRPCError({ code: "FORBIDDEN", message: "Account suspended" }); } } } catch (err) { } } return { req, user, staffUser }; }, onError({ error: error50, path, type, ctx }) { console.error("\u{1F6A8} tRPC Error :", { path, type, code: error50.code, message: error50.message, userId: ctx?.user?.userId, stack: error50.stack }); } })); app.route("/api", main_router_default); app.onError((err, c2) => { console.error(err); let status = 500; let message2 = "Internal Server Error"; if (err instanceof TRPCError) { const trpcStatusMap = { BAD_REQUEST: 400, UNAUTHORIZED: 401, FORBIDDEN: 403, NOT_FOUND: 404, TIMEOUT: 408, CONFLICT: 409, PRECONDITION_FAILED: 412, PAYLOAD_TOO_LARGE: 413, METHOD_NOT_SUPPORTED: 405, UNPROCESSABLE_CONTENT: 422, TOO_MANY_REQUESTS: 429, INTERNAL_SERVER_ERROR: 500 }; status = trpcStatusMap[err.code] || 500; message2 = err.message; } else if (err.statusCode) { status = err.statusCode; message2 = err.message; } else if (err.status) { status = err.status; message2 = err.message; } else if (err.message) { message2 = err.message; } return c2.json({ message: message2 }, status); }); return app; }, "createApp"); } }); // .wrangler/tmp/bundle-GYbPT2/middleware-loader.entry.ts init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); // .wrangler/tmp/bundle-GYbPT2/middleware-insertion-facade.js init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); // worker.ts init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); var worker_default = { async fetch(request, env2, ctx) { ; globalThis.ENV = env2; const { createApp: createApp2 } = await Promise.resolve().then(() => (init_app(), app_exports)); const { initDb: initDb2 } = await Promise.resolve().then(() => (init_dbService(), dbService_exports)); if (env2.DB) { initDb2(env2.DB); } const app = createApp2(); return app.fetch(request, env2, ctx); } }; // ../../node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); var drainBody = /* @__PURE__ */ __name(async (request, env2, _ctx, middlewareCtx) => { try { return await middlewareCtx.next(request, env2); } finally { try { if (request.body !== null && !request.bodyUsed) { const reader = request.body.getReader(); while (!(await reader.read()).done) { } } } catch (e2) { console.error("Failed to drain the unused request body.", e2); } } }, "drainBody"); var middleware_ensure_req_body_drained_default = drainBody; // ../../node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); function reduceError(e2) { return { name: e2?.name, message: e2?.message ?? String(e2), stack: e2?.stack, cause: e2?.cause === void 0 ? void 0 : reduceError(e2.cause) }; } __name(reduceError, "reduceError"); var jsonError = /* @__PURE__ */ __name(async (request, env2, _ctx, middlewareCtx) => { try { return await middlewareCtx.next(request, env2); } catch (e2) { const error50 = reduceError(e2); return Response.json(error50, { status: 500, headers: { "MF-Experimental-Error-Stack": "true" } }); } }, "jsonError"); var middleware_miniflare3_json_error_default = jsonError; // .wrangler/tmp/bundle-GYbPT2/middleware-insertion-facade.js var __INTERNAL_WRANGLER_MIDDLEWARE__ = [ middleware_ensure_req_body_drained_default, middleware_miniflare3_json_error_default ]; var middleware_insertion_facade_default = worker_default; // ../../node_modules/wrangler/templates/middleware/common.ts init_strip_cf_connecting_ip_header(); init_modules_watch_stub(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process(); init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console(); init_performance2(); var __facade_middleware__ = []; function __facade_register__(...args) { __facade_middleware__.push(...args.flat()); } __name(__facade_register__, "__facade_register__"); function __facade_invokeChain__(request, env2, ctx, dispatch, middlewareChain) { const [head, ...tail] = middlewareChain; const middlewareCtx = { dispatch, next(newRequest, newEnv) { return __facade_invokeChain__(newRequest, newEnv, ctx, dispatch, tail); } }; return head(request, env2, ctx, middlewareCtx); } __name(__facade_invokeChain__, "__facade_invokeChain__"); function __facade_invoke__(request, env2, ctx, dispatch, finalMiddleware) { return __facade_invokeChain__(request, env2, ctx, dispatch, [ ...__facade_middleware__, finalMiddleware ]); } __name(__facade_invoke__, "__facade_invoke__"); // .wrangler/tmp/bundle-GYbPT2/middleware-loader.entry.ts var __Facade_ScheduledController__ = class { constructor(scheduledTime, cron, noRetry) { this.scheduledTime = scheduledTime; this.cron = cron; this.#noRetry = noRetry; } #noRetry; noRetry() { if (!(this instanceof __Facade_ScheduledController__)) { throw new TypeError("Illegal invocation"); } this.#noRetry(); } }; __name(__Facade_ScheduledController__, "__Facade_ScheduledController__"); function wrapExportedHandler(worker) { if (__INTERNAL_WRANGLER_MIDDLEWARE__ === void 0 || __INTERNAL_WRANGLER_MIDDLEWARE__.length === 0) { return worker; } for (const middleware2 of __INTERNAL_WRANGLER_MIDDLEWARE__) { __facade_register__(middleware2); } const fetchDispatcher = /* @__PURE__ */ __name(function(request, env2, ctx) { if (worker.fetch === void 0) { throw new Error("Handler does not export a fetch() function."); } return worker.fetch(request, env2, ctx); }, "fetchDispatcher"); return { ...worker, fetch(request, env2, ctx) { const dispatcher = /* @__PURE__ */ __name(function(type, init) { if (type === "scheduled" && worker.scheduled !== void 0) { const controller = new __Facade_ScheduledController__( Date.now(), init.cron ?? "", () => { } ); return worker.scheduled(controller, env2, ctx); } }, "dispatcher"); return __facade_invoke__(request, env2, ctx, dispatcher, fetchDispatcher); } }; } __name(wrapExportedHandler, "wrapExportedHandler"); function wrapWorkerEntrypoint(klass) { if (__INTERNAL_WRANGLER_MIDDLEWARE__ === void 0 || __INTERNAL_WRANGLER_MIDDLEWARE__.length === 0) { return klass; } for (const middleware2 of __INTERNAL_WRANGLER_MIDDLEWARE__) { __facade_register__(middleware2); } return class extends klass { #fetchDispatcher = (request, env2, ctx) => { this.env = env2; this.ctx = ctx; if (super.fetch === void 0) { throw new Error("Entrypoint class does not define a fetch() function."); } return super.fetch(request); }; #dispatcher = (type, init) => { if (type === "scheduled" && super.scheduled !== void 0) { const controller = new __Facade_ScheduledController__( Date.now(), init.cron ?? "", () => { } ); return super.scheduled(controller); } }; fetch(request) { return __facade_invoke__( request, this.env, this.ctx, this.#dispatcher, this.#fetchDispatcher ); } }; } __name(wrapWorkerEntrypoint, "wrapWorkerEntrypoint"); var WRAPPED_ENTRY; if (typeof middleware_insertion_facade_default === "object") { WRAPPED_ENTRY = wrapExportedHandler(middleware_insertion_facade_default); } else if (typeof middleware_insertion_facade_default === "function") { WRAPPED_ENTRY = wrapWorkerEntrypoint(middleware_insertion_facade_default); } var middleware_loader_entry_default = WRAPPED_ENTRY; export { __INTERNAL_WRANGLER_MIDDLEWARE__, middleware_loader_entry_default as default }; /*! Bundled license information: @trpc/server/dist/resolveResponse-CHqBlAgR.mjs: (* istanbul ignore if -- @preserve *) (*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) */ //# sourceMappingURL=worker.js.map