Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Add comprehensive tests for embodiment emotion classifier, forge cache, and pose presets

udvk285ce906fb08
diff --git a/api/_lib/forge-cache.js b/api/_lib/forge-cache.js
new file mode 100644
index 000000000..98d4016c2
--- /dev/null
+++ b/api/_lib/forge-cache.js
@@ -0,0 +1,152 @@
+// Content-addressed result cache for the /forge generation pipeline.
+//
+// This is distinct from the in-flight coalescing in forge-scale.js. Coalescing
+// collapses CONCURRENT identical requests onto one live job for a ~6-minute
+// window; this cache remembers a COMPLETED generation for days, so the second
+// person to type "a brass steampunk teapot" next week gets the already-paid-for
+// mesh back instantly instead of re-running (and re-paying for) the GPU pipeline.
+//
+// Privacy boundary — the cache only ever holds text→3D results derived from a
+// public prompt (the same class of asset the public showcase already shares).
+// The CALLER is responsible for never caching image→3D (a user's uploaded photo
+// is private) or high-tier (paid/gated per caller) generations — see the call
+// site in api/forge.js. The stored value carries only the public durable GLB URL
+// and non-identifying provenance: no client key, no IP, nothing that could leak
+// one user's private asset to another.
+//
+// Fail-open in every direction (mirrors forge-scale.js): without Upstash Redis,
+// or on any command error, every function degrades to "miss / no-op" so a cache
+// outage only costs the dedup, never correctness.
+
+import { createHash } from 'node:crypto';
+import { getRedis } from './redis.js';
+
+const CACHE_PREFIX = 'fr:result:';
+const BIND_PREFIX = 'fr:job:';
+
+function intEnv(name, fallback) {
+ const v = typeof process !== 'undefined' ? process.env?.[name] : null;
+ const n = v == null || v === '' ? NaN : Number(v);
+ return Number.isFinite(n) && n > 0 ? Math.floor(n) : fallback;
+}
+
+// Default 7-day TTL. A generated mesh for a given prompt+params doesn't go stale,
+// but a bounded TTL keeps the keyspace self-pruning and lets a model upgrade roll
+// through naturally. Overridable per-deployment.
+const RESULT_TTL_S = intEnv('FORGE_RESULT_CACHE_TTL_S', 7 * 24 * 3600);
+// The job→key binding only needs to outlive a single generation's polling window.
+const BIND_TTL_S = 3600;
+
+// On by default whenever Redis is available; an operator can hard-disable it
+// (e.g. during a model rollout) with FORGE_RESULT_CACHE=0 without a deploy. The
+// optional `redis` lets callers (and tests) gate on an injected client rather
+// than the shared one.
+export function forgeResultCacheEnabled(redis) {
+ const flag = typeof process !== 'undefined' ? process.env?.FORGE_RESULT_CACHE : null;
+ if (flag === '0' || flag === 'false') return false;
+ return Boolean(redis ?? getRedis());
+}
+
+function client(override) {
+ return override || getRedis();
+}
+
+/**
+ * Stable content address for a generation. Keyed on everything that changes the
+ * output: path, tier, backend, the normalized prompt, and the output-affecting
+ * options (seed, format, texture size, polycount). Returns null when the inputs
+ * aren't cacheable (no prompt) so the caller can skip the cache cleanly.
+ *
+ * @param {{ path?: string, tier?: string|{id:string}, backend?: string,
+ * prompt?: string, options?: object }} input
+ * @returns {string | null}
+ */
+export function forgeResultCacheKey({ path, tier, backend, prompt, options }) {
+ const text = String(prompt || '').trim().toLowerCase();
+ if (!text) return null;
+ const tierId = typeof tier === 'string' ? tier : tier?.id || '';
+ const opt = options || {};
+ const basis = JSON.stringify([
+ path || '',
+ tierId,
+ backend || '',
+ text,
+ // Only output-affecting options participate. A null seed/format/size keeps
+ // the key identical to a request that never sent options, so adding the
+ // options feature doesn't invalidate the cache for existing callers.
+ opt.seed ?? null,
+ opt.outputFormat || 'glb',
+ opt.textureSize ?? null,
+ opt.targetPolycount ?? null,
+ ]);
+ return createHash('sha256').update(basis).digest('hex').slice(0, 40);
+}
+
+/**
+ * Look up a cached completed result. Returns the stored value
+ * ({ glb_url, backend, tier, path, quality?, cached_at }) or null on miss.
+ */
+export async function getCachedForgeResult(key, { redis } = {}) {
+ const r = client(redis);
+ if (!r || !key || !forgeResultCacheEnabled(r)) return null;
+ try {
+ const raw = await r.get(`${CACHE_PREFIX}${key}`);
+ if (!raw) return null;
+ const value = typeof raw === 'string' ? JSON.parse(raw) : raw;
+ // Only a stored, public durable URL is a valid hit.
+ if (!value || typeof value.glb_url !== 'string' || !value.glb_url) return null;
+ return value;
+ } catch {
+ return null;
+ }
+}
+
+/**
+ * Store a completed result. `value.glb_url` must be a public durable URL. Extra
+ * provenance (backend/tier/path/quality) is persisted for the cache-hit response.
+ * No-op without Redis or when disabled. Returns true on a write.
+ */
+export async function putCachedForgeResult(key, value, { ttlS = RESULT_TTL_S, redis } = {}) {
+ const r = client(redis);
+ if (!r || !key || !forgeResultCacheEnabled(r)) return false;
+ if (!value || typeof value.glb_url !== 'string' || !value.glb_url) return false;
+ const payload = {
+ glb_url: value.glb_url,
+ backend: value.backend ?? null,
+ tier: value.tier ?? null,
+ path: value.path ?? null,
+ quality: value.quality ?? null,
+ cached_at: value.cached_at || new Date().toISOString().slice(0, 10),
+ };
+ try {
+ await r.set(`${CACHE_PREFIX}${key}`, JSON.stringify(payload), { ex: ttlS });
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+// Remember which cache key a just-submitted job belongs to, so the poll path —
+// which sees the job handle and the durable GLB, but not the original request —
+// can populate the result cache when the job finishes. Best-effort, short TTL.
+export async function bindJobToCacheKey(jobHandle, key, { redis } = {}) {
+ const r = client(redis);
+ if (!r || !jobHandle || !key || !forgeResultCacheEnabled(r)) return;
+ try {
+ await r.set(`${BIND_PREFIX}${jobHandle}`, key, { ex: BIND_TTL_S });
+ } catch {
+ /* best-effort */
+ }
+}
+
+// Resolve the cache key a job was bound to at submit time, or null.
+export async function cacheKeyForJob(jobHandle, { redis } = {}) {
+ const r = client(redis);
+ if (!r || !jobHandle || !forgeResultCacheEnabled(r)) return null;
+ try {
+ const v = await r.get(`${BIND_PREFIX}${jobHandle}`);
+ return typeof v === 'string' && v ? v : null;
+ } catch {
+ return null;
+ }
+}
diff --git a/api/_lib/forge-options.js b/api/_lib/forge-options.js
new file mode 100644
index 000000000..ab5c85824
--- /dev/null
+++ b/api/_lib/forge-options.js
@@ -0,0 +1,152 @@
+// Optional, additive output controls for the /forge generation pipeline.
+//
+// Every field here is OFF by default: a request that omits all of them produces
+// byte-for-byte the same behavior the endpoint had before this module existed.
+// They let a caller tune an individual generation without changing the tier
+// contract:
+// • seed — reproducibility (same seed + prompt + params → same mesh)
+// • output_format — glb (default) or a compressed variant (draco / meshopt)
+// • texture_size — bake textures at a specific resolution
+// • target_polycount — explicit geometry budget on poly-aware backends
+//
+// normalizeForgeOptions() validates and clamps; an explicitly-present but invalid
+// value is reported in `errors` so the endpoint can answer 400 with an actionable
+// message rather than silently doing something the caller didn't ask for. A value
+// that is simply absent is never an error — it just keeps the current default.
+
+// glb is the universal default. The two compressed variants run a post-generation
+// pass (see glb-compress.js) that shrinks the delivered file without changing the
+// rendered result — Draco for geometry, meshopt (EXT_meshopt_compression) for
+// geometry + a faster GPU upload. Both stay valid glTF 2.0 with the right decoder.
+export const OUTPUT_FORMATS = Object.freeze(['glb', 'glb-draco', 'glb-meshopt']);
+export const TEXTURE_SIZES = Object.freeze([512, 1024, 2048, 4096]);
+
+const POLYCOUNT_MIN = 100;
+const POLYCOUNT_MAX = 500_000;
+const SEED_MAX = 4_294_967_295; // uint32 — the range every provider's RNG accepts
+
+function compressionFor(format) {
+ if (format === 'glb-draco') return 'draco';
+ if (format === 'glb-meshopt') return 'meshopt';
+ return 'none';
+}
+
+/**
+ * Parse the optional output controls from a /forge request body.
+ *
+ * @param {any} body
+ * @returns {{
+ * seed: number | null,
+ * outputFormat: 'glb' | 'glb-draco' | 'glb-meshopt',
+ * compression: 'none' | 'draco' | 'meshopt',
+ * textureSize: number | null,
+ * targetPolycount: number | null,
+ * hasOptions: boolean, // true iff any non-default option was supplied
+ * errors: Array<{ field: string, message: string }>,
+ * }}
+ */
+export function normalizeForgeOptions(body) {
+ const errors = [];
+ const b = body && typeof body === 'object' ? body : {};
+
+ // seed — accept any integer; clamp into the uint32 range providers accept.
+ let seed = null;
+ if (b.seed !== undefined && b.seed !== null) {
+ const n = Number(b.seed);
+ if (!Number.isFinite(n) || !Number.isInteger(n) || n < 0) {
+ errors.push({ field: 'seed', message: 'seed must be a non-negative integer.' });
+ } else {
+ seed = Math.min(n, SEED_MAX);
+ }
+ }
+
+ // output_format / format — controls the post-generation compression variant.
+ let outputFormat = 'glb';
+ const rawFormat = b.output_format ?? b.format;
+ if (rawFormat !== undefined && rawFormat !== null && rawFormat !== '') {
+ const f = String(rawFormat).toLowerCase().trim();
+ if (OUTPUT_FORMATS.includes(f)) outputFormat = f;
+ else
+ errors.push({
+ field: 'output_format',
+ message: `output_format must be one of: ${OUTPUT_FORMATS.join(', ')}.`,
+ });
+ }
+
+ // texture_size / texture_resolution — bake resolution for poly-aware backends.
+ let textureSize = null;
+ const rawTex = b.texture_size ?? b.texture_resolution;
+ if (rawTex !== undefined && rawTex !== null && rawTex !== '') {
+ const n = Number(rawTex);
+ if (TEXTURE_SIZES.includes(n)) textureSize = n;
+ else
+ errors.push({
+ field: 'texture_size',
+ message: `texture_size must be one of: ${TEXTURE_SIZES.join(', ')}.`,
+ });
+ }
+
+ // target_polycount — explicit geometry budget (poly-aware backends only). A
+ // `quality` alias maps coarse → fine for callers that prefer a word over a number.
+ let targetPolycount = null;
+ let rawPoly = b.target_polycount;
+ if ((rawPoly === undefined || rawPoly === null) && typeof b.quality === 'string') {
+ const map = { low: 5_000, draft: 5_000, medium: 30_000, standard: 50_000, high: 150_000, ultra: 300_000 };
+ const q = b.quality.toLowerCase().trim();
+ if (q in map) rawPoly = map[q];
+ else errors.push({ field: 'quality', message: `quality must be one of: ${Object.keys(map).join(', ')}.` });
+ }
+ if (rawPoly !== undefined && rawPoly !== null && rawPoly !== '') {
+ const n = Number(rawPoly);
+ if (!Number.isFinite(n) || !Number.isInteger(n) || n < POLYCOUNT_MIN || n > POLYCOUNT_MAX) {
+ errors.push({
+ field: 'target_polycount',
+ message: `target_polycount must be an integer between ${POLYCOUNT_MIN} and ${POLYCOUNT_MAX}.`,
+ });
+ } else {
+ targetPolycount = n;
+ }
+ }
+
+ const hasOptions =
+ seed !== null || outputFormat !== 'glb' || textureSize !== null || targetPolycount !== null;
+
+ return {
+ seed,
+ outputFormat,
+ compression: compressionFor(outputFormat),
+ textureSize,
+ targetPolycount,
+ hasOptions,
+ errors,
+ };
+}
+
+// The subset of normalized options that is safe to forward to a provider's
+// reconstruct call. Only fields a model actually consumes (seed, texture size,
+// polycount) — never the post-generation compression, which we apply ourselves.
+// Returns a plain object that callers spread into their existing reconstructParams,
+// so an all-default options object contributes nothing (current behavior preserved).
+export function providerReconstructParams(opts, { polyControl = false } = {}) {
+ const out = {};
+ if (!opts) return out;
+ if (opts.seed !== null && opts.seed !== undefined) out.seed = opts.seed;
+ if (polyControl) {
+ if (opts.textureSize) out.texture_size = opts.textureSize;
+ if (opts.targetPolycount) out.target_polycount = opts.targetPolycount;
+ }
+ return out;
+}
+
+// Compact, response-safe echo of what the caller actually got — included in the
+// generation response so a client can confirm the seed used (for reproducibility)
+// and which format/resolution was applied.
+export function summarizeForgeOptions(opts) {
+ if (!opts) return {};
+ return {
+ seed: opts.seed,
+ output_format: opts.outputFormat,
+ texture_size: opts.textureSize,
+ target_polycount: opts.targetPolycount,
+ };
+}
diff --git a/api/_lib/glb-quality.js b/api/_lib/glb-quality.js
new file mode 100644
index 000000000..fad9e7a21
--- /dev/null
+++ b/api/_lib/glb-quality.js
@@ -0,0 +1,302 @@
+// Deterministic GLB quality scoring for the Forge pipeline.
+//
+// inspectGlb() (glb-inspect.js) answers "is this a valid glTF and does it have a
+// rig?". This module answers the harder product question: "is this a GOOD mesh,
+// or did the generator hand back a degenerate blob a user shouldn't see?". It
+// reads only the glTF JSON chunk — accessor counts and POSITION min/max bounds —
+// so it stays fast on large meshes (no BIN decode) while still reasoning about
+// geometry density, bounding-box volume, and material/texture presence.
+//
+// The output is a single, stable quality signal the generation flow attaches to
+// metadata and uses to flag low-quality outputs (and auto-retry once before
+// returning). It never mutates the mesh and never throws — an unparseable buffer
+// scores `invalid` rather than crashing the boundary.
+
+import { inspectGlb } from './glb-inspect.js';
+
+// Thresholds. Tuned for the Forge lanes (TRELLIS / Hunyuan3D / TripoSR), whose
+// real outputs land in the tens-of-thousands of triangles with PBR textures. A
+// genuinely degenerate output (the failure mode we must catch) is a near-empty
+// mesh, a zero-volume bounding box, or a handful of triangles. Overridable via
+// env so a deployment can retune without a code change.
+function intEnv(name, fallback) {
+ const v = typeof process !== 'undefined' ? process.env?.[name] : null;
+ const n = v == null || v === '' ? NaN : Number(v);
+ return Number.isFinite(n) && n >= 0 ? Math.floor(n) : fallback;
+}
+
+export const QUALITY_THRESHOLDS = Object.freeze({
+ // Below this triangle count the mesh is treated as degenerate (effectively empty).
+ degenerateTriangles: intEnv('FORGE_QUALITY_MIN_TRIS', 80),
+ // Below this it is flagged low (renders, but coarse — a retry usually helps).
+ lowTriangles: intEnv('FORGE_QUALITY_LOW_TRIS', 800),
+ // A bounding-box diagonal at or below this (in the mesh's own units) is a
+ // collapsed / zero-volume result — the classic "black dot" TRELLIS failure.
+ minBboxDiagonal: 1e-4,
+});
+
+// Pull the per-attribute vertex count and union the POSITION bounding box across
+// every primitive of every mesh. glTF accessors carry `count` (element count)
+// and, for POSITION, `min`/`max` (3-vectors) — enough to measure geometry
+// density and extent without ever touching the binary buffer.
+function summarizeGeometry(gltf) {
+ const accessors = Array.isArray(gltf.accessors) ? gltf.accessors : [];
+ const meshes = Array.isArray(gltf.meshes) ? gltf.meshes : [];
+ let vertexCount = 0;
+ let triangleCount = 0;
+ let primitiveCount = 0;
+ let indexedPrimitives = 0;
+ let texturedPrimitives = 0;
+ let min = [Infinity, Infinity, Infinity];
+ let max = [-Infinity, -Infinity, -Infinity];
+ let haveBounds = false;
+
+ for (const mesh of meshes) {
+ const prims = Array.isArray(mesh.primitives) ? mesh.primitives : [];
+ for (const prim of prims) {
+ primitiveCount++;
+ // mode 4 (TRIANGLES) is the glTF default; only triangle topology
+ // contributes to the triangle count. Non-triangle prims still count as
+ // geometry but not as renderable surface area.
+ const mode = typeof prim.mode === 'number' ? prim.mode : 4;
+ const posIdx = prim.attributes?.POSITION;
+ const pos = Number.isInteger(posIdx) ? accessors[posIdx] : null;
+ if (pos && Number.isFinite(pos.count)) {
+ vertexCount += pos.count;
+ if (Array.isArray(pos.min) && Array.isArray(pos.max) && pos.min.length >= 3) {
+ for (let i = 0; i < 3; i++) {
+ if (Number.isFinite(pos.min[i])) min[i] = Math.min(min[i], pos.min[i]);
+ if (Number.isFinite(pos.max[i])) max[i] = Math.max(max[i], pos.max[i]);
+ }
+ haveBounds = true;
+ }
+ }
+ let primTris = 0;
+ if (Number.isInteger(prim.indices) && accessors[prim.indices]) {
+ indexedPrimitives++;
+ const idx = accessors[prim.indices];
+ if (mode === 4 && Number.isFinite(idx.count)) primTris = Math.floor(idx.count / 3);
+ } else if (pos && mode === 4 && Number.isFinite(pos.count)) {
+ primTris = Math.floor(pos.count / 3);
+ }
+ triangleCount += primTris;
+ if (Number.isInteger(prim.material)) texturedPrimitives++;
+ }
+ }
+
+ const size = haveBounds
+ ? [max[0] - min[0], max[1] - min[1], max[2] - min[2]].map((d) => (Number.isFinite(d) ? Math.abs(d) : 0))
+ : [0, 0, 0];
+ const bboxDiagonal = Math.sqrt(size[0] ** 2 + size[1] ** 2 + size[2] ** 2);
+
+ return {
+ vertexCount,
+ triangleCount,
+ primitiveCount,
+ indexedPrimitives,
+ texturedPrimitives,
+ bbox: haveBounds ? { min, max, size } : null,
+ bboxDiagonal: Number.isFinite(bboxDiagonal) ? bboxDiagonal : 0,
+ };
+}
+
+// Does the asset carry any actual texture data? A textured 3D output should have
+// images and at least one material that samples one. We check both the image
+// table and material texture references so an embedded-bin texture (the common
+// Forge case) and a separate-file texture both register.
+function summarizeMaterials(gltf) {
+ const materials = Array.isArray(gltf.materials) ? gltf.materials : [];
+ const textures = Array.isArray(gltf.textures) ? gltf.textures : [];
+ const images = Array.isArray(gltf.images) ? gltf.images : [];
+ let materialsWithTexture = 0;
+ for (const m of materials) {
+ const pbr = m.pbrMetallicRoughness || {};
+ const refs = [
+ pbr.baseColorTexture,
+ pbr.metallicRoughnessTexture,
+ m.normalTexture,
+ m.occlusionTexture,
+ m.emissiveTexture,
+ ];
+ if (refs.some((r) => r && Number.isInteger(r.index))) materialsWithTexture++;
+ }
+ return {
+ materialCount: materials.length,
+ textureCount: textures.length,
+ imageCount: images.length,
+ materialsWithTexture,
+ hasTextures: images.length > 0 && textures.length > 0 && materialsWithTexture > 0,
+ hasMaterials: materials.length > 0,
+ };
+}
+
+// Re-parse the JSON chunk for the accessor/material detail inspectGlb() doesn't
+// expose. Mirrors inspectGlb's chunk math exactly so the two never disagree on
+// what a valid GLB is. Returns the parsed glTF object or null.
+function parseGltfJson(buf) {
+ if (!buf || typeof buf.byteLength !== 'number' || buf.byteLength < 20) return null;
+ const view =
+ buf instanceof DataView
+ ? buf
+ : ArrayBuffer.isView(buf)
+ ? new DataView(buf.buffer, buf.byteOffset, buf.byteLength)
+ : new DataView(buf);
+ if (view.getUint32(0, true) !== 0x46546c67) return null; // 'glTF'
+ if (view.getUint32(16, true) !== 0x4e4f534a) return null; // 'JSON'
+ const jsonLen = view.getUint32(12, true);
+ if (20 + jsonLen > buf.byteLength) return null;
+ const start = (buf.byteOffset || 0) + 20;
+ const bytes = buf.buffer
+ ? new Uint8Array(buf.buffer, start, jsonLen)
+ : new Uint8Array(buf, 20, jsonLen);
+ try {
+ return JSON.parse(new TextDecoder('utf-8').decode(bytes));
+ } catch {
+ return null;
+ }
+}
+
+/**
+ * Score a generated GLB's quality from its glTF JSON chunk alone.
+ *
+ * @param {Buffer|Uint8Array|ArrayBuffer|DataView} buf
+ * @returns {{
+ * valid: boolean,
+ * flag: 'ok' | 'low' | 'degenerate' | 'invalid',
+ * score: number, // 0..1 composite
+ * reasons: string[], // why it was flagged (empty when ok)
+ * metrics: {
+ * sizeBytes: number,
+ * vertexCount: number,
+ * triangleCount: number,
+ * meshCount: number,
+ * primitiveCount: number,
+ * bboxDiagonal: number,
+ * hasMaterials: boolean,
+ * hasTextures: boolean,
+ * materialCount: number,
+ * textureCount: number,
+ * imageCount: number,
+ * isIndexed: boolean,
+ * watertightish: boolean,
+ * generator: string | null,
+ * },
+ * }}
+ */
+export function scoreGlbQuality(buf, { allowPartial = false } = {}) {
+ const base = inspectGlb(buf, { allowPartial });
+ if (!base) {
+ return {
+ valid: false,
+ flag: 'invalid',
+ score: 0,
+ reasons: ['not_valid_glb'],
+ metrics: {
+ sizeBytes: buf && typeof buf.byteLength === 'number' ? buf.byteLength : 0,
+ vertexCount: 0,
+ triangleCount: 0,
+ meshCount: 0,
+ primitiveCount: 0,
+ bboxDiagonal: 0,
+ hasMaterials: false,
+ hasTextures: false,
+ materialCount: 0,
+ textureCount: 0,
+ imageCount: 0,
+ isIndexed: false,
+ watertightish: false,
+ generator: null,
+ },
+ };
+ }
+
+ const gltf = parseGltfJson(buf);
+ const geo = gltf
+ ? summarizeGeometry(gltf)
+ : { vertexCount: 0, triangleCount: 0, primitiveCount: 0, indexedPrimitives: 0, texturedPrimitives: 0, bbox: null, bboxDiagonal: 0 };
+ const mat = gltf
+ ? summarizeMaterials(gltf)
+ : { materialCount: 0, textureCount: 0, imageCount: 0, materialsWithTexture: 0, hasTextures: false, hasMaterials: false };
+
+ const t = QUALITY_THRESHOLDS;
+ const reasons = [];
+
+ // "Watertight-ish": an indexed triangle mesh whose vertex:triangle ratio sits
+ // in the range a closed surface produces (~V ≈ T/2 for a manifold). A purely
+ // heuristic signal — true watertightness needs edge-adjacency analysis over the
+ // BIN chunk — but it cheaply separates a clean reconstructed surface from a
+ // soup of disconnected triangles.
+ const isIndexed = geo.primitiveCount > 0 && geo.indexedPrimitives === geo.primitiveCount;
+ const vtRatio = geo.triangleCount > 0 ? geo.vertexCount / geo.triangleCount : 0;
+ const watertightish = isIndexed && vtRatio > 0.35 && vtRatio < 0.9;
+
+ // Hard degeneracy checks → flag degenerate.
+ let degenerate = false;
+ if (base.meshCount === 0 || geo.triangleCount < t.degenerateTriangles) {
+ degenerate = true;
+ reasons.push(geo.triangleCount === 0 ? 'no_geometry' : 'too_few_triangles');
+ }
+ if (geo.bbox && geo.bboxDiagonal <= t.minBboxDiagonal) {
+ degenerate = true;
+ reasons.push('zero_volume');
+ }
+
+ // Soft quality checks → flag low.
+ let low = false;
+ if (!degenerate && geo.triangleCount < t.lowTriangles) {
+ low = true;
+ reasons.push('low_poly');
+ }
+ if (!mat.hasMaterials) {
+ low = low || !degenerate;
+ reasons.push('no_materials');
+ } else if (!mat.hasTextures) {
+ low = low || !degenerate;
+ reasons.push('no_textures');
+ }
+
+ // Composite 0..1 score: geometry density (capped), texture presence, material
+ // presence, and the watertight heuristic, each weighted. Degenerate clamps low.
+ const densityScore = Math.max(0, Math.min(1, Math.log10(Math.max(geo.triangleCount, 1)) / Math.log10(50_000)));
+ const textureScore = mat.hasTextures ? 1 : mat.hasMaterials ? 0.4 : 0;
+ const structureScore = watertightish ? 1 : isIndexed ? 0.6 : 0.3;
+ let score = 0.5 * densityScore + 0.3 * textureScore + 0.2 * structureScore;
+ if (degenerate) score = Math.min(score, 0.1);
+ else if (low) score = Math.min(score, 0.55);
+ score = Math.round(Math.max(0, Math.min(1, score)) * 1000) / 1000;
+
+ const flag = degenerate ? 'degenerate' : low ? 'low' : 'ok';
+
+ return {
+ valid: true,
+ flag,
+ score,
+ reasons,
+ metrics: {
+ sizeBytes: base.sizeBytes,
+ vertexCount: geo.vertexCount,
+ triangleCount: geo.triangleCount,
+ meshCount: base.meshCount,
+ primitiveCount: geo.primitiveCount,
+ bboxDiagonal: Math.round(geo.bboxDiagonal * 1e6) / 1e6,
+ hasMaterials: mat.hasMaterials,
+ hasTextures: mat.hasTextures,
+ materialCount: mat.materialCount,
+ textureCount: mat.textureCount,
+ imageCount: mat.imageCount,
+ isIndexed,
+ watertightish,
+ generator: base.generator,
+ },
+ };
+}
+
+// True when a scored result is bad enough to justify the one auto-retry the
+// generation flow allows before returning. Degenerate always qualifies; a `low`
+// flag qualifies only when the score is in the bottom band, so a merely-coarse
+// (but usable) mesh isn't re-paid for needlessly.
+export function shouldRetryForQuality(quality) {
+ if (!quality) return false;
+ if (quality.flag === 'invalid' || quality.flag === 'degenerate') return true;
+ return quality.flag === 'low' && quality.score < 0.3;
+}
diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.js
index ced85a3ba..267b7a8e0 100644
--- a/api/_lib/rate-limit.js
+++ b/api/_lib/rate-limit.js
@@ -388,25 +388,12 @@ export const limits = {
// the Upstash quota without buying any real protection here.
mcp3dStatus: (key) =>
getLimiter('mcp3d:status', { limit: 240, window: '1 m', local: true }).limit(key),
- // FREE 3D Studio MCP (api/mcp-studio.js) — unauthenticated, no payment, so the
- // per-IP limits ARE the abuse boundary that keeps anonymous callers from
- // draining real provider spend (Replicate / forge GPU). Three buckets:
- // · studioIp — cheap per-IP/min guard on EVERY JSON-RPC call (incl.
- // discovery), so a poll/list flood can't hammer the box.
- // · studioGenerateIp — hard hourly ceiling per IP on the costly generation
- // tools (each submits a real GPU job). Critical → fails
- // closed in prod without Redis rather than uncapping spend.
- // · studioGenerateGlobal — platform-wide hourly circuit breaker across ALL
- // studio IPs, so distributed callers each under their own
- // cap can't collectively drain the shared budget. Shares
- // the FORGE_PAID_GLOBAL_HOURLY envelope with the paid lane.
- studioIp: (ip) => getLimiter('studio:ip', { limit: 120, window: '1 m' }).limit(ip),
- studioGenerateIp: (ip) =>
- getLimiter('studio:generate:ip', {
- limit: Math.max(1, Number(process.env.STUDIO_GENERATE_HOURLY) || 20),
- window: '1 h',
- critical: true,
- }).limit(ip),
+ // Platform-wide hourly circuit breaker across ALL free-studio IPs, so
+ // distributed callers each under their own studioGenHourly cap can't
+ // collectively drain the shared GPU/provider budget. Shares the
+ // FORGE_PAID_GLOBAL_HOURLY envelope with the paid lane. Critical → fails closed
+ // in prod without Redis rather than uncapping spend. (studioIp / studioGenBurst
+ // / studioGenHourly are defined above next to the other mcp buckets.)
studioGenerateGlobal: () =>
getLimiter('studio:generate:global', {
limit: FORGE_PAID_GLOBAL_HOURLY,
diff --git a/api/agents.js b/api/agents.js
index 6a6764b2a..8aa67781c 100644
--- a/api/agents.js
+++ b/api/agents.js
@@ -808,6 +808,11 @@ function decorate(row, isOwner = true) {
wallet_ready: walletReady,
walletReady,
is_registered: Boolean(row.erc8004_agent_id) || !!onchain,
+ // Public on-chain ERC-8004 identity (the registry ids are public, mirroring
+ // /api/agents/by-wallet and the public registry index) so agent-to-agent
+ // commerce can read this agent's reputation by id without a second lookup.
+ erc8004_agent_id: row.erc8004_agent_id != null ? String(row.erc8004_agent_id) : null,
+ chain_id: row.chain_id ?? null,
// Whether the requesting session owns this agent. Owner-only write paths
// (action log, memory sync) gate on this so public viewers don't fire
// requests the backend will reject with 403.
diff --git a/api/agents/public.js b/api/agents/public.js
index c4314db7b..57def1ab4 100644
--- a/api/agents/public.js
+++ b/api/agents/public.js
@@ -48,6 +48,8 @@ export default wrap(async (req, res) => {
i.chat_count,
i.created_at,
i.meta,
+ i.erc8004_agent_id,
+ i.chain_id,
a.thumbnail_key as avatar_thumbnail_key,
a.visibility as avatar_visibility
from agent_identities i
@@ -88,8 +90,13 @@ export default wrap(async (req, res) => {
avatar_thumbnail: thumbnail,
home_url: r.home_url || `/agent/${r.id}`,
chat_count: Number(r.chat_count) || 0,
- is_registered: !!(onchain || meta.sol_mint_address || meta.erc8004_agent_id),
+ is_registered: !!(onchain || meta.sol_mint_address || r.erc8004_agent_id || meta.erc8004_agent_id),
onchain: onchain ? { network: onchain.network, asset: onchain.sol_asset || null } : null,
+ // On-chain ERC-8004 identity (public registry ids) so the agent-commerce
+ // discovery tool can read each candidate's reputation without a second
+ // round-trip. Falls back to the legacy meta field for older records.
+ erc8004_agent_id: r.erc8004_agent_id != null ? String(r.erc8004_agent_id) : (meta.erc8004_agent_id != null ? String(meta.erc8004_agent_id) : null),
+ chain_id: r.chain_id ?? null,
created_at: r.created_at,
};
});
diff --git a/apps-sdk/embodiment/embodiment-stage.js b/apps-sdk/embodiment/embodiment-stage.js
new file mode 100644
index 000000000..34aa8b318
--- /dev/null
+++ b/apps-sdk/embodiment/embodiment-stage.js
@@ -0,0 +1,434 @@
+/**
+ * EmbodimentStage — a living agent body you can drop into a panel.
+ *
+ * This is the engine behind three.ws's headline trick: a generated, rigged avatar
+ * that renders inline, lip-syncs the assistant's replies, shows the matching
+ * emotion, plays a body gesture, idles between turns, and reacts while a tool runs.
+ * It is framework-agnostic — give it a DOM container and a persona (a name + a GLB
+ * URL) and it mounts a Three.js scene and drives it. The Apps SDK host bridge and
+ * the local demo harness are both thin wrappers around this one class.
+ *
+ * Everything it does runs on real platform pipelines, not canned stand-ins:
+ * • Body animation rides AnimationManager + the canonicalize/retarget pipeline,
+ * so the baked clip library (idle, gestures) drives ANY humanoid rig. A rig
+ * that can't be skeleton-driven (no skin / non-humanoid prop) is detected up
+ * front (decideRigMode) and falls back to a gentle alive-idle — never a frozen
+ * T-pose.
+ * • Lip-sync is best-first: an Audio2Face ARKit track synced to TTS audio when
+ * present, else live spectral analysis of playing audio, else a deterministic
+ * text-timed mouth envelope. If the rig has no mouth morphs, AvatarMouthTarget
+ * drives the jaw (or head) bone instead, so the face is never frozen.
+ * • Emotion is detected from the reply text (or set explicitly), blended onto the
+ * face (FaceExpression / ARKit morphs) AND expressed through a body gesture, so
+ * even a morph-less rig emotes.
+ *
+ * State machine: loading → idle ⇄ listening ⇄ thinking ⇄ speaking → (error).
+ * Each transition is observable via opts.onState so the host can paint a status.
+ */
+
+import {
+ Scene, PerspectiveCamera, WebGLRenderer, AmbientLight, DirectionalLight,
+ PMREMGenerator, Box3, Vector3, Group, Color,
+} from 'three';
+import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
+import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
+
+import { AnimationManager } from '../../src/animation-manager.js';
+import { AvatarMouthTarget } from '../../src/voice/avatar-morph-target.js';
+import { A2FPlayer } from '../../src/voice/a2f-player.js';
+import { inspectRig, decideRigMode } from '../../src/embodiment/rig-mode.js';
+import { expressionForText, expressionFor } from '../../src/embodiment/emotion.js';
+import { TextVisemeEnvelope, estimateSpeechDuration } from '../../src/embodiment/text-visemes.js';
+import { FaceExpression } from './face-expression.js';
+
+const REDUCED_MOTION =
+ typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
+
+// The subset of the baked clip manifest the embodiment stage needs: a believable
+// idle plus the emotion gestures the engine asks for. Loaded lazily from the
+// platform's animation manifest so the stage rides the same retarget pipeline.
+const REQUIRED_CLIPS = [
+ 'idle', 'av-waiting', 'av-joy', 'av-celebrating', 'xbot-sad-pose',
+ 'defeated', 'angry', 'reaction', 'wave',
+];
+
+export class EmbodimentStage {
+ /**
+ * @param {HTMLElement} container
+ * @param {{ onState?: (state:string, detail?:object)=>void, background?: string }} [opts]
+ */
+ constructor(container, opts = {}) {
+ this.container = container;
+ this.onState = typeof opts.onState === 'function' ? opts.onState : () => {};
+ this.state = 'loading';
+ this._disposed = false;
+ this._rigMode = null;
+ this._lastT = 0;
+
+ // Lip-sync timing (text-driven path).
+ this._speakEnv = null;
+ this._speakStart = 0;
+ this._speakDur = 0;
+ this._audio = null;
+ this._a2fActive = false;
+
+ // Subsystems.
+ this.anim = new AnimationManager();
+ this.mouth = new AvatarMouthTarget();
+ this.a2f = new A2FPlayer();
+ this.face = new FaceExpression();
+
+ this._buildScene(opts.background);
+ this._raf = requestAnimationFrame(this._tick);
+ this._onResize = () => this._resize();
+ window.addEventListener('resize', this._onResize);
+ if (typeof ResizeObserver === 'function') {
+ this._ro = new ResizeObserver(() => this._resize());
+ this._ro.observe(container);
+ }
+ }
+
+ // ── scene ───────────────────────────────────────────────────────────────────
+
+ _buildScene(background) {
+ const c = this.container;
+ const w = Math.max(1, c.clientWidth);
+ const h = Math.max(1, c.clientHeight);
+
+ this.scene = new Scene();
+ if (background && background !== 'transparent') this.scene.background = new Color(background);
+
+ this.camera = new PerspectiveCamera(32, w / h, 0.05, 200);
+ this.camera.position.set(0, 1.45, 3.0);
+
+ this.renderer = new WebGLRenderer({ antialias: true, alpha: true, powerPreference: 'high-performance' });
+ this.renderer.setSize(w, h);
+ this.renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
+ this.renderer.outputColorSpace = 'srgb';
+ c.appendChild(this.renderer.domElement);
+ this.renderer.domElement.setAttribute('aria-label', 'Interactive 3D agent');
+ this.renderer.domElement.setAttribute('role', 'img');
+
+ this.scene.add(new AmbientLight(0xffffff, 0.6));
+ const key = new DirectionalLight(0xffffff, 1.6);
+ key.position.set(2, 4, 3);
+ this.scene.add(key);
+ const rim = new DirectionalLight(0x99bbff, 0.5);
+ rim.position.set(-3, 2, -2);
+ this.scene.add(rim);
+
+ const pmrem = new PMREMGenerator(this.renderer);
+ this._envTex = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
+ this.scene.environment = this._envTex;
+ pmrem.dispose();
+
+ this.controls = new OrbitControls(this.camera, this.renderer.domElement);
+ this.controls.enableDamping = true;
+ this.controls.dampingFactor = 0.08;
+ this.controls.minDistance = 1.0;
+ this.controls.maxDistance = 6;
+ this.controls.target.set(0, 1.3, 0);
+ this.controls.enablePan = false;
+
+ this.root = new Group();
+ this.scene.add(this.root);
+ }
+
+ _resize() {
+ if (this._disposed) return;
+ const w = Math.max(1, this.container.clientWidth);
+ const h = Math.max(1, this.container.clientHeight);
+ this.renderer.setSize(w, h);
+ this.camera.aspect = w / h;
+ this.camera.updateProjectionMatrix();
+ }
+
+ // ── persona loading ───────────────────────────────────────────────────────
+
+ /**
+ * Load (or swap to) a persona's body.
+ * @param {{ glbUrl: string, name?: string, personaId?: string }} persona
+ */
+ async loadPersona(persona) {
+ this._setState('loading', { name: persona?.name });
+ // Clear any previous body.
+ if (this._model) {
+ this.root.remove(this._model);
+ this._disposeObject(this._model);
+ this._model = null;
+ }
+ this.face.reset();
+ this._speakEnv = null;
+ this._a2fActive = false;
+
+ let gltf;
+ try {
+ const loader = new GLTFLoader();
+ gltf = await loader.loadAsync(persona.glbUrl);
+ } catch (err) {
+ this._setState('error', { message: 'Could not load this avatar.', cause: String(err?.message || err) });
+ return false;
+ }
+ if (this._disposed) return false;
+
+ const model = gltf.scene || gltf.scenes?.[0];
+ if (!model) {
+ this._setState('error', { message: 'This file has no renderable scene.' });
+ return false;
+ }
+ this._model = model;
+ this.root.add(model);
+ this._frameModel(model);
+
+ // Decide rig mode from the node graph BEFORE wiring the animation system.
+ const { hasSkinnedMesh, boneNames } = inspectRig(model);
+ this._rigMode = decideRigMode({ hasSkinnedMesh, boneNames });
+
+ // Lip-sync + face binding (works regardless of rig mode).
+ this.mouth.attach(model);
+ this.a2f.attach(model);
+ this.face.attach(model);
+
+ // Animation: canonical clip library for humanoids, alive-idle fallback else.
+ this.anim.attach(model, { avatarId: persona.personaId, avatarUrl: persona.glbUrl });
+ this._clipsReady = false;
+ if (this._rigMode.mode === 'canonical' && this.anim.supportsCanonicalClips()) {
+ await this._loadClips();
+ if (this._disposed) return false;
+ this._clipsReady = true;
+ await this.anim.play('idle').catch(() => {});
+ }
+
+ this._setState('idle', {
+ name: persona.name,
+ rig: this._rigMode.mode,
+ rigReason: this._rigMode.reason,
+ hasMouthMorphs: this.mouth.hasMouthMorphs(),
+ hasJawBone: this.mouth.hasJawBone(),
+ hasFaceMorphs: this.face.hasMorphs(),
+ hasVisemeTrack: this.a2f.hasCoverage(),
+ });
+ return true;
+ }
+
+ async _loadClips() {
+ // Pull the platform animation manifest and register only what the stage uses.
+ let defs = [];
+ try {
+ const res = await fetch('/animations/manifest.json', { credentials: 'same-origin' });
+ if (res.ok) {
+ const manifest = await res.json();
+ const want = new Set(REQUIRED_CLIPS);
+ defs = manifest.filter((d) => want.has(d.name));
+ }
+ } catch {
+ /* manifest unreachable — idle fallback still animates via the bone idle */
+ }
+ if (!defs.length) return;
+ this.anim.setAnimationDefs(defs);
+ // Ensure the idle is present before first paint; gestures lazy-load on demand.
+ await this.anim.ensureLoaded('idle').catch(() => {});
+ }
+
+ _frameModel(model) {
+ const box = new Box3().setFromObject(model);
+ const size = box.getSize(new Vector3());
+ const center = box.getCenter(new Vector3());
+ // Recentre on the ground, framed on the upper body / face.
+ model.position.x += -center.x;
+ model.position.z += -center.z;
+ model.position.y += -box.min.y;
+ const height = size.y || 1.6;
+ const focusY = Math.min(height * 0.82, height - 0.1);
+ this.controls.target.set(0, focusY, 0);
+ const dist = Math.max(1.4, height * 1.15);
+ this.camera.position.set(0, focusY + height * 0.05, dist);
+ this.camera.near = Math.max(0.01, dist / 100);
+ this.camera.far = dist * 50;
+ this.camera.updateProjectionMatrix();
+ this.controls.update();
+ }
+
+ // ── conversational states ─────────────────────────────────────────────────
+
+ /** The body is attending to the user (between the user typing and a reply). */
+ listening() {
+ if (this.state === 'speaking') return;
+ this._endSpeech();
+ this._setState('listening');
+ this.face.setTarget({ browInnerUp: 0.12, eyeWideLeft: 0.08, eyeWideRight: 0.08 });
+ this._playGestureOrIdle(null, 'idle');
+ }
+
+ /** A tool is running — the body shows a thinking beat. */
+ thinking() {
+ if (this.state === 'speaking') return;
+ this._endSpeech();
+ this._setState('thinking');
+ const expr = expressionFor('thinking', 0.7);
+ this.face.setTarget(expr.face);
+ this._playGestureOrIdle(expr.gesture, expr.idle);
+ }
+
+ /**
+ * Perform a reply. Drives lip-sync + emotion + gesture for this turn, then
+ * settles back to idle.
+ * @param {{ text: string, emotion?: string, intensity?: number, gesture?: string, audioUrl?: string, visemeTrack?: object }} turn
+ */
+ async speak(turn = {}) {
+ const text = String(turn.text || '').trim();
+ if (!text) return;
+ const expr = turn.emotion
+ ? { ...expressionFor(turn.emotion, turn.intensity ?? 0.85) }
+ : expressionForText(text);
+ const gesture = turn.gesture || expr.gesture;
+
+ this._setState('speaking', { text, emotion: expr.emotion, intensity: expr.intensity, gesture });
+ this.face.setTarget(expr.face);
+ this._playGestureOrIdle(gesture, expr.idle);
+
+ // Lip-sync source, best-first.
+ this._endSpeech(false);
+ if (turn.visemeTrack && this.a2f.hasCoverage() && turn.audioUrl) {
+ await this._speakWithAudio(turn.audioUrl, turn.visemeTrack);
+ } else {
+ this._speakWithText(text);
+ }
+ }
+
+ _speakWithText(text) {
+ this._speakEnv = new TextVisemeEnvelope(text);
+ this._speakStart = this._clockNow();
+ this._speakDur = this._speakEnv.duration;
+ this._a2fActive = false;
+ }
+
+ async _speakWithAudio(audioUrl, track) {
+ try {
+ const audio = new Audio(audioUrl);
+ audio.crossOrigin = 'anonymous';
+ this._audio = audio;
+ this.a2f.setTrack(track);
+ this._a2fActive = true;
+ this._speakDur = track?.durationSec || estimateSpeechDuration('', {});
+ await audio.play();
+ audio.addEventListener('ended', () => this._endSpeech(), { once: true });
+ } catch {
+ // Autoplay blocked or audio failed — fall back to the text envelope.
+ this._a2fActive = false;
+ this._speakWithText(audioUrl ? '' : '');
+ }
+ }
+
+ _endSpeech(settle = true) {
+ if (this._audio) {
+ try { this._audio.pause(); } catch { /* noop */ }
+ this._audio = null;
+ }
+ this._speakEnv = null;
+ this._a2fActive = false;
+ if (this.a2f?.reset) this.a2f.reset();
+ this.mouth.setMouthShape({ open: 0, wide: 0, round: 0 });
+ if (settle && this.state === 'speaking') {
+ this._setState('idle');
+ this.face.setTarget({});
+ this._playGestureOrIdle(null, 'idle');
+ }
+ }
+
+ _playGestureOrIdle(gesture, idle = 'idle') {
+ if (!this._clipsReady) return; // fallback rig: alive-idle handled in _tick
+ const idleName = idle || 'idle';
+ this.anim.crossfadeTo(idleName).catch(() => {});
+ if (gesture && gesture !== idleName) {
+ // Upper-body gesture over the idle so the legs keep their weight shift.
+ this.anim.ensureLoaded(gesture)
+ .then((ok) => { if (ok) this.anim.playOverlay(gesture, { loop: false, upperBodyOnly: true }).catch(() => {}); })
+ .catch(() => {});
+ } else {
+ this.anim.stopOverlay().catch?.(() => {});
+ }
+ }
+
+ // ── frame loop ──────────────────────────────────────────────────────────────
+
+ _clockNow() {
+ return (typeof performance !== 'undefined' ? performance.now() : Date.now()) / 1000;
+ }
+
+ _tick = () => {
+ if (this._disposed) return;
+ this._raf = requestAnimationFrame(this._tick);
+ const now = this._clockNow();
+ const dt = this._lastT ? Math.min(0.05, now - this._lastT) : 0.016;
+ this._lastT = now;
+
+ // Body animation.
+ this.anim.update(dt);
+
+ // Fallback alive-idle: when the rig can't play canonical clips, the body
+ // must still breathe. A slow vertical bob + gentle yaw — never a frozen pose.
+ if (!this._clipsReady && this._model && !REDUCED_MOTION) {
+ const t = now;
+ this._model.position.y = (this._model.position.y || 0); // keep grounded base
+ this.root.rotation.y = Math.sin(t * 0.25) * 0.18;
+ this.root.position.y = Math.sin(t * 1.1) * 0.012;
+ }
+
+ // Lip-sync.
+ if (this.state === 'speaking') {
+ if (this._a2fActive && this._audio) {
+ this.a2f.update(this._audio.currentTime);
+ if (this._audio.ended) this._endSpeech();
+ } else if (this._speakEnv) {
+ const t = now - this._speakStart;
+ const shape = this._speakEnv.sample(t);
+ this.mouth.setMouthShape(shape);
+ if (this._speakEnv.done(t)) this._endSpeech();
+ }
+ }
+
+ // Emotion face ease.
+ this.face.update(dt);
+
+ this.controls.update();
+ this.renderer.render(this.scene, this.camera);
+ };
+
+ // ── state + teardown ──────────────────────────────────────────────────────
+
+ _setState(state, detail = {}) {
+ this.state = state;
+ try { this.onState(state, detail); } catch { /* host callback must not break the loop */ }
+ }
+
+ _disposeObject(obj) {
+ obj.traverse?.((node) => {
+ if (node.geometry) node.geometry.dispose?.();
+ const mats = Array.isArray(node.material) ? node.material : node.material ? [node.material] : [];
+ for (const m of mats) {
+ for (const k of Object.keys(m)) {
+ const v = m[k];
+ if (v && v.isTexture) v.dispose?.();
+ }
+ m.dispose?.();
+ }
+ });
+ }
+
+ destroy() {
+ if (this._disposed) return;
+ this._disposed = true;
+ cancelAnimationFrame(this._raf);
+ window.removeEventListener('resize', this._onResize);
+ this._ro?.disconnect?.();
+ this._endSpeech(false);
+ this.mouth.dispose?.();
+ if (this._model) this._disposeObject(this._model);
+ this._envTex?.dispose?.();
+ this.controls?.dispose?.();
+ this.renderer?.dispose?.();
+ if (this.renderer?.domElement?.parentNode) this.renderer.domElement.parentNode.removeChild(this.renderer.domElement);
+ }
+}
diff --git a/docs/roadmap/_generated/02/baseline-failures.txt b/docs/roadmap/_generated/02/baseline-failures.txt
new file mode 100644
index 000000000..721b6b9ae
--- /dev/null
+++ b/docs/roadmap/_generated/02/baseline-failures.txt
@@ -0,0 +1,12 @@
+tests/api/agent-memory.test.js
+tests/api/forge-lane-routing.test.js
+tests/api/x402-discovery-green.test.js
+tests/api/x402-spec.test.js
+tests/auto-rig-completion.test.js
+tests/branding.test.js
+tests/build-asset-paths.test.js
+tests/mcp-forge-free.test.js
+tests/metering.test.js
+tests/pose-presets.test.js
+tests/refine-lineage.test.js
+tests/remix-royalty.test.js
diff --git a/docs/roadmap/_generated/02/gate-before.txt b/docs/roadmap/_generated/02/gate-before.txt
index f9404224b..af97ce28c 100644
--- a/docs/roadmap/_generated/02/gate-before.txt
+++ b/docs/roadmap/_generated/02/gate-before.txt
@@ -9,28 +9,417 @@
RUN v4.1.7 /workspaces/three.ws
- ❯ tests/api/x402-spec.test.js (23 tests | 23 skipped) 76420ms
- ❯ tests/forge-humanoid.test.js (31 tests | 1 failed) 609ms
- × returns a non-humanoid verdict for empty input, never throws 211ms
+ ❯ tests/api/x402-spec.test.js (23 tests | 2 failed) 2012ms
+ × advertises only USDC on Solana by default (no THREE accept) 12ms
+ × adds a THREE Solana accept after USDC when X402_ACCEPT_THREE_SOLANA is on 4ms
+ ❯ tests/refine-lineage.test.js (20 tests | 1 failed) 20ms
+ × is deterministic — same inputs give the same prompt 7ms
+ ❯ tests/remix-royalty.test.js (15 tests | 1 failed) 18ms
+ × drops a sub-dust royalty rather than paying it 9ms
+ ❯ tests/api/forge-lane-routing.test.js (16 tests | 1 failed) 21ms
+ × treats unknown/degraded health as usable (never blocks on missing telemetry) 8ms
stderr | tests/auto-rig-completion.test.js > 6a — cron recovers an open job from its stored result_glb_url > finalizes via the stored URL and never re-polls the provider
[auto-rig-sweep] job error { jobId: 'job-a', error: 'Invalid IP address: undefined' }
- ❯ tests/auto-rig-completion.test.js (5 tests | 3 failed) 447ms
- × finalizes via the stored URL and never re-polls the provider 352ms
- × lets exactly one of two concurrent finalizes materialize the avatar 21ms
- × a thrown winner releases the claim to a cron-selectable status (not done, not wedged) 53ms
- ❯ tests/branding.test.js (4 tests | 4 failed) 100741ms
- × no "Avaturn" in user-facing files 98080ms
- × no "Character Studio" in user-facing files 1197ms
- × no "Ready Player Me" in user-facing files 891ms
- × no "RPM" referring to Ready Player Me (heuristic: near avatar/selfie) 466ms
- ❯ tests/metering.test.js (11 tests | 1 failed) 2378ms
- × issues a MeterUsage command with the product code, dimension, and idempotency allocation 2255ms
- ❯ tests/build-asset-paths.test.js (5 tests | 1 failed) 56ms
- × serves /style.css from dist root 53ms
- ❯ tests/api/agent-memory.test.js (22 tests | 1 failed) 148ms
- × truncates content longer than 10,000 characters 18ms
- ❯ tests/api/x402-discovery-parity.test.js (4 tests | 3 failed) 615330ms
- × lists every paid /api/x402/* endpoint (no silent drift) 256105ms
- × catalogs both hosted MCP servers with their own identities 199182ms
- × every cataloged x402 resource carries a price and at least one accept 159733ms
+ ❯ tests/auto-rig-completion.test.js (5 tests | 3 failed) 119ms
+ × finalizes via the stored URL and never re-polls the provider 103ms
+ × lets exactly one of two concurrent finalizes materialize the avatar 4ms
+ × a thrown winner releases the claim to a cron-selectable status (not done, not wedged) 8ms
+ ❯ tests/api/agent-memory.test.js (22 tests | 1 failed) 30ms
+ × truncates content longer than 10,000 characters 7ms
+ ❯ tests/metering.test.js (11 tests | 1 failed) 55ms
+ × issues a MeterUsage command with the product code, dimension, and idempotency allocation 42ms
+ ❯ tests/build-asset-paths.test.js (5 tests | 1 failed) 15ms
+ × serves /style.css from dist root 12ms
+ ❯ tests/branding.test.js (4 tests | 4 failed) 8398ms
+ × no "Avaturn" in user-facing files 7728ms
+ × no "Character Studio" in user-facing files 308ms
+ × no "Ready Player Me" in user-facing files 191ms
+ × no "RPM" referring to Ready Player Me (heuristic: near avatar/selfie) 169ms
+stderr | tests/api/x402-discovery-green.test.js > x402 discovery catalog is fully green > every resource carries a real output.example for result cards
+[wk/x402-discovery] agent services unavailable Missing required env var: DATABASE_URL
+
+stderr | tests/api/x402-discovery-green.test.js > x402 discovery catalog is fully green
+[wk/x402-discovery] agent services unavailable Missing required env var: DATABASE_URL
+
+ ❯ tests/api/x402-discovery-green.test.js (4 tests | 2 failed) 1957ms
+ × has no listing-quality warnings (every resource ranks and renders fully) 9ms
+ × every resource carries a real output.example for result cards 5ms
+ ❯ tests/mcp-forge-free.test.js (7 tests | 3 failed) 30ms
+ × surfaces a not-configured deployment as a designed error 11ms
+ × surfaces a busy lane as a rate_limited error with retry hint 5ms
+ × reports a terminal generation failure from the poll loop 2ms
+ ❯ tests/pose-presets.test.js (9 tests | 1 failed) 153ms
+ × no preset drives a hand or the head below the floor 103ms
+
+⎯⎯⎯⎯⎯⎯ Failed Tests 21 ⎯⎯⎯⎯⎯⎯⎯
+
+ FAIL tests/auto-rig-completion.test.js > 6a — cron recovers an open job from its stored result_glb_url > finalizes via the stored URL and never re-polls the provider
+AssertionError: expected +0 to be 1 // Object.is equality
+
+- Expected
++ Received
+
+- 1
++ 0
+
+ ❯ tests/auto-rig-completion.test.js:206:26
+ 204| expect(body.ok).toBe(true);
+ 205| expect(body.scanned).toBe(1);
+ 206| expect(body.finalized).toBe(1);
+ | ^
+ 207|
+ 208| // Req 4: the stored URL was reused — the provider's status() was NO…
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/21]⎯
+
+ FAIL tests/auto-rig-completion.test.js > 6c — finalizeAutoRigStage is concurrency-safe > lets exactly one of two concurrent finalizes materialize the avatar
+TypeError: Invalid IP address: undefined
+ ❯ lookup api/_lib/ssrf-guard.js:172:5
+ 170| const agent = new AgentClass({
+ 171| lookup(_hostname, _options, cb) {
+ 172| cb(null, pinnedIp, net.isIPv6(pinnedIp) ? 6 : 4);
+ | ^
+ 173| },
+ 174| });
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/21]⎯
+
+ FAIL tests/auto-rig-completion.test.js > 6c — finalizeAutoRigStage is concurrency-safe > a thrown winner releases the claim to a cron-selectable status (not done, not wedged)
+AssertionError: expected [Function] to throw error including 'r2 down' but got 'Invalid IP address: undefined'
+
+Expected: "r2 down"
+Received: "Invalid IP address: undefined"
+
+ ❯ tests/auto-rig-completion.test.js:329:4
+ 327| await expect(
+ 328| finalizeAutoRigStage({ userId: 'u1', jobId: 'job-d', job, glbUrl: '…
+ 329| ).rejects.toThrow('r2 down');
+ | ^
+ 330|
+ 331| // The claim was released back to 'running' — cron-selectable, never…
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/21]⎯
+
+ FAIL tests/branding.test.js > three.ws branding lock > no "Avaturn" in user-facing files
+Error: Forbidden brand "Avaturn" found in 5 user-facing location(s):
+ docs/launch/go-no-go-2026-06-24.md:150
+ brands **"Avaturn" (×4), "Ready Player Me" (×7), "Character Studio" (×2), "RPM"** in user-facing
+ docs/tutorials/animate-your-avatar.md:170
+ **Facial expression** ([src/runtime/arkit52.js](../../src/runtime/arkit52.js)) — independent of the skeleton. If your avatar carries ARKit-52 blendshapes (most modern exports do — RPM, Avaturn, VRoid), the runtime resolves those morph targets and drives expression and lip-sync directly on the face. A skeletal clip plays the body; the blendshape layer plays the eyes, brows, and mouth on top.
+ docs/tutorials/animate-your-avatar.md:180
+ - **"This rig can't be retargeted — only N recognizable humanoid bones."** The model exposes fewer than 8 canonical bones. It's likely non-humanoid, a static prop, or a rig whose bone names the canonicalizer doesn't recognize. Re-export it as a standard humanoid (Mixamo, RPM, Avaturn, VRM all work), or auto-rig a rig-less mesh first.
+ docs/ux-flows/01-onboarding-creation.md:43
+ - **External calls / dependencies:** `GET /api/config`; `GET /api/avatars`; `GET /api/usage/summary`; `POST /api/avatars/fork`; `GET /api/avatars/:id` + raw GLB fetch (guest fork). Avaturn / Ready Player Me iframes loaded by `AvatarCreator`.
+ src/viewer/framing.js:50
+ * default, every Avaturn/RPM rig) are returned unchanged and never re-framed.
+
+Replace with three.ws-branded language, or add a documented exemption to tests/branding-allowlist.json.
+ ❯ tests/branding.test.js:370:11
+
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/21]⎯
+
+ FAIL tests/branding.test.js > three.ws branding lock > no "Character Studio" in user-facing files
+Error: Forbidden brand "Character Studio" found in 3 user-facing location(s):
+ public/docs/index.html:131
+ ['character-studio', 'Character studio', 'Author and pose characters.'],
+ docs/internal/ISSUES-ARCHIVE-2026-06.md:11
+ vendored CharacterStudio fork that all predated the upgrade.
+ docs/launch/go-no-go-2026-06-24.md:150
+ brands **"Avaturn" (×4), "Ready Player Me" (×7), "Character Studio" (×2), "RPM"** in user-facing
+
+Replace with three.ws-branded language, or add a documented exemption to tests/branding-allowlist.json.
+ ❯ tests/branding.test.js:370:11
+
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/21]⎯
+
+ FAIL tests/branding.test.js > three.ws branding lock > no "Ready Player Me" in user-facing files
+Error: Forbidden brand "Ready Player Me" found in 8 user-facing location(s):
+ public/demos/audio2face.html:95
+ (ARKit, Ready Player Me, VRM, Oculus visemes). If Audio2Face is unavailable, the
+ docs/launch/go-no-go-2026-06-24.md:150
+ brands **"Avaturn" (×4), "Ready Player Me" (×7), "Character Studio" (×2), "RPM"** in user-facing
+ docs/tutorials/import-avatar-url.md:3
+ You already have an avatar living somewhere else — a Ready Player Me model on a CloudFront link, a GLB on Arweave, an export sitting in your own storage. You don't need to download it, convert it, or re-host it. Paste the URL into [three.ws/import/rpm](/import/rpm) and the platform fetches it server-side, normalizes its skeleton, auto-rigs it so it can move, and saves it to your account as an avatar an agent can wear.
+ docs/tutorials/import-avatar-url.md:14
+ You: paste https://models.readyplayer.me/64c3….glb into /import/rpm
+ docs/tutorials/import-avatar-url.md:31
+ Most avatar hosts (Ready Player Me's CloudFront CDN, Arweave gateways, arbitrary object storage) serve their GLBs **without CORS headers**. A browser `fetch()` to those URLs is blocked before a single byte arrives. So the importer doesn't rely on your browser reaching the file at all:
+ docs/tutorials/import-avatar-url.md:50
+ **Ready Player Me.** RPM gives you a model URL of the form `https://models.readyplayer.me/<id>.glb`. If you only have the avatar's web page, append `.glb` to the avatar ID, or open the page, then DevTools → **Network**, filter by `.glb`, and copy the request URL. RPM serves these from a CloudFront CDN with no CORS headers — exactly the case the server-side fetch is built for.
+ docs/tutorials/import-avatar-url.md:148
+ - **Paste a `.glb` URL** at [/import/rpm](/import/rpm) — Ready Player Me, any CDN, Arweave, or your own storage all work.
+ docs/ux-flows/01-onboarding-creation.md:43
+ - **External calls / dependencies:** `GET /api/config`; `GET /api/avatars`; `GET /api/usage/summary`; `POST /api/avatars/fork`; `GET /api/avatars/:id` + raw GLB fetch (guest fork). Avaturn / Ready Player Me iframes loaded by `AvatarCreator`.
+
+Replace with three.ws-branded language, or add a documented exemption to tests/branding-allowlist.json.
+ ❯ tests/branding.test.js:370:11
+
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/21]⎯
+
+ FAIL tests/branding.test.js > three.ws branding lock > no "RPM" referring to Ready Player Me (heuristic: near avatar/selfie)
+Error: Found "RPM" near avatar/selfie context in 4 location(s) — assume Ready Player Me:
+ docs/roadmap/REUSE-MAP.md:36
+ | Turnkey talking-avatar | met4citizen/TalkingHead (+HeadTTS) | ✅ MIT | Full Oculus OVR + ARKit viseme pipeline on RPM/Mixamo GLB. |
+ docs/tutorials/animate-your-avatar.md:170
+ **Facial expression** ([src/runtime/arkit52.js](../../src/runtime/arkit52.js)) — independent of the skeleton. If your avatar carries ARKit-52 blendshapes (most modern exports do — RPM, Avaturn, VRoid), the runtime resolves those morph targets and drives expression and lip-sync directly on the face. A skeletal clip plays the body; the blendshape layer plays the eyes, brows, and mouth on top.
+ docs/tutorials/import-avatar-url.md:50
+ **Ready Player Me.** RPM gives you a model URL of the form `https://models.readyplayer.me/<id>.glb`. If you only have the avatar's web page, append `.glb` to the avatar ID, or open the page, then DevTools → **Network**, filter by `.glb`, and copy the request URL. RPM serves these from a CloudFront CDN with no CORS headers — exactly the case the server-side fetch is built for.
+ docs/ux-flows/04-embed-widget-studio.md:167
+ - **avatar-embed runtime** (`src/avatar-embed.js`) backs `/embed/avatar/<handle>`, `/a-embed.html`, and the agent embed; exposes the `v1.avatar.*` postMessage bridge (speak, emote, morphs, lookAt, mocap, idle, hotkeys, mic, state) plus RPM-compatible event aliases and a same-origin BroadcastChannel control surface.
+ ❯ tests/branding.test.js:407:10
+ 405| .map((h) => ` ${h.file}:${h.line}\n ${h.text}`)
+ 406| .join('\n');
+ 407| throw new Error(
+ | ^
+ 408| `Found "RPM" near avatar/selfie context in ${hits.length} location…
+ 409| );
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/21]⎯
+
+ FAIL tests/build-asset-paths.test.js > build asset paths > serves /style.css from dist root
+AssertionError: expected false to be true // Object.is equality
+
+- Expected
++ Received
+
+- true
++ false
+
+ ❯ tests/build-asset-paths.test.js:19:50
+ 17|
+ 18| it('serves /style.css from dist root', () => {
+ 19| expect(existsSync(resolve(dist, 'style.css'))).toBe(true);
+ | ^
+ 20| });
+ 21|
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/21]⎯
+
+ FAIL tests/mcp-forge-free.test.js > forge_free — handler > surfaces a not-configured deployment as a designed error
+AssertionError: expected 'provider_error' to be 'not_configured' // Object.is equality
+
+Expected: "not_configured"
+Received: "provider_error"
+
+ ❯ tests/mcp-forge-free.test.js:158:21
+ 156| const out = structured(envelope);
+ 157| expect(out.ok).toBe(false);
+ 158| expect(out.error).toBe('not_configured');
+ | ^
+ 159| });
+ 160|
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/21]⎯
+
+ FAIL tests/mcp-forge-free.test.js > forge_free — handler > surfaces a busy lane as a rate_limited error with retry hint
+AssertionError: expected 'provider_error' to be 'rate_limited' // Object.is equality
+
+Expected: "rate_limited"
+Received: "provider_error"
+
+ ❯ tests/mcp-forge-free.test.js:165:21
+ 163| const out = structured(await tool.handler({ prompt: 'a ceramic teapo…
+ 164| expect(out.ok).toBe(false);
+ 165| expect(out.error).toBe('rate_limited');
+ | ^
+ 166| expect(out.retryAfter).toBe(8);
+ 167| });
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/21]⎯
+
+ FAIL tests/mcp-forge-free.test.js > forge_free — handler > reports a terminal generation failure from the poll loop
+AssertionError: expected 'provider_error' to be 'generation_failed' // Object.is equality
+
+Expected: "generation_failed"
+Received: "provider_error"
+
+ ❯ tests/mcp-forge-free.test.js:175:21
+ 173| const out = structured(await tool.handler({ prompt: 'a marble bust' …
+ 174| expect(out.ok).toBe(false);
+ 175| expect(out.error).toBe('generation_failed');
+ | ^
+ 176| });
+ 177| });
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/21]⎯
+
+ FAIL tests/metering.test.js > AWS Marketplace — MeterUsage call shape (SDK boundary mocked) > issues a MeterUsage command with the product code, dimension, and idempotency allocation
+TypeError: vi.dontMock is not a function
+ ❯ tests/metering.test.js:194:6
+ 192| // Idempotency allocation carries the dedupe key AWS bills against.
+ 193| expect(input.UsageAllocations[0].Tags[0].Value).toBe('alloc-1');
+ 194| vi.dontMock('@aws-sdk/client-marketplace-metering');
+ | ^
+ 195| vi.dontMock('@aws-sdk/client-marketplace-entitlement-service');
+ 196| vi.dontMock('../api/_lib/env.js');
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/21]⎯
+
+ FAIL tests/pose-presets.test.js > pose geometry (real mannequin forward kinematics) > no preset drives a hand or the head below the floor
+AssertionError: sit-floor L hand: expected -0.19006247768508422 to be greater than -0.15
+ ❯ tests/pose-presets.test.js:106:48
+ 104| // A small negative tolerance: floor-contact poses (push-up-style) …
+ 105| // graze y=0, but nothing should sink a hand far underground.
+ 106| expect(handTip(m, 'L').y, `${p.id} L hand`).toBeGreaterThan(-0.15);
+ | ^
+ 107| expect(handTip(m, 'R').y, `${p.id} R hand`).toBeGreaterThan(-0.15);
+ 108| expect(head.y, `${p.id} head`).toBeGreaterThan(0.2);
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[13/21]⎯
+
+ FAIL tests/refine-lineage.test.js > composeRefinement > is deterministic — same inputs give the same prompt
+AssertionError: expected 'a knight helmet, bigger helmet' to be 'a knight helmet, helmet bigger' // Object.is equality
+
+Expected: "a knight helmet, helmet bigger"
+Received: "a knight helmet, bigger helmet"
+
+ ❯ tests/refine-lineage.test.js:52:13
+ 50| const b = composeRefinement('a knight helmet', 'bigger helmet');
+ 51| expect(a).toBe(b);
+ 52| expect(a).toBe('a knight helmet, helmet bigger');
+ | ^
+ 53| });
+ 54|
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[14/21]⎯
+
+ FAIL tests/remix-royalty.test.js > computeRemixSplit — split math > drops a sub-dust royalty rather than paying it
+AssertionError: expected true to be false // Object.is equality
+
+- Expected
++ Received
+
+- false
++ true
+
+ ❯ tests/remix-royalty.test.js:70:55
+ 68| // Tiny price where 10% rounds below the dust floor.
+ 69| const s = computeRemixSplit({ priceAtomics: 50_000n, royaltyBps: 100…
+ 70| expect(s.creatorAtomics < REMIX_MIN_PAYOUT_ATOMICS).toBe(false); // …
+ | ^
+ 71| expect(s.creatorAtomics).toBe(0n);
+ 72| expect(s.dust).toBe(true);
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[15/21]⎯
+
+ FAIL tests/api/agent-memory.test.js > POST /api/agent-memory > truncates content longer than 10,000 characters
+AssertionError: expected undefined to be defined
+ ❯ tests/api/agent-memory.test.js:405:27
+ 403|
+ 404| expect(status).toBe(201);
+ 405| expect(capturedContent).toBeDefined();
+ | ^
+ 406| expect(capturedContent.length).toBe(10_000);
+ 407| });
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[16/21]⎯
+
+ FAIL tests/api/forge-lane-routing.test.js > resolveBackendIdWithHealth — prefer healthy self-host → other free → paid > treats unknown/degraded health as usable (never blocks on missing telemetry)
+AssertionError: expected 'huggingface' to be 'trellis_selfhost' // Object.is equality
+
+Expected: "trellis_selfhost"
+Received: "huggingface"
+
+ ❯ tests/api/forge-lane-routing.test.js:123:101
+ 121| // trellis_selfhost has no entry (unknown) → still picked, ahead of …
+ 122| const health = { huggingface: 'ok' };
+ 123| expect(resolveBackendIdWithHealth({ path: 'image', tier: 'standard',…
+ | ^
+ 124| 'trellis_selfhost',
+ 125| );
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[17/21]⎯
+
+ FAIL tests/api/x402-discovery-green.test.js > x402 discovery catalog is fully green > has no listing-quality warnings (every resource ranks and renders fully)
+AssertionError: Resources with listing-quality warnings:
+ ▲ /api/x402/token-intel: no output.example: expected [ { …(3) } ] to deeply equal []
+
+- Expected
++ Received
+
+- []
++ [
++ {
++ "errors": [],
++ "label": "/api/x402/token-intel",
++ "warnings": [
++ "no output.example",
++ ],
++ },
++ ]
+
+ ❯ tests/api/x402-discovery-green.test.js:158:5
+ 156| .map((r) => ` ▲ ${r.label}: ${r.warnings.join('; ')}`)
+ 157| .join('\n')}`,
+ 158| ).toEqual([]);
+ | ^
+ 159| });
+ 160|
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[18/21]⎯
+
+ FAIL tests/api/x402-discovery-green.test.js > x402 discovery catalog is fully green > every resource carries a real output.example for result cards
+AssertionError: /api/x402/token-intel is missing bazaar.info.output.example: expected undefined to be truthy
+
+- Expected:
+true
+
++ Received:
+undefined
+
+ ❯ tests/api/x402-discovery-green.test.js:165:68
+ 163| for (const r of doc.resources || []) {
+ 164| const ex = (r.extensions?.bazaar || r.bazaar)?.info?.output?.exampl…
+ 165| expect(ex, `${label(r)} is missing bazaar.info.output.example`).toB…
+ | ^
+ 166| }
+ 167| });
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[19/21]⎯
+
+ FAIL tests/api/x402-spec.test.js > paymentRequirements > advertises only USDC on Solana by default (no THREE accept)
+AssertionError: expected 2 to be 1 // Object.is equality
+
+- Expected
++ Received
+
+- 1
++ 2
+
+ ❯ tests/api/x402-spec.test.js:243:25
+ 241| r.network.startsWith('solana:'),
+ 242| );
+ 243| expect(solana.length).toBe(1);
+ | ^
+ 244| expect(solana[0].extra.name).toBe('USDC');
+ 245| });
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[20/21]⎯
+
+ FAIL tests/api/x402-spec.test.js > paymentRequirements > adds a THREE Solana accept after USDC when X402_ACCEPT_THREE_SOLANA is on
+AssertionError: expected '10000000' to be '1000' // Object.is equality
+
+Expected: "1000"
+Received: "10000000"
+
+ ❯ tests/api/x402-spec.test.js:261:28
+ 259| expect(solana[1].extra.feePayer).toBe(solana[0].extra.feePayer);
+ 260| // Default: reuses the USDC atomic price.
+ 261| expect(solana[1].amount).toBe(solana[0].amount);
+ | ^
+ 262| });
+ 263|
+
+⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[21/21]⎯
+
+
+ Test Files 12 failed | 580 passed | 3 skipped (595)
+ Tests 21 failed | 8504 passed | 18 skipped (8543)
+ Start at 22:43:37
+ Duration 182.83s (transform 21.96s, setup 0ms, import 187.03s, tests 155.75s, environment 25.75s)
+
+EXIT_CODE=1
diff --git a/docs/roadmap/_generated/07/gate-before.txt b/docs/roadmap/_generated/07/gate-before.txt
index 9f0c684c6..460966548 100644
--- a/docs/roadmap/_generated/07/gate-before.txt
+++ b/docs/roadmap/_generated/07/gate-before.txt
@@ -1,4 +1,62 @@
+# Gate baseline (per-step). Backend creds (NVIDIA/Replicate/R2/HF) absent locally — generation/vision/asr capability probes report unconfigured; those lanes verified by contract tests + designed unavailable states.
+
+== typecheck ==
> [email protected] typecheck
> tsc -p jsconfig.json
+typecheck:0
+== test:gate ==
+
+> [email protected] test:gate
+> node scripts/test-gate.mjs
+
+[test-gate] running 7 critical-path test files…
+
+ RUN v4.1.7 /workspaces/three.ws
+
+
+ Test Files 7 passed (7)
+ Tests 79 passed (79)
+ Start at 22:43:37
+ Duration 2.75s (transform 1.92s, setup 0ms, import 3.88s, tests 384ms, environment 1ms)
+
+[test-gate] ✓ all critical-path tests passed
+test:gate:0
+== audit:routes ==
+
+> [email protected] audit:routes
+> node scripts/verify-routes.mjs
+
+Route verify — 231 catalog pages, 908 main routes, 1 post-filesystem routes.
+ modeled dist files: 1434 · canonical-covered: 231 · literal page routes checked for shadows: 377
+ filesystem boundary (handle:filesystem) present: yes
+
+✓ static checks pass: every catalog page reachable, unknown paths → designed 404, no shadowed page routes.
+audit:routes:0
+== audit:handlers ==
+
+> [email protected] audit:handlers
+> node scripts/audit-empty-handlers.mjs
+
+✓ audit-empty-handlers: all API handlers export a body (1187 checked)
+audit:handlers:0
+== audit:mcp ==
+
+> [email protected] audit:mcp
+> node scripts/audit-mcp-manifests.mjs
+
+[audit:mcp] server-studio.json: description is 186 chars (registry max is 100)
+[audit:mcp] 1 violation(s) across 15 manifests
+audit:mcp:1
+== audit:pages ==
+
+> [email protected] audit:pages
+> node scripts/audit-page-index.mjs
+
+Route audit: 122 auditable page routes, 231 documented in pages.json.
+✓ Every auditable page route is documented.
+
+ℹ 5 manifest page(s) have no `added` date (omitted from /changelog). Fine for legacy pages; add dates as you touch them.
+audit:pages:0
+DONE
diff --git a/docs/roadmap/_generated/09/gate-before.txt b/docs/roadmap/_generated/09/gate-before.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/docs/store-submissions/_generated/claude-reviewer-guide.md b/docs/store-submissions/_generated/claude-reviewer-guide.md
new file mode 100644
index 000000000..85267b8c7
--- /dev/null
+++ b/docs/store-submissions/_generated/claude-reviewer-guide.md
@@ -0,0 +1,192 @@
+# Claude Connectors — reviewer setup & verification guide
+
+**Connector:** three.ws 3D Agent — `io.github.nirholas/3d-agent-mcp`
+**Package:** npm `@three-ws/mcp-server` (v1.2.0+) · **Transport:** stdio (MCP 2025-06-18)
+**Surface:** 17 tools — **1 free** (`forge_free`) + **16 paid** (x402 USDC on Solana mainnet, `exact` scheme).
+
+This guide lets someone with **zero prior context** verify the whole server: connect it, run
+the free path, exercise the paid tools for real, and understand why the paid tools answer
+`PaymentRequired` (that is expected, not a bug).
+
+---
+
+## 0. TL;DR for the reviewer
+
+1. Add the connector (one command, no account, no wallet).
+2. Call `forge_free` → get a real 3D GLB + viewer link, **free**. ✅ end-to-end proof.
+3. Call any paid tool with no payment → a clean `PaymentRequired` (price, USDC-on-Solana,
+ how to pay). This is the **designed** response. ✅ "behaves well when every tool is called".
+4. To run paid tools **for real and free**, set the review entitlement (one env var) and call
+ again → real results. ✅ paid surface verified without a funded wallet.
+
+---
+
+## 1. Connection
+
+This is a **stdio** connector — there is **no remote URL and no OAuth login**. Paid calls are
+authorized per-call by an x402 USDC micro-payment on Solana; account sign-in is not part of
+this server. (If you are looking for an OAuth flow, there isn't one here — see §5.)
+
+**Claude Code / Claude Desktop / Cursor:**
+
+```bash
+claude mcp add 3d-agent -- npx -y @three-ws/mcp-server
+```
+
+Or in an MCP client config:
+
+```json
+{
+ "mcpServers": {
+ "3d-agent": { "command": "npx", "args": ["-y", "@three-ws/mcp-server"] }
+ }
+}
+```
+
+No environment variables are required to start the server or to run the free path. The server
+boots with a built-in default payout address, so every paid tool advertises a valid
+`PaymentRequired` out of the box.
+
+---
+
+## 2. Free smoke test (no auth, no payment) — do this first
+
+Call **`forge_free`**:
+
+```jsonc
+// tool: forge_free
+{ "prompt": "a friendly round robot mascot, glossy white plastic", "tier": "draft" }
+```
+
+Expected (~30–90s; the free NVIDIA NIM / Microsoft TRELLIS lane):
+
+```json
+{
+ "ok": true, "free": true, "cost": "$0.00", "mode": "text_to_3d",
+ "glbUrl": "https://pub-….r2.dev/forge/anon/<id>.glb",
+ "preview": "https://three.ws/viewer?src=<encoded glbUrl>",
+ "backend": "nvidia", "durable": true, "attempts": 1
+}
+```
+
+- Open `preview` in a browser → the model renders in the three.ws `<model-viewer>`.
+- A verified-real example produced during review:
+ https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2Fa620d14f-a83d-43fe-8c0f-c87a46042933.glb
+
+**Reliability note.** If the NVIDIA lane is momentarily cold, `forge_free` may report
+`backend:"huggingface"`; it retries to prefer a **durable** result and verifies the URL is
+reachable before returning it, so you never get a dead link. If the lane is fully degraded it
+returns a clear `lane_degraded` error ("…try again shortly") — just call it again.
+
+---
+
+## 3. Calling the paid tools with no payment — what you'll see
+
+Call any paid tool (e.g. `get_pose_seed` with `{ "prompt": "warrior stance" }`). With no
+payment you get a structured **`PaymentRequired`** — this is the correct, expected response:
+
+```json
+{
+ "isError": true, // x402 contract (see §5) — NOT a crash
+ "structuredContent": {
+ "x402Version": 2,
+ "accepts": [{
+ "scheme": "exact",
+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", // Solana mainnet
+ "amount": "1000", // atomic USDC (6 decimals) → $0.001
+ "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC
+ "payTo": "BUrwd1nK6tFeeJMyzRHDo6AuVbnSfUULfvwq21X93nSN"
+ }]
+ },
+ "content": [ /* the JSON envelope, plus a plain-language explanation of the price + how to pay */ ]
+}
+```
+
+Every priced tool also states its price in its own description (e.g. *"Paid: $0.15 USDC"*) and
+in `tools/list` under `pricing`/`extensions.bazaar`. Prices range from **$0.0005**
+(`ens_sns_resolve`) to **$0.45** (`forge_avatar`). See
+`claude-tool-call-evidence.md` for the full per-tool table (16/16 verified clean).
+
+---
+
+## 4. Funded review path — exercise paid tools for real (no wallet needed)
+
+A connector reviewer can't mint x402 payments from a plain MCP host, so the server ships a
+**server-side review entitlement**: when the server is started with a secret and the client
+presents the matching value, paid tools run their **real handler with no charge** (real
+results, no mock).
+
+Set **both** env vars to the **same** secret value when adding the connector:
+
+```bash
+claude mcp add 3d-agent \
+ -e MCP_REVIEW_SECRET=<token-from-private-reviewer-notes> \
+ -e MCP_REVIEW_MODE=<same-token> \
+ -- npx -y @three-ws/mcp-server
+```
+
+(The reviewer token is supplied in the **private reviewer notes** of the submission, not in
+this repo. Review mode is **off** unless `MCP_REVIEW_SECRET` is set, so it can never be
+abused on a normal install.)
+
+With the entitlement active:
+
+- **A read tool returns real data immediately** — e.g. `get_pose_seed`
+ `{ "prompt": "warrior stance" }` →
+ `{ "presetId": "fighting-stance", "seed": "6153fce51ebdb477", "previewUrl": "https://three.ws/pose?seed=…" }`.
+- **`text_to_avatar`** `{ "prompt": "a cheerful cyberpunk fox in a red hoodie" }` → a real
+ generated GLB URL + `preview` viewer link (Replicate / Hunyuan-3D). This requires the
+ instance to carry the generation credentials (`REPLICATE_API_TOKEN`,
+ `REPLICATE_TEXT_TO_AVATAR_MODEL`); the reviewer instance in the private notes has them set.
+ Without those credentials the tool returns a **clean structured** `not_configured` error
+ (never a crash).
+
+**Alternative (pay for real with USDC).** If you prefer to test the actual payment rail, fund
+a small Solana wallet with USDC and use an x402-capable client to attach an `exact` payment in
+`_meta["x402/payment"]`; payments settle to the `payTo` in the challenge. Failed calls are
+never billed. For directory review, the entitlement above is the simpler path.
+
+---
+
+## 5. What `PaymentRequired` / `isError: true` means (read this)
+
+The paid tools are **transactional** (the directory allows this). When called without payment
+they return a `PaymentRequired` result that carries `isError: true`. **This is not a failure
+or a crash** — it is the [x402 MCP transport](https://x402.org) contract:
+
+- The `isError: true` flag is **required** so an x402-capable client recognizes the challenge
+ and auto-pays; the machine-readable terms live in `structuredContent` (`x402Version`,
+ `accepts[]` with price, asset, network, `payTo`).
+- For a human reader, each challenge also includes a plain-language line: *"Payment required —
+ this is the EXPECTED response for a paid tool, not an error…"*.
+- No payment is moved, nothing is broken, and the call can be completed by paying or by using
+ the review entitlement (§4).
+
+So "every tool returns either a real result or a clean `PaymentRequired`" is the intended,
+correct behavior across the whole surface.
+
+---
+
+## 6. Expected output by tool category
+
+| Category | Tools | Unpaid | Paid / review-mode result |
+|---|---|---|---|
+| **Free 3D** | `forge_free` | *n/a — always free* | real GLB URL + viewer link |
+| **3D generation** | `text_to_avatar`, `mesh_forge`, `rig_mesh`, `forge_avatar` | clean `PaymentRequired` | GLB / rigged-GLB URL + `preview`/`poseStudioUrl` |
+| **Pose** | `get_pose_seed` | clean `PaymentRequired` | preset id + seed + `previewUrl` on three.ws/pose |
+| **Names** | `ens_sns_resolve` | clean `PaymentRequired` | resolved ENS/SNS address(es) |
+| **Market data** | `pump_snapshot`, `sentiment_pulse`, `aixbt_intel`, `aixbt_projects` | clean `PaymentRequired` | live token/market/sentiment JSON |
+| **Agents / reputation** | `agent_reputation`, `agent_delegate_action`, `agenc_list_tasks`, `agenc_get_task`, `agenc_get_agent` | clean `PaymentRequired` | on-chain reputation / AgenC task + agent reads |
+| **Solana utility** | `vanity_grinder` | clean `PaymentRequired` | a vanity Solana keypair/seed phrase (treat result as a secret) |
+
+---
+
+## 7. Verification checklist
+
+- [ ] `claude mcp add 3d-agent -- npx -y @three-ws/mcp-server` connects; `tools/list` shows 17 tools.
+- [ ] `forge_free` returns a real GLB URL; `preview` opens in a browser.
+- [ ] Any paid tool, no payment → clean `PaymentRequired` (price + USDC-on-Solana + `payTo`), not a crash.
+- [ ] Re-add with `MCP_REVIEW_SECRET`/`MCP_REVIEW_MODE` (token from private notes); `get_pose_seed` returns real data; `text_to_avatar` returns a real GLB (credentialed reviewer instance).
+- [ ] No tool returns an unexplained error or stack trace.
+
+Full captured transcript: [`claude-tool-call-evidence.md`](./claude-tool-call-evidence.md).
diff --git a/docs/store-submissions/_generated/claude-tool-call-evidence.md b/docs/store-submissions/_generated/claude-tool-call-evidence.md
new file mode 100644
index 000000000..bb13b118a
--- /dev/null
+++ b/docs/store-submissions/_generated/claude-tool-call-evidence.md
@@ -0,0 +1,147 @@
+# Claude Connectors — tool-call evidence (`@three-ws/mcp-server`)
+
+**Connector:** `io.github.nirholas/3d-agent-mcp` — npm `@three-ws/[email protected]`, stdio transport.
+**Captured:** 2026-06-25 (UTC), against production `https://three.ws` for the free lane; payment challenges captured from the shipped tool surface with the built-in default payout.
+**Surface:** 17 tools — **1 free** (`forge_free`) + **16 paid** (x402 USDC on Solana mainnet, `exact` scheme).
+
+Methodology: every tool was driven once. Free tool → real generation. Paid tools were
+called with **no x402 payment and no review entitlement** — each must return a clean
+`PaymentRequired` (v2 MCP transport: `structuredContent` x402 envelope + `isError: true`),
+never a crash or stack trace. The review entitlement was then enabled to confirm paid
+tools run for real.
+
+---
+
+## 1. Free end-to-end smoke test — `forge_free` (no auth, no payment)
+
+Real call through the production `/api/forge` free NVIDIA NIM (Microsoft TRELLIS) lane:
+
+```json
+{
+ "ok": true, "free": true, "cost": "$0.00", "mode": "text_to_3d",
+ "glbUrl": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/a620d14f-a83d-43fe-8c0f-c87a46042933.glb",
+ "preview": "https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2Fa620d14f-a83d-43fe-8c0f-c87a46042933.glb",
+ "prompt": "a friendly round robot mascot, glossy white plastic",
+ "tier": "draft", "backend": "nvidia", "durable": true, "attempts": 1,
+ "creationId": "a620d14f-a83d-43fe-8c0f-c87a46042933", "durationMs": 57314
+}
+```
+
+- **GLB URL (durable R2):** https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/a620d14f-a83d-43fe-8c0f-c87a46042933.glb — verified reachable (HTTP `206` to a ranged GET).
+- **Viewer:** https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2Fa620d14f-a83d-43fe-8c0f-c87a46042933.glb
+
+**Reliability hardening verified.** When the NVIDIA NIM lane is cold it degrades to a
+HuggingFace Space whose gradio `/tmp` URL can expire within seconds (`durable:false`). The
+hardened `runForgeFree` (a) prefers a durable result via a bounded retry and (b) verifies any
+non-durable URL is actually reachable before returning it — so a reviewer never receives a
+dead link as "success". A second run reproduced the retry upgrading a degraded attempt to a
+durable one:
+
+```
+ok=true backend=nvidia durable=true attempts=2 # attempt 1 degraded → attempt 2 landed the durable NVIDIA lane
+glbUrl=https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/14f67185-efcc-45f6-8ab6-f9ca75637902.glb
+```
+
+When every attempt is non-durable **and** unreachable, the tool returns a clear
+`lane_degraded` error ("…try again shortly"), not a broken success.
+
+---
+
+## 2. Unpaid audit — every paid tool returns a clean `PaymentRequired`
+
+Each row: one call, no payment, no review mode. **Result: 16/16 paid tools returned a clean
+`PaymentRequired`. Zero crashes, zero stack traces.**
+
+Common to every challenge: `isError: true` (required by the @x402/mcp client to
+auto-detect-and-pay — it is the x402 contract, **not** a failure), `x402Version: 2`,
+`asset` = `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` (USDC), `network` =
+`solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` (Solana mainnet), `payTo` =
+`BUrwd1nK6tFeeJMyzRHDo6AuVbnSfUULfvwq21X93nSN` (platform default — the unsubstituted
+`${MCP_SVM_PAYMENT_ADDRESS}` placeholder bug is fixed), plus an appended plain-language line:
+*"Payment required — this is the EXPECTED response for a paid tool, not an error…"*.
+
+| Tool | Price | `amount` (atomic USDC) | Clean 402 |
+|---|---|---|---|
+| `ens_sns_resolve` | $0.0005 | 500 | ✓ |
+| `get_pose_seed` | $0.001 | 1000 | ✓ |
+| `agenc_list_tasks` | $0.001 | 1000 | ✓ |
+| `agenc_get_task` | $0.001 | 1000 | ✓ |
+| `agenc_get_agent` | $0.001 | 1000 | ✓ |
+| `sentiment_pulse` | $0.003 | 3000 | ✓ |
+| `pump_snapshot` | $0.005 | 5000 | ✓ |
+| `agent_delegate_action` | $0.01 | 10000 | ✓ |
+| `agent_reputation` | $0.01 | 10000 | ✓ |
+| `aixbt_intel` | $0.01 | 10000 | ✓ |
+| `aixbt_projects` | $0.01 | 10000 | ✓ |
+| `vanity_grinder` | $0.05 | 50000 | ✓ |
+| `text_to_avatar` | $0.15 | 150000 | ✓ |
+| `rig_mesh` | $0.20 | 200000 | ✓ |
+| `mesh_forge` | $0.25 | 250000 | ✓ |
+| `forge_avatar` | $0.45 | 450000 | ✓ |
+
+Representative raw challenge (`text_to_avatar`):
+
+```json
+{
+ "isError": true,
+ "structuredContent": {
+ "x402Version": 2,
+ "error": "Payment required to access this tool",
+ "accepts": [{
+ "scheme": "exact",
+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
+ "amount": "150000",
+ "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
+ "payTo": "BUrwd1nK6tFeeJMyzRHDo6AuVbnSfUULfvwq21X93nSN",
+ "maxTimeoutSeconds": 60,
+ "extra": { "name": "USDC", "decimals": 6, "feePayer": "2wKupLR9q6wXYppw8Gr2NvWxKBUqm4PPJKkQfoxHDBg4" }
+ }]
+ },
+ "content": [
+ { "type": "text", "text": "{…the x402 envelope as JSON…}" },
+ { "type": "text", "text": "Payment required — this is the EXPECTED response for a paid tool, not an error. Calling \"text_to_avatar\" costs $0.15 in USDC on Solana (paid to BUrwd1nK6tFeeJMyzRHDo6AuVbnSfUULfvwq21X93nSN). To execute it, supply an x402 \"exact\" payment in _meta[\"x402/payment\"] and call again, or set the reviewer entitlement (MCP_REVIEW_MODE) to run it without payment. Full machine-readable requirements are in structuredContent.accepts." }
+ ]
+}
+```
+
+---
+
+## 3. Funded review path — paid tools run for real (no mock)
+
+With the server-side review entitlement enabled
+(`MCP_REVIEW_SECRET=<token>` on the server **and** matching `MCP_REVIEW_MODE=<token>` in the
+client env), `reviewModeActive()` → `true` and paid tools run their **real handler** with no
+USDC charge.
+
+**Read tool — `get_pose_seed` (real result, no upstream creds needed):**
+
+```json
+{ "isError": false,
+ "structuredContent": {
+ "presetId": "fighting-stance",
+ "seed": "6153fce51ebdb477",
+ "previewUrl": "https://three.ws/pose?seed=6153fce51ebdb477&preset=fighting-stance"
+} }
+```
+
+**Generation tool — `text_to_avatar`** runs its real handler too; in this local capture no
+Replicate credentials were configured, so it returns a **clean, structured** error (not a
+crash) — exactly the designed contract:
+
+```json
+{ "ok": false, "error": "not_configured",
+ "message": "REPLICATE_TEXT_TO_AVATAR_MODEL is not set on the server. Pin a commercial-OK image/text-to-3D version (e.g. tencent/hunyuan-3d-3.1 latest)." }
+```
+
+On the operator-funded instance you point the reviewer at (which carries
+`REPLICATE_API_TOKEN` + `REPLICATE_TEXT_TO_AVATAR_MODEL`), the same review-mode call returns a
+real generated GLB URL + viewer link. See `claude-reviewer-guide.md` §"Funded review path".
+
+---
+
+## Verdict
+
+- No paid tool returns a crash-shaped error when unpaid — **16/16 clean `PaymentRequired`**.
+- Free path (`forge_free`) produces a viewable, durable GLB end-to-end with no auth/payment.
+- Review entitlement returns real results (demonstrated on `get_pose_seed`); generation
+ tools return real GLBs on a credentialed instance and clean structured errors otherwise.
diff --git a/mcp-server/app/build.mjs b/mcp-server/app/build.mjs
new file mode 100644
index 000000000..7c54d827c
--- /dev/null
+++ b/mcp-server/app/build.mjs
@@ -0,0 +1,135 @@
+// Build the agent_hire provenance receipt MCP App into one self-contained HTML.
+//
+// Bundles app/commerce-receipt.js (which imports the MCP Apps SDK) with esbuild
+// and inlines it into the card HTML. The result, src/ui/commerce-receipt.html,
+// is committed and shipped in the npm package — the stdio server serves it as
+// the ui:// resource that agent_hire links via _meta.ui.resourceUri.
+//
+// Run: node mcp-server/app/build.mjs
+
+import { build } from 'esbuild';
+import { writeFile, mkdir } from 'node:fs/promises';
+import { fileURLToPath } from 'node:url';
+import { dirname, join } from 'node:path';
+
+const here = dirname(fileURLToPath(import.meta.url));
+const pkgRoot = join(here, '..');
+
+const result = await build({
+ entryPoints: [join(here, 'commerce-receipt.js')],
+ bundle: true,
+ format: 'iife',
+ platform: 'browser',
+ target: 'es2020',
+ minify: true,
+ write: false,
+ legalComments: 'none',
+});
+const appJs = result.outputFiles[0].text;
+
+const html = `<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>three.ws agent hire receipt</title>
+<style>
+ :root {
+ --bg: #0b0b12; --panel: #14141f; --line: #24243a; --txt: #ececf5;
+ --muted: #9a9ab2; --accent: #6a5cff; --good: #2fd27a; --mid: #f2b441; --low: #ff5d5d;
+ }
+ :root[data-theme="light"] {
+ --bg: #f5f5fa; --panel: #ffffff; --line: #e4e4ee; --txt: #1a1a26;
+ --muted: #6a6a82; --accent: #5a4cf0;
+ }
+ * { box-sizing: border-box; }
+ html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt);
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; }
+ #status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
+ color: var(--muted); font-size: 14px; padding: 24px; text-align: center; }
+ #card { max-width: 520px; margin: 0 auto; padding: 18px; }
+ .head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
+ .receipt-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
+ color: var(--accent); }
+ .head h1 { font-size: 18px; margin: 0; font-weight: 700; flex: 1; }
+ .badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
+ border: 1px solid var(--line); }
+ .rep-high { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
+ .rep-mid { color: var(--mid); border-color: color-mix(in srgb, var(--mid) 45%, transparent); }
+ .rep-low { color: var(--low); border-color: color-mix(in srgb, var(--low) 45%, transparent); }
+ .rep-unknown { color: var(--muted); }
+ #agent-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
+ #rep-detail { font-size: 12px; color: var(--muted); margin: 2px 0 14px; }
+ .match { margin: 0 0 16px; }
+ .match-track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
+ #match-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #9b6cff);
+ border-radius: 999px; transition: width .5s ease; }
+ #match-pct { font-size: 12px; color: var(--muted); margin-top: 5px; display: block; }
+ .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
+ border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
+ .cell { background: var(--panel); padding: 11px 13px; }
+ .cell .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
+ .cell .v { font-size: 16px; font-weight: 700; margin-top: 3px; }
+ .cell .v small { font-size: 12px; font-weight: 600; color: var(--muted); }
+ #settle-row { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
+ border-radius: 10px; padding: 10px 13px; margin-bottom: 14px; font-size: 13px; }
+ #settle-row .k { color: var(--muted); }
+ #settle-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
+ #settle-link { margin-left: auto; color: var(--accent); text-decoration: none; font-weight: 600; }
+ #settle-link:hover, #settle-link:focus-visible { text-decoration: underline; }
+ .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
+ #task { font-size: 13px; color: var(--txt); margin-bottom: 14px; }
+ #response-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; }
+ #response { font-size: 13px; line-height: 1.5; white-space: pre-wrap; margin: 0; max-height: 240px; overflow: auto; }
+ a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+ @media (prefers-reduced-motion: reduce) { #match-bar { transition: none; } }
+</style>
+</head>
+<body>
+<div id="status">Loading hire receipt…</div>
+<main id="card" hidden aria-live="polite">
+ <div class="head">
+ <span class="receipt-tag">Hired &amp; paid</span>
+ <h1 id="agent-name">Agent</h1>
+ <span id="rep-badge" class="badge rep-unknown">unrated</span>
+ </div>
+ <div id="agent-id"></div>
+ <div id="rep-detail"></div>
+
+ <div class="match">
+ <div class="match-track"><div id="match-bar"></div></div>
+ <span id="match-pct">task fit n/a</span>
+ </div>
+
+ <div class="grid">
+ <div class="cell"><div class="k">Paid</div><div class="v"><span id="amount">—</span> <small id="asset">USDC</small></div></div>
+ <div class="cell"><div class="k">Settled on</div><div class="v" style="font-size:14px"><span id="network">Solana</span></div></div>
+ <div class="cell"><div class="k">Latency</div><div class="v" id="latency">—</div></div>
+ <div class="cell"><div class="k">Scheme</div><div class="v" style="font-size:14px">x402 exact</div></div>
+ </div>
+
+ <div id="settle-row" hidden>
+ <span class="k">Settlement</span>
+ <span id="settle-ref">—</span>
+ <a id="settle-link" href="#" target="_blank" rel="noopener noreferrer" hidden>view tx ↗</a>
+ </div>
+
+ <div class="label">Task</div>
+ <div id="task"></div>
+
+ <div id="response-wrap" hidden>
+ <div class="label">Result</div>
+ <pre id="response"></pre>
+ </div>
+</main>
+<script>${appJs}</script>
+</body>
+</html>`;
+
+const outDir = join(pkgRoot, 'src', 'ui');
+await mkdir(outDir, { recursive: true });
+const out = join(outDir, 'commerce-receipt.html');
+await writeFile(out, html, 'utf8');
+console.log(
+ `commerce-receipt.html written (${(html.length / 1024).toFixed(1)} KB, app bundle ${(appJs.length / 1024).toFixed(1)} KB)`,
+);
diff --git a/mcp-server/app/commerce-receipt.js b/mcp-server/app/commerce-receipt.js
new file mode 100644
index 000000000..df51e3829
--- /dev/null
+++ b/mcp-server/app/commerce-receipt.js
@@ -0,0 +1,159 @@
+// MCP App (iframe) for the agent_hire provenance receipt.
+//
+// Renders a transaction/provenance card inline in the host: which agent was
+// hired, its live ERC-8004 reputation, the USDC amount settled, the real
+// on-chain settlement reference (read from the tool result's
+// _meta["x402/payment-response"]), the latency, and the delegated result. The
+// whole point is trust through visibility — the user sees exactly what the host
+// model did, who it paid, and what it cost.
+//
+// Bundled (esbuild) and inlined into src/ui/commerce-receipt.html by
+// app/build.mjs. No external network calls, no analytics, no token surface —
+// USDC appears only as the settlement unit, never as a promoted coin.
+
+import { App } from '@modelcontextprotocol/ext-apps';
+
+const PAYMENT_RESPONSE_META_KEY = 'x402/payment-response';
+
+const els = {
+ card: document.getElementById('card'),
+ status: document.getElementById('status'),
+ agentName: document.getElementById('agent-name'),
+ agentId: document.getElementById('agent-id'),
+ repBadge: document.getElementById('rep-badge'),
+ repDetail: document.getElementById('rep-detail'),
+ matchBar: document.getElementById('match-bar'),
+ matchPct: document.getElementById('match-pct'),
+ amount: document.getElementById('amount'),
+ asset: document.getElementById('asset'),
+ network: document.getElementById('network'),
+ latency: document.getElementById('latency'),
+ settleRow: document.getElementById('settle-row'),
+ settleRef: document.getElementById('settle-ref'),
+ settleLink: document.getElementById('settle-link'),
+ task: document.getElementById('task'),
+ response: document.getElementById('response'),
+ responseWrap: document.getElementById('response-wrap'),
+};
+
+function short(s, head = 6, tail = 6) {
+ if (typeof s !== 'string' || s.length <= head + tail + 1) return s || '';
+ return `${s.slice(0, head)}…${s.slice(-tail)}`;
+}
+
+// Solana explorer link for a settled tx signature. Only ever a Solana mainnet
+// explorer — never an arbitrary URL.
+function explorerUrl(sig) {
+ if (typeof sig !== 'string' || !/^[1-9A-HJ-NP-Za-km-z]{43,90}$/.test(sig)) return null;
+ return `https://solscan.io/tx/${sig}`;
+}
+
+function reputationClass(avg) {
+ if (avg == null) return 'rep-unknown';
+ if (avg >= 0.66) return 'rep-high';
+ if (avg >= 0.2) return 'rep-mid';
+ return 'rep-low';
+}
+
+function showError(message) {
+ els.status.hidden = false;
+ els.status.textContent = message;
+ els.card.hidden = true;
+}
+
+function applyResult(result) {
+ const sc = (result && result.structuredContent) || {};
+ // agent_hire returns { ok, provenance, result, ... }. Tolerate the provenance
+ // block being the top-level object too.
+ const prov = sc.provenance || (sc.payment ? sc : null);
+
+ if (sc.ok === false) {
+ showError(sc.message || sc.error || 'The hire was blocked.');
+ return;
+ }
+ if (!prov) {
+ showError('Waiting for a hire receipt…');
+ return;
+ }
+
+ els.status.hidden = true;
+ els.card.hidden = false;
+
+ els.agentName.textContent = prov.agentName || 'Agent';
+ els.agentId.textContent = prov.agentId ? short(prov.agentId, 8, 6) : '';
+
+ // Reputation badge
+ const rep = prov.reputation;
+ const avg = rep && typeof rep.average === 'number' ? rep.average : null;
+ els.repBadge.className = `badge ${reputationClass(avg)}`;
+ if (rep && avg != null) {
+ els.repBadge.textContent = `rep ${avg.toFixed(2)}`;
+ els.repDetail.textContent = `${rep.count || 0} vouch${rep.count === 1 ? '' : 'es'} · ${rep.source || 'erc8004'}${rep.chain ? ` · ${rep.chain}` : ''}`;
+ } else if (rep) {
+ els.repBadge.textContent = 'on-chain id';
+ els.repDetail.textContent = `ERC-8004 #${rep.erc8004AgentId || '?'} · no vouches yet`;
+ } else {
+ els.repBadge.textContent = 'unrated';
+ els.repDetail.textContent = 'no on-chain reputation record';
+ }
+
+ // Capability match
+ const match = typeof prov.capabilityMatch === 'number' ? Math.max(0, Math.min(1, prov.capabilityMatch)) : null;
+ if (match != null) {
+ els.matchBar.style.width = `${(match * 100).toFixed(0)}%`;
+ els.matchPct.textContent = `${(match * 100).toFixed(0)}% task fit`;
+ } else {
+ els.matchBar.style.width = '0%';
+ els.matchPct.textContent = 'task fit n/a';
+ }
+
+ // Payment
+ const pay = prov.payment || {};
+ els.amount.textContent = pay.amountDisplay || (pay.amountUsd != null ? `$${pay.amountUsd}` : '—');
+ els.asset.textContent = pay.asset || 'USDC';
+ els.network.textContent = pay.networkLabel || 'Solana';
+ els.latency.textContent = prov.latencyMs != null ? `${(prov.latencyMs / 1000).toFixed(1)}s` : '—';
+
+ // Real settlement reference from _meta (attached by the x402 wrapper).
+ const settle = (result && result._meta && result._meta[PAYMENT_RESPONSE_META_KEY]) || null;
+ const sig = settle && (settle.transaction || settle.txHash || settle.signature);
+ if (sig) {
+ els.settleRow.hidden = false;
+ els.settleRef.textContent = short(sig, 8, 8);
+ const url = explorerUrl(sig);
+ if (url) {
+ els.settleLink.href = url;
+ els.settleLink.hidden = false;
+ } else {
+ els.settleLink.hidden = true;
+ }
+ } else {
+ // Settlement reference not yet present (e.g. preview, or host strips _meta).
+ els.settleRow.hidden = false;
+ els.settleRef.textContent = settle && settle.success === false ? 'settlement failed' : 'settled via x402';
+ els.settleLink.hidden = true;
+ }
+
+ // Task + delegated result
+ els.task.textContent = prov.task || sc.task || '';
+ const responseText = sc.result && (sc.result.response || sc.result.text);
+ if (responseText) {
+ els.response.textContent = responseText;
+ els.responseWrap.hidden = false;
+ } else {
+ els.responseWrap.hidden = true;
+ }
+}
+
+const app = new App({ name: 'three.ws Agent Hire Receipt', version: '1.0.0' });
+
+app.ontoolresult = (params) => applyResult(params);
+app.onerror = (err) => console.error('[commerce-receipt]', err);
+app.onhostcontextchanged = (ctx) => {
+ if (ctx && ctx.theme) document.documentElement.dataset.theme = ctx.theme;
+};
+
+app.connect().catch((err) => {
+ showError('Waiting for an MCP host…');
+ console.warn('[commerce-receipt] not connected to a host:', err?.message || err);
+});
diff --git a/mcp-server/package.json b/mcp-server/package.json
index da69a0b72..6090da4c8 100644
--- a/mcp-server/package.json
+++ b/mcp-server/package.json
@@ -50,6 +50,7 @@
},
"scripts": {
"start": "node src/index.js",
+ "build:ui": "node app/build.mjs",
"inspect": "npx -y @modelcontextprotocol/inspector node src/index.js",
"prepublishOnly": "node -e \"import('./src/index.js').catch(e => { if (!e.message.includes('facilitator')) throw e })\" 2>/dev/null; echo 'package check ok'"
},
@@ -76,6 +77,10 @@
"zod": "^3.23.8",
"zod-to-json-schema": "3.25.2"
},
+ "devDependencies": {
+ "@modelcontextprotocol/ext-apps": "^1.7.4",
+ "esbuild": "^0.28.0"
+ },
"bugs": {
"url": "https://github.com/nirholas/three.ws/issues"
}
diff --git a/mcp-server/src/commerce-ui.js b/mcp-server/src/commerce-ui.js
new file mode 100644
index 000000000..05fd4c09e
--- /dev/null
+++ b/mcp-server/src/commerce-ui.js
@@ -0,0 +1,44 @@
+// MCP Apps (SEP-1865) UI resource wiring for the agent_hire provenance receipt.
+//
+// agent_hire is an MCP App: it declares a ui:// resource (via _meta.ui.resourceUri
+// on the tool) that the host renders in a sandboxed iframe — the transaction /
+// provenance card showing who was hired, their reputation, the USDC settled, the
+// real settlement reference, and the delegated result. This module owns the
+// resource URI, MIME type, the CSP the sandbox needs, and reading the prebuilt
+// HTML bundle (app/build.mjs writes it here).
+
+import { readFileSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+import { dirname, join } from 'node:path';
+
+export const UI_RESOURCE_URI = 'ui://three-ws-commerce/hire-receipt.html';
+
+// The MCP Apps MIME type — identifies an HTML payload as an interactive app
+// resource per the MCP Apps spec.
+export const UI_MIME_TYPE = 'text/html;profile=mcp-app';
+
+// Origins the sandboxed iframe is allowed to reach. The receipt is fully
+// self-contained (inlined JS, no model/asset fetches) and only ever links out
+// to the Solana explorer for the settlement tx — so the only grant needed is
+// the explorer the "view tx" link targets. No token/coin endpoints.
+export const UI_CSP = {
+ connectDomains: [],
+ resourceDomains: ['https://solscan.io'],
+};
+
+// _meta.ui object placed on the UI resource (carries the CSP grant).
+export const UI_RESOURCE_META = { ui: { csp: UI_CSP } };
+
+// _meta.ui object placed on the agent_hire tool (links it to the UI resource).
+export const UI_TOOL_META = { ui: { resourceUri: UI_RESOURCE_URI } };
+
+const here = dirname(fileURLToPath(import.meta.url));
+let cachedHtml = null;
+
+// Read the prebuilt, self-contained card HTML (app/build.mjs writes it here).
+export function loadReceiptHtml() {
+ if (cachedHtml == null) {
+ cachedHtml = readFileSync(join(here, 'ui', 'commerce-receipt.html'), 'utf8');
+ }
+ return cachedHtml;
+}
diff --git a/mcp-server/src/index.js b/mcp-server/src/index.js
index 7d48889eb..df6ab3db3 100755
--- a/mcp-server/src/index.js
+++ b/mcp-server/src/index.js
@@ -39,11 +39,19 @@ import { buildForgeAvatarTool } from './tools/forge-avatar.js';
import { buildSentimentPulseTool } from './tools/sentiment-pulse.js';
import { buildEnsSnsResolveTool } from './tools/ens-sns-resolve.js';
import { buildAgentDelegateActionTool } from './tools/agent-delegate-action.js';
+import { buildAgentHireDiscoverTool } from './tools/agent-hire-discover.js';
+import { buildAgentHireTool } from './tools/agent-hire.js';
import { buildAgenCListTasksTool } from './tools/agenc-list-tasks.js';
import { buildAgenCGetTaskTool } from './tools/agenc-get-task.js';
import { buildAgenCGetAgentTool } from './tools/agenc-get-agent.js';
import { buildAixbtIntelTool } from './tools/aixbt-intel.js';
import { buildAixbtProjectsTool } from './tools/aixbt-projects.js';
+import {
+ UI_RESOURCE_URI,
+ UI_MIME_TYPE,
+ UI_RESOURCE_META,
+ loadReceiptHtml,
+} from './commerce-ui.js';
const SERVER_INSTRUCTIONS =
'MCP tools from three.ws. Most are paid: each quotes its USDC price in its description, and a call ' +
@@ -62,9 +70,13 @@ const SERVER_INSTRUCTIONS =
'ERC-8004 agent reputation (agent_reputation), Solana vanity address mining ' +
'(vanity_grinder), and AgenC coordination protocol reads — ' +
'task discovery, task status + lifecycle, and agent registry lookup ' +
- '(agenc_list_tasks, agenc_get_task, agenc_get_agent), and aixbt market ' +
+ '(agenc_list_tasks, agenc_get_task, agenc_get_agent), aixbt market ' +
'intelligence — narrative intel feed and momentum-ranked project scans ' +
- '(aixbt_intel, aixbt_projects).';
+ '(aixbt_intel, aixbt_projects), and live agent-to-agent commerce: discover and ' +
+ 'reputation-rank agents to hire for a task (agent_hire_discover), then hire one ' +
+ 'end to end — quote the price, settle real USDC via x402, run the remote agent, ' +
+ 'and return its result plus an inline provenance receipt with hard spend caps ' +
+ '(agent_hire).';
// The advertised MCP server version comes straight from package.json so it
// can never drift from the published npm version.
@@ -82,6 +94,8 @@ const TOOL_BUILDERS = [
buildForgeAvatarTool,
buildEnsSnsResolveTool,
buildAgentDelegateActionTool,
+ buildAgentHireDiscoverTool,
+ buildAgentHireTool,
buildSentimentPulseTool,
buildPoseSeedTool,
buildPumpSnapshotTool,
@@ -124,11 +138,13 @@ export async function buildServer() {
{
// Declare full tools capability so clients on the strict MCP 2025-06-18
// spec know we don't push tools/list_changed notifications (our tool
- // surface is fixed per-process). `resources` + `logging` left
- // undeclared because we don't ship resource or logging APIs over this
- // transport; declaring them empty would mislead clients into calling
- // resources/list and getting a method-not-found.
- capabilities: { tools: { listChanged: false } },
+ // surface is fixed per-process). `resources` is declared because
+ // agent_hire ships an MCP Apps UI resource (the provenance receipt
+ // card). `logging` stays undeclared — we ship no logging API.
+ capabilities: {
+ tools: { listChanged: false },
+ resources: { listChanged: false },
+ },
instructions: SERVER_INSTRUCTIONS,
},
);
@@ -146,11 +162,38 @@ export async function buildServer() {
// confirmation prompts per tool instead of treating every call
// as a destructive write.
annotations: t.annotations,
+ // Optional tool-level _meta (e.g. MCP Apps _meta.ui.resourceUri,
+ // which links agent_hire to its inline provenance receipt card).
+ ...(t._meta ? { _meta: t._meta } : {}),
},
t.handler,
);
}
+ // MCP Apps UI resource: the agent_hire provenance receipt card the host
+ // renders in a sandboxed iframe. agent_hire links to it via
+ // _meta.ui.resourceUri; the resource carries the sandbox CSP grant.
+ server.registerResource(
+ 'hire-receipt',
+ UI_RESOURCE_URI,
+ {
+ title: 'Agent hire receipt',
+ description: 'Inline provenance receipt rendered by agent_hire.',
+ mimeType: UI_MIME_TYPE,
+ _meta: UI_RESOURCE_META,
+ },
+ async (uri) => ({
+ contents: [
+ {
+ uri: uri.href ?? UI_RESOURCE_URI,
+ mimeType: UI_MIME_TYPE,
+ text: loadReceiptHtml(),
+ _meta: UI_RESOURCE_META,
+ },
+ ],
+ }),
+ );
+
return server;
}
diff --git a/mcp-server/src/lib/agent-registry.js b/mcp-server/src/lib/agent-registry.js
index e67d7121c..30cd2161c 100644
--- a/mcp-server/src/lib/agent-registry.js
+++ b/mcp-server/src/lib/agent-registry.js
@@ -44,10 +44,49 @@ export async function fetchCandidates({ q, skill, limit = 24 } = {}) {
return agents;
}
+/**
+ * Fetch one agent's public record by id, returning the fields the commerce
+ * tools need (name, on-chain identity for reputation, skills for task-fit).
+ * Returns null when the agent does not exist or the directory is unreachable —
+ * the caller decides whether a missing record is fatal.
+ *
+ * @param {string} agentId — three.ws agent UUID
+ * @returns {Promise<{id:string,name:string,description:string|null,skills:string[],erc8004_agent_id:string|null,chain_id:number|null,is_registered:boolean}|null>}
+ */
+export async function fetchAgentById(agentId) {
+ const url = `${baseUrl()}/api/agents/${encodeURIComponent(agentId)}`;
+ let res;
+ try {
+ res = await resilientFetch(
+ url,
+ { headers: { accept: 'application/json' } },
+ { timeoutMs: 10_000, retries: 2, label: 'agent-by-id' },
+ );
+ } catch {
+ return null;
+ }
+ if (!res.ok) return null;
+ const data = await res.json().catch(() => null);
+ const a = data?.agent;
+ if (!a || !a.id) return null;
+ return {
+ id: a.id,
+ name: a.name || null,
+ description: a.description || null,
+ skills: Array.isArray(a.skills) ? a.skills : [],
+ erc8004_agent_id:
+ a.erc8004_agent_id != null && String(a.erc8004_agent_id).trim() !== ''
+ ? String(a.erc8004_agent_id)
+ : null,
+ chain_id: a.chain_id ?? null,
+ is_registered: !!a.is_registered,
+ };
+}
+
// Token-overlap relevance between the task text and an agent's name + skills +
// description. Cheap, deterministic, and good enough to order a shortlist; the
// registry's full-text search already did the heavy filtering.
-function relevanceScore(task, agent) {
+export function relevanceScore(task, agent) {
const taskTokens = tokenize(task);
if (taskTokens.size === 0) return 0;
const hay = tokenize(
diff --git a/mcp-server/src/lib/pose-presets.js b/mcp-server/src/lib/pose-presets.js
index 4b5af0fa5..5dfe28957 100644
--- a/mcp-server/src/lib/pose-presets.js
+++ b/mcp-server/src/lib/pose-presets.js
@@ -108,6 +108,20 @@ export const PRESETS = [
chest: { x: -0.05, y: 0, z: 0 },
},
},
+ {
+ id: 'salute',
+ label: 'Salute',
+ group: 'Standing',
+ pose: {
+ chest: { x: -0.04, y: 0, z: 0 },
+ head: { x: 0.05, y: 0, z: 0 },
+ shoulderL: { x: -0.04, y: 0, z: 0.09 },
+ elbowL: { x: -0.12, y: 0, z: 0 },
+ shoulderR: { x: -0.78, y: 0.35, z: -0.60 },
+ elbowR: { x: -2.35, y: 0, z: 0 },
+ wristR: { x: 0, y: 0, z: -0.20 },
+ },
+ },
// ─── ACTION ───
{
@@ -217,6 +231,25 @@ export const PRESETS = [
rootPosition: { x: 0, y: -0.42, z: 0 },
},
},
+ {
+ id: 'fighting-stance',
+ label: 'Fighting stance',
+ group: 'Action',
+ pose: {
+ spine: { x: 0.05, y: 0.10, z: 0 },
+ chest: { x: 0.05, y: 0.22, z: 0 },
+ head: { x: 0.08, y: 0.12, z: 0 },
+ shoulderL: { x: -0.85, y: 0.30, z: -0.30 },
+ shoulderR: { x: -0.85, y: -0.25, z: -0.20 },
+ elbowL: { x: -2.10, y: 0, z: 0 },
+ elbowR: { x: -2.20, y: 0, z: 0 },
+ hipL: { x: -0.25, y: 0.10, z: 0.05 },
+ hipR: { x: -0.20, y: -0.10, z: -0.05 },
+ kneeL: { x: 0.45, y: 0, z: 0 },
+ kneeR: { x: 0.55, y: 0, z: 0 },
+ rootPosition: { x: 0, y: -0.12, z: 0 },
+ },
+ },
// ─── SITTING & FLOOR ───
{
@@ -404,6 +437,22 @@ export const PRESETS = [
head: { x: 0, y: -0.30, z: 0 },
},
},
+ {
+ id: 'facepalm',
+ label: 'Facepalm',
+ group: 'Expressive',
+ pose: {
+ spine: { x: 0.10, y: 0, z: 0 },
+ chest: { x: 0.18, y: 0, z: 0 },
+ neck: { x: 0.25, y: 0, z: 0 },
+ head: { x: 0.50, y: 0, z: 0 },
+ shoulderR: { x: -0.90, y: 0.50, z: -0.45 },
+ elbowR: { x: -2.40, y: 0, z: 0 },
+ wristR: { x: 0.10, y: 0, z: 0 },
+ shoulderL: { x: -0.15, y: 0, z: 0.12 },
+ elbowL: { x: -0.30, y: 0, z: 0 },
+ },
+ },
];
export function getPresetById(id) {
diff --git a/mcp-server/src/tools/_studio-core.js b/mcp-server/src/tools/_studio-core.js
index 4f937aaff..01f93b939 100644
--- a/mcp-server/src/tools/_studio-core.js
+++ b/mcp-server/src/tools/_studio-core.js
@@ -286,15 +286,25 @@ export async function runForgeFree({ prompt, tier }) {
const maxAttempts = Math.max(1, Math.min(4, Number(env('FORGE_FREE_ATTEMPTS', '2')) || 2));
let liveFallback = null; // first reachable-but-non-durable result, used only if no durable one appears
- let lastError = null;
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
let gen;
try {
gen = await forgeFreeOnce({ base, prompt: trimmed, tierId });
} catch (err) {
- lastError = err;
- continue; // provider/timeout error — retry while attempts remain
+ // A generation error is surfaced immediately — terminal failures
+ // (generation_failed, rate_limited, not_configured, timeout) must not
+ // trigger a wasteful re-generation, and this preserves the tool's
+ // original error contract. The ONLY exception: if an earlier attempt
+ // already produced a reachable result, keep it rather than losing a
+ // usable model to a later attempt's transient error.
+ if (liveFallback) break;
+ return coreError(err.code || 'provider_error', err.message, {
+ ...(err.extra || {}),
+ ...(err.retryAfter ? { retryAfter: err.retryAfter } : {}),
+ ...(attempt > 1 ? { attempts: attempt } : {}),
+ durationMs: Date.now() - startedAt,
+ });
}
// Durable — the reliable, R2-persisted result. Return immediately.
if (gen.data.durable && gen.data.glb_url) {
@@ -308,15 +318,16 @@ export async function runForgeFree({ prompt, tier }) {
attempts: attempt,
});
}
- // Non-durable — only trust it if the ephemeral URL is actually fetchable
- // right now. Keep the first reachable one, but keep trying for a durable
- // result while attempts remain.
+ // Non-durable success — only trust it if the ephemeral URL is actually
+ // fetchable right now. Keep the first reachable one, but keep trying for a
+ // durable result while attempts remain.
if (gen.data.glb_url && !liveFallback && (await isUrlReachable(gen.data.glb_url))) {
liveFallback = { data: gen.data, jobId: gen.jobId };
}
}
- // No durable result — fall back to a verified-reachable non-durable one.
+ // No durable result across all attempts — fall back to a verified-reachable
+ // non-durable one (flagged with a `warning` in shapeForgeFree).
if (liveFallback) {
return shapeForgeFree({
data: liveFallback.data,
@@ -329,16 +340,8 @@ export async function runForgeFree({ prompt, tier }) {
});
}
- // Nothing usable across all attempts — return a clear, actionable error
- // instead of a dead "success".
- if (lastError) {
- return coreError(lastError.code || 'provider_error', lastError.message, {
- ...(lastError.extra || {}),
- ...(lastError.retryAfter ? { retryAfter: lastError.retryAfter } : {}),
- attempts: maxAttempts,
- durationMs: Date.now() - startedAt,
- });
- }
+ // Every attempt produced a non-durable URL that was unreachable — return a
+ // clear, actionable error instead of a dead "success".
return coreError(
'lane_degraded',
'The free 3D lane produced a result but its URL was unreachable — the durable NVIDIA NIM path is ' +
diff --git a/mcp-server/src/tools/agent-hire.js b/mcp-server/src/tools/agent-hire.js
new file mode 100644
index 000000000..8673a08f7
--- /dev/null
+++ b/mcp-server/src/tools/agent-hire.js
@@ -0,0 +1,248 @@
+// `agent_hire` — paid MCP tool that hires a three.ws agent transparently: it
+// quotes the price up front, settles real USDC via the existing x402 facilitator,
+// runs the remote agent, and returns its result PLUS a provenance receipt (which
+// agent, its reputation, the amount paid, the settlement reference, the latency).
+//
+// Pricing: the platform delegation fee (MCP_AGENT_HIRE_PRICE_USD, default $0.05),
+// settled `exact` in USDC on Solana mainnet — the SAME x402 path every paid tool
+// uses. There is no mock settlement: a successful call settles real USDC, and the
+// on-chain reference lands in the result _meta["x402/payment-response"].
+//
+// Guardrails (enforced BEFORE the remote agent runs, so a blocked call returns a
+// clean error and the x402 wrapper cancels the payment — the caller is never
+// charged for a refused or failed hire):
+// - hard per-call spend cap (+ optional caller maxSpendUsd, which can only
+// tighten it)
+// - per-session cumulative cap
+// - confirmation required above a threshold
+// - optional ERC-8004 reputation floor
+//
+// Step two of the agent-to-agent commerce loop (discover → hire). The receipt is
+// rendered inline by the linked MCP App (commerce-ui.js) — trust through
+// visibility.
+
+import { z } from 'zod';
+
+import { paid, toolError } from '../payments.js';
+import { jsonSchemaFromZod } from './_shared.js';
+import { runDelegation } from '../lib/delegate-transport.js';
+import { fetchAgentById, readAgentReputation, relevanceScore } from '../lib/agent-registry.js';
+import {
+ buildProvenance,
+ evaluateSpendGuards,
+ formatUsd,
+ getSessionSpend,
+ guardrailConfig,
+ recordSessionSpend,
+} from '../lib/agent-commerce.js';
+import { UI_TOOL_META } from '../commerce-ui.js';
+
+const TOOL_NAME = 'agent_hire';
+const TOOL_DESCRIPTION =
+ 'Hire a three.ws agent end to end: quote the price up front, settle real USDC via x402, run the remote agent, and return its result PLUS a provenance receipt (agent, ERC-8004 reputation, amount paid, on-chain settlement reference, latency). Enforces hard spend caps (per-call + per-session), a confirmation threshold, and an optional reputation floor — a blocked or failed hire never charges the caller. Renders an inline receipt card. Step two of the commerce loop (after agent_hire_discover). Paid: the platform delegation fee in USDC.';
+
+function payToAddress() {
+ for (const k of ['MCP_SVM_PAYMENT_ADDRESS', 'X402_PAY_TO_SOLANA', 'X402_PAY_TO']) {
+ const v = process.env[k];
+ if (v && v.trim()) return v.trim();
+ }
+ return null;
+}
+
+const inputZodShape = {
+ agentId: z.string().min(1).max(120).describe('three.ws agent id (UUID) to hire.'),
+ message: z.string().min(1).max(4000).describe('The task / message to delegate to the agent.'),
+ model: z
+ .string()
+ .min(1)
+ .max(100)
+ .describe('Optional Claude model override (must be in the talk endpoint allowlist).')
+ .optional(),
+ maxSpendUsd: z
+ .number()
+ .min(0)
+ .describe('Optional per-call spend ceiling (USD). Can only tighten the hard cap, never raise it.')
+ .optional(),
+ minReputation: z
+ .number()
+ .describe('Optional ERC-8004 reputation floor — refuse the hire if the agent is below it.')
+ .optional(),
+ confirm: z
+ .boolean()
+ .describe('Set true to authorize a hire at or above the confirmation threshold.')
+ .optional(),
+ sessionId: z
+ .string()
+ .min(1)
+ .max(200)
+ .describe('Optional sub-session id to scope the per-session spend cap (defaults to the connection).')
+ .optional(),
+};
+
+const inputJsonSchema = jsonSchemaFromZod(inputZodShape);
+
+// The headline price is the platform delegation fee resolved from env at build
+// time (process env is static for a server's lifetime). This is the exact USDC
+// the x402 wrapper charges, so the quote and the charge can never disagree.
+const HIRE_PRICE_USD = guardrailConfig().hirePriceUsd;
+const HIRE_PRICE_LABEL = formatUsd(HIRE_PRICE_USD);
+
+export async function buildAgentHireTool() {
+ const handler = await paid(
+ {
+ toolName: TOOL_NAME,
+ description: TOOL_DESCRIPTION,
+ scheme: 'exact',
+ priceUsd: HIRE_PRICE_LABEL,
+ inputSchema: inputJsonSchema,
+ example: {
+ agentId: '5a4b3c2d-1234-5678-90ab-cdef01234567',
+ message: 'Summarise the latest pump.fun graduations in 3 bullets.',
+ minReputation: 0.5,
+ },
+ outputExample: {
+ ok: true,
+ agentId: '5a4b3c2d-1234-5678-90ab-cdef01234567',
+ agentName: 'Pump Sage',
+ result: { response: '• …', model: 'claude-haiku-4-5-20251001', durationMs: 1840 },
+ provenance: {
+ agentName: 'Pump Sage',
+ reputation: { average: 0.94, count: 12, source: 'erc8004', chain: 'Base' },
+ payment: { amountDisplay: '$0.05', asset: 'USDC', networkLabel: 'Solana mainnet' },
+ latencyMs: 1840,
+ },
+ },
+ },
+ async ({ agentId, message, model, maxSpendUsd, minReputation, confirm, sessionId }) => {
+ const cfg = guardrailConfig();
+ const price = cfg.hirePriceUsd;
+
+ // 1) Spend guardrails — evaluated before anything else so a blocked hire
+ // cancels the payment (toolError → isError) and never runs the agent.
+ const verdict = evaluateSpendGuards({
+ priceUsd: price,
+ maxSpendUsd,
+ confirm,
+ sessionId,
+ config: cfg,
+ });
+ if (!verdict.allowed) {
+ return toolError(verdict.code, verdict.message, {
+ quotedPriceUsd: formatUsd(price),
+ guardrails: verdict.limits,
+ });
+ }
+
+ // 2) Resolve the agent + reputation (best-effort enrichment; also powers
+ // the optional reputation gate).
+ const record = await fetchAgentById(agentId);
+ const reputation = record ? await readAgentReputation(record) : null;
+ const capabilityMatch =
+ record && record.skills.length
+ ? relevanceScore(message, { name: record.name, description: record.description, skills: record.skills })
+ : null;
+
+ // 3) Reputation gate (only when a floor is requested). Fail closed: an
+ // explicit floor with no readable on-chain reputation refuses the hire.
+ const floor =
+ typeof minReputation === 'number'
+ ? minReputation
+ : cfg.minReputation > 0
+ ? cfg.minReputation
+ : null;
+ if (floor != null) {
+ const avg = reputation ? reputation.average : null;
+ if (avg == null) {
+ return toolError(
+ 'reputation_unavailable',
+ `a reputation floor of ${floor} was set but ${record?.name || agentId} has no readable ERC-8004 reputation`,
+ { requestedMinReputation: floor },
+ );
+ }
+ if (avg < floor) {
+ return toolError(
+ 'reputation_below_threshold',
+ `${record?.name || agentId} has ERC-8004 reputation ${avg.toFixed(2)}, below the requested floor of ${floor}`,
+ { requestedMinReputation: floor, reputation: { average: avg, count: reputation.count } },
+ );
+ }
+ }
+
+ // 4) Run the remote agent. NOT retried (non-idempotent). On failure we
+ // return a clean error → payment cancelled ("real value or none").
+ const started = Date.now();
+ const delegation = await runDelegation({ agentId, message, model });
+ const latencyMs = Date.now() - started;
+ if (!delegation.ok) {
+ if (delegation.status === 0) {
+ return toolError('upstream_unreachable', delegation.error || 'agent endpoint unreachable');
+ }
+ return toolError(
+ delegation.error || 'agent_hire_failed',
+ delegation.message || delegation.error || `endpoint returned ${delegation.status}`,
+ );
+ }
+
+ const remote = delegation.data;
+ const agentName = remote.agentName || record?.name || null;
+
+ // 5) Provenance receipt + record the (about-to-settle) spend against the
+ // session ledger. The live on-chain settlement reference is attached
+ // by the x402 wrapper to result._meta — the card reads it from there.
+ const provenance = buildProvenance({
+ agentId,
+ agentName,
+ reputation,
+ capabilityMatch,
+ amountUsd: price,
+ latencyMs,
+ model: remote.model,
+ payTo: payToAddress(),
+ task: message,
+ });
+ const sessionSpentUsd = recordSessionSpend(sessionId, price, provenance);
+
+ return {
+ ok: true,
+ agentId,
+ agentName,
+ result: {
+ response: remote.response,
+ model: remote.model,
+ durationMs: remote.durationMs ?? latencyMs,
+ },
+ provenance,
+ guardrails: {
+ quotedPriceUsd: formatUsd(price),
+ perCallCapUsd: formatUsd(verdict.limits.effectivePerCallUsd),
+ sessionSpentUsd: formatUsd(sessionSpentUsd),
+ sessionCapUsd: formatUsd(cfg.maxPerSessionUsd),
+ sessionRemainingUsd: formatUsd(Math.max(0, cfg.maxPerSessionUsd - sessionSpentUsd)),
+ },
+ note: `Hired ${agentName || agentId}${
+ reputation && reputation.average != null ? ` (rep ${reputation.average.toFixed(2)})` : ''
+ } · paid ${formatUsd(price)} USDC · settlement reference in _meta["x402/payment-response"] · ${(
+ latencyMs / 1000
+ ).toFixed(1)}s`,
+ fetchedAt: new Date().toISOString(),
+ };
+ },
+ );
+ return {
+ name: TOOL_NAME,
+ title: `Agent hire (${HIRE_PRICE_LABEL})`,
+ description: TOOL_DESCRIPTION,
+ inputSchema: inputZodShape,
+ // MCP Apps: link to the provenance receipt card the host renders inline.
+ _meta: UI_TOOL_META,
+ // Spends USDC + runs a remote agent — a write with side effects, but it
+ // never destroys existing state.
+ annotations: {
+ readOnlyHint: false,
+ destructiveHint: false,
+ idempotentHint: false,
+ openWorldHint: true,
+ },
+ handler,
+ };
+}
diff --git a/mcp-server/src/ui/commerce-receipt.html b/mcp-server/src/ui/commerce-receipt.html
new file mode 100644
index 000000000..509eb99fb
--- /dev/null
+++ b/mcp-server/src/ui/commerce-receipt.html
@@ -0,0 +1,165 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>three.ws agent hire receipt</title>
+<style>
+ :root {
+ --bg: #0b0b12; --panel: #14141f; --line: #24243a; --txt: #ececf5;
+ --muted: #9a9ab2; --accent: #6a5cff; --good: #2fd27a; --mid: #f2b441; --low: #ff5d5d;
+ }
+ :root[data-theme="light"] {
+ --bg: #f5f5fa; --panel: #ffffff; --line: #e4e4ee; --txt: #1a1a26;
+ --muted: #6a6a82; --accent: #5a4cf0;
+ }
+ * { box-sizing: border-box; }
+ html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt);
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; }
+ #status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
+ color: var(--muted); font-size: 14px; padding: 24px; text-align: center; }
+ #card { max-width: 520px; margin: 0 auto; padding: 18px; }
+ .head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
+ .receipt-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
+ color: var(--accent); }
+ .head h1 { font-size: 18px; margin: 0; font-weight: 700; flex: 1; }
+ .badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
+ border: 1px solid var(--line); }
+ .rep-high { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
+ .rep-mid { color: var(--mid); border-color: color-mix(in srgb, var(--mid) 45%, transparent); }
+ .rep-low { color: var(--low); border-color: color-mix(in srgb, var(--low) 45%, transparent); }
+ .rep-unknown { color: var(--muted); }
+ #agent-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
+ #rep-detail { font-size: 12px; color: var(--muted); margin: 2px 0 14px; }
+ .match { margin: 0 0 16px; }
+ .match-track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
+ #match-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #9b6cff);
+ border-radius: 999px; transition: width .5s ease; }
+ #match-pct { font-size: 12px; color: var(--muted); margin-top: 5px; display: block; }
+ .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
+ border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
+ .cell { background: var(--panel); padding: 11px 13px; }
+ .cell .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
+ .cell .v { font-size: 16px; font-weight: 700; margin-top: 3px; }
+ .cell .v small { font-size: 12px; font-weight: 600; color: var(--muted); }
+ #settle-row { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
+ border-radius: 10px; padding: 10px 13px; margin-bottom: 14px; font-size: 13px; }
+ #settle-row .k { color: var(--muted); }
+ #settle-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
+ #settle-link { margin-left: auto; color: var(--accent); text-decoration: none; font-weight: 600; }
+ #settle-link:hover, #settle-link:focus-visible { text-decoration: underline; }
+ .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
+ #task { font-size: 13px; color: var(--txt); margin-bottom: 14px; }
+ #response-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; }
+ #response { font-size: 13px; line-height: 1.5; white-space: pre-wrap; margin: 0; max-height: 240px; overflow: auto; }
+ a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+ @media (prefers-reduced-motion: reduce) { #match-bar { transition: none; } }
+</style>
+</head>
+<body>
+<div id="status">Loading hire receipt…</div>
+<main id="card" hidden aria-live="polite">
+ <div class="head">
+ <span class="receipt-tag">Hired &amp; paid</span>
+ <h1 id="agent-name">Agent</h1>
+ <span id="rep-badge" class="badge rep-unknown">unrated</span>
+ </div>
+ <div id="agent-id"></div>
+ <div id="rep-detail"></div>
+
+ <div class="match">
+ <div class="match-track"><div id="match-bar"></div></div>
+ <span id="match-pct">task fit n/a</span>
+ </div>
+
+ <div class="grid">
+ <div class="cell"><div class="k">Paid</div><div class="v"><span id="amount">—</span> <small id="asset">USDC</small></div></div>
+ <div class="cell"><div class="k">Settled on</div><div class="v" style="font-size:14px"><span id="network">Solana</span></div></div>
+ <div class="cell"><div class="k">Latency</div><div class="v" id="latency">—</div></div>
+ <div class="cell"><div class="k">Scheme</div><div class="v" style="font-size:14px">x402 exact</div></div>
+ </div>
+
+ <div id="settle-row" hidden>
+ <span class="k">Settlement</span>
+ <span id="settle-ref">—</span>
+ <a id="settle-link" href="#" target="_blank" rel="noopener noreferrer" hidden>view tx ↗</a>
+ </div>
+
+ <div class="label">Task</div>
+ <div id="task"></div>
+
+ <div id="response-wrap" hidden>
+ <div class="label">Result</div>
+ <pre id="response"></pre>
+ </div>
+</main>
+<script>"use strict";(()=>{var Uc=Object.defineProperty;var id=(t,r,n)=>r in t?Uc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n;var Te=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,n)=>(typeof require<"u"?require:r)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var k=(t,r)=>()=>(t&&(r=t(t=0)),r);var xe=(t,r)=>{for(var n in r)Uc(t,n,{get:r[n],enumerable:!0})};var C=(t,r,n)=>id(t,typeof r!="symbol"?r+"":r,n);function u(t,r,n){function i(c,l){var h;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(h=c._zod).traits??(h.traits=new Set),c._zod.traits.add(t),r(c,l);for(let g in a.prototype)g in c||Object.defineProperty(c,g,{value:a.prototype[g].bind(c)});c._zod.constr=a,c._zod.def=l}let e=n?.Parent??Object;class o extends e{}Object.defineProperty(o,"name",{value:t});function a(c){var l;let h=n?.Parent?new o:this;i(h,c),(l=h._zod).deferred??(l.deferred=[]);for(let g of h._zod.deferred)g();return h}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}function W(t){return t&&Object.assign(kt,t),kt}var _r,yr,pe,kt,qe=k(()=>{_r=Object.freeze({status:"aborted"});yr=Symbol("zod_brand"),pe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},kt={}});var y={};xe(y,{BIGINT_FORMAT_RANGES:()=>Po,Class:()=>$o,NUMBER_FORMAT_RANGES:()=>jo,aborted:()=>Ne,allowsEval:()=>So,assert:()=>ld,assertEqual:()=>ad,assertIs:()=>cd,assertNever:()=>ud,assertNotEqual:()=>sd,assignProp:()=>ko,cached:()=>It,captureStackTrace:()=>$r,cleanEnum:()=>zd,cleanRegex:()=>jt,clone:()=>oe,createTransparentProxy:()=>hd,defineLazy:()=>R,esc:()=>Oe,escapeRegex:()=>_e,extend:()=>_d,finalizeIssue:()=>se,floatSafeRemainder:()=>zo,getElementAtPath:()=>md,getEnumValues:()=>wt,getLengthableOrigin:()=>Ot,getParsedType:()=>gd,getSizableOrigin:()=>Tt,isObject:()=>Ve,isPlainObject:()=>Fe,issue:()=>To,joinValues:()=>f,jsonStringifyReplacer:()=>xo,merge:()=>yd,normalizeParams:()=>v,nullish:()=>ze,numKeys:()=>fd,omit:()=>bd,optionalKeys:()=>Io,partial:()=>$d,pick:()=>vd,prefixIssues:()=>ie,primitiveTypes:()=>wo,promiseAllObject:()=>dd,propertyKeyTypes:()=>Pt,randomString:()=>pd,required:()=>xd,stringifyPrimitive:()=>_,unwrapMessage:()=>St});function ad(t){return t}function sd(t){return t}function cd(t){}function ud(t){throw new Error}function ld(t){}function wt(t){let r=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,e])=>r.indexOf(+i)===-1).map(([i,e])=>e)}function f(t,r="|"){return t.map(n=>_(n)).join(r)}function xo(t,r){return typeof r=="bigint"?r.toString():r}function It(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function ze(t){return t==null}function jt(t){let r=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(r,n)}function zo(t,r){let n=(t.toString().split(".")[1]||"").length,i=(r.toString().split(".")[1]||"").length,e=n>i?n:i,o=Number.parseInt(t.toFixed(e).replace(".","")),a=Number.parseInt(r.toFixed(e).replace(".",""));return o%a/10**e}function R(t,r,n){Object.defineProperty(t,r,{get(){{let e=n();return t[r]=e,e}throw new Error("cached value already set")},set(e){Object.defineProperty(t,r,{value:e})},configurable:!0})}function ko(t,r,n){Object.defineProperty(t,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function md(t,r){return r?r.reduce((n,i)=>n?.[i],t):t}function dd(t){let r=Object.keys(t),n=r.map(i=>t[i]);return Promise.all(n).then(i=>{let e={};for(let o=0;o<r.length;o++)e[r[o]]=i[o];return e})}function pd(t=10){let r="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=r[Math.floor(Math.random()*r.length)];return n}function Oe(t){return JSON.stringify(t)}function Ve(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Fe(t){if(Ve(t)===!1)return!1;let r=t.constructor;if(r===void 0)return!0;let n=r.prototype;return!(Ve(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function fd(t){let r=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r++;return r}function _e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oe(t,r,n){let i=new t._zod.constr(r??t._zod.def);return(!r||n?.parent)&&(i._zod.parent=t),i}function v(t){let r=t;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function hd(t){let r;return new Proxy({},{get(n,i,e){return r??(r=t()),Reflect.get(r,i,e)},set(n,i,e,o){return r??(r=t()),Reflect.set(r,i,e,o)},has(n,i){return r??(r=t()),Reflect.has(r,i)},deleteProperty(n,i){return r??(r=t()),Reflect.deleteProperty(r,i)},ownKeys(n){return r??(r=t()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,i){return r??(r=t()),Reflect.getOwnPropertyDescriptor(r,i)},defineProperty(n,i,e){return r??(r=t()),Reflect.defineProperty(r,i,e)}})}function _(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Io(t){return Object.keys(t).filter(r=>t[r]._zod.optin==="optional"&&t[r]._zod.optout==="optional")}function vd(t,r){let n={},i=t._zod.def;for(let e in r){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=i.shape[e])}return oe(t,{...t._zod.def,shape:n,checks:[]})}function bd(t,r){let n={...t._zod.def.shape},i=t._zod.def;for(let e in r){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);r[e]&&delete n[e]}return oe(t,{...t._zod.def,shape:n,checks:[]})}function _d(t,r){if(!Fe(r))throw new Error("Invalid input to extend: expected a plain object");let n={...t._zod.def,get shape(){let i={...t._zod.def.shape,...r};return ko(this,"shape",i),i},checks:[]};return oe(t,n)}function yd(t,r){return oe(t,{...t._zod.def,get shape(){let n={...t._zod.def.shape,...r._zod.def.shape};return ko(this,"shape",n),n},catchall:r._zod.def.catchall,checks:[]})}function $d(t,r,n){let i=r._zod.def.shape,e={...i};if(n)for(let o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(e[o]=t?new t({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)e[o]=t?new t({type:"optional",innerType:i[o]}):i[o];return oe(r,{...r._zod.def,shape:e,checks:[]})}function xd(t,r,n){let i=r._zod.def.shape,e={...i};if(n)for(let o in n){if(!(o in e))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(e[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)e[o]=new t({type:"nonoptional",innerType:i[o]});return oe(r,{...r._zod.def,shape:e,checks:[]})}function Ne(t,r=0){for(let n=r;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function ie(t,r){return r.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function St(t){return typeof t=="string"?t:t?.message}function se(t,r,n){let i={...t,path:t.path??[]};if(!t.message){let e=St(t.inst?._zod.def?.error?.(t))??St(r?.error?.(t))??St(n.customError?.(t))??St(n.localeError?.(t))??"Invalid input";i.message=e}return delete i.inst,delete i.continue,r?.reportInput||delete i.input,i}function Tt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Ot(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function To(...t){let[r,n,i]=t;return typeof r=="string"?{message:r,code:"custom",input:n,inst:i}:{...r}}function zd(t){return Object.entries(t).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}var $r,So,gd,Pt,wo,jo,Po,$o,P=k(()=>{$r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};So=It(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});gd=t=>{let r=typeof t;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},Pt=new Set(["string","number","symbol"]),wo=new Set(["string","number","bigint","boolean","symbol","undefined"]);jo={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]},Po={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};$o=class{constructor(...r){}}});function Je(t,r=n=>n.message){let n={},i=[];for(let e of t.issues)e.path.length>0?(n[e.path[0]]=n[e.path[0]]||[],n[e.path[0]].push(r(e))):i.push(r(e));return{formErrors:i,fieldErrors:n}}function Be(t,r){let n=r||function(o){return o.message},i={_errors:[]},e=o=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>e({issues:c}));else if(a.code==="invalid_key")e({issues:a.issues});else if(a.code==="invalid_element")e({issues:a.issues});else if(a.path.length===0)i._errors.push(n(a));else{let c=i,l=0;for(;l<a.path.length;){let h=a.path[l];l===a.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(n(a))):c[h]=c[h]||{_errors:[]},c=c[h],l++}}};return e(t),i}function xr(t,r){let n=r||function(o){return o.message},i={errors:[]},e=(o,a=[])=>{var c,l;for(let h of o.issues)if(h.code==="invalid_union"&&h.errors.length)h.errors.map(g=>e({issues:g},h.path));else if(h.code==="invalid_key")e({issues:h.issues},h.path);else if(h.code==="invalid_element")e({issues:h.issues},h.path);else{let g=[...a,...h.path];if(g.length===0){i.errors.push(n(h));continue}let m=i,$=0;for(;$<g.length;){let b=g[$],p=$===g.length-1;typeof b=="string"?(m.properties??(m.properties={}),(c=m.properties)[b]??(c[b]={errors:[]}),m=m.properties[b]):(m.items??(m.items=[]),(l=m.items)[b]??(l[b]={errors:[]}),m=m.items[b]),p&&m.errors.push(n(h)),$++}}};return e(t),i}function Dc(t){let r=[];for(let n of t)typeof n=="number"?r.push(`[${n}]`):typeof n=="symbol"?r.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?r.push(`[${JSON.stringify(n)}]`):(r.length&&r.push("."),r.push(n));return r.join("")}function zr(t){let r=[],n=[...t.issues].sort((i,e)=>i.path.length-e.path.length);for(let i of n)r.push(`\u2716 ${i.message}`),i.path?.length&&r.push(` \u2192 at ${Dc(i.path)}`);return r.join(`
+`)}var Ec,Nt,He,Oo=k(()=>{qe();P();Ec=(t,r)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:r,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(r,xo,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Nt=u("$ZodError",Ec),He=u("$ZodError",Ec,{Parent:Error})});var kr,Ut,Sr,Et,wr,We,Ir,Dt,jr=k(()=>{qe();Oo();P();kr=t=>(r,n,i,e)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new pe;if(a.issues.length){let c=new(e?.Err??t)(a.issues.map(l=>se(l,o,W())));throw $r(c,e?.callee),c}return a.value},Ut=kr(He),Sr=t=>async(r,n,i,e)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(e?.Err??t)(a.issues.map(l=>se(l,o,W())));throw $r(c,e?.callee),c}return a.value},Et=Sr(He),wr=t=>(r,n,i)=>{let e=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},e);if(o instanceof Promise)throw new pe;return o.issues.length?{success:!1,error:new(t??Nt)(o.issues.map(a=>se(a,e,W())))}:{success:!0,data:o.value}},We=wr(He),Ir=t=>async(r,n,i)=>{let e=i?Object.assign(i,{async:!0}):{async:!0},o=r._zod.run({value:n,issues:[]},e);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(a=>se(a,e,W())))}:{success:!0,data:o.value}},Dt=Ir(He)});var ke={};xe(ke,{_emoji:()=>Zc,base64:()=>Jo,base64url:()=>Pr,bigint:()=>Xo,boolean:()=>ri,browserEmail:()=>Nd,cidrv4:()=>Fo,cidrv6:()=>Ho,cuid:()=>No,cuid2:()=>Uo,date:()=>Ko,datetime:()=>Qo,domain:()=>Ud,duration:()=>Ao,e164:()=>Wo,email:()=>Mo,emoji:()=>Lo,extendedDuration:()=>Sd,guid:()=>Co,hostname:()=>Bo,html5Email:()=>Pd,integer:()=>ei,ipv4:()=>qo,ipv6:()=>Vo,ksuid:()=>Zo,lowercase:()=>ii,nanoid:()=>Ro,null:()=>ni,number:()=>ti,rfc5322Email:()=>Td,string:()=>Yo,time:()=>Go,ulid:()=>Eo,undefined:()=>oi,unicodeEmail:()=>Od,uppercase:()=>ai,uuid:()=>Ue,uuid4:()=>wd,uuid6:()=>Id,uuid7:()=>jd,xid:()=>Do});function Lo(){return new RegExp(Zc,"u")}function Ac(t){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${r}`:t.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${t.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Go(t){return new RegExp(`^${Ac(t)}$`)}function Qo(t){let r=Ac({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");let i=`${r}(?:${n.join("|")})`;return new RegExp(`^${Rc}T(?:${i})$`)}var No,Uo,Eo,Do,Zo,Ro,Ao,Sd,Co,Ue,wd,Id,jd,Mo,Pd,Td,Od,Nd,Zc,qo,Vo,Fo,Ho,Jo,Pr,Bo,Ud,Wo,Rc,Ko,Yo,Xo,ei,ti,ri,ni,oi,ii,ai,Tr=k(()=>{No=/^[cC][^\s-]{8,}$/,Uo=/^[0-9a-z]+$/,Eo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Do=/^[0-9a-vA-V]{20}$/,Zo=/^[A-Za-z0-9]{27}$/,Ro=/^[a-zA-Z0-9_-]{21}$/,Ao=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Sd=/^[-+]?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)?)??$/,Co=/^([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})$/,Ue=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,wd=Ue(4),Id=Ue(6),jd=Ue(7),Mo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Pd=/^[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])?)*$/,Td=/^(([^<>()\[\]\\.,;:\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,}))$/,Od=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Nd=/^[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])?)*$/,Zc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";qo=/^(?:(?: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])$/,Vo=/^(([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})$/,Fo=/^((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])$/,Ho=/^(([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])$/,Jo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pr=/^[A-Za-z0-9_-]*$/,Bo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Ud=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wo=/^\+(?:[0-9]){6,14}[0-9]$/,Rc="(?:(?:\\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])))",Ko=new RegExp(`^${Rc}$`);Yo=t=>{let r=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},Xo=/^\d+n?$/,ei=/^\d+$/,ti=/^-?\d+(?:\.\d+)?/i,ri=/true|false/i,ni=/null/i,oi=/undefined/i,ii=/^[^A-Z]*$/,ai=/^[^a-z]*$/});function Cc(t,r,n){t.issues.length&&r.issues.push(...ie(n,t.issues))}var B,Mc,Or,Nr,si,ci,ui,li,mi,di,pi,fi,gi,Ke,hi,vi,bi,_i,yi,$i,xi,zi,ki,Ur=k(()=>{qe();Tr();P();B=u("$ZodCheck",(t,r)=>{var n;t._zod??(t._zod={}),t._zod.def=r,(n=t._zod).onattach??(n.onattach=[])}),Mc={number:"number",bigint:"bigint",object:"date"},Or=u("$ZodCheckLessThan",(t,r)=>{B.init(t,r);let n=Mc[typeof r.value];t._zod.onattach.push(i=>{let e=i._zod.bag,o=(r.inclusive?e.maximum:e.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<o&&(r.inclusive?e.maximum=r.value:e.exclusiveMaximum=r.value)}),t._zod.check=i=>{(r.inclusive?i.value<=r.value:i.value<r.value)||i.issues.push({origin:n,code:"too_big",maximum:r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),Nr=u("$ZodCheckGreaterThan",(t,r)=>{B.init(t,r);let n=Mc[typeof r.value];t._zod.onattach.push(i=>{let e=i._zod.bag,o=(r.inclusive?e.minimum:e.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>o&&(r.inclusive?e.minimum=r.value:e.exclusiveMinimum=r.value)}),t._zod.check=i=>{(r.inclusive?i.value>=r.value:i.value>r.value)||i.issues.push({origin:n,code:"too_small",minimum:r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),si=u("$ZodCheckMultipleOf",(t,r)=>{B.init(t,r),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=r.value)}),t._zod.check=n=>{if(typeof n.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%r.value===BigInt(0):zo(n.value,r.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:t,continue:!r.abort})}}),ci=u("$ZodCheckNumberFormat",(t,r)=>{B.init(t,r),r.format=r.format||"float64";let n=r.format?.includes("int"),i=n?"int":"number",[e,o]=jo[r.format];t._zod.onattach.push(a=>{let c=a._zod.bag;c.format=r.format,c.minimum=e,c.maximum=o,n&&(c.pattern=ei)}),t._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:i,format:r.format,code:"invalid_type",input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!r.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!r.abort});return}}c<e&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:e,inclusive:!0,inst:t,continue:!r.abort}),c>o&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inst:t})}}),ui=u("$ZodCheckBigIntFormat",(t,r)=>{B.init(t,r);let[n,i]=Po[r.format];t._zod.onattach.push(e=>{let o=e._zod.bag;o.format=r.format,o.minimum=n,o.maximum=i}),t._zod.check=e=>{let o=e.value;o<n&&e.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!r.abort}),o>i&&e.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:t})}}),li=u("$ZodCheckMaxSize",(t,r)=>{var n;B.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!ze(e)&&e.size!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<e&&(i._zod.bag.maximum=r.maximum)}),t._zod.check=i=>{let e=i.value;e.size<=r.maximum||i.issues.push({origin:Tt(e),code:"too_big",maximum:r.maximum,input:e,inst:t,continue:!r.abort})}}),mi=u("$ZodCheckMinSize",(t,r)=>{var n;B.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!ze(e)&&e.size!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>e&&(i._zod.bag.minimum=r.minimum)}),t._zod.check=i=>{let e=i.value;e.size>=r.minimum||i.issues.push({origin:Tt(e),code:"too_small",minimum:r.minimum,input:e,inst:t,continue:!r.abort})}}),di=u("$ZodCheckSizeEquals",(t,r)=>{var n;B.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!ze(e)&&e.size!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag;e.minimum=r.size,e.maximum=r.size,e.size=r.size}),t._zod.check=i=>{let e=i.value,o=e.size;if(o===r.size)return;let a=o>r.size;i.issues.push({origin:Tt(e),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!r.abort})}}),pi=u("$ZodCheckMaxLength",(t,r)=>{var n;B.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!ze(e)&&e.length!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<e&&(i._zod.bag.maximum=r.maximum)}),t._zod.check=i=>{let e=i.value;if(e.length<=r.maximum)return;let a=Ot(e);i.issues.push({origin:a,code:"too_big",maximum:r.maximum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),fi=u("$ZodCheckMinLength",(t,r)=>{var n;B.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!ze(e)&&e.length!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>e&&(i._zod.bag.minimum=r.minimum)}),t._zod.check=i=>{let e=i.value;if(e.length>=r.minimum)return;let a=Ot(e);i.issues.push({origin:a,code:"too_small",minimum:r.minimum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),gi=u("$ZodCheckLengthEquals",(t,r)=>{var n;B.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!ze(e)&&e.length!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag;e.minimum=r.length,e.maximum=r.length,e.length=r.length}),t._zod.check=i=>{let e=i.value,o=e.length;if(o===r.length)return;let a=Ot(e),c=o>r.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!r.abort})}}),Ke=u("$ZodCheckStringFormat",(t,r)=>{var n,i;B.init(t,r),t._zod.onattach.push(e=>{let o=e._zod.bag;o.format=r.format,r.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(r.pattern))}),r.pattern?(n=t._zod).check??(n.check=e=>{r.pattern.lastIndex=0,!r.pattern.test(e.value)&&e.issues.push({origin:"string",code:"invalid_format",format:r.format,input:e.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:t,continue:!r.abort})}):(i=t._zod).check??(i.check=()=>{})}),hi=u("$ZodCheckRegex",(t,r)=>{Ke.init(t,r),t._zod.check=n=>{r.pattern.lastIndex=0,!r.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:t,continue:!r.abort})}}),vi=u("$ZodCheckLowerCase",(t,r)=>{r.pattern??(r.pattern=ii),Ke.init(t,r)}),bi=u("$ZodCheckUpperCase",(t,r)=>{r.pattern??(r.pattern=ai),Ke.init(t,r)}),_i=u("$ZodCheckIncludes",(t,r)=>{B.init(t,r);let n=_e(r.includes),i=new RegExp(typeof r.position=="number"?`^.{${r.position}}${n}`:n);r.pattern=i,t._zod.onattach.push(e=>{let o=e._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=e=>{e.value.includes(r.includes,r.position)||e.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:e.value,inst:t,continue:!r.abort})}}),yi=u("$ZodCheckStartsWith",(t,r)=>{B.init(t,r);let n=new RegExp(`^${_e(r.prefix)}.*`);r.pattern??(r.pattern=n),t._zod.onattach.push(i=>{let e=i._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(r.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:i.value,inst:t,continue:!r.abort})}}),$i=u("$ZodCheckEndsWith",(t,r)=>{B.init(t,r);let n=new RegExp(`.*${_e(r.suffix)}$`);r.pattern??(r.pattern=n),t._zod.onattach.push(i=>{let e=i._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(r.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:i.value,inst:t,continue:!r.abort})}});xi=u("$ZodCheckProperty",(t,r)=>{B.init(t,r),t._zod.check=n=>{let i=r.schema._zod.run({value:n.value[r.property],issues:[]},{});if(i instanceof Promise)return i.then(e=>Cc(e,n,r.property));Cc(i,n,r.property)}}),zi=u("$ZodCheckMimeType",(t,r)=>{B.init(t,r);let n=new Set(r.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=r.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:r.mime,input:i.value.type,inst:t})}}),ki=u("$ZodCheckOverwrite",(t,r)=>{B.init(t,r),t._zod.check=n=>{n.value=r.tx(n.value)}})});var Zt,Si=k(()=>{Zt=class{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let i=r.split(`
+`).filter(a=>a),e=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(e)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let r=Function,n=this?.args,e=[...(this?.content??[""]).map(o=>` ${o}`)];return new r(...n,e.join(`
+`))}}});var wi,Ii=k(()=>{wi={major:4,minor:0,patch:0}});function Wi(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Xc(t){if(!Pr.test(t))return!1;let r=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=r.padEnd(Math.ceil(r.length/4)*4,"=");return Wi(n)}function eu(t,r=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let e=JSON.parse(atob(i));return!("typ"in e&&e?.typ!=="JWT"||!e.alg||r&&(!("alg"in e)||e.alg!==r))}catch{return!1}}function qc(t,r,n){t.issues.length&&r.issues.push(...ie(n,t.issues)),r.value[n]=t.value}function Er(t,r,n){t.issues.length&&r.issues.push(...ie(n,t.issues)),r.value[n]=t.value}function Vc(t,r,n,i){t.issues.length?i[n]===void 0?n in i?r.value[n]=void 0:r.value[n]=t.value:r.issues.push(...ie(n,t.issues)):t.value===void 0?n in i&&(r.value[n]=void 0):r.value[n]=t.value}function Fc(t,r,n,i){for(let e of t)if(e.issues.length===0)return r.value=e.value,r;return r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:t.map(e=>e.issues.map(o=>se(o,i,W())))}),r}function ji(t,r){if(t===r)return{valid:!0,data:t};if(t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(Fe(t)&&Fe(r)){let n=Object.keys(r),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),e={...t,...r};for(let o of i){let a=ji(t[o],r[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};e[o]=a.data}return{valid:!0,data:e}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let e=t[i],o=r[i],a=ji(e,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Hc(t,r,n){if(r.issues.length&&t.issues.push(...r.issues),n.issues.length&&t.issues.push(...n.issues),Ne(t))return t;let i=ji(r.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}function Dr(t,r,n){t.issues.length&&r.issues.push(...ie(n,t.issues)),r.value[n]=t.value}function Jc(t,r,n,i,e,o,a){t.issues.length&&(Pt.has(typeof i)?n.issues.push(...ie(i,t.issues)):n.issues.push({origin:"map",code:"invalid_key",input:e,inst:o,issues:t.issues.map(c=>se(c,a,W()))})),r.issues.length&&(Pt.has(typeof i)?n.issues.push(...ie(i,r.issues)):n.issues.push({origin:"map",code:"invalid_element",input:e,inst:o,key:i,issues:r.issues.map(c=>se(c,a,W()))})),n.value.set(t.value,r.value)}function Bc(t,r){t.issues.length&&r.issues.push(...t.issues),r.value.add(t.value)}function Wc(t,r){return t.value===void 0&&(t.value=r.defaultValue),t}function Kc(t,r){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:r}),t}function Gc(t,r,n){return Ne(t)?t:r.out._zod.run({value:t.value,issues:t.issues},n)}function Qc(t){return t.value=Object.freeze(t.value),t}function Yc(t,r,n,i){if(!t){let e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),r.issues.push(To(e))}}var T,Ee,V,Pi,Ti,Oi,Ni,Ui,Ei,Di,Zi,Ri,Ai,Ci,Mi,Li,qi,Vi,Fi,Hi,Ji,Bi,Ki,Gi,Qi,Yi,Xi,Zr,ea,Rt,Rr,ta,ra,na,oa,ia,Ge,aa,sa,ca,At,ua,Ar,la,ma,De,da,pa,fa,ga,ha,va,Ct,ba,_a,ya,$a,xa,za,ka,Sa,Mt,wa,Ia,ja,Pa,Ta,Lt=k(()=>{Ur();qe();Si();jr();Tr();P();Ii();P();T=u("$ZodType",(t,r)=>{var n;t??(t={}),t._zod.def=r,t._zod.bag=t._zod.bag||{},t._zod.version=wi;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let e of i)for(let o of e._zod.onattach)o(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let e=(o,a,c)=>{let l=Ne(o),h;for(let g of a){if(g._zod.def.when){if(!g._zod.def.when(o))continue}else if(l)continue;let m=o.issues.length,$=g._zod.check(o);if($ instanceof Promise&&c?.async===!1)throw new pe;if(h||$ instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await $,o.issues.length!==m&&(l||(l=Ne(o,m)))});else{if(o.issues.length===m)continue;l||(l=Ne(o,m))}}return h?h.then(()=>o):o};t._zod.run=(o,a)=>{let c=t._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new pe;return c.then(l=>e(l,i,a))}return e(c,i,a)}}t["~standard"]={validate:e=>{try{let o=We(t,e);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Dt(t,e).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Ee=u("$ZodString",(t,r)=>{T.init(t,r),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Yo(t._zod.bag),t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),V=u("$ZodStringFormat",(t,r)=>{Ke.init(t,r),Ee.init(t,r)}),Pi=u("$ZodGUID",(t,r)=>{r.pattern??(r.pattern=Co),V.init(t,r)}),Ti=u("$ZodUUID",(t,r)=>{if(r.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(i===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=Ue(i))}else r.pattern??(r.pattern=Ue());V.init(t,r)}),Oi=u("$ZodEmail",(t,r)=>{r.pattern??(r.pattern=Mo),V.init(t,r)}),Ni=u("$ZodURL",(t,r)=>{V.init(t,r),t._zod.check=n=>{try{let i=n.value,e=new URL(i),o=e.href;r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(e.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Bo.source,input:n.value,inst:t,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:n.value,inst:t,continue:!r.abort})),!i.endsWith("/")&&o.endsWith("/")?n.value=o.slice(0,-1):n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!r.abort})}}}),Ui=u("$ZodEmoji",(t,r)=>{r.pattern??(r.pattern=Lo()),V.init(t,r)}),Ei=u("$ZodNanoID",(t,r)=>{r.pattern??(r.pattern=Ro),V.init(t,r)}),Di=u("$ZodCUID",(t,r)=>{r.pattern??(r.pattern=No),V.init(t,r)}),Zi=u("$ZodCUID2",(t,r)=>{r.pattern??(r.pattern=Uo),V.init(t,r)}),Ri=u("$ZodULID",(t,r)=>{r.pattern??(r.pattern=Eo),V.init(t,r)}),Ai=u("$ZodXID",(t,r)=>{r.pattern??(r.pattern=Do),V.init(t,r)}),Ci=u("$ZodKSUID",(t,r)=>{r.pattern??(r.pattern=Zo),V.init(t,r)}),Mi=u("$ZodISODateTime",(t,r)=>{r.pattern??(r.pattern=Qo(r)),V.init(t,r)}),Li=u("$ZodISODate",(t,r)=>{r.pattern??(r.pattern=Ko),V.init(t,r)}),qi=u("$ZodISOTime",(t,r)=>{r.pattern??(r.pattern=Go(r)),V.init(t,r)}),Vi=u("$ZodISODuration",(t,r)=>{r.pattern??(r.pattern=Ao),V.init(t,r)}),Fi=u("$ZodIPv4",(t,r)=>{r.pattern??(r.pattern=qo),V.init(t,r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv4"})}),Hi=u("$ZodIPv6",(t,r)=>{r.pattern??(r.pattern=Vo),V.init(t,r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!r.abort})}}}),Ji=u("$ZodCIDRv4",(t,r)=>{r.pattern??(r.pattern=Fo),V.init(t,r)}),Bi=u("$ZodCIDRv6",(t,r)=>{r.pattern??(r.pattern=Ho),V.init(t,r),t._zod.check=n=>{let[i,e]=n.value.split("/");try{if(!e)throw new Error;let o=Number(e);if(`${o}`!==e)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!r.abort})}}});Ki=u("$ZodBase64",(t,r)=>{r.pattern??(r.pattern=Jo),V.init(t,r),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{Wi(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!r.abort})}});Gi=u("$ZodBase64URL",(t,r)=>{r.pattern??(r.pattern=Pr),V.init(t,r),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{Xc(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!r.abort})}}),Qi=u("$ZodE164",(t,r)=>{r.pattern??(r.pattern=Wo),V.init(t,r)});Yi=u("$ZodJWT",(t,r)=>{V.init(t,r),t._zod.check=n=>{eu(n.value,r.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!r.abort})}}),Xi=u("$ZodCustomStringFormat",(t,r)=>{V.init(t,r),t._zod.check=n=>{r.fn(n.value)||n.issues.push({code:"invalid_format",format:r.format,input:n.value,inst:t,continue:!r.abort})}}),Zr=u("$ZodNumber",(t,r)=>{T.init(t,r),t._zod.pattern=t._zod.bag.pattern??ti,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=Number(n.value)}catch{}let e=n.value;if(typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e))return n;let o=typeof e=="number"?Number.isNaN(e)?"NaN":Number.isFinite(e)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:e,inst:t,...o?{received:o}:{}}),n}}),ea=u("$ZodNumber",(t,r)=>{ci.init(t,r),Zr.init(t,r)}),Rt=u("$ZodBoolean",(t,r)=>{T.init(t,r),t._zod.pattern=ri,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=!!n.value}catch{}let e=n.value;return typeof e=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:e,inst:t}),n}}),Rr=u("$ZodBigInt",(t,r)=>{T.init(t,r),t._zod.pattern=Xo,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),ta=u("$ZodBigInt",(t,r)=>{ui.init(t,r),Rr.init(t,r)}),ra=u("$ZodSymbol",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;return typeof e=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:e,inst:t}),n}}),na=u("$ZodUndefined",(t,r)=>{T.init(t,r),t._zod.pattern=oi,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(n,i)=>{let e=n.value;return typeof e>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:e,inst:t}),n}}),oa=u("$ZodNull",(t,r)=>{T.init(t,r),t._zod.pattern=ni,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let e=n.value;return e===null||n.issues.push({expected:"null",code:"invalid_type",input:e,inst:t}),n}}),ia=u("$ZodAny",(t,r)=>{T.init(t,r),t._zod.parse=n=>n}),Ge=u("$ZodUnknown",(t,r)=>{T.init(t,r),t._zod.parse=n=>n}),aa=u("$ZodNever",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),sa=u("$ZodVoid",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;return typeof e>"u"||n.issues.push({expected:"void",code:"invalid_type",input:e,inst:t}),n}}),ca=u("$ZodDate",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=new Date(n.value)}catch{}let e=n.value,o=e instanceof Date;return o&&!Number.isNaN(e.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:e,...o?{received:"Invalid Date"}:{},inst:t}),n}});At=u("$ZodArray",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;if(!Array.isArray(e))return n.issues.push({expected:"array",code:"invalid_type",input:e,inst:t}),n;n.value=Array(e.length);let o=[];for(let a=0;a<e.length;a++){let c=e[a],l=r.element._zod.run({value:c,issues:[]},i);l instanceof Promise?o.push(l.then(h=>qc(h,n,a))):qc(l,n,a)}return o.length?Promise.all(o).then(()=>n):n}});ua=u("$ZodObject",(t,r)=>{T.init(t,r);let n=It(()=>{let m=Object.keys(r.shape);for(let b of m)if(!(r.shape[b]instanceof T))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);let $=Io(r.shape);return{shape:r.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set($)}});R(t._zod,"propValues",()=>{let m=r.shape,$={};for(let b in m){let p=m[b]._zod;if(p.values){$[b]??($[b]=new Set);for(let x of p.values)$[b].add(x)}}return $});let i=m=>{let $=new Zt(["shape","payload","ctx"]),b=n.value,p=w=>{let j=Oe(w);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};$.write("const input = payload.value;");let x=Object.create(null),S=0;for(let w of b.keys)x[w]=`key_${S++}`;$.write("const newResult = {}");for(let w of b.keys)if(b.optionalKeys.has(w)){let j=x[w];$.write(`const ${j} = ${p(w)};`);let U=Oe(w);$.write(`
+ if (${j}.issues.length) {
+ if (input[${U}] === undefined) {
+ if (${U} in input) {
+ newResult[${U}] = undefined;
+ }
+ } else {
+ payload.issues = payload.issues.concat(
+ ${j}.issues.map((iss) => ({
+ ...iss,
+ path: iss.path ? [${U}, ...iss.path] : [${U}],
+ }))
+ );
+ }
+ } else if (${j}.value === undefined) {
+ if (${U} in input) newResult[${U}] = undefined;
+ } else {
+ newResult[${U}] = ${j}.value;
+ }
+ `)}else{let j=x[w];$.write(`const ${j} = ${p(w)};`),$.write(`
+ if (${j}.issues.length) payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
+ ...iss,
+ path: iss.path ? [${Oe(w)}, ...iss.path] : [${Oe(w)}]
+ })));`),$.write(`newResult[${Oe(w)}] = ${j}.value`)}$.write("payload.value = newResult;"),$.write("return payload;");let A=$.compile();return(w,j)=>A(m,w,j)},e,o=Ve,a=!kt.jitless,l=a&&So.value,h=r.catchall,g;t._zod.parse=(m,$)=>{g??(g=n.value);let b=m.value;if(!o(b))return m.issues.push({expected:"object",code:"invalid_type",input:b,inst:t}),m;let p=[];if(a&&l&&$?.async===!1&&$.jitless!==!0)e||(e=i(r.shape)),m=e(m,$);else{m.value={};let j=g.shape;for(let U of g.keys){let Pe=j[U],br=Pe._zod.run({value:b[U],issues:[]},$),Oc=Pe._zod.optin==="optional"&&Pe._zod.optout==="optional";br instanceof Promise?p.push(br.then(Nc=>Oc?Vc(Nc,m,U,b):Er(Nc,m,U))):Oc?Vc(br,m,U,b):Er(br,m,U)}}if(!h)return p.length?Promise.all(p).then(()=>m):m;let x=[],S=g.keySet,A=h._zod,w=A.def.type;for(let j of Object.keys(b)){if(S.has(j))continue;if(w==="never"){x.push(j);continue}let U=A.run({value:b[j],issues:[]},$);U instanceof Promise?p.push(U.then(Pe=>Er(Pe,m,j))):Er(U,m,j)}return x.length&&m.issues.push({code:"unrecognized_keys",keys:x,input:b,inst:t}),p.length?Promise.all(p).then(()=>m):m}});Ar=u("$ZodUnion",(t,r)=>{T.init(t,r),R(t._zod,"optin",()=>r.options.some(n=>n._zod.optin==="optional")?"optional":void 0),R(t._zod,"optout",()=>r.options.some(n=>n._zod.optout==="optional")?"optional":void 0),R(t._zod,"values",()=>{if(r.options.every(n=>n._zod.values))return new Set(r.options.flatMap(n=>Array.from(n._zod.values)))}),R(t._zod,"pattern",()=>{if(r.options.every(n=>n._zod.pattern)){let n=r.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>jt(i.source)).join("|")})$`)}}),t._zod.parse=(n,i)=>{let e=!1,o=[];for(let a of r.options){let c=a._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)o.push(c),e=!0;else{if(c.issues.length===0)return c;o.push(c)}}return e?Promise.all(o).then(a=>Fc(a,n,t,i)):Fc(o,n,t,i)}}),la=u("$ZodDiscriminatedUnion",(t,r)=>{Ar.init(t,r);let n=t._zod.parse;R(t._zod,"propValues",()=>{let e={};for(let o of r.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${r.options.indexOf(o)}"`);for(let[c,l]of Object.entries(a)){e[c]||(e[c]=new Set);for(let h of l)e[c].add(h)}}return e});let i=It(()=>{let e=r.options,o=new Map;for(let a of e){let c=a._zod.propValues[r.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${r.options.indexOf(a)}"`);for(let l of c){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});t._zod.parse=(e,o)=>{let a=e.value;if(!Ve(a))return e.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),e;let c=i.value.get(a?.[r.discriminator]);return c?c._zod.run(e,o):r.unionFallback?n(e,o):(e.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[r.discriminator],inst:t}),e)}}),ma=u("$ZodIntersection",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value,o=r.left._zod.run({value:e,issues:[]},i),a=r.right._zod.run({value:e,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,h])=>Hc(n,l,h)):Hc(n,o,a)}});De=u("$ZodTuple",(t,r)=>{T.init(t,r);let n=r.items,i=n.length-[...n].reverse().findIndex(e=>e._zod.optin!=="optional");t._zod.parse=(e,o)=>{let a=e.value;if(!Array.isArray(a))return e.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),e;e.value=[];let c=[];if(!r.rest){let h=a.length>n.length,g=a.length<i-1;if(h||g)return e.issues.push({input:a,inst:t,origin:"array",...h?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length}}),e}let l=-1;for(let h of n){if(l++,l>=a.length&&l>=i)continue;let g=h._zod.run({value:a[l],issues:[]},o);g instanceof Promise?c.push(g.then(m=>Dr(m,e,l))):Dr(g,e,l)}if(r.rest){let h=a.slice(n.length);for(let g of h){l++;let m=r.rest._zod.run({value:g,issues:[]},o);m instanceof Promise?c.push(m.then($=>Dr($,e,l))):Dr(m,e,l)}}return c.length?Promise.all(c).then(()=>e):e}});da=u("$ZodRecord",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;if(!Fe(e))return n.issues.push({expected:"record",code:"invalid_type",input:e,inst:t}),n;let o=[];if(r.keyType._zod.values){let a=r.keyType._zod.values;n.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let h=r.valueType._zod.run({value:e[l],issues:[]},i);h instanceof Promise?o.push(h.then(g=>{g.issues.length&&n.issues.push(...ie(l,g.issues)),n.value[l]=g.value})):(h.issues.length&&n.issues.push(...ie(l,h.issues)),n.value[l]=h.value)}let c;for(let l in e)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:e,inst:t,keys:c})}else{n.value={};for(let a of Reflect.ownKeys(e)){if(a==="__proto__")continue;let c=r.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:c.issues.map(h=>se(h,i,W())),input:a,path:[a],inst:t}),n.value[c.value]=c.value;continue}let l=r.valueType._zod.run({value:e[a],issues:[]},i);l instanceof Promise?o.push(l.then(h=>{h.issues.length&&n.issues.push(...ie(a,h.issues)),n.value[c.value]=h.value})):(l.issues.length&&n.issues.push(...ie(a,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),pa=u("$ZodMap",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;if(!(e instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:e,inst:t}),n;let o=[];n.value=new Map;for(let[a,c]of e){let l=r.keyType._zod.run({value:a,issues:[]},i),h=r.valueType._zod.run({value:c,issues:[]},i);l instanceof Promise||h instanceof Promise?o.push(Promise.all([l,h]).then(([g,m])=>{Jc(g,m,n,a,e,t,i)})):Jc(l,h,n,a,e,t,i)}return o.length?Promise.all(o).then(()=>n):n}});fa=u("$ZodSet",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;if(!(e instanceof Set))return n.issues.push({input:e,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let a of e){let c=r.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(l=>Bc(l,n))):Bc(c,n)}return o.length?Promise.all(o).then(()=>n):n}});ga=u("$ZodEnum",(t,r)=>{T.init(t,r);let n=wt(r.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(i=>Pt.has(typeof i)).map(i=>typeof i=="string"?_e(i):i.toString()).join("|")})$`),t._zod.parse=(i,e)=>{let o=i.value;return t._zod.values.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:t}),i}}),ha=u("$ZodLiteral",(t,r)=>{T.init(t,r),t._zod.values=new Set(r.values),t._zod.pattern=new RegExp(`^(${r.values.map(n=>typeof n=="string"?_e(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let e=n.value;return t._zod.values.has(e)||n.issues.push({code:"invalid_value",values:r.values,input:e,inst:t}),n}}),va=u("$ZodFile",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;return e instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:e,inst:t}),n}}),Ct=u("$ZodTransform",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=r.transform(n.value,n);if(i.async)return(e instanceof Promise?e:Promise.resolve(e)).then(a=>(n.value=a,n));if(e instanceof Promise)throw new pe;return n.value=e,n}}),ba=u("$ZodOptional",(t,r)=>{T.init(t,r),t._zod.optin="optional",t._zod.optout="optional",R(t._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),R(t._zod,"pattern",()=>{let n=r.innerType._zod.pattern;return n?new RegExp(`^(${jt(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>r.innerType._zod.optin==="optional"?r.innerType._zod.run(n,i):n.value===void 0?n:r.innerType._zod.run(n,i)}),_a=u("$ZodNullable",(t,r)=>{T.init(t,r),R(t._zod,"optin",()=>r.innerType._zod.optin),R(t._zod,"optout",()=>r.innerType._zod.optout),R(t._zod,"pattern",()=>{let n=r.innerType._zod.pattern;return n?new RegExp(`^(${jt(n.source)}|null)$`):void 0}),R(t._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:r.innerType._zod.run(n,i)}),ya=u("$ZodDefault",(t,r)=>{T.init(t,r),t._zod.optin="optional",R(t._zod,"values",()=>r.innerType._zod.values),t._zod.parse=(n,i)=>{if(n.value===void 0)return n.value=r.defaultValue,n;let e=r.innerType._zod.run(n,i);return e instanceof Promise?e.then(o=>Wc(o,r)):Wc(e,r)}});$a=u("$ZodPrefault",(t,r)=>{T.init(t,r),t._zod.optin="optional",R(t._zod,"values",()=>r.innerType._zod.values),t._zod.parse=(n,i)=>(n.value===void 0&&(n.value=r.defaultValue),r.innerType._zod.run(n,i))}),xa=u("$ZodNonOptional",(t,r)=>{T.init(t,r),R(t._zod,"values",()=>{let n=r.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let e=r.innerType._zod.run(n,i);return e instanceof Promise?e.then(o=>Kc(o,t)):Kc(e,t)}});za=u("$ZodSuccess",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=r.innerType._zod.run(n,i);return e instanceof Promise?e.then(o=>(n.value=o.issues.length===0,n)):(n.value=e.issues.length===0,n)}}),ka=u("$ZodCatch",(t,r)=>{T.init(t,r),t._zod.optin="optional",R(t._zod,"optout",()=>r.innerType._zod.optout),R(t._zod,"values",()=>r.innerType._zod.values),t._zod.parse=(n,i)=>{let e=r.innerType._zod.run(n,i);return e instanceof Promise?e.then(o=>(n.value=o.value,o.issues.length&&(n.value=r.catchValue({...n,error:{issues:o.issues.map(a=>se(a,i,W()))},input:n.value}),n.issues=[]),n)):(n.value=e.value,e.issues.length&&(n.value=r.catchValue({...n,error:{issues:e.issues.map(o=>se(o,i,W()))},input:n.value}),n.issues=[]),n)}}),Sa=u("$ZodNaN",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),Mt=u("$ZodPipe",(t,r)=>{T.init(t,r),R(t._zod,"values",()=>r.in._zod.values),R(t._zod,"optin",()=>r.in._zod.optin),R(t._zod,"optout",()=>r.out._zod.optout),t._zod.parse=(n,i)=>{let e=r.in._zod.run(n,i);return e instanceof Promise?e.then(o=>Gc(o,r,i)):Gc(e,r,i)}});wa=u("$ZodReadonly",(t,r)=>{T.init(t,r),R(t._zod,"propValues",()=>r.innerType._zod.propValues),R(t._zod,"values",()=>r.innerType._zod.values),R(t._zod,"optin",()=>r.innerType._zod.optin),R(t._zod,"optout",()=>r.innerType._zod.optout),t._zod.parse=(n,i)=>{let e=r.innerType._zod.run(n,i);return e instanceof Promise?e.then(Qc):Qc(e)}});Ia=u("$ZodTemplateLiteral",(t,r)=>{T.init(t,r);let n=[];for(let i of r.parts)if(i instanceof T){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let e=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!e)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=e.startsWith("^")?1:0,a=e.endsWith("$")?e.length-1:e.length;n.push(e.slice(o,a))}else if(i===null||wo.has(typeof i))n.push(_e(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,e)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"template_literal",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),i)}),ja=u("$ZodPromise",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(e=>r.innerType._zod.run({value:e,issues:[]},i))}),Pa=u("$ZodLazy",(t,r)=>{T.init(t,r),R(t._zod,"innerType",()=>r.getter()),R(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),R(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),R(t._zod,"optin",()=>t._zod.innerType._zod.optin),R(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),Ta=u("$ZodCustom",(t,r)=>{B.init(t,r),T.init(t,r),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,e=r.fn(i);if(e instanceof Promise)return e.then(o=>Yc(o,n,i,t));Yc(e,n,i,t)}})});function ru(){return{localeError:Ed()}}var Ed,nu=k(()=>{P();Ed=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":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 ${e.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\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 ${_(e.values[0])}`:`\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: ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${e.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${e.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${e.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${e.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${e.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${e.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${e.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`${i[o.format]??e.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 ${e.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${e.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${e.keys.length>1?"\u0629":""}: ${f(e.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${e.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 ${e.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function ou(){return{localeError:Dd()}}var Dd,iu=k(()=>{P();Dd=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${e.expected}, daxil olan ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${_(e.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${e.origin??"d\u0259y\u0259r"} ${o}${e.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${e.origin??"d\u0259y\u0259r"} ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${e.origin} ${o}${e.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${e.origin} ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[o.format]??e.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${e.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${e.keys.length>1?"lar":""}: ${f(e.keys,", ")}`;case"invalid_key":return`${e.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${e.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function au(t,r,n,i){let e=Math.abs(t),o=e%10,a=e%100;return a>=11&&a<=19?i:o===1?r:o>=2&&o<=4?n:i}function su(){return{localeError:Zd()}}var Zd,cu=k(()=>{P();Zd=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(e))return"\u043C\u0430\u0441\u0456\u045E";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${e.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${_(e.values[0])}`:`\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 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);if(a){let c=Number(e.maximum),l=au(c,a.unit.one,a.unit.few,a.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 ${e.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${e.maximum.toString()} ${l}`}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 ${e.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);if(a){let c=Number(e.minimum),l=au(c,a.unit.one,a.unit.few,a.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 ${e.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${e.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${e.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[o.format]??e.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 ${e.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${e.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${f(e.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${e.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 ${e.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function uu(){return{localeError:Rd()}}var Rd,lu=k(()=>{P();Rd=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Valor inv\xE0lid: s'esperava ${_(e.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${f(e.values," o ")}`;case"too_big":{let o=e.inclusive?"com a m\xE0xim":"menys de",a=r(e.origin);return a?`Massa gran: s'esperava que ${e.origin??"el valor"} contingu\xE9s ${o} ${e.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${e.origin??"el valor"} fos ${o} ${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?"com a m\xEDnim":"m\xE9s de",a=r(e.origin);return a?`Massa petit: s'esperava que ${e.origin} contingu\xE9s ${o} ${e.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${o} ${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${i[o.format]??e.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${e.divisor}`;case"unrecognized_keys":return`Clau${e.keys.length>1?"s":""} no reconeguda${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${e.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${e.origin}`;default:return"Entrada inv\xE0lida"}}}});function mu(){return{localeError:Ad()}}var Ad,du=k(()=>{P();Ad=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(e))return"pole";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${e.expected}, obdr\u017Eeno ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${_(e.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${e.origin??"hodnota"} mus\xED m\xEDt ${o}${e.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${e.origin??"hodnota"} mus\xED b\xFDt ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${e.origin??"hodnota"} mus\xED m\xEDt ${o}${e.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${e.origin??"hodnota"} mus\xED b\xFDt ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${i[o.format]??e.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${e.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${f(e.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${e.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${e.origin}`;default:return"Neplatn\xFD vstup"}}}});function pu(){return{localeError:Cd()}}var Cd,fu=k(()=>{P();Cd=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"Zahl";case"object":{if(Array.isArray(e))return"Array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Ung\xFCltige Eingabe: erwartet ${_(e.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Zu gro\xDF: erwartet, dass ${e.origin??"Wert"} ${o}${e.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${e.origin??"Wert"} ${o}${e.maximum.toString()} ist`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Zu klein: erwartet, dass ${e.origin} ${o}${e.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${o}${e.minimum.toString()} ist`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${i[o.format]??e.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case"unrecognized_keys":return`${e.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${f(e.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${e.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${e.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Cr(){return{localeError:Ld()}}var Md,Ld,Oa=k(()=>{P();Md=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},Ld=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function r(i){return t[i]??null}let n={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"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${Md(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${_(i.values[0])}`:`Invalid option: expected one of ${f(i.values,"|")}`;case"too_big":{let e=i.inclusive?"<=":"<",o=r(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${e}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${e}${i.maximum.toString()}`}case"too_small":{let e=i.inclusive?">=":">",o=r(i.origin);return o?`Too small: expected ${i.origin} to have ${e}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${e}${i.minimum.toString()}`}case"invalid_format":{let e=i;return e.format==="starts_with"?`Invalid string: must start with "${e.prefix}"`:e.format==="ends_with"?`Invalid string: must end with "${e.suffix}"`:e.format==="includes"?`Invalid string: must include "${e.includes}"`:e.format==="regex"?`Invalid string: must match pattern ${e.pattern}`:`Invalid ${n[e.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${f(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});function gu(){return{localeError:Vd()}}var qd,Vd,hu=k(()=>{P();qd=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},Vd=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function r(i){return t[i]??null}let n={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"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${i.expected}, ricevi\u011Dis ${qd(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${_(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${f(i.values,"|")}`;case"too_big":{let e=i.inclusive?"<=":"<",o=r(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${e}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${e}${i.maximum.toString()}`}case"too_small":{let e=i.inclusive?">=":">",o=r(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${e}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${e}${i.minimum.toString()}`}case"invalid_format":{let e=i;return e.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${e.prefix}"`:e.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${e.suffix}"`:e.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${e.includes}"`:e.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${e.pattern}`:`Nevalida ${n[e.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${f(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}}});function vu(){return{localeError:Fd()}}var Fd,bu=k(()=>{P();Fd=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(e))return"arreglo";if(e===null)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${e.expected}, recibido ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Entrada inv\xE1lida: se esperaba ${_(e.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Demasiado grande: se esperaba que ${e.origin??"valor"} tuviera ${o}${e.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${e.origin??"valor"} fuera ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Demasiado peque\xF1o: se esperaba que ${e.origin} tuviera ${o}${e.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${e.origin} fuera ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${i[o.format]??e.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${e.divisor}`;case"unrecognized_keys":return`Llave${e.keys.length>1?"s":""} desconocida${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${e.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${e.origin}`;default:return"Entrada inv\xE1lida"}}}});function _u(){return{localeError:Hd()}}var Hd,yu=k(()=>{P();Hd=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(e))return"\u0622\u0631\u0627\u06CC\u0647";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${e.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(e.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return e.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${_(e.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\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 ${f(e.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${e.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${e.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${e.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${e.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${e.origin} \u0628\u0627\u06CC\u062F ${o}${e.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${e.origin} \u0628\u0627\u06CC\u062F ${o}${e.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[o.format]??e.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 ${e.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${e.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${f(e.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${e.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 ${e.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function $u(){return{localeError:Jd()}}var Jd,xu=k(()=>{P();Jd=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${_(e.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${e.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${e.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??e.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${e.divisor} monikerta`;case"unrecognized_keys":return`${e.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${f(e.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"}}}});function zu(){return{localeError:Bd()}}var Bd,ku=k(()=>{P();Bd=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"nombre";case"object":{if(Array.isArray(e))return"tableau";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Entr\xE9e invalide : ${e.expected} attendu, ${n(e.input)} re\xE7u`;case"invalid_value":return e.values.length===1?`Entr\xE9e invalide : ${_(e.values[0])} attendu`:`Option invalide : une valeur parmi ${f(e.values,"|")} attendue`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Trop grand : ${e.origin??"valeur"} doit ${a.verb} ${o}${e.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${e.origin??"valeur"} doit \xEAtre ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Trop petit : ${e.origin} doit ${a.verb} ${o}${e.minimum.toString()} ${a.unit}`:`Trop petit : ${e.origin} doit \xEAtre ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${i[o.format]??e.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${e.divisor}`;case"unrecognized_keys":return`Cl\xE9${e.keys.length>1?"s":""} non reconnue${e.keys.length>1?"s":""} : ${f(e.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${e.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${e.origin}`;default:return"Entr\xE9e invalide"}}}});function Su(){return{localeError:Wd()}}var Wd,wu=k(()=>{P();Wd=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${e.expected}, re\xE7u ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Entr\xE9e invalide : attendu ${_(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"\u2264":"<",a=r(e.origin);return a?`Trop grand : attendu que ${e.origin??"la valeur"} ait ${o}${e.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${e.origin??"la valeur"} soit ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?"\u2265":">",a=r(e.origin);return a?`Trop petit : attendu que ${e.origin} ait ${o}${e.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${e.origin} soit ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??e.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${e.divisor}`;case"unrecognized_keys":return`Cl\xE9${e.keys.length>1?"s":""} non reconnue${e.keys.length>1?"s":""} : ${f(e.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${e.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${e.origin}`;default:return"Entr\xE9e invalide"}}}});function Iu(){return{localeError:Kd()}}var Kd,ju=k(()=>{P();Kd=()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return e=>{switch(e.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${e.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${_(e.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${e.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${e.maximum.toString()} ${a.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${e.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${e.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${e.minimum.toString()} ${a.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${e.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${o.prefix}"`:o.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${o.suffix}"`:o.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${o.includes}"`:o.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${o.pattern}`:`${i[o.format]??e.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}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 ${e.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${e.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${e.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${f(e.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${e.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${e.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Pu(){return{localeError:Gd()}}var Gd,Tu=k(()=>{P();Gd=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(e))return"t\xF6mb";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${e.expected}, a kapott \xE9rt\xE9k ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${_(e.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`T\xFAl nagy: ${e.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${e.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${e.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${e.origin} m\xE9rete t\xFAl kicsi ${o}${e.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${e.origin} t\xFAl kicsi ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[o.format]??e.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${e.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${e.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${e.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Ou(){return{localeError:Qd()}}var Qd,Nu=k(()=>{P();Qd=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Input tidak valid: diharapkan ${_(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Terlalu besar: diharapkan ${e.origin??"value"} memiliki ${o}${e.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${e.origin??"value"} menjadi ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Terlalu kecil: diharapkan ${e.origin} memiliki ${o}${e.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??e.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${e.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${e.origin}`;default:return"Input tidak valid"}}}});function Uu(){return{localeError:Yd()}}var Yd,Eu=k(()=>{P();Yd=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"numero";case"object":{if(Array.isArray(e))return"vettore";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Input non valido: atteso ${_(e.values[0])}`:`Opzione non valida: atteso uno tra ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Troppo grande: ${e.origin??"valore"} deve avere ${o}${e.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${e.origin??"valore"} deve essere ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Troppo piccolo: ${e.origin} deve avere ${o}${e.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${e.origin} deve essere ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??e.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case"unrecognized_keys":return`Chiav${e.keys.length>1?"i":"e"} non riconosciut${e.keys.length>1?"e":"a"}: ${f(e.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${e.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${e.origin}`;default:return"Input non valido"}}}});function Du(){return{localeError:Xd()}}var Xd,Zu=k(()=>{P();Xd=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(e))return"\u914D\u5217";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${e.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(e.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return e.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${_(e.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${f(e.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=e.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=r(e.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${e.origin??"\u5024"}\u306F${e.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${e.origin??"\u5024"}\u306F${e.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=e.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=r(e.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${e.origin}\u306F${e.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${e.origin}\u306F${e.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[o.format]??e.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${e.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${e.keys.length>1?"\u7FA4":""}: ${f(e.keys,"\u3001")}`;case"invalid_key":return`${e.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${e.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function Ru(){return{localeError:ep()}}var ep,Au=k(()=>{P();ep=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(e))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(e===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":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 ${e.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\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 ${_(e.values[0])}`:`\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 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${e.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${e.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${e.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${e.origin} ${o} ${e.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${e.origin} ${o} ${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[o.format]??e.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 ${e.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${f(e.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 ${e.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 ${e.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function Cu(){return{localeError:tp()}}var tp,Mu=k(()=>{P();tp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${e.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(e.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return e.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${_(e.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${f(e.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=e.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=r(e.origin),l=c?.unit??"\uC694\uC18C";return c?`${e.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${e.maximum.toString()}${l} ${o}${a}`:`${e.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${e.maximum.toString()} ${o}${a}`}case"too_small":{let o=e.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=r(e.origin),l=c?.unit??"\uC694\uC18C";return c?`${e.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${e.minimum.toString()}${l} ${o}${a}`:`${e.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${e.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[o.format]??e.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${e.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${f(e.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${e.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${e.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function Lu(){return{localeError:rp()}}var rp,qu=k(()=>{P();rp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(e))return"\u043D\u0438\u0437\u0430";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${e.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Invalid input: expected ${_(e.values[0])}`:`\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 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${e.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${e.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${e.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${e.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${e.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${e.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`Invalid ${i[o.format]??e.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 ${e.divisor}`;case"unrecognized_keys":return`${e.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"}: ${f(e.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${e.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 ${e.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function Vu(){return{localeError:np()}}var np,Fu=k(()=>{P();np=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"nombor";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Input tidak sah: dijangka ${_(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Terlalu besar: dijangka ${e.origin??"nilai"} ${a.verb} ${o}${e.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${e.origin??"nilai"} adalah ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Terlalu kecil: dijangka ${e.origin} ${a.verb} ${o}${e.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??e.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${f(e.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${e.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${e.origin}`;default:return"Input tidak sah"}}}});function Hu(){return{localeError:op()}}var op,Ju=k(()=>{P();op=()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"getal";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Ongeldige invoer: verwacht ${_(e.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Te lang: verwacht dat ${e.origin??"waarde"} ${o}${e.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${e.origin??"waarde"} ${o}${e.maximum.toString()} is`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Te kort: verwacht dat ${e.origin} ${o}${e.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${o}${e.minimum.toString()} is`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??e.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${e.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${e.origin}`;default:return"Ongeldige invoer"}}}});function Bu(){return{localeError:ip()}}var ip,Wu=k(()=>{P();ip=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"tall";case"object":{if(Array.isArray(e))return"liste";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Ugyldig verdi: forventet ${_(e.values[0])}`:`Ugyldig valg: forventet en av ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`For stor(t): forventet ${e.origin??"value"} til \xE5 ha ${o}${e.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${e.origin??"value"} til \xE5 ha ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`For lite(n): forventet ${e.origin} til \xE5 ha ${o}${e.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${e.origin} til \xE5 ha ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${i[o.format]??e.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${e.divisor}`;case"unrecognized_keys":return`${e.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${f(e.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${e.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${e.origin}`;default:return"Ugyldig input"}}}});function Ku(){return{localeError:ap()}}var ap,Gu=k(()=>{P();ap=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"numara";case"object":{if(Array.isArray(e))return"saf";if(e===null)return"gayb";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`F\xE2sit giren: umulan ${e.expected}, al\u0131nan ${n(e.input)}`;case"invalid_value":return e.values.length===1?`F\xE2sit giren: umulan ${_(e.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Fazla b\xFCy\xFCk: ${e.origin??"value"}, ${o}${e.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${e.origin??"value"}, ${o}${e.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Fazla k\xFC\xE7\xFCk: ${e.origin}, ${o}${e.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${e.origin}, ${o}${e.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=e;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[o.format]??e.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${e.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`${e.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${e.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Qu(){return{localeError:sp()}}var sp,Yu=k(()=>{P();sp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(e))return"\u0627\u0631\u06D0";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${e.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(e.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return e.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${_(e.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${f(e.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${e.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${e.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${e.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${e.maximum.toString()} \u0648\u064A`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${e.origin} \u0628\u0627\u06CC\u062F ${o}${e.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${e.origin} \u0628\u0627\u06CC\u062F ${o}${e.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${i[o.format]??e.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${e.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${e.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${f(e.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${e.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 ${e.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function Xu(){return{localeError:cp()}}var cp,el=k(()=>{P();cp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"liczba";case"object":{if(Array.isArray(e))return"tablica";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${_(e.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${e.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${e.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${e.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${e.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${e.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${e.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[o.format]??e.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${e.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${e.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${e.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function tl(){return{localeError:up()}}var up,rl=k(()=>{P();up=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(e))return"array";if(e===null)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${e.expected}, recebido ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Entrada inv\xE1lida: esperado ${_(e.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Muito grande: esperado que ${e.origin??"valor"} tivesse ${o}${e.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${e.origin??"valor"} fosse ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Muito pequeno: esperado que ${e.origin} tivesse ${o}${e.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${i[o.format]??e.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${e.divisor}`;case"unrecognized_keys":return`Chave${e.keys.length>1?"s":""} desconhecida${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${e.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${e.origin}`;default:return"Campo inv\xE1lido"}}}});function nl(t,r,n,i){let e=Math.abs(t),o=e%10,a=e%100;return a>=11&&a<=19?i:o===1?r:o>=2&&o<=4?n:i}function ol(){return{localeError:lp()}}var lp,il=k(()=>{P();lp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(e))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${e.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${_(e.values[0])}`:`\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 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);if(a){let c=Number(e.maximum),l=nl(c,a.unit.one,a.unit.few,a.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 ${e.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${e.maximum.toString()} ${l}`}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 ${e.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);if(a){let c=Number(e.minimum),l=nl(c,a.unit.one,a.unit.few,a.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 ${e.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${e.minimum.toString()} ${l}`}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 ${e.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[o.format]??e.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 ${e.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${e.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${e.keys.length>1?"\u0438":""}: ${f(e.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${e.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 ${e.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function al(){return{localeError:mp()}}var mp,sl=k(()=>{P();mp=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(e))return"tabela";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${e.expected}, prejeto ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${_(e.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${e.origin??"vrednost"} imelo ${o}${e.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${e.origin??"vrednost"} ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${e.origin} imelo ${o}${e.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${e.origin} ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??e.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${e.divisor}`;case"unrecognized_keys":return`Neprepoznan${e.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${f(e.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${e.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${e.origin}`;default:return"Neveljaven vnos"}}}});function cl(){return{localeError:dp()}}var dp,ul=k(()=>{P();dp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"antal";case"object":{if(Array.isArray(e))return"lista";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${e.expected}, fick ${n(e.input)}`;case"invalid_value":return e.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${_(e.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${e.origin??"v\xE4rdet"} att ha ${o}${e.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${e.origin??"v\xE4rdet"} att ha ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${e.origin??"v\xE4rdet"} att ha ${o}${e.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${e.origin??"v\xE4rdet"} att ha ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??e.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${e.divisor}`;case"unrecognized_keys":return`${e.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${f(e.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${e.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${e.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function ll(){return{localeError:pp()}}var pp,ml=k(()=>{P();pp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(e))return"\u0B85\u0BA3\u0BBF";if(e===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":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 ${e.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\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 ${_(e.values[0])}`:`\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 ${f(e.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\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 ${e.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${e.maximum.toString()} ${a.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`:`\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 ${e.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${e.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\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 ${e.origin} ${o}${e.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\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 ${e.origin} ${o}${e.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${i[o.format]??e.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${e.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${e.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${f(e.keys,", ")}`;case"invalid_key":return`${e.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`${e.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"}}}});function dl(){return{localeError:fp()}}var fp,pl=k(()=>{P();fp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(e))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(e===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":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 ${e.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${_(e.values[0])}`:`\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 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=r(e.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${e.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${e.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${e.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=r(e.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${e.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${e.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${e.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[o.format]??e.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 ${e.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: ${f(e.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${e.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 ${e.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function fl(){return{localeError:hp()}}var gp,hp,gl=k(()=>{P();gp=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},hp=()=>{let t={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 r(i){return t[i]??null}let n={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"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${gp(i.input)}`;case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${_(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${f(i.values,"|")}`;case"too_big":{let e=i.inclusive?"<=":"<",o=r(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${e}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${e}${i.maximum.toString()}`}case"too_small":{let e=i.inclusive?">=":">",o=r(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${e}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${e}${i.minimum.toString()}`}case"invalid_format":{let e=i;return e.format==="starts_with"?`Ge\xE7ersiz metin: "${e.prefix}" ile ba\u015Flamal\u0131`:e.format==="ends_with"?`Ge\xE7ersiz metin: "${e.suffix}" ile bitmeli`:e.format==="includes"?`Ge\xE7ersiz metin: "${e.includes}" i\xE7ermeli`:e.format==="regex"?`Ge\xE7ersiz metin: ${e.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[e.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${f(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function hl(){return{localeError:vp()}}var vp,vl=k(()=>{P();vp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(e))return"\u043C\u0430\u0441\u0438\u0432";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":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 ${e.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\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 ${_(e.values[0])}`:`\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 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\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 ${e.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${e.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\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 ${e.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${e.origin} ${a.verb} ${o}${e.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${e.origin} \u0431\u0443\u0434\u0435 ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[o.format]??e.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 ${e.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${e.keys.length>1?"\u0456":""}: ${f(e.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${e.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 ${e.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function bl(){return{localeError:bp()}}var bp,_l=k(()=>{P();bp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(e))return"\u0622\u0631\u06D2";if(e===null)return"\u0646\u0644";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${e.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(e.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return e.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${_(e.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${f(e.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${e.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${e.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${e.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${e.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${e.origin} \u06A9\u06D2 ${o}${e.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${e.origin} \u06A9\u0627 ${o}${e.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[o.format]??e.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${e.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${e.keys.length>1?"\u0632":""}: ${f(e.keys,"\u060C ")}`;case"invalid_key":return`${e.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${e.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function yl(){return{localeError:_p()}}var _p,$l=k(()=>{P();_p=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(e))return"m\u1EA3ng";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${e.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${_(e.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${e.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${e.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${e.origin??"gi\xE1 tr\u1ECB"} ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${e.origin} ${a.verb} ${o}${e.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${e.origin} ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${i[o.format]??e.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 ${e.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${f(e.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${e.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 ${e.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function xl(){return{localeError:yp()}}var yp,zl=k(()=>{P();yp=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(e))return"\u6570\u7EC4";if(e===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${e.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${_(e.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${e.origin??"\u503C"} ${o}${e.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${e.origin??"\u503C"} ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${e.origin} ${o}${e.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${e.origin} ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${i[o.format]??e.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${e.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${f(e.keys,", ")}`;case"invalid_key":return`${e.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${e.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function kl(){return{localeError:$p()}}var $p,Sl=k(()=>{P();$p=()=>{let t={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 r(e){return t[e]??null}let n=e=>{let o=typeof e;switch(o){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return o},i={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"};return e=>{switch(e.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${e.expected}\uFF0C\u4F46\u6536\u5230 ${n(e.input)}`;case"invalid_value":return e.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${_(e.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${f(e.values,"|")}`;case"too_big":{let o=e.inclusive?"<=":"<",a=r(e.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${e.origin??"\u503C"} \u61C9\u70BA ${o}${e.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${e.origin??"\u503C"} \u61C9\u70BA ${o}${e.maximum.toString()}`}case"too_small":{let o=e.inclusive?">=":">",a=r(e.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${e.origin} \u61C9\u70BA ${o}${e.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${e.origin} \u61C9\u70BA ${o}${e.minimum.toString()}`}case"invalid_format":{let o=e;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${i[o.format]??e.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${e.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${e.keys.length>1?"\u5011":""}\uFF1A${f(e.keys,"\u3001")}`;case"invalid_key":return`${e.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${e.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});var Qe={};xe(Qe,{ar:()=>ru,az:()=>ou,be:()=>su,ca:()=>uu,cs:()=>mu,de:()=>pu,en:()=>Cr,eo:()=>gu,es:()=>vu,fa:()=>_u,fi:()=>$u,fr:()=>zu,frCA:()=>Su,he:()=>Iu,hu:()=>Pu,id:()=>Ou,it:()=>Uu,ja:()=>Du,kh:()=>Ru,ko:()=>Cu,mk:()=>Lu,ms:()=>Vu,nl:()=>Hu,no:()=>Bu,ota:()=>Ku,pl:()=>Xu,ps:()=>Qu,pt:()=>tl,ru:()=>ol,sl:()=>al,sv:()=>cl,ta:()=>ll,th:()=>dl,tr:()=>fl,ua:()=>hl,ur:()=>bl,vi:()=>yl,zhCN:()=>xl,zhTW:()=>kl});var Na=k(()=>{nu();iu();cu();lu();du();fu();Oa();hu();bu();yu();xu();ku();wu();ju();Tu();Nu();Eu();Zu();Au();Mu();qu();Fu();Ju();Wu();Gu();Yu();el();rl();il();sl();ul();ml();pl();gl();vl();_l();$l();zl();Sl()});function qt(){return new Ye}var Mr,Lr,Ye,de,Ua=k(()=>{Mr=Symbol("ZodOutput"),Lr=Symbol("ZodInput"),Ye=class{constructor(){this._map=new Map,this._idmap=new Map}add(r,...n){let i=n[0];if(this._map.set(r,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,r)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(r){let n=this._map.get(r);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(r),this}get(r){let n=r._zod.parent;if(n){let i={...this.get(n)??{}};return delete i.id,{...i,...this._map.get(r)}}return this._map.get(r)}has(r){return this._map.has(r)}};de=qt()});function Ea(t,r){return new t({type:"string",...v(r)})}function Da(t,r){return new t({type:"string",coerce:!0,...v(r)})}function qr(t,r){return new t({type:"string",format:"email",check:"string_format",abort:!1,...v(r)})}function Vt(t,r){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...v(r)})}function Vr(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...v(r)})}function Fr(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...v(r)})}function Hr(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...v(r)})}function Jr(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...v(r)})}function Br(t,r){return new t({type:"string",format:"url",check:"string_format",abort:!1,...v(r)})}function Wr(t,r){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...v(r)})}function Kr(t,r){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...v(r)})}function Gr(t,r){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...v(r)})}function Qr(t,r){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...v(r)})}function Yr(t,r){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...v(r)})}function Xr(t,r){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...v(r)})}function en(t,r){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...v(r)})}function tn(t,r){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(r)})}function rn(t,r){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(r)})}function nn(t,r){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...v(r)})}function on(t,r){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...v(r)})}function an(t,r){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...v(r)})}function sn(t,r){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...v(r)})}function cn(t,r){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...v(r)})}function un(t,r){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...v(r)})}function Za(t,r){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(r)})}function Ra(t,r){return new t({type:"string",format:"date",check:"string_format",...v(r)})}function Aa(t,r){return new t({type:"string",format:"time",check:"string_format",precision:null,...v(r)})}function Ca(t,r){return new t({type:"string",format:"duration",check:"string_format",...v(r)})}function Ma(t,r){return new t({type:"number",checks:[],...v(r)})}function La(t,r){return new t({type:"number",coerce:!0,checks:[],...v(r)})}function qa(t,r){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...v(r)})}function Va(t,r){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...v(r)})}function Fa(t,r){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...v(r)})}function Ha(t,r){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...v(r)})}function Ja(t,r){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...v(r)})}function Ba(t,r){return new t({type:"boolean",...v(r)})}function Wa(t,r){return new t({type:"boolean",coerce:!0,...v(r)})}function Ka(t,r){return new t({type:"bigint",...v(r)})}function Ga(t,r){return new t({type:"bigint",coerce:!0,...v(r)})}function Qa(t,r){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...v(r)})}function Ya(t,r){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...v(r)})}function Xa(t,r){return new t({type:"symbol",...v(r)})}function es(t,r){return new t({type:"undefined",...v(r)})}function ts(t,r){return new t({type:"null",...v(r)})}function rs(t){return new t({type:"any"})}function Xe(t){return new t({type:"unknown"})}function ns(t,r){return new t({type:"never",...v(r)})}function os(t,r){return new t({type:"void",...v(r)})}function is(t,r){return new t({type:"date",...v(r)})}function as(t,r){return new t({type:"date",coerce:!0,...v(r)})}function ss(t,r){return new t({type:"nan",...v(r)})}function fe(t,r){return new Or({check:"less_than",...v(r),value:t,inclusive:!1})}function ce(t,r){return new Or({check:"less_than",...v(r),value:t,inclusive:!0})}function ge(t,r){return new Nr({check:"greater_than",...v(r),value:t,inclusive:!1})}function ne(t,r){return new Nr({check:"greater_than",...v(r),value:t,inclusive:!0})}function mn(t){return ge(0,t)}function dn(t){return fe(0,t)}function pn(t){return ce(0,t)}function fn(t){return ne(0,t)}function Se(t,r){return new si({check:"multiple_of",...v(r),value:t})}function Ze(t,r){return new li({check:"max_size",...v(r),maximum:t})}function we(t,r){return new mi({check:"min_size",...v(r),minimum:t})}function et(t,r){return new di({check:"size_equals",...v(r),size:t})}function Re(t,r){return new pi({check:"max_length",...v(r),maximum:t})}function ye(t,r){return new fi({check:"min_length",...v(r),minimum:t})}function Ae(t,r){return new gi({check:"length_equals",...v(r),length:t})}function tt(t,r){return new hi({check:"string_format",format:"regex",...v(r),pattern:t})}function rt(t){return new vi({check:"string_format",format:"lowercase",...v(t)})}function nt(t){return new bi({check:"string_format",format:"uppercase",...v(t)})}function ot(t,r){return new _i({check:"string_format",format:"includes",...v(r),includes:t})}function it(t,r){return new yi({check:"string_format",format:"starts_with",...v(r),prefix:t})}function at(t,r){return new $i({check:"string_format",format:"ends_with",...v(r),suffix:t})}function gn(t,r,n){return new xi({check:"property",property:t,schema:r,...v(n)})}function st(t,r){return new zi({check:"mime_type",mime:t,...v(r)})}function he(t){return new ki({check:"overwrite",tx:t})}function ct(t){return he(r=>r.normalize(t))}function ut(){return he(t=>t.trim())}function lt(){return he(t=>t.toLowerCase())}function mt(){return he(t=>t.toUpperCase())}function Ft(t,r,n){return new t({type:"array",element:r,...v(n)})}function xp(t,r,n){return new t({type:"union",options:r,...v(n)})}function zp(t,r,n,i){return new t({type:"union",options:n,discriminator:r,...v(i)})}function kp(t,r,n){return new t({type:"intersection",left:r,right:n})}function cs(t,r,n,i){let e=n instanceof T,o=e?i:n,a=e?n:null;return new t({type:"tuple",items:r,rest:a,...v(o)})}function Sp(t,r,n,i){return new t({type:"record",keyType:r,valueType:n,...v(i)})}function wp(t,r,n,i){return new t({type:"map",keyType:r,valueType:n,...v(i)})}function Ip(t,r,n){return new t({type:"set",valueType:r,...v(n)})}function jp(t,r,n){let i=Array.isArray(r)?Object.fromEntries(r.map(e=>[e,e])):r;return new t({type:"enum",entries:i,...v(n)})}function Pp(t,r,n){return new t({type:"enum",entries:r,...v(n)})}function Tp(t,r,n){return new t({type:"literal",values:Array.isArray(r)?r:[r],...v(n)})}function us(t,r){return new t({type:"file",...v(r)})}function Op(t,r){return new t({type:"transform",transform:r})}function Np(t,r){return new t({type:"optional",innerType:r})}function Up(t,r){return new t({type:"nullable",innerType:r})}function Ep(t,r,n){return new t({type:"default",innerType:r,get defaultValue(){return typeof n=="function"?n():n}})}function Dp(t,r,n){return new t({type:"nonoptional",innerType:r,...v(n)})}function Zp(t,r){return new t({type:"success",innerType:r})}function Rp(t,r,n){return new t({type:"catch",innerType:r,catchValue:typeof n=="function"?n:()=>n})}function Ap(t,r,n){return new t({type:"pipe",in:r,out:n})}function Cp(t,r){return new t({type:"readonly",innerType:r})}function Mp(t,r,n){return new t({type:"template_literal",parts:r,...v(n)})}function Lp(t,r){return new t({type:"lazy",getter:r})}function qp(t,r){return new t({type:"promise",innerType:r})}function ls(t,r,n){let i=v(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:r,...i})}function ms(t,r,n){return new t({type:"custom",check:"custom",fn:r,...v(n)})}function ds(t,r){let n=v(r),i=n.truthy??["true","1","yes","on","y","enabled"],e=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),e=e.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(i),a=new Set(e),c=t.Pipe??Mt,l=t.Boolean??Rt,h=t.String??Ee,g=t.Transform??Ct,m=new g({type:"transform",transform:(p,x)=>{let S=p;return n.case!=="sensitive"&&(S=S.toLowerCase()),o.has(S)?!0:a.has(S)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:x.value,inst:m}),{})},error:n.error}),$=new c({type:"pipe",in:new h({type:"string",error:n.error}),out:m,error:n.error});return new c({type:"pipe",in:$,out:new l({type:"boolean",error:n.error}),error:n.error})}function ps(t,r,n,i={}){let e=v(i),o={...v(i),check:"string_format",type:"string",format:r,fn:typeof n=="function"?n:c=>n.test(c),...e};return n instanceof RegExp&&(o.pattern=n),new t(o)}var ln,fs=k(()=>{Ur();Lt();P();ln={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function vn(t){return new hn({type:"function",input:Array.isArray(t?.input)?cs(De,t?.input):t?.input??Ft(At,Xe(Ge)),output:t?.output??Xe(Ge)})}var hn,wl=k(()=>{fs();jr();Lt();Lt();hn=class{constructor(r){this._def=r,this.def=r}implement(r){if(typeof r!="function")throw new Error("implement() must be called with a function");let n=((...i)=>{let e=this._def.input?Ut(this._def.input,i,void 0,{callee:n}):i;if(!Array.isArray(e))throw new Error("Invalid arguments schema: not an array or tuple schema.");let o=r(...e);return this._def.output?Ut(this._def.output,o,void 0,{callee:n}):o});return n}implementAsync(r){if(typeof r!="function")throw new Error("implement() must be called with a function");let n=(async(...i)=>{let e=this._def.input?await Et(this._def.input,i,void 0,{callee:n}):i;if(!Array.isArray(e))throw new Error("Invalid arguments schema: not an array or tuple schema.");let o=await r(...e);return this._def.output?Et(this._def.output,o,void 0,{callee:n}):o});return n}input(...r){let n=this.constructor;return Array.isArray(r[0])?new n({type:"function",input:new De({type:"tuple",items:r[0],rest:r[1]}),output:this._def.output}):new n({type:"function",input:r[0],output:this._def.output})}output(r){let n=this.constructor;return new n({type:"function",input:this._def.input,output:r})}}});function bn(t,r){if(t instanceof Ye){let i=new Ht(r),e={};for(let c of t._idmap.entries()){let[l,h]=c;i.process(h)}let o={},a={registry:t,uri:r?.uri,defs:e};for(let c of t._idmap.entries()){let[l,h]=c;o[l]=i.emit(h,{...r,external:a})}if(Object.keys(e).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:e}}return{schemas:o}}let n=new Ht(r);return n.process(t),n.emit(t,r)}function G(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let e=t._zod.def;switch(e.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return G(e.element,n);case"object":{for(let o in e.shape)if(G(e.shape[o],n))return!0;return!1}case"union":{for(let o of e.options)if(G(o,n))return!0;return!1}case"intersection":return G(e.left,n)||G(e.right,n);case"tuple":{for(let o of e.items)if(G(o,n))return!0;return!!(e.rest&&G(e.rest,n))}case"record":return G(e.keyType,n)||G(e.valueType,n);case"map":return G(e.keyType,n)||G(e.valueType,n);case"set":return G(e.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return G(e.innerType,n);case"lazy":return G(e.getter(),n);case"default":return G(e.innerType,n);case"prefault":return G(e.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return G(e.in,n)||G(e.out,n);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${e.type}`)}var Ht,Il=k(()=>{Ua();P();Ht=class{constructor(r){this.counter=0,this.metadataRegistry=r?.metadata??de,this.target=r?.target??"draft-2020-12",this.unrepresentable=r?.unrepresentable??"throw",this.override=r?.override??(()=>{}),this.io=r?.io??"output",this.seen=new Map}process(r,n={path:[],schemaPath:[]}){var i;let e=r._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(r);if(a)return a.count++,n.schemaPath.includes(r)&&(a.cycle=n.path),a.schema;let c={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(r,c);let l=r._zod.toJSONSchema?.();if(l)c.schema=l;else{let m={...n,schemaPath:[...n.schemaPath,r],path:n.path},$=r._zod.parent;if($)c.ref=$,this.process($,m),this.seen.get($).isParent=!0;else{let b=c.schema;switch(e.type){case"string":{let p=b;p.type="string";let{minimum:x,maximum:S,format:A,patterns:w,contentEncoding:j}=r._zod.bag;if(typeof x=="number"&&(p.minLength=x),typeof S=="number"&&(p.maxLength=S),A&&(p.format=o[A]??A,p.format===""&&delete p.format),j&&(p.contentEncoding=j),w&&w.size>0){let U=[...w];U.length===1?p.pattern=U[0].source:U.length>1&&(c.schema.allOf=[...U.map(Pe=>({...this.target==="draft-7"?{type:"string"}:{},pattern:Pe.source}))])}break}case"number":{let p=b,{minimum:x,maximum:S,format:A,multipleOf:w,exclusiveMaximum:j,exclusiveMinimum:U}=r._zod.bag;typeof A=="string"&&A.includes("int")?p.type="integer":p.type="number",typeof U=="number"&&(p.exclusiveMinimum=U),typeof x=="number"&&(p.minimum=x,typeof U=="number"&&(U>=x?delete p.minimum:delete p.exclusiveMinimum)),typeof j=="number"&&(p.exclusiveMaximum=j),typeof S=="number"&&(p.maximum=S,typeof j=="number"&&(j<=S?delete p.maximum:delete p.exclusiveMaximum)),typeof w=="number"&&(p.multipleOf=w);break}case"boolean":{let p=b;p.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{b.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{b.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let p=b,{minimum:x,maximum:S}=r._zod.bag;typeof x=="number"&&(p.minItems=x),typeof S=="number"&&(p.maxItems=S),p.type="array",p.items=this.process(e.element,{...m,path:[...m.path,"items"]});break}case"object":{let p=b;p.type="object",p.properties={};let x=e.shape;for(let w in x)p.properties[w]=this.process(x[w],{...m,path:[...m.path,"properties",w]});let S=new Set(Object.keys(x)),A=new Set([...S].filter(w=>{let j=e.shape[w]._zod;return this.io==="input"?j.optin===void 0:j.optout===void 0}));A.size>0&&(p.required=Array.from(A)),e.catchall?._zod.def.type==="never"?p.additionalProperties=!1:e.catchall?e.catchall&&(p.additionalProperties=this.process(e.catchall,{...m,path:[...m.path,"additionalProperties"]})):this.io==="output"&&(p.additionalProperties=!1);break}case"union":{let p=b;p.anyOf=e.options.map((x,S)=>this.process(x,{...m,path:[...m.path,"anyOf",S]}));break}case"intersection":{let p=b,x=this.process(e.left,{...m,path:[...m.path,"allOf",0]}),S=this.process(e.right,{...m,path:[...m.path,"allOf",1]}),A=j=>"allOf"in j&&Object.keys(j).length===1,w=[...A(x)?x.allOf:[x],...A(S)?S.allOf:[S]];p.allOf=w;break}case"tuple":{let p=b;p.type="array";let x=e.items.map((w,j)=>this.process(w,{...m,path:[...m.path,"prefixItems",j]}));if(this.target==="draft-2020-12"?p.prefixItems=x:p.items=x,e.rest){let w=this.process(e.rest,{...m,path:[...m.path,"items"]});this.target==="draft-2020-12"?p.items=w:p.additionalItems=w}e.rest&&(p.items=this.process(e.rest,{...m,path:[...m.path,"items"]}));let{minimum:S,maximum:A}=r._zod.bag;typeof S=="number"&&(p.minItems=S),typeof A=="number"&&(p.maxItems=A);break}case"record":{let p=b;p.type="object",p.propertyNames=this.process(e.keyType,{...m,path:[...m.path,"propertyNames"]}),p.additionalProperties=this.process(e.valueType,{...m,path:[...m.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let p=b,x=wt(e.entries);x.every(S=>typeof S=="number")&&(p.type="number"),x.every(S=>typeof S=="string")&&(p.type="string"),p.enum=x;break}case"literal":{let p=b,x=[];for(let S of e.values)if(S===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof S=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");x.push(Number(S))}else x.push(S);if(x.length!==0)if(x.length===1){let S=x[0];p.type=S===null?"null":typeof S,p.const=S}else x.every(S=>typeof S=="number")&&(p.type="number"),x.every(S=>typeof S=="string")&&(p.type="string"),x.every(S=>typeof S=="boolean")&&(p.type="string"),x.every(S=>S===null)&&(p.type="null"),p.enum=x;break}case"file":{let p=b,x={type:"string",format:"binary",contentEncoding:"binary"},{minimum:S,maximum:A,mime:w}=r._zod.bag;S!==void 0&&(x.minLength=S),A!==void 0&&(x.maxLength=A),w?w.length===1?(x.contentMediaType=w[0],Object.assign(p,x)):p.anyOf=w.map(j=>({...x,contentMediaType:j})):Object.assign(p,x);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let p=this.process(e.innerType,m);b.anyOf=[p,{type:"null"}];break}case"nonoptional":{this.process(e.innerType,m),c.ref=e.innerType;break}case"success":{let p=b;p.type="boolean";break}case"default":{this.process(e.innerType,m),c.ref=e.innerType,b.default=JSON.parse(JSON.stringify(e.defaultValue));break}case"prefault":{this.process(e.innerType,m),c.ref=e.innerType,this.io==="input"&&(b._prefault=JSON.parse(JSON.stringify(e.defaultValue)));break}case"catch":{this.process(e.innerType,m),c.ref=e.innerType;let p;try{p=e.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}b.default=p;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let p=b,x=r._zod.pattern;if(!x)throw new Error("Pattern not found in template literal");p.type="string",p.pattern=x.source;break}case"pipe":{let p=this.io==="input"?e.in._zod.def.type==="transform"?e.out:e.in:e.out;this.process(p,m),c.ref=p;break}case"readonly":{this.process(e.innerType,m),c.ref=e.innerType,b.readOnly=!0;break}case"promise":{this.process(e.innerType,m),c.ref=e.innerType;break}case"optional":{this.process(e.innerType,m),c.ref=e.innerType;break}case"lazy":{let p=r._zod.innerType;this.process(p,m),c.ref=p;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let h=this.metadataRegistry.get(r);return h&&Object.assign(c.schema,h),this.io==="input"&&G(r)&&(delete c.schema.examples,delete c.schema.default),this.io==="input"&&c.schema._prefault&&((i=c.schema).default??(i.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(r).schema}emit(r,n){let i={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},e=this.seen.get(r);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=g=>{let m=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let x=i.external.registry.get(g[0])?.id,S=i.external.uri??(w=>w);if(x)return{ref:S(x)};let A=g[1].defId??g[1].schema.id??`schema${this.counter++}`;return g[1].defId=A,{defId:A,ref:`${S("__shared")}#/${m}/${A}`}}if(g[1]===e)return{ref:"#"};let b=`#/${m}/`,p=g[1].schema.id??`__schema${this.counter++}`;return{defId:p,ref:b+p}},a=g=>{if(g[1].schema.$ref)return;let m=g[1],{ref:$,defId:b}=o(g);m.def={...m.schema},b&&(m.defId=b);let p=m.schema;for(let x in p)delete p[x];p.$ref=$};if(i.cycles==="throw")for(let g of this.seen.entries()){let m=g[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
+
+Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let g of this.seen.entries()){let m=g[1];if(r===g[0]){a(g);continue}if(i.external){let b=i.external.registry.get(g[0])?.id;if(r!==g[0]&&b){a(g);continue}}if(this.metadataRegistry.get(g[0])?.id){a(g);continue}if(m.cycle){a(g);continue}if(m.count>1&&i.reused==="ref"){a(g);continue}}let c=(g,m)=>{let $=this.seen.get(g),b=$.def??$.schema,p={...b};if($.ref===null)return;let x=$.ref;if($.ref=null,x){c(x,m);let S=this.seen.get(x).schema;S.$ref&&m.target==="draft-7"?(b.allOf=b.allOf??[],b.allOf.push(S)):(Object.assign(b,S),Object.assign(b,p))}$.isParent||this.override({zodSchema:g,jsonSchema:b,path:$.path??[]})};for(let g of[...this.seen.entries()].reverse())c(g[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),i.external?.uri){let g=i.external.registry.get(r)?.id;if(!g)throw new Error("Schema is missing an `id` property");l.$id=i.external.uri(g)}Object.assign(l,e.def);let h=i.external?.defs??{};for(let g of this.seen.entries()){let m=g[1];m.def&&m.defId&&(h[m.defId]=m.def)}i.external||Object.keys(h).length>0&&(this.target==="draft-2020-12"?l.$defs=h:l.definitions=h);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}}});var jl={};var Pl=k(()=>{});var ve={};xe(ve,{$ZodAny:()=>ia,$ZodArray:()=>At,$ZodAsyncError:()=>pe,$ZodBase64:()=>Ki,$ZodBase64URL:()=>Gi,$ZodBigInt:()=>Rr,$ZodBigIntFormat:()=>ta,$ZodBoolean:()=>Rt,$ZodCIDRv4:()=>Ji,$ZodCIDRv6:()=>Bi,$ZodCUID:()=>Di,$ZodCUID2:()=>Zi,$ZodCatch:()=>ka,$ZodCheck:()=>B,$ZodCheckBigIntFormat:()=>ui,$ZodCheckEndsWith:()=>$i,$ZodCheckGreaterThan:()=>Nr,$ZodCheckIncludes:()=>_i,$ZodCheckLengthEquals:()=>gi,$ZodCheckLessThan:()=>Or,$ZodCheckLowerCase:()=>vi,$ZodCheckMaxLength:()=>pi,$ZodCheckMaxSize:()=>li,$ZodCheckMimeType:()=>zi,$ZodCheckMinLength:()=>fi,$ZodCheckMinSize:()=>mi,$ZodCheckMultipleOf:()=>si,$ZodCheckNumberFormat:()=>ci,$ZodCheckOverwrite:()=>ki,$ZodCheckProperty:()=>xi,$ZodCheckRegex:()=>hi,$ZodCheckSizeEquals:()=>di,$ZodCheckStartsWith:()=>yi,$ZodCheckStringFormat:()=>Ke,$ZodCheckUpperCase:()=>bi,$ZodCustom:()=>Ta,$ZodCustomStringFormat:()=>Xi,$ZodDate:()=>ca,$ZodDefault:()=>ya,$ZodDiscriminatedUnion:()=>la,$ZodE164:()=>Qi,$ZodEmail:()=>Oi,$ZodEmoji:()=>Ui,$ZodEnum:()=>ga,$ZodError:()=>Nt,$ZodFile:()=>va,$ZodFunction:()=>hn,$ZodGUID:()=>Pi,$ZodIPv4:()=>Fi,$ZodIPv6:()=>Hi,$ZodISODate:()=>Li,$ZodISODateTime:()=>Mi,$ZodISODuration:()=>Vi,$ZodISOTime:()=>qi,$ZodIntersection:()=>ma,$ZodJWT:()=>Yi,$ZodKSUID:()=>Ci,$ZodLazy:()=>Pa,$ZodLiteral:()=>ha,$ZodMap:()=>pa,$ZodNaN:()=>Sa,$ZodNanoID:()=>Ei,$ZodNever:()=>aa,$ZodNonOptional:()=>xa,$ZodNull:()=>oa,$ZodNullable:()=>_a,$ZodNumber:()=>Zr,$ZodNumberFormat:()=>ea,$ZodObject:()=>ua,$ZodOptional:()=>ba,$ZodPipe:()=>Mt,$ZodPrefault:()=>$a,$ZodPromise:()=>ja,$ZodReadonly:()=>wa,$ZodRealError:()=>He,$ZodRecord:()=>da,$ZodRegistry:()=>Ye,$ZodSet:()=>fa,$ZodString:()=>Ee,$ZodStringFormat:()=>V,$ZodSuccess:()=>za,$ZodSymbol:()=>ra,$ZodTemplateLiteral:()=>Ia,$ZodTransform:()=>Ct,$ZodTuple:()=>De,$ZodType:()=>T,$ZodULID:()=>Ri,$ZodURL:()=>Ni,$ZodUUID:()=>Ti,$ZodUndefined:()=>na,$ZodUnion:()=>Ar,$ZodUnknown:()=>Ge,$ZodVoid:()=>sa,$ZodXID:()=>Ai,$brand:()=>yr,$constructor:()=>u,$input:()=>Lr,$output:()=>Mr,Doc:()=>Zt,JSONSchema:()=>jl,JSONSchemaGenerator:()=>Ht,NEVER:()=>_r,TimePrecision:()=>ln,_any:()=>rs,_array:()=>Ft,_base64:()=>an,_base64url:()=>sn,_bigint:()=>Ka,_boolean:()=>Ba,_catch:()=>Rp,_cidrv4:()=>nn,_cidrv6:()=>on,_coercedBigint:()=>Ga,_coercedBoolean:()=>Wa,_coercedDate:()=>as,_coercedNumber:()=>La,_coercedString:()=>Da,_cuid:()=>Gr,_cuid2:()=>Qr,_custom:()=>ls,_date:()=>is,_default:()=>Ep,_discriminatedUnion:()=>zp,_e164:()=>cn,_email:()=>qr,_emoji:()=>Wr,_endsWith:()=>at,_enum:()=>jp,_file:()=>us,_float32:()=>Va,_float64:()=>Fa,_gt:()=>ge,_gte:()=>ne,_guid:()=>Vt,_includes:()=>ot,_int:()=>qa,_int32:()=>Ha,_int64:()=>Qa,_intersection:()=>kp,_ipv4:()=>tn,_ipv6:()=>rn,_isoDate:()=>Ra,_isoDateTime:()=>Za,_isoDuration:()=>Ca,_isoTime:()=>Aa,_jwt:()=>un,_ksuid:()=>en,_lazy:()=>Lp,_length:()=>Ae,_literal:()=>Tp,_lowercase:()=>rt,_lt:()=>fe,_lte:()=>ce,_map:()=>wp,_max:()=>ce,_maxLength:()=>Re,_maxSize:()=>Ze,_mime:()=>st,_min:()=>ne,_minLength:()=>ye,_minSize:()=>we,_multipleOf:()=>Se,_nan:()=>ss,_nanoid:()=>Kr,_nativeEnum:()=>Pp,_negative:()=>dn,_never:()=>ns,_nonnegative:()=>fn,_nonoptional:()=>Dp,_nonpositive:()=>pn,_normalize:()=>ct,_null:()=>ts,_nullable:()=>Up,_number:()=>Ma,_optional:()=>Np,_overwrite:()=>he,_parse:()=>kr,_parseAsync:()=>Sr,_pipe:()=>Ap,_positive:()=>mn,_promise:()=>qp,_property:()=>gn,_readonly:()=>Cp,_record:()=>Sp,_refine:()=>ms,_regex:()=>tt,_safeParse:()=>wr,_safeParseAsync:()=>Ir,_set:()=>Ip,_size:()=>et,_startsWith:()=>it,_string:()=>Ea,_stringFormat:()=>ps,_stringbool:()=>ds,_success:()=>Zp,_symbol:()=>Xa,_templateLiteral:()=>Mp,_toLowerCase:()=>lt,_toUpperCase:()=>mt,_transform:()=>Op,_trim:()=>ut,_tuple:()=>cs,_uint32:()=>Ja,_uint64:()=>Ya,_ulid:()=>Yr,_undefined:()=>es,_union:()=>xp,_unknown:()=>Xe,_uppercase:()=>nt,_url:()=>Br,_uuid:()=>Vr,_uuidv4:()=>Fr,_uuidv6:()=>Hr,_uuidv7:()=>Jr,_void:()=>os,_xid:()=>Xr,clone:()=>oe,config:()=>W,flattenError:()=>Je,formatError:()=>Be,function:()=>vn,globalConfig:()=>kt,globalRegistry:()=>de,isValidBase64:()=>Wi,isValidBase64URL:()=>Xc,isValidJWT:()=>eu,locales:()=>Qe,parse:()=>Ut,parseAsync:()=>Et,prettifyError:()=>zr,regexes:()=>ke,registry:()=>qt,safeParse:()=>We,safeParseAsync:()=>Dt,toDotPath:()=>Dc,toJSONSchema:()=>bn,treeifyError:()=>xr,util:()=>y,version:()=>wi});var ae=k(()=>{qe();jr();Oo();Lt();Ur();Ii();P();Tr();Na();Ua();Si();wl();fs();Il();Pl()});var gs=k(()=>{ae()});var Ce={};xe(Ce,{ZodISODate:()=>Bt,ZodISODateTime:()=>Jt,ZodISODuration:()=>Kt,ZodISOTime:()=>Wt,date:()=>vs,datetime:()=>hs,duration:()=>_s,time:()=>bs});function hs(t){return Za(Jt,t)}function vs(t){return Ra(Bt,t)}function bs(t){return Aa(Wt,t)}function _s(t){return Ca(Kt,t)}var Jt,Bt,Wt,Kt,$n=k(()=>{ae();xn();Jt=u("ZodISODateTime",(t,r)=>{Mi.init(t,r),F.init(t,r)});Bt=u("ZodISODate",(t,r)=>{Li.init(t,r),F.init(t,r)});Wt=u("ZodISOTime",(t,r)=>{qi.init(t,r),F.init(t,r)});Kt=u("ZodISODuration",(t,r)=>{Vi.init(t,r),F.init(t,r)})});var Ul,El,Me,ys=k(()=>{ae();ae();Ul=(t,r)=>{Nt.init(t,r),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>Be(t,n)},flatten:{value:n=>Je(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},El=u("ZodError",Ul),Me=u("ZodError",Ul,{Parent:Error})});var zn,kn,Sn,wn,$s=k(()=>{ae();ys();zn=kr(Me),kn=Sr(Me),Sn=wr(Me),wn=Ir(Me)});function d(t){return Ea(pt,t)}function Dl(t){return qr(Pn,t)}function Zl(t){return Vt(Gt,t)}function Rl(t){return Vr(be,t)}function Al(t){return Fr(be,t)}function Cl(t){return Hr(be,t)}function Ml(t){return Jr(be,t)}function Ll(t){return Br(Tn,t)}function ql(t){return Wr(On,t)}function Vl(t){return Kr(Nn,t)}function Fl(t){return Gr(Un,t)}function Hl(t){return Qr(En,t)}function Jl(t){return Yr(Dn,t)}function Bl(t){return Xr(Zn,t)}function Wl(t){return en(Rn,t)}function Kl(t){return tn(An,t)}function Gl(t){return rn(Cn,t)}function Ql(t){return nn(Mn,t)}function Yl(t){return on(Ln,t)}function Xl(t){return an(qn,t)}function em(t){return sn(Vn,t)}function tm(t){return cn(Fn,t)}function rm(t){return un(Hn,t)}function nm(t,r,n={}){return ps(xs,t,r,n)}function Z(t){return Ma(ft,t)}function In(t){return qa(Le,t)}function om(t){return Va(Le,t)}function im(t){return Fa(Le,t)}function am(t){return Ha(Le,t)}function sm(t){return Ja(Le,t)}function K(t){return Ba(gt,t)}function cm(t){return Ka(ht,t)}function um(t){return Qa(Jn,t)}function lm(t){return Ya(Jn,t)}function mm(t){return Xa(zs,t)}function dm(t){return es(ks,t)}function Xt(t){return ts(Ss,t)}function pm(){return rs(ws)}function J(){return Xe(Is)}function er(t){return ns(js,t)}function fm(t){return os(Ps,t)}function gm(t){return is(tr,t)}function N(t,r){return Ft(Ts,t,r)}function hm(t){let r=t._zod.def.shape;return I(Object.keys(r))}function z(t,r){let n={type:"object",get shape(){return y.assignProp(this,"shape",{...t}),this.shape},...y.normalizeParams(r)};return new rr(n)}function vm(t,r){return new rr({type:"object",get shape(){return y.assignProp(this,"shape",{...t}),this.shape},catchall:er(),...y.normalizeParams(r)})}function Y(t,r){return new rr({type:"object",get shape(){return y.assignProp(this,"shape",{...t}),this.shape},catchall:J(),...y.normalizeParams(r)})}function L(t,r){return new Bn({type:"union",options:t,...y.normalizeParams(r)})}function nr(t,r,n){return new Os({type:"union",options:r,discriminator:t,...y.normalizeParams(n)})}function vt(t,r){return new Ns({type:"intersection",left:t,right:r})}function bm(t,r,n){let i=r instanceof T,e=i?n:r,o=i?r:null;return new Us({type:"tuple",items:t,rest:o,...y.normalizeParams(e)})}function q(t,r,n){return new Wn({type:"record",keyType:t,valueType:r,...y.normalizeParams(n)})}function _m(t,r,n){return new Wn({type:"record",keyType:L([t,er()]),valueType:r,...y.normalizeParams(n)})}function ym(t,r,n){return new Es({type:"map",keyType:t,valueType:r,...y.normalizeParams(n)})}function $m(t,r){return new Ds({type:"set",valueType:t,...y.normalizeParams(r)})}function re(t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new dt({type:"enum",entries:n,...y.normalizeParams(r)})}function xm(t,r){return new dt({type:"enum",entries:t,...y.normalizeParams(r)})}function I(t,r){return new Zs({type:"literal",values:Array.isArray(t)?t:[t],...y.normalizeParams(r)})}function zm(t){return us(Rs,t)}function Gn(t){return new Kn({type:"transform",transform:t})}function H(t){return new Qn({type:"optional",innerType:t})}function Qt(t){return new As({type:"nullable",innerType:t})}function km(t){return H(Qt(t))}function Ms(t,r){return new Cs({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():r}})}function qs(t,r){return new Ls({type:"prefault",innerType:t,get defaultValue(){return typeof r=="function"?r():r}})}function Vs(t,r){return new Yn({type:"nonoptional",innerType:t,...y.normalizeParams(r)})}function Sm(t){return new Fs({type:"success",innerType:t})}function Js(t,r){return new Hs({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function wm(t){return ss(Bs,t)}function Yt(t,r){return new Xn({type:"pipe",in:t,out:r})}function Ks(t){return new Ws({type:"readonly",innerType:t})}function Im(t,r){return new Gs({type:"template_literal",parts:t,...y.normalizeParams(r)})}function Ys(t){return new Qs({type:"lazy",getter:t})}function jm(t){return new Xs({type:"promise",innerType:t})}function ec(t){let r=new B({check:"custom"});return r._zod.check=t,r}function eo(t,r){return ls(or,t??(()=>!0),r)}function tc(t,r={}){return ms(or,t,r)}function rc(t){let r=ec(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(y.issue(i,n.value,r._zod.def));else{let e=i;e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=n.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),n.issues.push(y.issue(e))}},t(n.value,n)));return r}function Pm(t,r={error:`Input not instance of ${t.name}`}){let n=new or({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...y.normalizeParams(r)});return n._zod.bag.Class=t,n}function Om(t){let r=Ys(()=>L([d(t),Z(),K(),Xt(),N(r),q(d(),r)]));return r}function ir(t,r){return Yt(Gn(t),r)}var O,jn,pt,F,Pn,Gt,be,Tn,On,Nn,Un,En,Dn,Zn,Rn,An,Cn,Mn,Ln,qn,Vn,Fn,Hn,xs,ft,Le,gt,ht,Jn,zs,ks,Ss,ws,Is,js,Ps,tr,Ts,rr,Bn,Os,Ns,Us,Wn,Es,Ds,dt,Zs,Rs,Kn,Qn,As,Cs,Ls,Yn,Fs,Hs,Bs,Xn,Ws,Gs,Qs,Xs,or,Tm,xn=k(()=>{ae();ae();gs();$n();$s();O=u("ZodType",(t,r)=>(T.init(t,r),t.def=r,Object.defineProperty(t,"_def",{value:r}),t.check=(...n)=>t.clone({...r,checks:[...r.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),t.clone=(n,i)=>oe(t,n,i),t.brand=()=>t,t.register=((n,i)=>(n.add(t,i),t)),t.parse=(n,i)=>zn(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>Sn(t,n,i),t.parseAsync=async(n,i)=>kn(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>wn(t,n,i),t.spa=t.safeParseAsync,t.refine=(n,i)=>t.check(tc(n,i)),t.superRefine=n=>t.check(rc(n)),t.overwrite=n=>t.check(he(n)),t.optional=()=>H(t),t.nullable=()=>Qt(t),t.nullish=()=>H(Qt(t)),t.nonoptional=n=>Vs(t,n),t.array=()=>N(t),t.or=n=>L([t,n]),t.and=n=>vt(t,n),t.transform=n=>Yt(t,Gn(n)),t.default=n=>Ms(t,n),t.prefault=n=>qs(t,n),t.catch=n=>Js(t,n),t.pipe=n=>Yt(t,n),t.readonly=()=>Ks(t),t.describe=n=>{let i=t.clone();return de.add(i,{description:n}),i},Object.defineProperty(t,"description",{get(){return de.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return de.get(t);let i=t.clone();return de.add(i,n[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),jn=u("_ZodString",(t,r)=>{Ee.init(t,r),O.init(t,r);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...i)=>t.check(tt(...i)),t.includes=(...i)=>t.check(ot(...i)),t.startsWith=(...i)=>t.check(it(...i)),t.endsWith=(...i)=>t.check(at(...i)),t.min=(...i)=>t.check(ye(...i)),t.max=(...i)=>t.check(Re(...i)),t.length=(...i)=>t.check(Ae(...i)),t.nonempty=(...i)=>t.check(ye(1,...i)),t.lowercase=i=>t.check(rt(i)),t.uppercase=i=>t.check(nt(i)),t.trim=()=>t.check(ut()),t.normalize=(...i)=>t.check(ct(...i)),t.toLowerCase=()=>t.check(lt()),t.toUpperCase=()=>t.check(mt())}),pt=u("ZodString",(t,r)=>{Ee.init(t,r),jn.init(t,r),t.email=n=>t.check(qr(Pn,n)),t.url=n=>t.check(Br(Tn,n)),t.jwt=n=>t.check(un(Hn,n)),t.emoji=n=>t.check(Wr(On,n)),t.guid=n=>t.check(Vt(Gt,n)),t.uuid=n=>t.check(Vr(be,n)),t.uuidv4=n=>t.check(Fr(be,n)),t.uuidv6=n=>t.check(Hr(be,n)),t.uuidv7=n=>t.check(Jr(be,n)),t.nanoid=n=>t.check(Kr(Nn,n)),t.guid=n=>t.check(Vt(Gt,n)),t.cuid=n=>t.check(Gr(Un,n)),t.cuid2=n=>t.check(Qr(En,n)),t.ulid=n=>t.check(Yr(Dn,n)),t.base64=n=>t.check(an(qn,n)),t.base64url=n=>t.check(sn(Vn,n)),t.xid=n=>t.check(Xr(Zn,n)),t.ksuid=n=>t.check(en(Rn,n)),t.ipv4=n=>t.check(tn(An,n)),t.ipv6=n=>t.check(rn(Cn,n)),t.cidrv4=n=>t.check(nn(Mn,n)),t.cidrv6=n=>t.check(on(Ln,n)),t.e164=n=>t.check(cn(Fn,n)),t.datetime=n=>t.check(hs(n)),t.date=n=>t.check(vs(n)),t.time=n=>t.check(bs(n)),t.duration=n=>t.check(_s(n))});F=u("ZodStringFormat",(t,r)=>{V.init(t,r),jn.init(t,r)}),Pn=u("ZodEmail",(t,r)=>{Oi.init(t,r),F.init(t,r)});Gt=u("ZodGUID",(t,r)=>{Pi.init(t,r),F.init(t,r)});be=u("ZodUUID",(t,r)=>{Ti.init(t,r),F.init(t,r)});Tn=u("ZodURL",(t,r)=>{Ni.init(t,r),F.init(t,r)});On=u("ZodEmoji",(t,r)=>{Ui.init(t,r),F.init(t,r)});Nn=u("ZodNanoID",(t,r)=>{Ei.init(t,r),F.init(t,r)});Un=u("ZodCUID",(t,r)=>{Di.init(t,r),F.init(t,r)});En=u("ZodCUID2",(t,r)=>{Zi.init(t,r),F.init(t,r)});Dn=u("ZodULID",(t,r)=>{Ri.init(t,r),F.init(t,r)});Zn=u("ZodXID",(t,r)=>{Ai.init(t,r),F.init(t,r)});Rn=u("ZodKSUID",(t,r)=>{Ci.init(t,r),F.init(t,r)});An=u("ZodIPv4",(t,r)=>{Fi.init(t,r),F.init(t,r)});Cn=u("ZodIPv6",(t,r)=>{Hi.init(t,r),F.init(t,r)});Mn=u("ZodCIDRv4",(t,r)=>{Ji.init(t,r),F.init(t,r)});Ln=u("ZodCIDRv6",(t,r)=>{Bi.init(t,r),F.init(t,r)});qn=u("ZodBase64",(t,r)=>{Ki.init(t,r),F.init(t,r)});Vn=u("ZodBase64URL",(t,r)=>{Gi.init(t,r),F.init(t,r)});Fn=u("ZodE164",(t,r)=>{Qi.init(t,r),F.init(t,r)});Hn=u("ZodJWT",(t,r)=>{Yi.init(t,r),F.init(t,r)});xs=u("ZodCustomStringFormat",(t,r)=>{Xi.init(t,r),F.init(t,r)});ft=u("ZodNumber",(t,r)=>{Zr.init(t,r),O.init(t,r),t.gt=(i,e)=>t.check(ge(i,e)),t.gte=(i,e)=>t.check(ne(i,e)),t.min=(i,e)=>t.check(ne(i,e)),t.lt=(i,e)=>t.check(fe(i,e)),t.lte=(i,e)=>t.check(ce(i,e)),t.max=(i,e)=>t.check(ce(i,e)),t.int=i=>t.check(In(i)),t.safe=i=>t.check(In(i)),t.positive=i=>t.check(ge(0,i)),t.nonnegative=i=>t.check(ne(0,i)),t.negative=i=>t.check(fe(0,i)),t.nonpositive=i=>t.check(ce(0,i)),t.multipleOf=(i,e)=>t.check(Se(i,e)),t.step=(i,e)=>t.check(Se(i,e)),t.finite=()=>t;let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});Le=u("ZodNumberFormat",(t,r)=>{ea.init(t,r),ft.init(t,r)});gt=u("ZodBoolean",(t,r)=>{Rt.init(t,r),O.init(t,r)});ht=u("ZodBigInt",(t,r)=>{Rr.init(t,r),O.init(t,r),t.gte=(i,e)=>t.check(ne(i,e)),t.min=(i,e)=>t.check(ne(i,e)),t.gt=(i,e)=>t.check(ge(i,e)),t.gte=(i,e)=>t.check(ne(i,e)),t.min=(i,e)=>t.check(ne(i,e)),t.lt=(i,e)=>t.check(fe(i,e)),t.lte=(i,e)=>t.check(ce(i,e)),t.max=(i,e)=>t.check(ce(i,e)),t.positive=i=>t.check(ge(BigInt(0),i)),t.negative=i=>t.check(fe(BigInt(0),i)),t.nonpositive=i=>t.check(ce(BigInt(0),i)),t.nonnegative=i=>t.check(ne(BigInt(0),i)),t.multipleOf=(i,e)=>t.check(Se(i,e));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});Jn=u("ZodBigIntFormat",(t,r)=>{ta.init(t,r),ht.init(t,r)});zs=u("ZodSymbol",(t,r)=>{ra.init(t,r),O.init(t,r)});ks=u("ZodUndefined",(t,r)=>{na.init(t,r),O.init(t,r)});Ss=u("ZodNull",(t,r)=>{oa.init(t,r),O.init(t,r)});ws=u("ZodAny",(t,r)=>{ia.init(t,r),O.init(t,r)});Is=u("ZodUnknown",(t,r)=>{Ge.init(t,r),O.init(t,r)});js=u("ZodNever",(t,r)=>{aa.init(t,r),O.init(t,r)});Ps=u("ZodVoid",(t,r)=>{sa.init(t,r),O.init(t,r)});tr=u("ZodDate",(t,r)=>{ca.init(t,r),O.init(t,r),t.min=(i,e)=>t.check(ne(i,e)),t.max=(i,e)=>t.check(ce(i,e));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});Ts=u("ZodArray",(t,r)=>{At.init(t,r),O.init(t,r),t.element=r.element,t.min=(n,i)=>t.check(ye(n,i)),t.nonempty=n=>t.check(ye(1,n)),t.max=(n,i)=>t.check(Re(n,i)),t.length=(n,i)=>t.check(Ae(n,i)),t.unwrap=()=>t.element});rr=u("ZodObject",(t,r)=>{ua.init(t,r),O.init(t,r),y.defineLazy(t,"shape",()=>r.shape),t.keyof=()=>re(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:J()}),t.loose=()=>t.clone({...t._zod.def,catchall:J()}),t.strict=()=>t.clone({...t._zod.def,catchall:er()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>y.extend(t,n),t.merge=n=>y.merge(t,n),t.pick=n=>y.pick(t,n),t.omit=n=>y.omit(t,n),t.partial=(...n)=>y.partial(Qn,t,n[0]),t.required=(...n)=>y.required(Yn,t,n[0])});Bn=u("ZodUnion",(t,r)=>{Ar.init(t,r),O.init(t,r),t.options=r.options});Os=u("ZodDiscriminatedUnion",(t,r)=>{Bn.init(t,r),la.init(t,r)});Ns=u("ZodIntersection",(t,r)=>{ma.init(t,r),O.init(t,r)});Us=u("ZodTuple",(t,r)=>{De.init(t,r),O.init(t,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});Wn=u("ZodRecord",(t,r)=>{da.init(t,r),O.init(t,r),t.keyType=r.keyType,t.valueType=r.valueType});Es=u("ZodMap",(t,r)=>{pa.init(t,r),O.init(t,r),t.keyType=r.keyType,t.valueType=r.valueType});Ds=u("ZodSet",(t,r)=>{fa.init(t,r),O.init(t,r),t.min=(...n)=>t.check(we(...n)),t.nonempty=n=>t.check(we(1,n)),t.max=(...n)=>t.check(Ze(...n)),t.size=(...n)=>t.check(et(...n))});dt=u("ZodEnum",(t,r)=>{ga.init(t,r),O.init(t,r),t.enum=r.entries,t.options=Object.values(r.entries);let n=new Set(Object.keys(r.entries));t.extract=(i,e)=>{let o={};for(let a of i)if(n.has(a))o[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new dt({...r,checks:[],...y.normalizeParams(e),entries:o})},t.exclude=(i,e)=>{let o={...r.entries};for(let a of i)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new dt({...r,checks:[],...y.normalizeParams(e),entries:o})}});Zs=u("ZodLiteral",(t,r)=>{ha.init(t,r),O.init(t,r),t.values=new Set(r.values),Object.defineProperty(t,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});Rs=u("ZodFile",(t,r)=>{va.init(t,r),O.init(t,r),t.min=(n,i)=>t.check(we(n,i)),t.max=(n,i)=>t.check(Ze(n,i)),t.mime=(n,i)=>t.check(st(Array.isArray(n)?n:[n],i))});Kn=u("ZodTransform",(t,r)=>{Ct.init(t,r),O.init(t,r),t._zod.parse=(n,i)=>{n.addIssue=o=>{if(typeof o=="string")n.issues.push(y.issue(o,n.value,r));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(y.issue(a))}};let e=r.transform(n.value,n);return e instanceof Promise?e.then(o=>(n.value=o,n)):(n.value=e,n)}});Qn=u("ZodOptional",(t,r)=>{ba.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType});As=u("ZodNullable",(t,r)=>{_a.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType});Cs=u("ZodDefault",(t,r)=>{ya.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});Ls=u("ZodPrefault",(t,r)=>{$a.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType});Yn=u("ZodNonOptional",(t,r)=>{xa.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType});Fs=u("ZodSuccess",(t,r)=>{za.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType});Hs=u("ZodCatch",(t,r)=>{ka.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});Bs=u("ZodNaN",(t,r)=>{Sa.init(t,r),O.init(t,r)});Xn=u("ZodPipe",(t,r)=>{Mt.init(t,r),O.init(t,r),t.in=r.in,t.out=r.out});Ws=u("ZodReadonly",(t,r)=>{wa.init(t,r),O.init(t,r)});Gs=u("ZodTemplateLiteral",(t,r)=>{Ia.init(t,r),O.init(t,r)});Qs=u("ZodLazy",(t,r)=>{Pa.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.getter()});Xs=u("ZodPromise",(t,r)=>{ja.init(t,r),O.init(t,r),t.unwrap=()=>t._zod.def.innerType});or=u("ZodCustom",(t,r)=>{Ta.init(t,r),O.init(t,r)});Tm=(...t)=>ds({Pipe:Xn,Boolean:gt,String:pt,Transform:Kn},...t)});function Um(t){W({customError:t})}function Em(){return W().customError}var Nm,Dm=k(()=>{ae();Nm={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"}});var to={};xe(to,{bigint:()=>Wp,boolean:()=>Bp,date:()=>Kp,number:()=>Jp,string:()=>Hp});function Hp(t){return Da(pt,t)}function Jp(t){return La(ft,t)}function Bp(t){return Wa(gt,t)}function Wp(t){return Ga(ht,t)}function Kp(t){return as(tr,t)}var Zm=k(()=>{ae();xn()});var s={};xe(s,{$brand:()=>yr,$input:()=>Lr,$output:()=>Mr,NEVER:()=>_r,TimePrecision:()=>ln,ZodAny:()=>ws,ZodArray:()=>Ts,ZodBase64:()=>qn,ZodBase64URL:()=>Vn,ZodBigInt:()=>ht,ZodBigIntFormat:()=>Jn,ZodBoolean:()=>gt,ZodCIDRv4:()=>Mn,ZodCIDRv6:()=>Ln,ZodCUID:()=>Un,ZodCUID2:()=>En,ZodCatch:()=>Hs,ZodCustom:()=>or,ZodCustomStringFormat:()=>xs,ZodDate:()=>tr,ZodDefault:()=>Cs,ZodDiscriminatedUnion:()=>Os,ZodE164:()=>Fn,ZodEmail:()=>Pn,ZodEmoji:()=>On,ZodEnum:()=>dt,ZodError:()=>El,ZodFile:()=>Rs,ZodGUID:()=>Gt,ZodIPv4:()=>An,ZodIPv6:()=>Cn,ZodISODate:()=>Bt,ZodISODateTime:()=>Jt,ZodISODuration:()=>Kt,ZodISOTime:()=>Wt,ZodIntersection:()=>Ns,ZodIssueCode:()=>Nm,ZodJWT:()=>Hn,ZodKSUID:()=>Rn,ZodLazy:()=>Qs,ZodLiteral:()=>Zs,ZodMap:()=>Es,ZodNaN:()=>Bs,ZodNanoID:()=>Nn,ZodNever:()=>js,ZodNonOptional:()=>Yn,ZodNull:()=>Ss,ZodNullable:()=>As,ZodNumber:()=>ft,ZodNumberFormat:()=>Le,ZodObject:()=>rr,ZodOptional:()=>Qn,ZodPipe:()=>Xn,ZodPrefault:()=>Ls,ZodPromise:()=>Xs,ZodReadonly:()=>Ws,ZodRealError:()=>Me,ZodRecord:()=>Wn,ZodSet:()=>Ds,ZodString:()=>pt,ZodStringFormat:()=>F,ZodSuccess:()=>Fs,ZodSymbol:()=>zs,ZodTemplateLiteral:()=>Gs,ZodTransform:()=>Kn,ZodTuple:()=>Us,ZodType:()=>O,ZodULID:()=>Dn,ZodURL:()=>Tn,ZodUUID:()=>be,ZodUndefined:()=>ks,ZodUnion:()=>Bn,ZodUnknown:()=>Is,ZodVoid:()=>Ps,ZodXID:()=>Zn,_ZodString:()=>jn,_default:()=>Ms,any:()=>pm,array:()=>N,base64:()=>Xl,base64url:()=>em,bigint:()=>cm,boolean:()=>K,catch:()=>Js,check:()=>ec,cidrv4:()=>Ql,cidrv6:()=>Yl,clone:()=>oe,coerce:()=>to,config:()=>W,core:()=>ve,cuid:()=>Fl,cuid2:()=>Hl,custom:()=>eo,date:()=>gm,discriminatedUnion:()=>nr,e164:()=>tm,email:()=>Dl,emoji:()=>ql,endsWith:()=>at,enum:()=>re,file:()=>zm,flattenError:()=>Je,float32:()=>om,float64:()=>im,formatError:()=>Be,function:()=>vn,getErrorMap:()=>Em,globalRegistry:()=>de,gt:()=>ge,gte:()=>ne,guid:()=>Zl,includes:()=>ot,instanceof:()=>Pm,int:()=>In,int32:()=>am,int64:()=>um,intersection:()=>vt,ipv4:()=>Kl,ipv6:()=>Gl,iso:()=>Ce,json:()=>Om,jwt:()=>rm,keyof:()=>hm,ksuid:()=>Wl,lazy:()=>Ys,length:()=>Ae,literal:()=>I,locales:()=>Qe,looseObject:()=>Y,lowercase:()=>rt,lt:()=>fe,lte:()=>ce,map:()=>ym,maxLength:()=>Re,maxSize:()=>Ze,mime:()=>st,minLength:()=>ye,minSize:()=>we,multipleOf:()=>Se,nan:()=>wm,nanoid:()=>Vl,nativeEnum:()=>xm,negative:()=>dn,never:()=>er,nonnegative:()=>fn,nonoptional:()=>Vs,nonpositive:()=>pn,normalize:()=>ct,null:()=>Xt,nullable:()=>Qt,nullish:()=>km,number:()=>Z,object:()=>z,optional:()=>H,overwrite:()=>he,parse:()=>zn,parseAsync:()=>kn,partialRecord:()=>_m,pipe:()=>Yt,positive:()=>mn,prefault:()=>qs,preprocess:()=>ir,prettifyError:()=>zr,promise:()=>jm,property:()=>gn,readonly:()=>Ks,record:()=>q,refine:()=>tc,regex:()=>tt,regexes:()=>ke,registry:()=>qt,safeParse:()=>Sn,safeParseAsync:()=>wn,set:()=>$m,setErrorMap:()=>Um,size:()=>et,startsWith:()=>it,strictObject:()=>vm,string:()=>d,stringFormat:()=>nm,stringbool:()=>Tm,success:()=>Sm,superRefine:()=>rc,symbol:()=>mm,templateLiteral:()=>Im,toJSONSchema:()=>bn,toLowerCase:()=>lt,toUpperCase:()=>mt,transform:()=>Gn,treeifyError:()=>xr,trim:()=>ut,tuple:()=>bm,uint32:()=>sm,uint64:()=>lm,ulid:()=>Jl,undefined:()=>dm,union:()=>L,unknown:()=>J,uppercase:()=>nt,url:()=>Ll,uuid:()=>Rl,uuidv4:()=>Al,uuidv6:()=>Cl,uuidv7:()=>Ml,void:()=>fm,xid:()=>Bl});var nc=k(()=>{ae();xn();gs();ys();$s();Dm();ae();Oa();ae();Na();$n();$n();Zm();W(Cr())});var Rm,oc=k(()=>{nc();nc();Rm=s});var ic={};xe(ic,{$brand:()=>yr,$input:()=>Lr,$output:()=>Mr,NEVER:()=>_r,TimePrecision:()=>ln,ZodAny:()=>ws,ZodArray:()=>Ts,ZodBase64:()=>qn,ZodBase64URL:()=>Vn,ZodBigInt:()=>ht,ZodBigIntFormat:()=>Jn,ZodBoolean:()=>gt,ZodCIDRv4:()=>Mn,ZodCIDRv6:()=>Ln,ZodCUID:()=>Un,ZodCUID2:()=>En,ZodCatch:()=>Hs,ZodCustom:()=>or,ZodCustomStringFormat:()=>xs,ZodDate:()=>tr,ZodDefault:()=>Cs,ZodDiscriminatedUnion:()=>Os,ZodE164:()=>Fn,ZodEmail:()=>Pn,ZodEmoji:()=>On,ZodEnum:()=>dt,ZodError:()=>El,ZodFile:()=>Rs,ZodGUID:()=>Gt,ZodIPv4:()=>An,ZodIPv6:()=>Cn,ZodISODate:()=>Bt,ZodISODateTime:()=>Jt,ZodISODuration:()=>Kt,ZodISOTime:()=>Wt,ZodIntersection:()=>Ns,ZodIssueCode:()=>Nm,ZodJWT:()=>Hn,ZodKSUID:()=>Rn,ZodLazy:()=>Qs,ZodLiteral:()=>Zs,ZodMap:()=>Es,ZodNaN:()=>Bs,ZodNanoID:()=>Nn,ZodNever:()=>js,ZodNonOptional:()=>Yn,ZodNull:()=>Ss,ZodNullable:()=>As,ZodNumber:()=>ft,ZodNumberFormat:()=>Le,ZodObject:()=>rr,ZodOptional:()=>Qn,ZodPipe:()=>Xn,ZodPrefault:()=>Ls,ZodPromise:()=>Xs,ZodReadonly:()=>Ws,ZodRealError:()=>Me,ZodRecord:()=>Wn,ZodSet:()=>Ds,ZodString:()=>pt,ZodStringFormat:()=>F,ZodSuccess:()=>Fs,ZodSymbol:()=>zs,ZodTemplateLiteral:()=>Gs,ZodTransform:()=>Kn,ZodTuple:()=>Us,ZodType:()=>O,ZodULID:()=>Dn,ZodURL:()=>Tn,ZodUUID:()=>be,ZodUndefined:()=>ks,ZodUnion:()=>Bn,ZodUnknown:()=>Is,ZodVoid:()=>Ps,ZodXID:()=>Zn,_ZodString:()=>jn,_default:()=>Ms,any:()=>pm,array:()=>N,base64:()=>Xl,base64url:()=>em,bigint:()=>cm,boolean:()=>K,catch:()=>Js,check:()=>ec,cidrv4:()=>Ql,cidrv6:()=>Yl,clone:()=>oe,coerce:()=>to,config:()=>W,core:()=>ve,cuid:()=>Fl,cuid2:()=>Hl,custom:()=>eo,date:()=>gm,default:()=>Gp,discriminatedUnion:()=>nr,e164:()=>tm,email:()=>Dl,emoji:()=>ql,endsWith:()=>at,enum:()=>re,file:()=>zm,flattenError:()=>Je,float32:()=>om,float64:()=>im,formatError:()=>Be,function:()=>vn,getErrorMap:()=>Em,globalRegistry:()=>de,gt:()=>ge,gte:()=>ne,guid:()=>Zl,includes:()=>ot,instanceof:()=>Pm,int:()=>In,int32:()=>am,int64:()=>um,intersection:()=>vt,ipv4:()=>Kl,ipv6:()=>Gl,iso:()=>Ce,json:()=>Om,jwt:()=>rm,keyof:()=>hm,ksuid:()=>Wl,lazy:()=>Ys,length:()=>Ae,literal:()=>I,locales:()=>Qe,looseObject:()=>Y,lowercase:()=>rt,lt:()=>fe,lte:()=>ce,map:()=>ym,maxLength:()=>Re,maxSize:()=>Ze,mime:()=>st,minLength:()=>ye,minSize:()=>we,multipleOf:()=>Se,nan:()=>wm,nanoid:()=>Vl,nativeEnum:()=>xm,negative:()=>dn,never:()=>er,nonnegative:()=>fn,nonoptional:()=>Vs,nonpositive:()=>pn,normalize:()=>ct,null:()=>Xt,nullable:()=>Qt,nullish:()=>km,number:()=>Z,object:()=>z,optional:()=>H,overwrite:()=>he,parse:()=>zn,parseAsync:()=>kn,partialRecord:()=>_m,pipe:()=>Yt,positive:()=>mn,prefault:()=>qs,preprocess:()=>ir,prettifyError:()=>zr,promise:()=>jm,property:()=>gn,readonly:()=>Ks,record:()=>q,refine:()=>tc,regex:()=>tt,regexes:()=>ke,registry:()=>qt,safeParse:()=>Sn,safeParseAsync:()=>wn,set:()=>$m,setErrorMap:()=>Um,size:()=>et,startsWith:()=>it,strictObject:()=>vm,string:()=>d,stringFormat:()=>nm,stringbool:()=>Tm,success:()=>Sm,superRefine:()=>rc,symbol:()=>mm,templateLiteral:()=>Im,toJSONSchema:()=>bn,toLowerCase:()=>lt,toUpperCase:()=>mt,transform:()=>Gn,treeifyError:()=>xr,trim:()=>ut,tuple:()=>bm,uint32:()=>sm,uint64:()=>lm,ulid:()=>Jl,undefined:()=>dm,union:()=>L,unknown:()=>J,uppercase:()=>nt,url:()=>Ll,uuid:()=>Rl,uuidv4:()=>Al,uuidv6:()=>Cl,uuidv7:()=>Ml,void:()=>fm,xid:()=>Bl,z:()=>s});var Gp,ar=k(()=>{oc();oc();Gp=Rm});ae();function _n(t){return!!t._zod}function yn(t,r){return _n(t)?We(t,r):t.safeParse(r)}function Tl(t){if(!t)return;let r;if(_n(t)?r=t._zod?.def?.shape:r=t.shape,!!r){if(typeof r=="function")try{return r()}catch{return}return r}}function Ol(t){if(_n(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let n=t._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=t.value;if(i!==void 0)return i}ar();var Ie="io.modelcontextprotocol/related-task",no="2.0",Q=eo(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Am=L([d(),Z().int()]),Cm=d(),Nb=Y({ttl:Z().optional(),pollInterval:Z().optional()}),Qp=z({ttl:Z().optional()}),Yp=z({taskId:d()}),sc=Y({progressToken:Am.optional(),[Ie]:Yp.optional()}),ue=z({_meta:sc.optional()}),sr=ue.extend({task:Qp.optional()}),Mm=t=>sr.safeParse(t).success,X=z({method:d(),params:ue.loose().optional()}),le=z({_meta:sc.optional()}),me=z({method:d(),params:le.loose().optional()}),ee=Y({_meta:sc.optional()}),_t=L([d(),Z().int()]),Lm=z({jsonrpc:I(no),id:_t,...X.shape}).strict(),cc=t=>Lm.safeParse(t).success,qm=z({jsonrpc:I(no),...me.shape}).strict(),Vm=t=>qm.safeParse(t).success,uc=z({jsonrpc:I(no),id:_t,result:ee}).strict(),cr=t=>uc.safeParse(t).success;var M;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(M||(M={}));var lc=z({jsonrpc:I(no),id:_t.optional(),error:z({code:Z().int(),message:d(),data:J().optional()})}).strict();var Fm=t=>lc.safeParse(t).success;var Hm=L([Lm,qm,uc,lc]),Ub=L([uc,lc]),oo=ee.strict(),Xp=le.extend({requestId:_t.optional(),reason:d().optional()}),io=me.extend({method:I("notifications/cancelled"),params:Xp}),ef=z({src:d(),mimeType:d().optional(),sizes:N(d()).optional(),theme:re(["light","dark"]).optional()}),ur=z({icons:N(ef).optional()}),bt=z({name:d(),title:d().optional()}),lr=bt.extend({...bt.shape,...ur.shape,version:d(),websiteUrl:d().optional(),description:d().optional()}),tf=vt(z({applyDefaults:K().optional()}),q(d(),J())),rf=ir(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,vt(z({form:tf.optional(),url:Q.optional()}),q(d(),J()).optional())),nf=Y({list:Q.optional(),cancel:Q.optional(),requests:Y({sampling:Y({createMessage:Q.optional()}).optional(),elicitation:Y({create:Q.optional()}).optional()}).optional()}),of=Y({list:Q.optional(),cancel:Q.optional(),requests:Y({tools:Y({call:Q.optional()}).optional()}).optional()}),af=z({experimental:q(d(),Q).optional(),sampling:z({context:Q.optional(),tools:Q.optional()}).optional(),elicitation:rf.optional(),roots:z({listChanged:K().optional()}).optional(),tasks:nf.optional(),extensions:q(d(),Q).optional()}),sf=ue.extend({protocolVersion:d(),capabilities:af,clientInfo:lr}),cf=X.extend({method:I("initialize"),params:sf});var uf=z({experimental:q(d(),Q).optional(),logging:Q.optional(),completions:Q.optional(),prompts:z({listChanged:K().optional()}).optional(),resources:z({subscribe:K().optional(),listChanged:K().optional()}).optional(),tools:z({listChanged:K().optional()}).optional(),tasks:of.optional(),extensions:q(d(),Q).optional()}),lf=ee.extend({protocolVersion:d(),capabilities:uf,serverInfo:lr,instructions:d().optional()}),mf=me.extend({method:I("notifications/initialized"),params:le.optional()});var yt=X.extend({method:I("ping"),params:ue.optional()}),df=z({progress:Z(),total:H(Z()),message:H(d())}),pf=z({...le.shape,...df.shape,progressToken:Am}),ao=me.extend({method:I("notifications/progress"),params:pf}),ff=ue.extend({cursor:Cm.optional()}),mr=X.extend({params:ff.optional()}),dr=ee.extend({nextCursor:Cm.optional()}),gf=re(["working","input_required","completed","failed","cancelled"]),pr=z({taskId:d(),status:gf,ttl:L([Z(),Xt()]),createdAt:d(),lastUpdatedAt:d(),pollInterval:H(Z()),statusMessage:H(d())}),so=ee.extend({task:pr}),hf=le.merge(pr),fr=me.extend({method:I("notifications/tasks/status"),params:hf}),co=X.extend({method:I("tasks/get"),params:ue.extend({taskId:d()})}),uo=ee.merge(pr),lo=X.extend({method:I("tasks/result"),params:ue.extend({taskId:d()})}),Eb=ee.loose(),mo=mr.extend({method:I("tasks/list")}),po=dr.extend({tasks:N(pr)}),fo=X.extend({method:I("tasks/cancel"),params:ue.extend({taskId:d()})}),Jm=ee.merge(pr),Bm=z({uri:d(),mimeType:H(d()),_meta:q(d(),J()).optional()}),Wm=Bm.extend({text:d()}),mc=d().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Km=Bm.extend({blob:mc}),gr=re(["user","assistant"]),$t=z({audience:N(gr).optional(),priority:Z().min(0).max(1).optional(),lastModified:Ce.datetime({offset:!0}).optional()}),Gm=z({...bt.shape,...ur.shape,uri:d(),description:H(d()),mimeType:H(d()),size:H(Z()),annotations:$t.optional(),_meta:H(Y({}))}),vf=z({...bt.shape,...ur.shape,uriTemplate:d(),description:H(d()),mimeType:H(d()),annotations:$t.optional(),_meta:H(Y({}))}),bf=mr.extend({method:I("resources/list")}),dc=dr.extend({resources:N(Gm)}),_f=mr.extend({method:I("resources/templates/list")}),yf=dr.extend({resourceTemplates:N(vf)}),pc=ue.extend({uri:d()}),$f=pc,xf=X.extend({method:I("resources/read"),params:$f}),fc=ee.extend({contents:N(L([Wm,Km]))}),zf=me.extend({method:I("notifications/resources/list_changed"),params:le.optional()}),kf=pc,Sf=X.extend({method:I("resources/subscribe"),params:kf}),wf=pc,If=X.extend({method:I("resources/unsubscribe"),params:wf}),jf=le.extend({uri:d()}),Pf=me.extend({method:I("notifications/resources/updated"),params:jf}),Tf=z({name:d(),description:H(d()),required:H(K())}),Of=z({...bt.shape,...ur.shape,description:H(d()),arguments:H(N(Tf)),_meta:H(Y({}))}),Nf=mr.extend({method:I("prompts/list")}),Uf=dr.extend({prompts:N(Of)}),Ef=ue.extend({name:d(),arguments:q(d(),d()).optional()}),Df=X.extend({method:I("prompts/get"),params:Ef}),gc=z({type:I("text"),text:d(),annotations:$t.optional(),_meta:q(d(),J()).optional()}),hc=z({type:I("image"),data:mc,mimeType:d(),annotations:$t.optional(),_meta:q(d(),J()).optional()}),vc=z({type:I("audio"),data:mc,mimeType:d(),annotations:$t.optional(),_meta:q(d(),J()).optional()}),Zf=z({type:I("tool_use"),name:d(),id:d(),input:q(d(),J()),_meta:q(d(),J()).optional()}),bc=z({type:I("resource"),resource:L([Wm,Km]),annotations:$t.optional(),_meta:q(d(),J()).optional()}),_c=Gm.extend({type:I("resource_link")}),xt=L([gc,hc,vc,_c,bc]),Rf=z({role:gr,content:xt}),Af=ee.extend({description:d().optional(),messages:N(Rf)}),Cf=me.extend({method:I("notifications/prompts/list_changed"),params:le.optional()}),Mf=z({title:d().optional(),readOnlyHint:K().optional(),destructiveHint:K().optional(),idempotentHint:K().optional(),openWorldHint:K().optional()}),Lf=z({taskSupport:re(["required","optional","forbidden"]).optional()}),go=z({...bt.shape,...ur.shape,description:d().optional(),inputSchema:z({type:I("object"),properties:q(d(),Q).optional(),required:N(d()).optional()}).catchall(J()),outputSchema:z({type:I("object"),properties:q(d(),Q).optional(),required:N(d()).optional()}).catchall(J()).optional(),annotations:Mf.optional(),execution:Lf.optional(),_meta:q(d(),J()).optional()}),yc=mr.extend({method:I("tools/list")}),qf=dr.extend({tools:N(go)}),zt=ee.extend({content:N(xt).default([]),structuredContent:q(d(),J()).optional(),isError:K().optional()}),Db=zt.or(ee.extend({toolResult:J()})),Vf=sr.extend({name:d(),arguments:q(d(),J()).optional()}),$c=X.extend({method:I("tools/call"),params:Vf}),Ff=me.extend({method:I("notifications/tools/list_changed"),params:le.optional()}),Zb=z({autoRefresh:K().default(!0),debounceMs:Z().int().nonnegative().default(300)}),Qm=re(["debug","info","notice","warning","error","critical","alert","emergency"]),Hf=ue.extend({level:Qm}),Jf=X.extend({method:I("logging/setLevel"),params:Hf}),Bf=le.extend({level:Qm,logger:d().optional(),data:J()}),Wf=me.extend({method:I("notifications/message"),params:Bf}),Kf=z({name:d().optional()}),Gf=z({hints:N(Kf).optional(),costPriority:Z().min(0).max(1).optional(),speedPriority:Z().min(0).max(1).optional(),intelligencePriority:Z().min(0).max(1).optional()}),Qf=z({mode:re(["auto","required","none"]).optional()}),Yf=z({type:I("tool_result"),toolUseId:d().describe("The unique identifier for the corresponding tool call."),content:N(xt).default([]),structuredContent:z({}).loose().optional(),isError:K().optional(),_meta:q(d(),J()).optional()}),Xf=nr("type",[gc,hc,vc]),ro=nr("type",[gc,hc,vc,Zf,Yf]),eg=z({role:gr,content:L([ro,N(ro)]),_meta:q(d(),J()).optional()}),tg=sr.extend({messages:N(eg),modelPreferences:Gf.optional(),systemPrompt:d().optional(),includeContext:re(["none","thisServer","allServers"]).optional(),temperature:Z().optional(),maxTokens:Z().int(),stopSequences:N(d()).optional(),metadata:Q.optional(),tools:N(go).optional(),toolChoice:Qf.optional()}),rg=X.extend({method:I("sampling/createMessage"),params:tg}),xc=ee.extend({model:d(),stopReason:H(re(["endTurn","stopSequence","maxTokens"]).or(d())),role:gr,content:Xf}),zc=ee.extend({model:d(),stopReason:H(re(["endTurn","stopSequence","maxTokens","toolUse"]).or(d())),role:gr,content:L([ro,N(ro)])}),ng=z({type:I("boolean"),title:d().optional(),description:d().optional(),default:K().optional()}),og=z({type:I("string"),title:d().optional(),description:d().optional(),minLength:Z().optional(),maxLength:Z().optional(),format:re(["email","uri","date","date-time"]).optional(),default:d().optional()}),ig=z({type:re(["number","integer"]),title:d().optional(),description:d().optional(),minimum:Z().optional(),maximum:Z().optional(),default:Z().optional()}),ag=z({type:I("string"),title:d().optional(),description:d().optional(),enum:N(d()),default:d().optional()}),sg=z({type:I("string"),title:d().optional(),description:d().optional(),oneOf:N(z({const:d(),title:d()})),default:d().optional()}),cg=z({type:I("string"),title:d().optional(),description:d().optional(),enum:N(d()),enumNames:N(d()).optional(),default:d().optional()}),ug=L([ag,sg]),lg=z({type:I("array"),title:d().optional(),description:d().optional(),minItems:Z().optional(),maxItems:Z().optional(),items:z({type:I("string"),enum:N(d())}),default:N(d()).optional()}),mg=z({type:I("array"),title:d().optional(),description:d().optional(),minItems:Z().optional(),maxItems:Z().optional(),items:z({anyOf:N(z({const:d(),title:d()}))}),default:N(d()).optional()}),dg=L([lg,mg]),pg=L([cg,ug,dg]),fg=L([pg,ng,og,ig]),gg=sr.extend({mode:I("form").optional(),message:d(),requestedSchema:z({type:I("object"),properties:q(d(),fg),required:N(d()).optional()})}),hg=sr.extend({mode:I("url"),message:d(),elicitationId:d(),url:d().url()}),vg=L([gg,hg]),bg=X.extend({method:I("elicitation/create"),params:vg}),_g=le.extend({elicitationId:d()}),yg=me.extend({method:I("notifications/elicitation/complete"),params:_g}),$g=ee.extend({action:re(["accept","decline","cancel"]),content:ir(t=>t===null?void 0:t,q(d(),L([d(),Z(),K(),N(d())])).optional())}),xg=z({type:I("ref/resource"),uri:d()});var zg=z({type:I("ref/prompt"),name:d()}),kg=ue.extend({ref:L([zg,xg]),argument:z({name:d(),value:d()}),context:z({arguments:q(d(),d()).optional()}).optional()}),Sg=X.extend({method:I("completion/complete"),params:kg});var wg=ee.extend({completion:Y({values:N(d()).max(100),total:H(Z().int()),hasMore:H(K())})}),Ig=z({uri:d().startsWith("file://"),name:d().optional(),_meta:q(d(),J()).optional()}),jg=X.extend({method:I("roots/list"),params:ue.optional()}),Pg=ee.extend({roots:N(Ig)}),Tg=me.extend({method:I("notifications/roots/list_changed"),params:le.optional()}),Rb=L([yt,cf,Sg,Jf,Df,Nf,bf,_f,xf,Sf,If,$c,yc,co,lo,mo,fo]),Ab=L([io,ao,mf,Tg,fr]),Cb=L([oo,xc,zc,$g,Pg,uo,po,so]),Mb=L([yt,rg,bg,jg,co,lo,mo,fo]),Lb=L([io,ao,Wf,Pf,zf,Ff,Cf,fr,yg]),qb=L([oo,lf,wg,Af,Uf,dc,yf,fc,zt,qf,uo,po,so]),E=class t extends Error{constructor(r,n,i){super(`MCP error ${r}: ${n}`),this.code=r,this.data=i,this.name="McpError"}static fromError(r,n,i){if(r===M.UrlElicitationRequired&&i){let e=i;if(e.elicitations)return new ac(e.elicitations,n)}return new t(r,n,i)}},ac=class extends E{constructor(r,n=`URL elicitation${r.length>1?"s":""} required`){super(M.UrlElicitationRequired,n,{elicitations:r})}get elicitations(){return this.data?.elicitations??[]}};function je(t){return t==="completed"||t==="failed"||t==="cancelled"}var $_=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function kc(t){let n=Tl(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Ol(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function Sc(t,r){let n=yn(t,r);if(!n.success)throw n.error;return n.data}var Zg=6e4,ho=class{constructor(r){this._options=r,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(io,n=>{this._oncancel(n)}),this.setNotificationHandler(ao,n=>{this._onprogress(n)}),this.setRequestHandler(yt,n=>({})),this._taskStore=r?.taskStore,this._taskMessageQueue=r?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(co,async(n,i)=>{let e=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!e)throw new E(M.InvalidParams,"Failed to retrieve task: Task not found");return{...e}}),this.setRequestHandler(lo,async(n,i)=>{let e=async()=>{let o=n.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(c.type==="response"||c.type==="error"){let l=c.message,h=l.id,g=this._requestResolvers.get(h);if(g)if(this._requestResolvers.delete(h),c.type==="response")g(l);else{let m=l,$=new E(m.error.code,m.error.message,m.error.data);g($)}else{let m=c.type==="response"?"Response":"Error";this._onerror(new Error(`${m} handler missing for request ${h}`))}continue}await this._transport?.send(c.message,{relatedRequestId:i.requestId})}}let a=await this._taskStore.getTask(o,i.sessionId);if(!a)throw new E(M.InvalidParams,`Task not found: ${o}`);if(!je(a.status))return await this._waitForTaskUpdate(o,i.signal),await e();if(je(a.status)){let c=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[Ie]:{taskId:o}}}}return await e()};return await e()}),this.setRequestHandler(mo,async(n,i)=>{try{let{tasks:e,nextCursor:o}=await this._taskStore.listTasks(n.params?.cursor,i.sessionId);return{tasks:e,nextCursor:o,_meta:{}}}catch(e){throw new E(M.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(fo,async(n,i)=>{try{let e=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!e)throw new E(M.InvalidParams,`Task not found: ${n.params.taskId}`);if(je(e.status))throw new E(M.InvalidParams,`Cannot cancel task in terminal status: ${e.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(n.params.taskId);let o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new E(M.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(e){throw e instanceof E?e:new E(M.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(r){if(!r.params.requestId)return;this._requestHandlerAbortControllers.get(r.params.requestId)?.abort(r.params.reason)}_setupTimeout(r,n,i,e,o=!1){this._timeoutInfo.set(r,{timeoutId:setTimeout(e,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:e})}_resetTimeout(r){let n=this._timeoutInfo.get(r);if(!n)return!1;let i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(r),E.fromError(M.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(r){let n=this._timeoutInfo.get(r);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(r))}async connect(r){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=r;let n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let e=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{e?.(o,a),cr(o)||Fm(o)?this._onresponse(o):cc(o)?this._onrequest(o,a):Vm(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let n=E.fromError(M.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of r.values())i(n)}_onerror(r){this.onerror?.(r)}_onnotification(r){let n=this._notificationHandlers.get(r.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(r)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(r,n){let i=this._requestHandlers.get(r.method)??this.fallbackRequestHandler,e=this._transport,o=r.params?._meta?.[Ie]?.taskId;if(i===void 0){let g={jsonrpc:"2.0",id:r.id,error:{code:M.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:g,timestamp:Date.now()},e?.sessionId).catch(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):e?.send(g).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(r.id,a);let c=Mm(r.params)?r.params.task:void 0,l=this._taskStore?this.requestTaskStore(r,e?.sessionId):void 0,h={signal:a.signal,sessionId:e?.sessionId,_meta:r.params?._meta,sendNotification:async g=>{if(a.signal.aborted)return;let m={relatedRequestId:r.id};o&&(m.relatedTask={taskId:o}),await this.notification(g,m)},sendRequest:async(g,m,$)=>{if(a.signal.aborted)throw new E(M.ConnectionClosed,"Request was cancelled");let b={...$,relatedRequestId:r.id};o&&!b.relatedTask&&(b.relatedTask={taskId:o});let p=b.relatedTask?.taskId??o;return p&&l&&await l.updateTaskStatus(p,"input_required"),await this.request(g,m,b)},authInfo:n?.authInfo,requestId:r.id,requestInfo:n?.requestInfo,taskId:o,taskStore:l,taskRequestedTtl:c?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(r.method)}).then(()=>i(r,h)).then(async g=>{if(a.signal.aborted)return;let m={result:g,jsonrpc:"2.0",id:r.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:m,timestamp:Date.now()},e?.sessionId):await e?.send(m)},async g=>{if(a.signal.aborted)return;let m={jsonrpc:"2.0",id:r.id,error:{code:Number.isSafeInteger(g.code)?g.code:M.InternalError,message:g.message??"Internal error",...g.data!==void 0&&{data:g.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:m,timestamp:Date.now()},e?.sessionId):await e?.send(m)}).catch(g=>this._onerror(new Error(`Failed to send response: ${g}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===a&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(r){let{progressToken:n,...i}=r.params,e=Number(n),o=this._progressHandlers.get(e);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(r)}`));return}let a=this._responseHandlers.get(e),c=this._timeoutInfo.get(e);if(c&&a&&c.resetTimeoutOnProgress)try{this._resetTimeout(e)}catch(l){this._responseHandlers.delete(e),this._progressHandlers.delete(e),this._cleanupTimeout(e),a(l);return}o(i)}_onresponse(r){let n=Number(r.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),cr(r))i(r);else{let a=new E(r.error.code,r.error.message,r.error.data);i(a)}return}let e=this._responseHandlers.get(n);if(e===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(r)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(cr(r)&&r.result&&typeof r.result=="object"){let a=r.result;if(a.task&&typeof a.task=="object"){let c=a.task;typeof c.taskId=="string"&&(o=!0,this._taskProgressTokens.set(c.taskId,n))}}if(o||this._progressHandlers.delete(n),cr(r))e(r);else{let a=E.fromError(r.error.code,r.error.message,r.error.data);e(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(r,n,i){let{task:e}=i??{};if(!e){try{yield{type:"result",result:await this.request(r,n,i)}}catch(a){yield{type:"error",error:a instanceof E?a:new E(M.InternalError,String(a))}}return}let o;try{let a=await this.request(r,so,i);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new E(M.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:c},je(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:c.status==="failed"?yield{type:"error",error:new E(M.InternalError,`Task ${o} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new E(M.InternalError,`Task ${o} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}let l=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(h=>setTimeout(h,l)),i?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof E?a:new E(M.InternalError,String(a))}}}request(r,n,i){let{relatedRequestId:e,resumptionToken:o,onresumptiontoken:a,task:c,relatedTask:l}=i??{};return new Promise((h,g)=>{let m=w=>{g(w)};if(!this._transport){m(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(r.method),c&&this.assertTaskCapability(r.method)}catch(w){m(w);return}i?.signal?.throwIfAborted();let $=this._requestMessageId++,b={...r,jsonrpc:"2.0",id:$};i?.onprogress&&(this._progressHandlers.set($,i.onprogress),b.params={...r.params,_meta:{...r.params?._meta||{},progressToken:$}}),c&&(b.params={...b.params,task:c}),l&&(b.params={...b.params,_meta:{...b.params?._meta||{},[Ie]:l}});let p=w=>{this._responseHandlers.delete($),this._progressHandlers.delete($),this._cleanupTimeout($),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:$,reason:String(w)}},{relatedRequestId:e,resumptionToken:o,onresumptiontoken:a}).catch(U=>this._onerror(new Error(`Failed to send cancellation: ${U}`)));let j=w instanceof E?w:new E(M.RequestTimeout,String(w));g(j)};this._responseHandlers.set($,w=>{if(!i?.signal?.aborted){if(w instanceof Error)return g(w);try{let j=yn(n,w.result);j.success?h(j.data):g(j.error)}catch(j){g(j)}}}),i?.signal?.addEventListener("abort",()=>{p(i?.signal?.reason)});let x=i?.timeout??Zg,S=()=>p(E.fromError(M.RequestTimeout,"Request timed out",{timeout:x}));this._setupTimeout($,x,i?.maxTotalTimeout,S,i?.resetTimeoutOnProgress??!1);let A=l?.taskId;if(A){let w=j=>{let U=this._responseHandlers.get($);U?U(j):this._onerror(new Error(`Response handler missing for side-channeled request ${$}`))};this._requestResolvers.set($,w),this._enqueueTaskMessage(A,{type:"request",message:b,timestamp:Date.now()}).catch(j=>{this._cleanupTimeout($),g(j)})}else this._transport.send(b,{relatedRequestId:e,resumptionToken:o,onresumptiontoken:a}).catch(w=>{this._cleanupTimeout($),g(w)})})}async getTask(r,n){return this.request({method:"tasks/get",params:r},uo,n)}async getTaskResult(r,n,i){return this.request({method:"tasks/result",params:r},n,i)}async listTasks(r,n){return this.request({method:"tasks/list",params:r},po,n)}async cancelTask(r,n){return this.request({method:"tasks/cancel",params:r},Jm,n)}async notification(r,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(r.method);let i=n?.relatedTask?.taskId;if(i){let c={...r,jsonrpc:"2.0",params:{...r.params,_meta:{...r.params?._meta||{},[Ie]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(r.method)&&!r.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(r.method))return;this._pendingDebouncedNotifications.add(r.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(r.method),!this._transport)return;let c={...r,jsonrpc:"2.0"};n?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[Ie]:n.relatedTask}}}),this._transport?.send(c,n).catch(l=>this._onerror(l))});return}let a={...r,jsonrpc:"2.0"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Ie]:n.relatedTask}}}),await this._transport.send(a,n)}setRequestHandler(r,n){let i=kc(r);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(e,o)=>{let a=Sc(r,e);return Promise.resolve(n(a,o))})}removeRequestHandler(r){this._requestHandlers.delete(r)}assertCanSetRequestHandler(r){if(this._requestHandlers.has(r))throw new Error(`A request handler for ${r} already exists, which would be overridden`)}setNotificationHandler(r,n){let i=kc(r);this._notificationHandlers.set(i,e=>{let o=Sc(r,e);return Promise.resolve(n(o))})}removeNotificationHandler(r){this._notificationHandlers.delete(r)}_cleanupTaskProgressHandler(r){let n=this._taskProgressTokens.get(r);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(r))}async _enqueueTaskMessage(r,n,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let e=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(r,n,i,e)}async _clearTaskQueue(r,n){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(r,n);for(let e of i)if(e.type==="request"&&cc(e.message)){let o=e.message.id,a=this._requestResolvers.get(o);a?(a(new E(M.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${r} cleanup`))}}}async _waitForTaskUpdate(r,n){let i=this._options?.defaultTaskPollInterval??1e3;try{let e=await this._taskStore?.getTask(r);e?.pollInterval&&(i=e.pollInterval)}catch{}return new Promise((e,o)=>{if(n.aborted){o(new E(M.InvalidRequest,"Request cancelled"));return}let a=setTimeout(e,i);n.addEventListener("abort",()=>{clearTimeout(a),o(new E(M.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(r,n){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async e=>{if(!r)throw new Error("No request provided");return await i.createTask(e,r.id,{method:r.method,params:r.params},n)},getTask:async e=>{let o=await i.getTask(e,n);if(!o)throw new E(M.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(e,o,a)=>{await i.storeTaskResult(e,o,a,n);let c=await i.getTask(e,n);if(c){let l=fr.parse({method:"notifications/tasks/status",params:c});await this.notification(l),je(c.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>i.getTaskResult(e,n),updateTaskStatus:async(e,o,a)=>{let c=await i.getTask(e,n);if(!c)throw new E(M.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(je(c.status))throw new E(M.InvalidParams,`Cannot update task "${e}" from terminal status "${c.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(e,o,a,n);let l=await i.getTask(e,n);if(l){let h=fr.parse({method:"notifications/tasks/status",params:l});await this.notification(h),je(l.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>i.listTasks(e,n)}}};function Ym(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Xm(t,r){let n={...t};for(let i in r){let e=i,o=r[e];if(o===void 0)continue;let a=n[e];Ym(a)&&Ym(o)?n[e]={...a,...o}:n[e]=o}return n}ar();ar();var yx=(t=>typeof Te<"u"?Te:typeof Proxy<"u"?new Proxy(t,{get:(r,n)=>(typeof Te<"u"?Te:r)[n]}):t)(function(t){if(typeof Te<"u")return Te.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),wc=class extends ho{constructor(){super(...arguments);C(this,"_registeredMethods",new Set);C(this,"_eventSlots",new Map);C(this,"setRequestHandler",(n,i)=>{this._assertMethodNotRegistered(n,"setRequestHandler"),super.setRequestHandler(n,i)});C(this,"setNotificationHandler",(n,i)=>{this._assertMethodNotRegistered(n,"setNotificationHandler"),super.setNotificationHandler(n,i)});C(this,"replaceRequestHandler",(n,i)=>{let e=n.shape.method.value;this._registeredMethods.add(e),super.setRequestHandler(n,i)})}onEventDispatch(n,i){}_ensureEventSlot(n){let i=this._eventSlots.get(n);if(!i){let e=this.eventSchemas[n];if(!e)throw Error(`Unknown event: ${String(n)}`);i={listeners:[]},this._eventSlots.set(n,i);let o=e.shape.method.value;this._registeredMethods.add(o);let a=i;super.setNotificationHandler(e,c=>{let l=c.params;this.onEventDispatch(n,l),a.onHandler?.(l);for(let h of[...a.listeners])h(l)})}return i}setEventHandler(n,i){let e=this._ensureEventSlot(n);e.onHandler&&i&&console.warn(`[MCP Apps] on${String(n)} handler replaced. Use addEventListener("${String(n)}", \u2026) to add multiple listeners without replacing.`),e.onHandler=i}getEventHandler(n){return this._eventSlots.get(n)?.onHandler}addEventListener(n,i){this._ensureEventSlot(n).listeners.push(i)}removeEventListener(n,i){let e=this._eventSlots.get(n);if(!e)return;let o=e.listeners.indexOf(i);o!==-1&&e.listeners.splice(o,1)}warnIfRequestHandlerReplaced(n,i,e){i&&e&&console.warn(`[MCP Apps] ${n} handler replaced. Previous handler will no longer be called.`)}_assertMethodNotRegistered(n,i){let e=n.shape.method.value;if(this._registeredMethods.has(e))throw Error(`Handler for "${e}" already registered (via ${i}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(e)}},Rg="2026-01-26";var Ag="ui/notifications/tool-input-partial";var Ic=class{constructor(r=window.parent,n){C(this,"eventTarget");C(this,"eventSource");C(this,"messageListener");C(this,"onclose");C(this,"onerror");C(this,"onmessage");C(this,"sessionId");C(this,"setProtocolVersion");this.eventTarget=r,this.eventSource=n,this.messageListener=i=>{if(n&&i.source!==this.eventSource){console.debug("Ignoring message from unknown source",i);return}let e=Hm.safeParse(i.data);e.success?(console.debug("Parsed message",e.data),this.onmessage?.(e.data)):i.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",e.error.message,i):(console.error("Failed to parse message",e.error.message,i),this.onerror?.(Error("Invalid JSON-RPC message received: "+e.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(r,n){r.method!==Ag&&console.debug("Sending message",r),this.eventTarget.postMessage(r,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}},Cg=s.union([s.literal("light"),s.literal("dark")]).describe("Color theme preference for the host environment."),vr=s.union([s.literal("inline"),s.literal("fullscreen"),s.literal("pip")]).describe("Display mode for UI presentation."),Mg=s.union([s.literal("--color-background-primary"),s.literal("--color-background-secondary"),s.literal("--color-background-tertiary"),s.literal("--color-background-inverse"),s.literal("--color-background-ghost"),s.literal("--color-background-info"),s.literal("--color-background-danger"),s.literal("--color-background-success"),s.literal("--color-background-warning"),s.literal("--color-background-disabled"),s.literal("--color-text-primary"),s.literal("--color-text-secondary"),s.literal("--color-text-tertiary"),s.literal("--color-text-inverse"),s.literal("--color-text-ghost"),s.literal("--color-text-info"),s.literal("--color-text-danger"),s.literal("--color-text-success"),s.literal("--color-text-warning"),s.literal("--color-text-disabled"),s.literal("--color-border-primary"),s.literal("--color-border-secondary"),s.literal("--color-border-tertiary"),s.literal("--color-border-inverse"),s.literal("--color-border-ghost"),s.literal("--color-border-info"),s.literal("--color-border-danger"),s.literal("--color-border-success"),s.literal("--color-border-warning"),s.literal("--color-border-disabled"),s.literal("--color-ring-primary"),s.literal("--color-ring-secondary"),s.literal("--color-ring-inverse"),s.literal("--color-ring-info"),s.literal("--color-ring-danger"),s.literal("--color-ring-success"),s.literal("--color-ring-warning"),s.literal("--font-sans"),s.literal("--font-mono"),s.literal("--font-weight-normal"),s.literal("--font-weight-medium"),s.literal("--font-weight-semibold"),s.literal("--font-weight-bold"),s.literal("--font-text-xs-size"),s.literal("--font-text-sm-size"),s.literal("--font-text-md-size"),s.literal("--font-text-lg-size"),s.literal("--font-heading-xs-size"),s.literal("--font-heading-sm-size"),s.literal("--font-heading-md-size"),s.literal("--font-heading-lg-size"),s.literal("--font-heading-xl-size"),s.literal("--font-heading-2xl-size"),s.literal("--font-heading-3xl-size"),s.literal("--font-text-xs-line-height"),s.literal("--font-text-sm-line-height"),s.literal("--font-text-md-line-height"),s.literal("--font-text-lg-line-height"),s.literal("--font-heading-xs-line-height"),s.literal("--font-heading-sm-line-height"),s.literal("--font-heading-md-line-height"),s.literal("--font-heading-lg-line-height"),s.literal("--font-heading-xl-line-height"),s.literal("--font-heading-2xl-line-height"),s.literal("--font-heading-3xl-line-height"),s.literal("--border-radius-xs"),s.literal("--border-radius-sm"),s.literal("--border-radius-md"),s.literal("--border-radius-lg"),s.literal("--border-radius-xl"),s.literal("--border-radius-full"),s.literal("--border-width-regular"),s.literal("--shadow-hairline"),s.literal("--shadow-sm"),s.literal("--shadow-md"),s.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Lg=s.record(Mg.describe(`Style variables for theming MCP apps.
+
+Individual style keys are optional - hosts may provide any subset of these values.
+Values are strings containing CSS values (colors, sizes, font stacks, etc.).
+
+Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
+for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),s.union([s.string(),s.undefined()]).describe(`Style variables for theming MCP apps.
+
+Individual style keys are optional - hosts may provide any subset of these values.
+Values are strings containing CSS values (colors, sizes, font stacks, etc.).
+
+Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
+for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
+
+Individual style keys are optional - hosts may provide any subset of these values.
+Values are strings containing CSS values (colors, sizes, font stacks, etc.).
+
+Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
+for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Ix=s.object({method:s.literal("ui/open-link"),params:s.object({url:s.string().describe("URL to open in the host's browser")})}),qg=s.object({isError:s.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),Vg=s.object({isError:s.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),Fg=s.object({isError:s.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),jx=s.object({method:s.literal("ui/notifications/sandbox-proxy-ready"),params:s.object({})}),jc=s.object({connectDomains:s.array(s.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
+
+- Maps to CSP \`connect-src\` directive
+- Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:s.array(s.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no network resources (secure default)"),frameDomains:s.array(s.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted \u2192 no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:s.array(s.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted \u2192 only same origin allowed (`base-uri 'self'`)")}),Pc=s.object({camera:s.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:s.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:s.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:s.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),Px=s.object({method:s.literal("ui/notifications/size-changed"),params:s.object({width:s.number().optional().describe("New width in pixels."),height:s.number().optional().describe("New height in pixels.")})}),Hg=s.object({method:s.literal("ui/notifications/tool-input"),params:s.object({arguments:s.record(s.string(),s.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Jg=s.object({method:s.literal("ui/notifications/tool-input-partial"),params:s.object({arguments:s.record(s.string(),s.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),Bg=s.object({method:s.literal("ui/notifications/tool-cancelled"),params:s.object({reason:s.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),Wg=s.object({fonts:s.string().optional()}),Kg=s.object({variables:Lg.optional().describe("CSS variables for theming the app."),css:Wg.optional().describe("CSS blocks that apps can inject.")}),Gg=s.object({method:s.literal("ui/resource-teardown"),params:s.object({})}),Tx=s.record(s.string(),s.unknown()),ed=s.object({text:s.object({}).optional().describe("Host supports text content blocks."),image:s.object({}).optional().describe("Host supports image content blocks."),audio:s.object({}).optional().describe("Host supports audio content blocks."),resource:s.object({}).optional().describe("Host supports resource content blocks."),resourceLink:s.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:s.object({}).optional().describe("Host supports structured content.")}),Ox=s.object({method:s.literal("ui/notifications/request-teardown"),params:s.object({}).optional()}),Qg=s.object({experimental:s.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:s.object({}).optional().describe("Host supports opening external URLs."),downloadFile:s.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:s.object({listChanged:s.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:s.object({listChanged:s.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:s.object({}).optional().describe("Host accepts log messages."),sandbox:s.object({permissions:Pc.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:jc.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:ed.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:ed.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:s.object({tools:s.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Yg=s.object({experimental:s.object({}).optional().describe("Experimental features (structure TBD)."),tools:s.object({listChanged:s.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:s.array(vr).optional().describe("Display modes the app supports.")}),Nx=s.object({method:s.literal("ui/notifications/initialized"),params:s.object({}).optional()}),Ux=s.object({csp:jc.optional().describe("Content Security Policy configuration for UI resources."),permissions:Pc.optional().describe("Sandbox permissions requested by the UI resource."),domain:s.string().optional().describe(`Dedicated origin for view sandbox.
+
+Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
+
+**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
+- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
+- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
+
+If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:s.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
+
+Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
+
+- \`true\`: request visible border + background
+- \`false\`: request no visible border + background
+- omitted: host decides border`)}),Ex=s.object({method:s.literal("ui/request-display-mode"),params:s.object({mode:vr.describe("The display mode being requested.")})}),Xg=s.object({mode:vr.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),eh=s.union([s.literal("model"),s.literal("app")]).describe("Tool visibility scope - who can access the tool."),Dx=s.object({resourceUri:s.string().optional(),visibility:s.array(eh).optional().describe(`Who can access this tool. Default: ["model", "app"]
+- "model": Tool visible to and callable by the agent
+- "app": Tool callable by the app from this server only`),csp:s.never().optional(),permissions:s.never().optional()}),Zx=s.object({mimeTypes:s.array(s.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Rx=s.object({method:s.literal("ui/download-file"),params:s.object({contents:s.array(s.union([bc,_c])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Ax=s.object({method:s.literal("ui/message"),params:s.object({role:s.literal("user").describe('Message role, currently only "user" is supported.'),content:s.array(xt).describe("Message content blocks (text, image, etc.).")})}),Cx=s.object({method:s.literal("ui/notifications/sandbox-resource-ready"),params:s.object({html:s.string().describe("HTML content to load into the inner iframe."),sandbox:s.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:jc.optional().describe("CSP configuration from resource metadata."),permissions:Pc.optional().describe("Sandbox permissions from resource metadata.")})}),th=s.object({method:s.literal("ui/notifications/tool-result"),params:zt.describe("Standard MCP tool execution result.")}),nd=s.object({toolInfo:s.object({id:_t.optional().describe("JSON-RPC id of the tools/call request."),tool:go.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Cg.optional().describe("Current color theme preference."),styles:Kg.optional().describe("Style configuration for theming the app."),displayMode:vr.optional().describe("How the UI is currently displayed."),availableDisplayModes:s.array(vr).optional().describe("Display modes the host supports."),containerDimensions:s.union([s.object({height:s.number().describe("Fixed container height in pixels.")}),s.object({maxHeight:s.union([s.number(),s.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(s.union([s.object({width:s.number().describe("Fixed container width in pixels.")}),s.object({maxWidth:s.union([s.number(),s.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
+container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:s.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:s.string().optional().describe("User's timezone in IANA format."),userAgent:s.string().optional().describe("Host application identifier."),platform:s.union([s.literal("web"),s.literal("desktop"),s.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s.object({touch:s.boolean().optional().describe("Whether the device supports touch input."),hover:s.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s.object({top:s.number().describe("Top safe area inset in pixels."),right:s.number().describe("Right safe area inset in pixels."),bottom:s.number().describe("Bottom safe area inset in pixels."),left:s.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),rh=s.object({method:s.literal("ui/notifications/host-context-changed"),params:nd.describe("Partial context update containing only changed fields.")}),Mx=s.object({method:s.literal("ui/update-model-context"),params:s.object({content:s.array(xt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:s.record(s.string(),s.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Lx=s.object({method:s.literal("ui/initialize"),params:s.object({appInfo:lr.describe("App identification (name and version)."),appCapabilities:Yg.describe("Features and capabilities this app provides."),protocolVersion:s.string().describe("Protocol version this app supports.")})}),nh=s.object({protocolVersion:s.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:lr.describe("Host application identification and version."),hostCapabilities:Qg.describe("Features and capabilities provided by the host."),hostContext:nd.describe("Rich context about the host environment.")}).passthrough(),oh={target:"draft-2020-12"};async function td(t,r){let n=t["~standard"];if(n.jsonSchema)return n.jsonSchema[r](oh);if(n.vendor==="zod"){let{z:i}=await Promise.resolve().then(()=>(ar(),ic));return i.toJSONSchema(t,{io:r})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function rd(t,r,n=""){let i=await t["~standard"].validate(r);if(i.issues){let e=i.issues.map(o=>{let a=o.path?.map(c=>typeof c=="object"?c.key:c).join(".");return a?`${a}: ${o.message}`:o.message}).join("; ");throw Error(n+e)}return i.value}var bo=class bo extends wc{constructor(n,i={},e={autoResize:!0}){super(e);C(this,"_appInfo");C(this,"_capabilities");C(this,"options");C(this,"_hostCapabilities");C(this,"_hostInfo");C(this,"_hostContext");C(this,"_registeredTools",{});C(this,"_initializedSent",!1);C(this,"eventSchemas",{toolinput:Hg,toolinputpartial:Jg,toolresult:th,toolcancelled:Bg,hostcontextchanged:rh});C(this,"_everHadListener",new Set);C(this,"_toolHandlersInitialized",!1);C(this,"_onteardown");C(this,"_oncalltool");C(this,"_onlisttools");C(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=i,this.options=e,e.allowUnsafeEval||s.config({jitless:!0}),this.setRequestHandler(yt,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(n){if(this._initializedSent)return;let i=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(i);console.warn(`${i}. This will throw in a future release.`)}_assertHandlerTiming(n){if(!bo.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let i=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(i);console.warn(i)}setEventHandler(n,i){i&&this._assertHandlerTiming(n),super.setEventHandler(n,i)}addEventListener(n,i){this._assertHandlerTiming(n),super.addEventListener(n,i)}onEventDispatch(n,i){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...i})}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=Xm(this._capabilities,n)}registerTool(n,i,e){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let o=this,a=()=>{o._initializedSent&&o._capabilities.tools?.listChanged&&o.sendToolListChanged()},c=i.inputSchema!==void 0,l={title:i.title,description:i.description,inputSchema:i.inputSchema,outputSchema:i.outputSchema,annotations:i.annotations,_meta:i._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(h){Object.assign(this,h),a()},remove(){o._registeredTools[n]===l&&(delete o._registeredTools[n],a())},handler:async(h,g)=>{if(!l.enabled)throw Error(`Tool ${n} is disabled`);let m;if(c){let $=l.inputSchema,b=$?await rd($,h??{},`Invalid input for tool ${n}: `):h??{};m=await e(b,g)}else m=await e(g);return l.outputSchema&&!m.isError&&(m.structuredContent=await rd(l.outputSchema,m.structuredContent,`Invalid output for tool ${n}: `)),m}};return this._registeredTools[n]=l,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),l}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,i)=>{let e=this._registeredTools[n.name];if(!e)throw Error(`Tool ${n.name} not found`);return e.handler(n.arguments,i)},this.onlisttools=async(n,i)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,o])=>o.enabled).map(async([e,o])=>{let a={name:e,title:o.title,description:o.description,inputSchema:o.inputSchema?await td(o.inputSchema,"input"):{type:"object",properties:{}}};return o.outputSchema&&(a.outputSchema=await td(o.outputSchema,"output")),o.annotations&&(a.annotations=o.annotations),o._meta&&(a._meta=o._meta),a}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(Gg,(i,e)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(i.params,e)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler($c,(i,e)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(i.params,e)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(yc,(i,e)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(i.params,e)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,i){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},zt,{onprogress:()=>{},resetTimeoutOnProgress:!0,...i})}async readServerResource(n,i){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},fc,i)}async listServerResources(n,i){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},dc,i)}async createSamplingMessage(n,i){this._assertInitialized("createSamplingMessage");let e=n.tools?zc:xc;return await this.request({method:"sampling/createMessage",params:n},e,i)}sendMessage(n,i){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},Fg,i)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,i){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},oo,i)}openLink(n,i){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},qg,i)}downloadFile(n,i){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},Vg,i)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,i){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},Xg,i)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,i=0,e=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let c=document.documentElement,l=c.style.height;c.style.height="max-content";let h=Math.ceil(c.getBoundingClientRect().height);c.style.height=l;let g=Math.ceil(window.innerWidth);(g!==i||h!==e)&&(i=g,e=h,this.sendSizeChanged({width:g,height:h}))}))};o();let a=new ResizeObserver(o);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(n=new Ic(window.parent,window.parent),i){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let e=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Rg}},nh,i);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};C(bo,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));var vo=bo;var ih="x402/payment-response",D={card:document.getElementById("card"),status:document.getElementById("status"),agentName:document.getElementById("agent-name"),agentId:document.getElementById("agent-id"),repBadge:document.getElementById("rep-badge"),repDetail:document.getElementById("rep-detail"),matchBar:document.getElementById("match-bar"),matchPct:document.getElementById("match-pct"),amount:document.getElementById("amount"),asset:document.getElementById("asset"),network:document.getElementById("network"),latency:document.getElementById("latency"),settleRow:document.getElementById("settle-row"),settleRef:document.getElementById("settle-ref"),settleLink:document.getElementById("settle-link"),task:document.getElementById("task"),response:document.getElementById("response"),responseWrap:document.getElementById("response-wrap")};function od(t,r=6,n=6){return typeof t!="string"||t.length<=r+n+1?t||"":`${t.slice(0,r)}\u2026${t.slice(-n)}`}function ah(t){return typeof t!="string"||!/^[1-9A-HJ-NP-Za-km-z]{43,90}$/.test(t)?null:`https://solscan.io/tx/${t}`}function sh(t){return t==null?"rep-unknown":t>=.66?"rep-high":t>=.2?"rep-mid":"rep-low"}function Tc(t){D.status.hidden=!1,D.status.textContent=t,D.card.hidden=!0}function ch(t){let r=t&&t.structuredContent||{},n=r.provenance||(r.payment?r:null);if(r.ok===!1){Tc(r.message||r.error||"The hire was blocked.");return}if(!n){Tc("Waiting for a hire receipt\u2026");return}D.status.hidden=!0,D.card.hidden=!1,D.agentName.textContent=n.agentName||"Agent",D.agentId.textContent=n.agentId?od(n.agentId,8,6):"";let i=n.reputation,e=i&&typeof i.average=="number"?i.average:null;D.repBadge.className=`badge ${sh(e)}`,i&&e!=null?(D.repBadge.textContent=`rep ${e.toFixed(2)}`,D.repDetail.textContent=`${i.count||0} vouch${i.count===1?"":"es"} \xB7 ${i.source||"erc8004"}${i.chain?` \xB7 ${i.chain}`:""}`):i?(D.repBadge.textContent="on-chain id",D.repDetail.textContent=`ERC-8004 #${i.erc8004AgentId||"?"} \xB7 no vouches yet`):(D.repBadge.textContent="unrated",D.repDetail.textContent="no on-chain reputation record");let o=typeof n.capabilityMatch=="number"?Math.max(0,Math.min(1,n.capabilityMatch)):null;o!=null?(D.matchBar.style.width=`${(o*100).toFixed(0)}%`,D.matchPct.textContent=`${(o*100).toFixed(0)}% task fit`):(D.matchBar.style.width="0%",D.matchPct.textContent="task fit n/a");let a=n.payment||{};D.amount.textContent=a.amountDisplay||(a.amountUsd!=null?`$${a.amountUsd}`:"\u2014"),D.asset.textContent=a.asset||"USDC",D.network.textContent=a.networkLabel||"Solana",D.latency.textContent=n.latencyMs!=null?`${(n.latencyMs/1e3).toFixed(1)}s`:"\u2014";let c=t&&t._meta&&t._meta[ih]||null,l=c&&(c.transaction||c.txHash||c.signature);if(l){D.settleRow.hidden=!1,D.settleRef.textContent=od(l,8,8);let g=ah(l);g?(D.settleLink.href=g,D.settleLink.hidden=!1):D.settleLink.hidden=!0}else D.settleRow.hidden=!1,D.settleRef.textContent=c&&c.success===!1?"settlement failed":"settled via x402",D.settleLink.hidden=!0;D.task.textContent=n.task||r.task||"";let h=r.result&&(r.result.response||r.result.text);h?(D.response.textContent=h,D.responseWrap.hidden=!1):D.responseWrap.hidden=!0}var _o=new vo({name:"three.ws Agent Hire Receipt",version:"1.0.0"});_o.ontoolresult=t=>ch(t);_o.onerror=t=>console.error("[commerce-receipt]",t);_o.onhostcontextchanged=t=>{t&&t.theme&&(document.documentElement.dataset.theme=t.theme)};_o.connect().catch(t=>{Tc("Waiting for an MCP host\u2026"),console.warn("[commerce-receipt] not connected to a host:",t?.message||t)});})();
+</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/src/animation-state-machine.js b/src/animation-state-machine.js
index 702a15092..b918e4b06 100644
--- a/src/animation-state-machine.js
+++ b/src/animation-state-machine.js
@@ -16,6 +16,10 @@
// `-end` transition (driven externally by the caller calling fire('react-end')
// after the clip duration elapses — the machine itself is duration-agnostic).
//
+// `listen` and `think` are looping conversational postures (worn while a peer
+// speaks / while a reply is generated). They behave like idle/talk/walk — held
+// until a `listen-end` / `think-end` (or any other) event crossfades them out.
+//
// This module is pure: no Three.js, no DOM, no async. Playback side effects
// are delivered through a single `onTransition({ state, clip, crossfade })`
// callback supplied by the caller. That makes the state machine unit-testable
@@ -31,11 +35,19 @@
*/
import { log } from './shared/log.js';
const DEFAULT_STATES = Object.freeze({
- idle: { clip: 'idle', loop: true, crossfade: 0.5, oneShot: false, returnTo: null },
- talk: { clip: 'idle', loop: true, crossfade: 0.35, oneShot: false, returnTo: null },
- walk: { clip: 'walk', loop: true, crossfade: 0.3, oneShot: false, returnTo: null },
- react: { clip: 'reaction', loop: false, crossfade: 0.25, oneShot: true, returnTo: 'idle' },
- emote: { clip: 'wave', loop: false, crossfade: 0.25, oneShot: true, returnTo: 'idle' },
+ idle: { clip: 'idle', loop: true, crossfade: 0.5, oneShot: false, returnTo: null },
+ talk: { clip: 'idle', loop: true, crossfade: 0.35, oneShot: false, returnTo: null },
+ walk: { clip: 'walk', loop: true, crossfade: 0.3, oneShot: false, returnTo: null },
+ react: { clip: 'reaction', loop: false, crossfade: 0.25, oneShot: true, returnTo: 'idle' },
+ emote: { clip: 'wave', loop: false, crossfade: 0.25, oneShot: true, returnTo: 'idle' },
+ // Postural modes the body holds while a conversation is in flight. `listen`
+ // is the attentive sway worn while the user/peer is speaking; `think` is the
+ // considering pose worn while a reply is being generated. Both loop and are
+ // left via their `-end` event (or any other transition), so they crossfade
+ // cleanly back to idle/talk without a T-pose pop. Clips are baked library
+ // loops, retargeted to any humanoid rig like every other state.
+ listen: { clip: 'av-listening-music', loop: true, crossfade: 0.4, oneShot: false, returnTo: null },
+ think: { clip: 'av-waiting', loop: true, crossfade: 0.4, oneShot: false, returnTo: null },
});
/** Built-in event → target-state transition table. */
@@ -48,6 +60,10 @@ const DEFAULT_TRANSITIONS = Object.freeze({
'react-end': 'idle',
'emote': 'emote',
'emote-end': 'idle',
+ 'listen': 'listen',
+ 'listen-end': 'idle',
+ 'think': 'think',
+ 'think-end': 'idle',
});
const STATE_NAMES = Object.freeze(Object.keys(DEFAULT_STATES));
@@ -85,6 +101,15 @@ const GESTURES = Object.freeze({
agree: { clip: 'xbot-agree', label: 'Agree', icon: '✅', loop: false, layer: 'upper', crossfade: 0.2 },
disagree: { clip: 'xbot-head-shake', label: 'Disagree', icon: '🙅', loop: false, layer: 'upper', crossfade: 0.2 },
talking: { clip: 'av-vtubing', label: 'Talking', icon: '💬', loop: true, layer: 'upper', crossfade: 0.3 },
+ // Conversational + locomotion gestures. `nod` reuses the agree clip as an
+ // upper-body affirm; `shrug` borrows the full-body `defeated` clip the agent
+ // slot registry already designates for the shrug slot; `jog` is a full-body
+ // run loop; `celebrate` a one-shot whole-body cheer. All clip names are baked
+ // in public/animations/manifest.json (covered by the gesture-manifest test).
+ nod: { clip: 'xbot-agree', label: 'Nod', icon: '🙂', loop: false, layer: 'upper', crossfade: 0.2 },
+ shrug: { clip: 'defeated', label: 'Shrug', icon: '🤷', loop: false, layer: 'full', crossfade: 0.3 },
+ jog: { clip: 'xbot-run', label: 'Jog', icon: '🏃', loop: true, layer: 'full', crossfade: 0.3 },
+ celebrate:{ clip: 'av-celebrating', label: 'Celebrate',icon: '🎉', loop: false, layer: 'full', crossfade: 0.3 },
});
const GESTURE_NAMES = Object.freeze(Object.keys(GESTURES));
diff --git a/tests/animation-state-machine.test.js b/tests/animation-state-machine.test.js
index 6abca8c3f..00befc303 100644
--- a/tests/animation-state-machine.test.js
+++ b/tests/animation-state-machine.test.js
@@ -30,10 +30,22 @@ describe('AnimationStateMachine — defaults', () => {
});
it('exposes the canonical state list', () => {
- expect(STATE_NAMES).toEqual(['idle', 'talk', 'walk', 'react', 'emote']);
+ expect(STATE_NAMES).toEqual(['idle', 'talk', 'walk', 'react', 'emote', 'listen', 'think']);
for (const n of STATE_NAMES) expect(DEFAULT_STATES[n]?.clip).toBeTruthy();
});
+ it('listen / think are looping postures that leave back to idle', () => {
+ expect(sm.fire('listen')).toBe('listen');
+ expect(DEFAULT_STATES.listen.loop).toBe(true);
+ expect(DEFAULT_STATES.listen.oneShot).toBe(false);
+ expect(sm.fire('listen-end')).toBe('idle');
+ expect(sm.fire('think')).toBe('think');
+ expect(DEFAULT_STATES.think.loop).toBe(true);
+ expect(sm.fire('think-end')).toBe('idle');
+ expect(DEFAULT_TRANSITIONS.listen).toBe('listen');
+ expect(DEFAULT_TRANSITIONS.think).toBe('think');
+ });
+
it('starts in idle', () => {
expect(sm.getCurrent()).toBe('idle');
expect(sm.getCurrentClip()).toBe('idle');
@@ -198,9 +210,10 @@ describe('AnimationStateMachine — gesture slot', () => {
sm = new AnimationStateMachine({}, onT, onG);
});
- it('exposes the eight built-in gestures', () => {
+ it('exposes the built-in gestures', () => {
expect(GESTURE_NAMES).toEqual([
'wave', 'dance', 'sit', 'point', 'cheer', 'agree', 'disagree', 'talking',
+ 'nod', 'shrug', 'jog', 'celebrate',
]);
for (const name of GESTURE_NAMES) {
const g = GESTURES[name];
diff --git a/tests/embodiment-emotion.test.js b/tests/embodiment-emotion.test.js
new file mode 100644
index 000000000..34cc08480
--- /dev/null
+++ b/tests/embodiment-emotion.test.js
@@ -0,0 +1,104 @@
+/**
+ * Embodiment emotion classifier + the manifest contract emotion.js promises.
+ *
+ * emotion.js says every gesture/idle clip it can ask for "MUST exist in
+ * public/animations/manifest.json — see the test." This is that test. It also
+ * pins the gesture clips the state machine added, so a future clip rename can't
+ * silently break either mapping.
+ */
+
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+import { dirname, resolve } from 'node:path';
+import {
+ EMOTIONS,
+ detectEmotion,
+ expressionFor,
+ expressionForText,
+ referencedClipNames,
+} from '../src/embodiment/emotion.js';
+import { GESTURES } from '../src/animation-state-machine.js';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const manifest = JSON.parse(
+ readFileSync(resolve(__dirname, '../public/animations/manifest.json'), 'utf8'),
+);
+const CLIP_NAMES = new Set(manifest.map((c) => c.name));
+
+describe('detectEmotion', () => {
+ it('returns neutral with zero intensity for empty / signal-free text', () => {
+ for (const t of ['', null, undefined, 'the cat sat on the mat']) {
+ const r = detectEmotion(t);
+ expect(r.emotion).toBe('neutral');
+ expect(r.intensity).toBe(0);
+ }
+ });
+
+ it('classifies the obvious emotions from lexical cues', () => {
+ expect(detectEmotion('Congratulations, that is amazing! 🎉').emotion).toBe('joy');
+ expect(detectEmotion("I'm so sorry, unfortunately that failed").emotion).toBe('sad');
+ expect(detectEmotion('This is unacceptable and frustrating').emotion).toBe('angry');
+ expect(detectEmotion('Whoa, no way — that is incredible!').emotion).toBe('surprised');
+ expect(detectEmotion('Hmm, let me think and analyze this').emotion).toBe('thinking');
+ });
+
+ it('intensity rises with shouting and stays within [0,1]', () => {
+ const calm = detectEmotion('that is great');
+ const loud = detectEmotion('THAT IS GREAT!!!');
+ expect(loud.intensity).toBeGreaterThan(calm.intensity);
+ expect(loud.intensity).toBeLessThanOrEqual(1);
+ expect(calm.intensity).toBeGreaterThanOrEqual(0);
+ });
+});
+
+describe('expressionFor', () => {
+ it('scales the face weights by intensity and clamps emotion to the known set', () => {
+ const full = expressionFor('joy', 1);
+ const half = expressionFor('joy', 0.5);
+ expect(full.face.mouthSmileLeft).toBeGreaterThan(half.face.mouthSmileLeft);
+ expect(expressionFor('not-an-emotion', 1).emotion).toBe('neutral');
+ });
+
+ it('escalates to the high-intensity gesture past the threshold', () => {
+ expect(expressionFor('joy', 0.4).gesture).toBe('av-joy');
+ expect(expressionFor('joy', 0.9).gesture).toBe('av-celebrating');
+ });
+
+ it('every emotion yields a renderable descriptor', () => {
+ for (const emo of EMOTIONS) {
+ const d = expressionFor(emo, 1);
+ expect(d.emotion).toBe(emo);
+ expect(typeof d.idle).toBe('string');
+ expect(d.face).toBeTypeOf('object');
+ }
+ });
+});
+
+describe('expressionForText', () => {
+ it('threads classification through to a full descriptor', () => {
+ const d = expressionForText('Congrats! 🎉 amazing work');
+ expect(d.emotion).toBe('joy');
+ expect(d.gesture).toBeTruthy();
+ expect(d.scores).toBeTypeOf('object');
+ });
+});
+
+describe('animation manifest contract', () => {
+ it('every clip emotion.js can request exists in the manifest', () => {
+ for (const name of referencedClipNames()) {
+ expect(CLIP_NAMES.has(name), `emotion clip "${name}" missing from manifest`).toBe(true);
+ }
+ });
+
+ it('every gesture clip the state machine exposes exists in the manifest', () => {
+ // `sitidle` is a known pre-existing gap (registry known_issues) — the new
+ // gestures added for the embodiment work must NOT introduce more of them.
+ const ADDED = ['nod', 'shrug', 'jog', 'celebrate', 'cheer', 'agree', 'disagree', 'talking', 'wave', 'point'];
+ for (const g of ADDED) {
+ const clip = GESTURES[g]?.clip;
+ expect(clip, `gesture "${g}" has no clip`).toBeTruthy();
+ expect(CLIP_NAMES.has(clip), `gesture "${g}" → "${clip}" missing from manifest`).toBe(true);
+ }
+ });
+});
diff --git a/tests/embodiment-text-visemes.test.js b/tests/embodiment-text-visemes.test.js
new file mode 100644
index 000000000..774545dd4
--- /dev/null
+++ b/tests/embodiment-text-visemes.test.js
@@ -0,0 +1,60 @@
+/**
+ * Text-timed lip-sync envelope — deterministic, bounded, and honest about its
+ * words (vowels open the mouth, bilabials close it, length tracks the text).
+ */
+
+import { describe, it, expect } from 'vitest';
+import { estimateSpeechDuration, TextVisemeEnvelope } from '../src/embodiment/text-visemes.js';
+
+describe('estimateSpeechDuration', () => {
+ it('grows with word count and clamps to [min,max]', () => {
+ const short = estimateSpeechDuration('hi');
+ const long = estimateSpeechDuration('word '.repeat(80));
+ expect(long).toBeGreaterThan(short);
+ expect(estimateSpeechDuration('')).toBeGreaterThanOrEqual(0.6);
+ expect(estimateSpeechDuration('word '.repeat(10000))).toBeLessThanOrEqual(40);
+ });
+});
+
+describe('TextVisemeEnvelope', () => {
+ it('is deterministic — same text + rate yields the same motion', () => {
+ const a = new TextVisemeEnvelope('hello there', { wpm: 165 });
+ const b = new TextVisemeEnvelope('hello there', { wpm: 165 });
+ for (const t of [0, 0.1, 0.3, 0.6]) {
+ expect(a.sample(t)).toEqual(b.sample(t));
+ }
+ });
+
+ it('keeps every channel within [0,1] and eases shut past the end', () => {
+ const env = new TextVisemeEnvelope('aeiou bmp', { wpm: 165 });
+ for (let t = 0; t <= env.duration + 1; t += env.duration / 7) {
+ const s = env.sample(t);
+ for (const k of ['open', 'wide', 'round']) {
+ expect(s[k]).toBeGreaterThanOrEqual(0);
+ expect(s[k]).toBeLessThanOrEqual(1);
+ }
+ }
+ expect(env.done(env.duration + 0.5)).toBe(true);
+ // Well past the end the mouth has eased toward rest.
+ let last = { open: 1 };
+ const fresh = new TextVisemeEnvelope('aeiou bmp', { wpm: 165 });
+ for (let i = 0; i < 50; i++) last = fresh.sample(fresh.duration + 2);
+ expect(last.open).toBeLessThan(0.05);
+ });
+
+ it('opens wider on a vowel-heavy line than a consonant-heavy one', () => {
+ const peak = (text) => {
+ const env = new TextVisemeEnvelope(text, { wpm: 165 });
+ let max = 0;
+ for (let t = 0; t < env.duration; t += env.duration / 40) max = Math.max(max, env.sample(t).open);
+ return max;
+ };
+ expect(peak('aaaaaa')).toBeGreaterThan(peak('mbpmbp'));
+ });
+
+ it('handles empty text without throwing', () => {
+ const env = new TextVisemeEnvelope('', {});
+ expect(env.sample(0)).toBeTypeOf('object');
+ expect(env.done(env.duration + 1)).toBe(true);
+ });
+});
diff --git a/tests/forge-cache.test.js b/tests/forge-cache.test.js
new file mode 100644
index 000000000..7726259c1
--- /dev/null
+++ b/tests/forge-cache.test.js
@@ -0,0 +1,121 @@
+import { describe, it, expect, beforeEach } from 'vitest';
+import {
+ forgeResultCacheKey,
+ getCachedForgeResult,
+ putCachedForgeResult,
+ bindJobToCacheKey,
+ cacheKeyForJob,
+} from '../api/_lib/forge-cache.js';
+
+// Minimal Upstash-shaped fake: get/set with a TTL-tolerant store. Lets the cache
+// run without a live Redis so the boundary logic is exercised deterministically.
+function fakeRedis() {
+ const store = new Map();
+ return {
+ store,
+ async get(k) {
+ return store.has(k) ? store.get(k) : null;
+ },
+ async set(k, v) {
+ store.set(k, v);
+ return 'OK';
+ },
+ async del(k) {
+ return store.delete(k) ? 1 : 0;
+ },
+ };
+}
+
+describe('forgeResultCacheKey', () => {
+ it('is stable for the same inputs and order-independent of object keys', () => {
+ const a = forgeResultCacheKey({ path: 'image', tier: 'standard', backend: 'trellis', prompt: 'A Red Cube' });
+ const b = forgeResultCacheKey({ backend: 'trellis', prompt: 'a red cube', tier: 'standard', path: 'image' });
+ expect(a).toBe(b); // prompt normalized (trim + lowercase)
+ expect(a).toMatch(/^[0-9a-f]{40}$/);
+ });
+
+ it('returns null without a prompt (not cacheable)', () => {
+ expect(forgeResultCacheKey({ path: 'image', tier: 'standard', backend: 'trellis', prompt: '' })).toBeNull();
+ expect(forgeResultCacheKey({ prompt: ' ' })).toBeNull();
+ });
+
+ it('changes when an output-affecting option changes', () => {
+ const base = { path: 'image', tier: 'standard', backend: 'trellis', prompt: 'a vase' };
+ const k0 = forgeResultCacheKey(base);
+ const kSeed = forgeResultCacheKey({ ...base, options: { seed: 7, outputFormat: 'glb' } });
+ const kFmt = forgeResultCacheKey({ ...base, options: { outputFormat: 'glb-draco' } });
+ const kTex = forgeResultCacheKey({ ...base, options: { textureSize: 2048, outputFormat: 'glb' } });
+ expect(new Set([k0, kSeed, kFmt, kTex]).size).toBe(4);
+ });
+
+ it('an all-default options object keys identically to no options (no invalidation)', () => {
+ const base = { path: 'image', tier: 'standard', backend: 'trellis', prompt: 'a vase' };
+ const noOpts = forgeResultCacheKey(base);
+ const defaultOpts = forgeResultCacheKey({
+ ...base,
+ options: { seed: null, outputFormat: 'glb', textureSize: null, targetPolycount: null },
+ });
+ expect(noOpts).toBe(defaultOpts);
+ });
+
+ it('different tier or backend keys differently', () => {
+ const p = 'a vase';
+ expect(forgeResultCacheKey({ path: 'image', tier: 'standard', backend: 'trellis', prompt: p })).not.toBe(
+ forgeResultCacheKey({ path: 'image', tier: 'high', backend: 'trellis', prompt: p }),
+ );
+ });
+});
+
+describe('forge result cache get/put round-trip', () => {
+ let redis;
+ beforeEach(() => {
+ redis = fakeRedis();
+ });
+
+ it('stores and retrieves a completed result', async () => {
+ const key = forgeResultCacheKey({ path: 'image', tier: 'standard', backend: 'trellis', prompt: 'a vase' });
+ expect(await getCachedForgeResult(key, { redis })).toBeNull(); // miss first
+
+ const ok = await putCachedForgeResult(
+ key,
+ { glb_url: 'https://cdn.example/forge/x.glb', backend: 'trellis', tier: 'standard', path: 'image', quality: { flag: 'ok', score: 0.8 } },
+ { redis },
+ );
+ expect(ok).toBe(true);
+
+ const hit = await getCachedForgeResult(key, { redis });
+ expect(hit).toBeTruthy();
+ expect(hit.glb_url).toBe('https://cdn.example/forge/x.glb');
+ expect(hit.quality.flag).toBe('ok');
+ expect(hit.cached_at).toMatch(/^\d{4}-\d{2}-\d{2}$/);
+ });
+
+ it('refuses to store a value without a public glb_url', async () => {
+ const key = 'k1';
+ expect(await putCachedForgeResult(key, { glb_url: '' }, { redis })).toBe(false);
+ expect(await putCachedForgeResult(key, {}, { redis })).toBe(false);
+ expect(redis.store.size).toBe(0);
+ });
+
+ it('treats a stored value missing glb_url as a miss', async () => {
+ redis.store.set('fr:result:bad', JSON.stringify({ backend: 'trellis' }));
+ expect(await getCachedForgeResult('bad', { redis })).toBeNull();
+ });
+
+ it('binds a job to its cache key and resolves it back', async () => {
+ const key = 'cachekey123';
+ await bindJobToCacheKey('jobhandle-abc', key, { redis });
+ expect(await cacheKeyForJob('jobhandle-abc', { redis })).toBe(key);
+ expect(await cacheKeyForJob('unknown-job', { redis })).toBeNull();
+ });
+});
+
+describe('fail-open without redis', () => {
+ it('all operations no-op safely when no client is available', async () => {
+ // No injected redis and (in test env) no shared Upstash → every call is a no-op.
+ expect(await getCachedForgeResult('k')).toBeNull();
+ expect(await putCachedForgeResult('k', { glb_url: 'https://x/y.glb' })).toBe(false);
+ expect(await cacheKeyForJob('j')).toBeNull();
+ await expect(bindJobToCacheKey('j', 'k')).resolves.toBeUndefined();
+ });
+});
diff --git a/tests/forge-options.test.js b/tests/forge-options.test.js
new file mode 100644
index 000000000..e3e8fcde7
--- /dev/null
+++ b/tests/forge-options.test.js
@@ -0,0 +1,119 @@
+import { describe, it, expect } from 'vitest';
+import {
+ normalizeForgeOptions,
+ providerReconstructParams,
+ summarizeForgeOptions,
+ OUTPUT_FORMATS,
+ TEXTURE_SIZES,
+} from '../api/_lib/forge-options.js';
+
+describe('normalizeForgeOptions — backward compatibility', () => {
+ it('an empty body yields all defaults and no options (current behavior)', () => {
+ const o = normalizeForgeOptions({});
+ expect(o.seed).toBeNull();
+ expect(o.outputFormat).toBe('glb');
+ expect(o.compression).toBe('none');
+ expect(o.textureSize).toBeNull();
+ expect(o.targetPolycount).toBeNull();
+ expect(o.hasOptions).toBe(false);
+ expect(o.errors).toEqual([]);
+ });
+
+ it('null/undefined body is safe', () => {
+ expect(normalizeForgeOptions(null).hasOptions).toBe(false);
+ expect(normalizeForgeOptions(undefined).errors).toEqual([]);
+ });
+
+ it('providerReconstructParams contributes nothing for default options', () => {
+ const o = normalizeForgeOptions({});
+ expect(providerReconstructParams(o, { polyControl: true })).toEqual({});
+ });
+});
+
+describe('normalizeForgeOptions — seed', () => {
+ it('accepts a valid integer seed', () => {
+ const o = normalizeForgeOptions({ seed: 12345 });
+ expect(o.seed).toBe(12345);
+ expect(o.hasOptions).toBe(true);
+ });
+
+ it('clamps an over-large seed into uint32', () => {
+ const o = normalizeForgeOptions({ seed: 9_999_999_999 });
+ expect(o.seed).toBe(4_294_967_295);
+ });
+
+ it('rejects a negative or non-integer seed', () => {
+ expect(normalizeForgeOptions({ seed: -1 }).errors[0].field).toBe('seed');
+ expect(normalizeForgeOptions({ seed: 1.5 }).errors[0].field).toBe('seed');
+ expect(normalizeForgeOptions({ seed: 'abc' }).errors[0].field).toBe('seed');
+ });
+});
+
+describe('normalizeForgeOptions — output format', () => {
+ it('maps each format to the right compression', () => {
+ expect(normalizeForgeOptions({ output_format: 'glb' }).compression).toBe('none');
+ expect(normalizeForgeOptions({ output_format: 'glb-draco' }).compression).toBe('draco');
+ expect(normalizeForgeOptions({ output_format: 'glb-meshopt' }).compression).toBe('meshopt');
+ });
+
+ it('accepts the `format` alias and is case-insensitive', () => {
+ expect(normalizeForgeOptions({ format: 'GLB-DRACO' }).outputFormat).toBe('glb-draco');
+ });
+
+ it('rejects an unknown format', () => {
+ const o = normalizeForgeOptions({ output_format: 'obj' });
+ expect(o.outputFormat).toBe('glb');
+ expect(o.errors[0].field).toBe('output_format');
+ });
+
+ it('all advertised formats validate', () => {
+ for (const f of OUTPUT_FORMATS) expect(normalizeForgeOptions({ output_format: f }).errors).toEqual([]);
+ });
+});
+
+describe('normalizeForgeOptions — texture size & polycount', () => {
+ it('accepts valid texture sizes via either key', () => {
+ for (const s of TEXTURE_SIZES) {
+ expect(normalizeForgeOptions({ texture_size: s }).textureSize).toBe(s);
+ expect(normalizeForgeOptions({ texture_resolution: s }).textureSize).toBe(s);
+ }
+ });
+
+ it('rejects an off-list texture size', () => {
+ expect(normalizeForgeOptions({ texture_size: 999 }).errors[0].field).toBe('texture_size');
+ });
+
+ it('accepts a target_polycount in range and rejects out-of-range', () => {
+ expect(normalizeForgeOptions({ target_polycount: 50_000 }).targetPolycount).toBe(50_000);
+ expect(normalizeForgeOptions({ target_polycount: 5 }).errors[0].field).toBe('target_polycount');
+ expect(normalizeForgeOptions({ target_polycount: 9_000_000 }).errors[0].field).toBe('target_polycount');
+ });
+
+ it('maps the quality alias to a polycount', () => {
+ expect(normalizeForgeOptions({ quality: 'high' }).targetPolycount).toBe(150_000);
+ expect(normalizeForgeOptions({ quality: 'ultra' }).targetPolycount).toBe(300_000);
+ expect(normalizeForgeOptions({ quality: 'nope' }).errors[0].field).toBe('quality');
+ });
+
+ it('forwards poly-aware params only when polyControl is set', () => {
+ const o = normalizeForgeOptions({ seed: 7, texture_size: 2048, target_polycount: 40_000 });
+ expect(providerReconstructParams(o, { polyControl: false })).toEqual({ seed: 7 });
+ expect(providerReconstructParams(o, { polyControl: true })).toEqual({
+ seed: 7,
+ texture_size: 2048,
+ target_polycount: 40_000,
+ });
+ });
+});
+
+describe('summarizeForgeOptions', () => {
+ it('echoes the resolved options for the response', () => {
+ const o = normalizeForgeOptions({ seed: 9, output_format: 'glb-draco', texture_size: 1024 });
+ expect(summarizeForgeOptions(o)).toEqual({
+ seed: 9,
+ output_format: 'glb-draco',
+ texture_size: 1024,
+ target_polycount: null,
+ });
+ });
+});
diff --git a/tests/glb-quality.test.js b/tests/glb-quality.test.js
new file mode 100644
index 000000000..1361d382d
--- /dev/null
+++ b/tests/glb-quality.test.js
@@ -0,0 +1,145 @@
+import { describe, it, expect } from 'vitest';
+import { readFileSync, existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { scoreGlbQuality, shouldRetryForQuality, QUALITY_THRESHOLDS } from '../api/_lib/glb-quality.js';
+
+// Build a minimal-but-valid binary glTF 2.0 from a JS glTF object. We only need
+// the JSON chunk to be well-formed — the quality scorer reads accessor counts and
+// POSITION bounds from JSON and never decodes the BIN chunk — so an empty BIN
+// chunk is sufficient and keeps the fixtures tiny and deterministic.
+function buildGlb(gltf, { binBytes = 0 } = {}) {
+ const json = Buffer.from(JSON.stringify(gltf), 'utf8');
+ const jsonPad = (4 - (json.length % 4)) % 4;
+ const jsonChunk = Buffer.concat([json, Buffer.alloc(jsonPad, 0x20)]);
+ const binPad = (4 - (binBytes % 4)) % 4;
+ const binChunk = binBytes ? Buffer.alloc(binBytes + binPad, 0) : Buffer.alloc(0);
+
+ const headerLen = 12;
+ const jsonHeader = 8 + jsonChunk.length;
+ const binHeader = binBytes ? 8 + binChunk.length : 0;
+ const total = headerLen + jsonHeader + binHeader;
+
+ const out = Buffer.alloc(total);
+ out.writeUInt32LE(0x46546c67, 0); // 'glTF'
+ out.writeUInt32LE(2, 4);
+ out.writeUInt32LE(total, 8);
+ out.writeUInt32LE(jsonChunk.length, 12);
+ out.writeUInt32LE(0x4e4f534a, 16); // 'JSON'
+ jsonChunk.copy(out, 20);
+ if (binBytes) {
+ const off = 20 + jsonChunk.length;
+ out.writeUInt32LE(binChunk.length, off);
+ out.writeUInt32LE(0x004e4942, off + 4); // 'BIN\0'
+ binChunk.copy(out, off + 8);
+ }
+ return out;
+}
+
+// A dense, textured, indexed mesh: the shape a healthy Forge output takes.
+function healthyGltf() {
+ const TRIS = 20_000;
+ const VERTS = Math.round(TRIS / 2); // manifold-ish V≈T/2
+ return {
+ asset: { version: '2.0', generator: 'TRELLIS' },
+ accessors: [
+ { componentType: 5126, count: VERTS, type: 'VEC3', min: [-1, -1, -1], max: [1, 1, 1] },
+ { componentType: 5125, count: TRIS * 3, type: 'SCALAR' },
+ ],
+ meshes: [{ primitives: [{ attributes: { POSITION: 0 }, indices: 1, material: 0, mode: 4 }] }],
+ materials: [{ pbrMetallicRoughness: { baseColorTexture: { index: 0 } } }],
+ textures: [{ source: 0 }],
+ images: [{ mimeType: 'image/png', bufferView: 0 }],
+ nodes: [{ mesh: 0 }],
+ };
+}
+
+describe('scoreGlbQuality', () => {
+ it('scores a dense, textured, indexed mesh as ok with a high score', () => {
+ const q = scoreGlbQuality(buildGlb(healthyGltf()));
+ expect(q.valid).toBe(true);
+ expect(q.flag).toBe('ok');
+ expect(q.reasons).toEqual([]);
+ expect(q.score).toBeGreaterThan(0.7);
+ expect(q.metrics.triangleCount).toBe(20_000);
+ expect(q.metrics.hasTextures).toBe(true);
+ expect(q.metrics.watertightish).toBe(true);
+ expect(shouldRetryForQuality(q)).toBe(false);
+ });
+
+ it('flags an empty / no-geometry mesh as degenerate', () => {
+ const gltf = healthyGltf();
+ gltf.meshes = [];
+ const q = scoreGlbQuality(buildGlb(gltf));
+ expect(q.flag).toBe('degenerate');
+ expect(q.reasons).toContain('no_geometry');
+ expect(q.score).toBeLessThanOrEqual(0.1);
+ expect(shouldRetryForQuality(q)).toBe(true);
+ });
+
+ it('flags a zero-volume (collapsed bbox) mesh as degenerate', () => {
+ const gltf = healthyGltf();
+ gltf.accessors[0].min = [0, 0, 0];
+ gltf.accessors[0].max = [0, 0, 0];
+ const q = scoreGlbQuality(buildGlb(gltf));
+ expect(q.flag).toBe('degenerate');
+ expect(q.reasons).toContain('zero_volume');
+ expect(shouldRetryForQuality(q)).toBe(true);
+ });
+
+ it('flags a sub-threshold triangle count as degenerate', () => {
+ const gltf = healthyGltf();
+ const tris = Math.max(1, QUALITY_THRESHOLDS.degenerateTriangles - 10);
+ gltf.accessors[0].count = tris * 2;
+ gltf.accessors[1].count = tris * 3;
+ const q = scoreGlbQuality(buildGlb(gltf));
+ expect(q.flag).toBe('degenerate');
+ expect(q.reasons).toContain('too_few_triangles');
+ });
+
+ it('flags a low-poly mesh as low (renders, but coarse)', () => {
+ const gltf = healthyGltf();
+ const tris = 300; // above degenerate, below lowTriangles
+ gltf.accessors[0].count = Math.round(tris / 2);
+ gltf.accessors[1].count = tris * 3;
+ const q = scoreGlbQuality(buildGlb(gltf));
+ expect(q.flag).toBe('low');
+ expect(q.reasons).toContain('low_poly');
+ expect(q.score).toBeLessThanOrEqual(0.55);
+ });
+
+ it('flags a textureless mesh', () => {
+ const gltf = healthyGltf();
+ delete gltf.materials;
+ delete gltf.textures;
+ delete gltf.images;
+ const q = scoreGlbQuality(buildGlb(gltf));
+ expect(q.metrics.hasTextures).toBe(false);
+ expect(q.reasons).toContain('no_materials');
+ });
+
+ it('returns invalid (never throws) on a non-GLB buffer', () => {
+ const q = scoreGlbQuality(Buffer.from('not a glb at all'));
+ expect(q.valid).toBe(false);
+ expect(q.flag).toBe('invalid');
+ expect(q.score).toBe(0);
+ expect(shouldRetryForQuality(q)).toBe(true);
+ });
+
+ it('handles null/empty input without throwing', () => {
+ expect(() => scoreGlbQuality(null)).not.toThrow();
+ expect(scoreGlbQuality(Buffer.alloc(0)).flag).toBe('invalid');
+ });
+
+ // Real bundled GLBs must all score valid and non-degenerate — they are shipped
+ // production assets, so a degenerate verdict here would mean a scorer bug.
+ const avatar = (name) => resolve(process.cwd(), 'public/avatars', name);
+ for (const name of ['cesium-man.glb', 'fox.glb', 'mannequin.glb']) {
+ const path = avatar(name);
+ it.runIf(existsSync(path))(`real asset ${name} scores valid and not degenerate`, () => {
+ const q = scoreGlbQuality(readFileSync(path));
+ expect(q.valid).toBe(true);
+ expect(q.flag).not.toBe('degenerate');
+ expect(q.metrics.triangleCount).toBeGreaterThan(0);
+ });
+ }
+});
diff --git a/tests/pose-presets.test.js b/tests/pose-presets.test.js
new file mode 100644
index 000000000..85ee85af4
--- /dev/null
+++ b/tests/pose-presets.test.js
@@ -0,0 +1,144 @@
+/**
+ * Pose preset library — structural, sync, and geometry tests.
+ *
+ * The preset data is the single source the /pose UI renders AND the paid
+ * `get_pose_seed` MCP tool returns, so a malformed preset (bad joint name,
+ * out-of-range axis) ships straight to users and paying agents. These tests
+ * pin the contract:
+ *
+ * 1. Structure — every preset uses only real mannequin joints and the three
+ * Euler axes, with a unique id and a known group.
+ * 2. Sync — the in-repo src/pose-presets.js and the vendored copy the
+ * MCP package publishes (mcp-server/src/lib/pose-presets.js)
+ * are byte-identical in their preset data, so a pose added in
+ * the studio is reachable from the tool and vice-versa.
+ * 3. Geometry — presets are validated against the real Mannequin forward
+ * kinematics: a salute's hand actually reaches the head, a
+ * facepalm's hand reaches the face, no preset buries a hand
+ * in the floor. This is what makes "correct full joint
+ * rotations" a checkable claim rather than a hand-wave.
+ */
+
+import { Vector3 } from 'three';
+import { describe, it, expect } from 'vitest';
+import {
+ PRESETS,
+ PRESET_GROUPS,
+ getPresetById,
+ getPresetsByGroup,
+} from '../src/pose-presets.js';
+import { PRESETS as MCP_PRESETS } from '../mcp-server/src/lib/pose-presets.js';
+import { Mannequin, JOINT_NAMES } from '../src/pose-mannequin.js';
+
+const VALID_JOINTS = new Set(JOINT_NAMES);
+const AXES = ['x', 'y', 'z'];
+
+// World-space tip of a hand: the wrist origin offset down its local -Y by the
+// hand length (male build handLen = 0.18), matching how the mesh hangs.
+function handTip(m, side) {
+ m.root.updateMatrixWorld(true);
+ return m.joints['wrist' + side].localToWorld(new Vector3(0, -0.18, 0));
+}
+function jointWorld(m, name) {
+ m.root.updateMatrixWorld(true);
+ return m.joints[name].getWorldPosition(new Vector3());
+}
+
+describe('pose preset structure', () => {
+ it('has unique ids', () => {
+ const ids = PRESETS.map((p) => p.id);
+ expect(new Set(ids).size).toBe(ids.length);
+ });
+
+ it('every preset has a label and a known group', () => {
+ for (const p of PRESETS) {
+ expect(p.label, p.id).toBeTruthy();
+ expect(PRESET_GROUPS, p.id).toContain(p.group);
+ }
+ });
+
+ it('every pose entry targets a real joint (or rootPosition) on the three axes', () => {
+ for (const p of PRESETS) {
+ for (const [joint, rot] of Object.entries(p.pose)) {
+ if (joint === 'rootPosition') {
+ for (const a of AXES) {
+ if (rot[a] !== undefined) expect(typeof rot[a], `${p.id}.rootPosition.${a}`).toBe('number');
+ }
+ continue;
+ }
+ expect(VALID_JOINTS.has(joint), `${p.id}: unknown joint "${joint}"`).toBe(true);
+ for (const a of AXES) {
+ if (rot[a] !== undefined) {
+ expect(Number.isFinite(rot[a]), `${p.id}.${joint}.${a}`).toBe(true);
+ }
+ }
+ }
+ }
+ });
+
+ it('getPresetById and getPresetsByGroup stay consistent with the array', () => {
+ expect(getPresetById('salute')?.label).toBe('Salute');
+ expect(getPresetById('does-not-exist')).toBeNull();
+ const byGroup = getPresetsByGroup();
+ const total = Object.values(byGroup).reduce((n, arr) => n + arr.length, 0);
+ expect(total).toBe(PRESETS.length);
+ for (const group of PRESET_GROUPS) expect(Array.isArray(byGroup[group])).toBe(true);
+ });
+});
+
+describe('src ↔ MCP preset sync', () => {
+ // The MCP package vendors a hand-synced copy; if they drift, agents calling
+ // get_pose_seed get a different pose than the /pose page shows for the same id.
+ it('the published MCP copy is identical to the in-repo source', () => {
+ expect(MCP_PRESETS.map((p) => p.id)).toEqual(PRESETS.map((p) => p.id));
+ expect(JSON.stringify(MCP_PRESETS)).toBe(JSON.stringify(PRESETS));
+ });
+});
+
+describe('pose geometry (real mannequin forward kinematics)', () => {
+ it('no preset drives a hand or the head below the floor', () => {
+ for (const p of PRESETS) {
+ const m = new Mannequin({ build: 'male' });
+ m.applyPose(p.pose);
+ const head = jointWorld(m, 'head');
+ // A small negative tolerance: floor-contact poses (push-up-style) may
+ // graze y=0, but nothing should sink a hand far underground.
+ expect(handTip(m, 'L').y, `${p.id} L hand`).toBeGreaterThan(-0.15);
+ expect(handTip(m, 'R').y, `${p.id} R hand`).toBeGreaterThan(-0.15);
+ expect(head.y, `${p.id} head`).toBeGreaterThan(0.2);
+ }
+ });
+
+ it('salute brings the right hand up to the head', () => {
+ const m = new Mannequin({ build: 'male' });
+ m.applyPose(getPresetById('salute').pose);
+ const head = jointWorld(m, 'head');
+ const hand = handTip(m, 'R');
+ // Hand near head height and close to it — a real salute, not an outstretched arm.
+ expect(hand.y).toBeGreaterThan(head.y - 0.2);
+ expect(hand.distanceTo(head)).toBeLessThan(0.35);
+ // Left arm stays down at the side.
+ expect(handTip(m, 'L').y).toBeLessThan(1.0);
+ });
+
+ it('facepalm brings the right hand onto the bowed face', () => {
+ const m = new Mannequin({ build: 'male' });
+ m.applyPose(getPresetById('facepalm').pose);
+ const head = jointWorld(m, 'head');
+ const hand = handTip(m, 'R');
+ expect(hand.distanceTo(head)).toBeLessThan(0.3);
+ // Head is bowed forward (chin down) into the hand.
+ expect(m.joints.head.rotation.x).toBeGreaterThan(0.3);
+ });
+
+ it('fighting stance raises both fists in front, near head height', () => {
+ const m = new Mannequin({ build: 'male' });
+ m.applyPose(getPresetById('fighting-stance').pose);
+ const head = jointWorld(m, 'head');
+ for (const side of ['L', 'R']) {
+ const hand = handTip(m, side);
+ expect(hand.y, `${side} fist height`).toBeGreaterThan(head.y - 0.25);
+ expect(hand.z, `${side} fist forward`).toBeGreaterThan(0.1); // in front of the torso
+ }
+ });
+});