gamestage 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.mjs +178 -395
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -10,32 +10,32 @@
10
10
  * A single bundled file, minified. Nothing here phones home, and inspect,
11
11
  * create and manifest validate all run without an account.
12
12
  */
13
- var vb=Object.defineProperty;var Ke=(e,t)=>{for(var r in t)vb(e,r,{get:t[r],enumerable:!0})};var at=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},At=class extends at{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Qn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new At(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function no(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as kb}from"node:events";import Ga from"node:child_process";import Ve from"node:path";import oo from"node:fs";import F from"node:process";import{stripVTControlCharacters as xb}from"node:util";import{stripVTControlCharacters as _b}from"node:util";var er=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>no(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(p,m){return r.formatItem(p,o,m,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let c=r.visibleArguments(t).map(p=>i(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,m)=>{let f=p.map(h=>i(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList(m,f,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));a=a.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,m)=>{let f=p.map(h=>i(r.styleSubcommandTerm(r.subcommandTerm(h)),r.styleSubcommandDescription(r.subcommandDescription(h))));a=a.concat(this.formatItemList(m,f,r))}),a.join(`
14
- `)}displayWidth(t){return _b(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,n){let a=" ".repeat(2);if(!o)return a+t;let s=t.padEnd(r+t.length-n.displayWidth(t)),c=2,d=(this.helpWidth??80)-r-c-2,p;return d<this.minWidthToWrap||n.preformatted(o)?p=o:p=n.boxWrap(o,d).replace(/\n/g,`
15
- `+" ".repeat(r+c)),a+s+" ".repeat(c)+p.replace(/\n/g,`
16
- ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,i=[];return o.forEach(a=>{let s=a.match(n);if(s===null){i.push("");return}let c=[s.shift()],l=this.displayWidth(c[0]);s.forEach(d=>{let p=this.displayWidth(d);if(l+p<=r){c.push(d),l+=p;return}i.push(c.join(""));let m=d.trimStart();c=[m],l=this.displayWidth(m)}),i.push(c.join(""))}),i.join(`
17
- `)}};var Vt=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=bb(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new At(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Rm(this.name().replace(/^no-/,"")):Rm(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ro=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===t)}};function Rm(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function bb(e){let t,r,o=/^-[^-]$/,n=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(o.test(i[0])&&(t=i.shift()),n.test(i[0])&&(r=i.shift()),!t&&o.test(i[0])&&(t=i.shift()),!t&&n.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let a=i[0],s=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
13
+ var Gb=Object.defineProperty;var Ke=(e,t)=>{for(var r in t)Gb(e,r,{get:t[r],enumerable:!0})};var it=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Et=class extends it{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var tr=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Et(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function so(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as Vb}from"node:events";import qa from"node:child_process";import Ve from"node:path";import lo from"node:fs";import F from"node:process";import{stripVTControlCharacters as Wb}from"node:util";import{stripVTControlCharacters as Zb}from"node:util";var nr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>so(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(d,m){return r.formatItem(d,o,m,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let c=r.visibleArguments(t).map(d=>i(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,m)=>{let f=d.map(h=>i(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList(m,f,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));a=a.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,m)=>{let f=d.map(h=>i(r.styleSubcommandTerm(r.subcommandTerm(h)),r.styleSubcommandDescription(r.subcommandDescription(h))));a=a.concat(this.formatItemList(m,f,r))}),a.join(`
14
+ `)}displayWidth(t){return Zb(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,n){let a=" ".repeat(2);if(!o)return a+t;let s=t.padEnd(r+t.length-n.displayWidth(t)),c=2,p=(this.helpWidth??80)-r-c-2,d;return p<this.minWidthToWrap||n.preformatted(o)?d=o:d=n.boxWrap(o,p).replace(/\n/g,`
15
+ `+" ".repeat(r+c)),a+s+" ".repeat(c)+d.replace(/\n/g,`
16
+ ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,i=[];return o.forEach(a=>{let s=a.match(n);if(s===null){i.push("");return}let c=[s.shift()],l=this.displayWidth(c[0]);s.forEach(p=>{let d=this.displayWidth(p);if(l+d<=r){c.push(p),l+=d;return}i.push(c.join(""));let m=p.trimStart();c=[m],l=this.displayWidth(m)}),i.push(c.join(""))}),i.join(`
17
+ `)}};var Vt=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=Bb(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Et(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Km(this.name().replace(/^no-/,"")):Km(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},co=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===t)}};function Km(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Bb(e){let t,r,o=/^-[^-]$/,n=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(o.test(i[0])&&(t=i.shift()),n.test(i[0])&&(r=i.shift()),!t&&o.test(i[0])&&(t=i.shift()),!t&&n.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let a=i[0],s=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
18
18
  - a short flag is a single dash and a single character
19
19
  - either use a single dash and a single character (for a short flag)
20
20
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(a)?new Error(`${s}
21
21
  - too many short flags`):n.test(a)?new Error(`${s}
22
22
  - too many long flags`):new Error(`${s}
23
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function wb(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let n=1;n<=e.length;n++){let i;e[n-1]===t[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}function Fa(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let o=[],n=3,i=.4;return t.forEach(a=>{if(a.length<=1)return;let s=wb(e,a),c=Math.max(e.length,a.length);(c-s)/c>i&&(s<n?(n=s,o=[a]):s===n&&o.push(a))}),o.sort((a,s)=>a.localeCompare(s)),r&&(o=o.map(a=>`--${a}`)),o.length>1?`
23
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function Kb(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let n=1;n<=e.length;n++){let i;e[n-1]===t[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}function Ya(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let o=[],n=3,i=.4;return t.forEach(a=>{if(a.length<=1)return;let s=Kb(e,a),c=Math.max(e.length,a.length);(c-s)/c>i&&(s<n?(n=s,o=[a]):s===n&&o.push(a))}),o.sort((a,s)=>a.localeCompare(s)),r&&(o=o.map(a=>`--${a}`)),o.length>1?`
24
24
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
25
- (Did you mean ${o[0]}?)`:""}var Wt=class e extends kb{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>F.stdout.write(r),writeErr:r=>F.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>F.stdout.isTTY?F.stdout.columns:void 0,getErrHelpWidth:()=>F.stderr.isTTY?F.stderr.columns:void 0,getOutHasColors:()=>Dm()??(F.stdout.isTTY&&F.stdout.hasColors?.()),getErrHasColors:()=>Dm()??(F.stderr.isTTY&&F.stderr.hasColors?.()),stripColor:r=>xb(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,a,s]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(a);return n&&(c.description(n),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,s&&c.arguments(s),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new er,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
26
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Qn(t,r)}argument(t,r,o,n){let i=this.createArgument(t,r);return typeof o=="function"?i.default(n).argParser(o):i.default(o),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let o=t??"help [command]",[,n,i]=o.match(/([^ ]+) *(.*)/),a=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),a&&s.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=s,(t||r)&&this._initCommandGroup(s),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
27
- Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new at(t,r,o)),F.exit(t)}action(t){let r=o=>{let n=this.registeredArguments.length,i=o.slice(0,n);return this._storeOptionsAsProperties?i[n]=this:i[n]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new Vt(t,r)}_callParseArg(t,r,o,n){try{return t.parseArg(r,o)}catch(i){if(i.code==="commander.invalidArgument"){let a=`${n} ${i.message}`;this.error(a,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
28
- - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),o=r(t).find(n=>this._findCommand(n));if(o){let n=r(this._findCommand(o)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let n=(i,a,s)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(o);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,a):i!==null&&t.variadic&&(i=t._collectValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(o,i,s)};return this.on("option:"+r,i=>{let a=`error: option '${t.flags}' argument '${i}' is invalid.`;n(i,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let a=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;n(i,a,"env")}),this}_optionEx(t,r,o,n,i){if(typeof r=="object"&&r instanceof Vt)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,o);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(i).argParser(n);else if(n instanceof RegExp){let s=n;n=(c,l)=>{let d=s.exec(c);return d?d[0]:l},a.default(i).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,o,n){return this._optionEx({},t,r,o,n)}requiredOption(t,r,o,n){return this._optionEx({mandatory:!0},t,r,o,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){F.versions?.electron&&(r.from="electron");let n=F.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=F.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":F.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let r=t.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
29
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(oo.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
25
+ (Did you mean ${o[0]}?)`:""}var Wt=class e extends Vb{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>F.stdout.write(r),writeErr:r=>F.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>F.stdout.isTTY?F.stdout.columns:void 0,getErrHelpWidth:()=>F.stderr.isTTY?F.stderr.columns:void 0,getOutHasColors:()=>Wm()??(F.stdout.isTTY&&F.stdout.hasColors?.()),getErrHasColors:()=>Wm()??(F.stderr.isTTY&&F.stderr.hasColors?.()),stripColor:r=>Wb(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,a,s]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(a);return n&&(c.description(n),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,s&&c.arguments(s),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new nr,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
26
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new tr(t,r)}argument(t,r,o,n){let i=this.createArgument(t,r);return typeof o=="function"?i.default(n).argParser(o):i.default(o),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let o=t??"help [command]",[,n,i]=o.match(/([^ ]+) *(.*)/),a=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),a&&s.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=s,(t||r)&&this._initCommandGroup(s),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
27
+ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new it(t,r,o)),F.exit(t)}action(t){let r=o=>{let n=this.registeredArguments.length,i=o.slice(0,n);return this._storeOptionsAsProperties?i[n]=this:i[n]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new Vt(t,r)}_callParseArg(t,r,o,n){try{return t.parseArg(r,o)}catch(i){if(i.code==="commander.invalidArgument"){let a=`${n} ${i.message}`;this.error(a,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
28
+ - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),o=r(t).find(n=>this._findCommand(n));if(o){let n=r(this._findCommand(o)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let n=(i,a,s)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(o);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,a):i!==null&&t.variadic&&(i=t._collectValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(o,i,s)};return this.on("option:"+r,i=>{let a=`error: option '${t.flags}' argument '${i}' is invalid.`;n(i,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let a=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;n(i,a,"env")}),this}_optionEx(t,r,o,n,i){if(typeof r=="object"&&r instanceof Vt)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,o);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(i).argParser(n);else if(n instanceof RegExp){let s=n;n=(c,l)=>{let p=s.exec(c);return p?p[0]:l},a.default(i).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,o,n){return this._optionEx({},t,r,o,n)}requiredOption(t,r,o,n){return this._optionEx({mandatory:!0},t,r,o,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){F.versions?.electron&&(r.from="electron");let n=F.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=F.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":F.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let r=t.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
29
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(lo.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
30
30
  - if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
31
31
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
32
- - ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(d,p){let m=Ve.resolve(d,p);if(oo.existsSync(m))return m;if(o.includes(Ve.extname(p)))return;let f=o.find(h=>oo.existsSync(`${m}${h}`));if(f)return`${m}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let d;try{d=oo.realpathSync(this._scriptPath)}catch{d=this._scriptPath}a=Ve.resolve(Ve.dirname(d),a)}if(a){let d=n(a,i);if(!d&&!t._executableFile&&this._scriptPath){let p=Ve.basename(this._scriptPath,Ve.extname(this._scriptPath));p!==this._name&&(d=n(a,`${p}-${t._name}`))}i=d||i}let s=o.includes(Ve.extname(i)),c;F.platform!=="win32"?s?(r.unshift(i),r=jm(F.execArgv).concat(r),c=Ga.spawn(F.argv[0],r,{stdio:"inherit"})):c=Ga.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,t._name),r.unshift(i),r=jm(F.execArgv).concat(r),c=Ga.spawn(F.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{F.on(p,()=>{c.killed===!1&&c.exitCode===null&&c.kill(p)})});let l=this._exitCallback;c.on("close",d=>{d=d??1,l?l(new at(d,"commander.executeSubCommandAsync","(close)")):F.exit(d)}),c.on("error",d=>{if(d.code==="ENOENT")this._checkForMissingExecutable(i,a,t._name);else if(d.code==="EACCES")throw new Error(`'${i}' not executable`);if(!l)F.exit(1);else{let p=new at(1,"commander.executeSubCommandAsync","(error)");p.nestedError=d,l(p)}}),this.runningCommand=c}_dispatchSubcommand(t,r,o){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,n,"preSubcommand"),i=this._chainOrCall(i,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(o));else return n._parseCommand(r,o)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,n,i)=>{let a=n;if(n!==null&&o.parseArg){let s=`error: command-argument value '${n}' is invalid for argument '${o.name()}'.`;a=this._callParseArg(o,n,i,s)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,n)=>{let i=o.defaultValue;o.variadic?n<this.args.length?(i=this.args.slice(n),o.parseArg&&(i=i.reduce((a,s)=>t(o,s,a),o.defaultValue))):i===void 0&&(i=[]):n<this.args.length&&(i=this.args[n],o.parseArg&&(i=t(o,i,o.defaultValue))),r[n]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,n=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:i,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(i=>{o=this._chainOrCall(o,()=>i.callback(i.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let n=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(i=>{n=this._chainOrCall(n,()=>i(this,r))}),n}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(i,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(i))n(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let n=o.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let n=t.find(i=>o.conflictsWith.includes(i.attributeName()));n&&this._conflictingOption(o,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],n=r;function i(d){return d.length>1&&d[0]==="-"}let a=d=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(d)?!this._getCommandAndAncestors().some(p=>p.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,s=null,c=null,l=0;for(;l<t.length||c;){let d=c??t[l++];if(c=null,d==="--"){n===o&&n.push(d),n.push(...t.slice(l));break}if(s&&(!i(d)||a(d))){this.emit(`option:${s.name()}`,d);continue}if(s=null,i(d)){let p=this._findOption(d);if(p){if(p.required){let m=t[l++];m===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,m)}else if(p.optional){let m=null;l<t.length&&(!i(t[l])||a(t[l]))&&(m=t[l++]),this.emit(`option:${p.name()}`,m)}else this.emit(`option:${p.name()}`);s=p.variadic?p:null;continue}}if(d.length>2&&d[0]==="-"&&d[1]!=="-"){let p=this._findOption(`-${d[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,d.slice(2)):(this.emit(`option:${p.name()}`),c=`-${d.slice(2)}`);continue}}if(/^--[^=]+=/.test(d)){let p=d.indexOf("="),m=this._findOption(d.slice(0,p));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,d.slice(p+1));continue}}if(n===r&&i(d)&&!(this.commands.length===0&&a(d))&&(n=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(d)){r.push(d),o.push(...t.slice(l));break}else if(this._getHelpCommand()&&d===this._getHelpCommand().name()){r.push(d,...t.slice(l));break}else if(this._defaultCommandName){o.push(d,...t.slice(l));break}}if(this._passThroughOptions){n.push(d,...t.slice(l));break}n.push(d)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let n=this.options[o].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
32
+ - ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(p,d){let m=Ve.resolve(p,d);if(lo.existsSync(m))return m;if(o.includes(Ve.extname(d)))return;let f=o.find(h=>lo.existsSync(`${m}${h}`));if(f)return`${m}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=lo.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=Ve.resolve(Ve.dirname(p),a)}if(a){let p=n(a,i);if(!p&&!t._executableFile&&this._scriptPath){let d=Ve.basename(this._scriptPath,Ve.extname(this._scriptPath));d!==this._name&&(p=n(a,`${d}-${t._name}`))}i=p||i}let s=o.includes(Ve.extname(i)),c;F.platform!=="win32"?s?(r.unshift(i),r=Vm(F.execArgv).concat(r),c=qa.spawn(F.argv[0],r,{stdio:"inherit"})):c=qa.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,t._name),r.unshift(i),r=Vm(F.execArgv).concat(r),c=qa.spawn(F.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{F.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",p=>{p=p??1,l?l(new it(p,"commander.executeSubCommandAsync","(close)")):F.exit(p)}),c.on("error",p=>{if(p.code==="ENOENT")this._checkForMissingExecutable(i,a,t._name);else if(p.code==="EACCES")throw new Error(`'${i}' not executable`);if(!l)F.exit(1);else{let d=new it(1,"commander.executeSubCommandAsync","(error)");d.nestedError=p,l(d)}}),this.runningCommand=c}_dispatchSubcommand(t,r,o){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,n,"preSubcommand"),i=this._chainOrCall(i,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(o));else return n._parseCommand(r,o)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,n,i)=>{let a=n;if(n!==null&&o.parseArg){let s=`error: command-argument value '${n}' is invalid for argument '${o.name()}'.`;a=this._callParseArg(o,n,i,s)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,n)=>{let i=o.defaultValue;o.variadic?n<this.args.length?(i=this.args.slice(n),o.parseArg&&(i=i.reduce((a,s)=>t(o,s,a),o.defaultValue))):i===void 0&&(i=[]):n<this.args.length&&(i=this.args[n],o.parseArg&&(i=t(o,i,o.defaultValue))),r[n]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,n=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:i,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(i=>{o=this._chainOrCall(o,()=>i.callback(i.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let n=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(i=>{n=this._chainOrCall(n,()=>i(this,r))}),n}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(i,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(i))n(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let n=o.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let n=t.find(i=>o.conflictsWith.includes(i.attributeName()));n&&this._conflictingOption(o,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],n=r;function i(p){return p.length>1&&p[0]==="-"}let a=p=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(p)?!this._getCommandAndAncestors().some(d=>d.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,s=null,c=null,l=0;for(;l<t.length||c;){let p=c??t[l++];if(c=null,p==="--"){n===o&&n.push(p),n.push(...t.slice(l));break}if(s&&(!i(p)||a(p))){this.emit(`option:${s.name()}`,p);continue}if(s=null,i(p)){let d=this._findOption(p);if(d){if(d.required){let m=t[l++];m===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,m)}else if(d.optional){let m=null;l<t.length&&(!i(t[l])||a(t[l]))&&(m=t[l++]),this.emit(`option:${d.name()}`,m)}else this.emit(`option:${d.name()}`);s=d.variadic?d:null;continue}}if(p.length>2&&p[0]==="-"&&p[1]!=="-"){let d=this._findOption(`-${p[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,p.slice(2)):(this.emit(`option:${d.name()}`),c=`-${p.slice(2)}`);continue}}if(/^--[^=]+=/.test(p)){let d=p.indexOf("="),m=this._findOption(p.slice(0,d));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,p.slice(d+1));continue}}if(n===r&&i(p)&&!(this.commands.length===0&&a(p))&&(n=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(p)){r.push(p),o.push(...t.slice(l));break}else if(this._getHelpCommand()&&p===this._getHelpCommand().name()){r.push(p,...t.slice(l));break}else if(this._defaultCommandName){o.push(p,...t.slice(l));break}}if(this._passThroughOptions){n.push(p,...t.slice(l));break}n.push(p)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let n=this.options[o].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
33
33
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
34
34
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
35
- `),this.outputHelp({error:!0}));let o=r||{},n=o.exitCode||1,i=o.code||"commander.error";this._exit(n,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in F.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,F.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new ro(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,o.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=a=>{let s=a.attributeName(),c=this.getOptionValue(s),l=this.options.find(p=>p.negate&&s===p.attributeName()),d=this.options.find(p=>!p.negate&&s===p.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:d||a},n=a=>{let s=o(a),c=s.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},i=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],i=this;do{let a=i.createHelp().visibleOptions(i).filter(s=>s.long).map(s=>s.long);n=n.concat(a),i=i.parent}while(i&&!i._enablePositionalOptions);r=Fa(t,n)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",n=t.length,i=this.parent?` for '${this.name()}'`:"",a=t.join(", "),s=`error: too many arguments${i}. Expected ${r} argument${o} but got ${n}: ${a}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(i=>{n.push(i.name()),i.alias()&&n.push(i.alias())}),r=Fa(t,n)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let n=this.createOption(r,o);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
36
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let n=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>no(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Ve.basename(t,Ve.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let n=r.formatHelp(this,r);return o.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,o,n,i;return r?(o=s=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(o=s=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(n||(s=this._outputConfiguration.stripColor(s)),o(s)),hasColors:n,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),n={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation({error:o.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(F.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
35
+ `),this.outputHelp({error:!0}));let o=r||{},n=o.exitCode||1,i=o.code||"commander.error";this._exit(n,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in F.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,F.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new co(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,o.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=a=>{let s=a.attributeName(),c=this.getOptionValue(s),l=this.options.find(d=>d.negate&&s===d.attributeName()),p=this.options.find(d=>!d.negate&&s===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:p||a},n=a=>{let s=o(a),c=s.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},i=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],i=this;do{let a=i.createHelp().visibleOptions(i).filter(s=>s.long).map(s=>s.long);n=n.concat(a),i=i.parent}while(i&&!i._enablePositionalOptions);r=Ya(t,n)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",n=t.length,i=this.parent?` for '${this.name()}'`:"",a=t.join(", "),s=`error: too many arguments${i}. Expected ${r} argument${o} but got ${n}: ${a}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(i=>{n.push(i.name()),i.alias()&&n.push(i.alias())}),r=Ya(t,n)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let n=this.createOption(r,o);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
36
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let n=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>so(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Ve.basename(t,Ve.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let n=r.formatHelp(this,r);return o.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,o,n,i;return r?(o=s=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(o=s=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(n||(s=this._outputConfiguration.stripColor(s)),o(s)),hasColors:n,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),n={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation({error:o.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(F.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
37
37
  Expecting one of '${o.join("', '")}'`);let n=`${t}Help`;return this.on(n,i=>{let a;typeof r=="function"?a=r({error:i.error,command:i.command}):a=r,a&&i.write(`${a}
38
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function jm(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",n="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:t})}function Dm(){if(F.env.NO_COLOR||F.env.FORCE_COLOR==="0"||F.env.FORCE_COLOR==="false")return!1;if(F.env.FORCE_COLOR||F.env.CLICOLOR_FORCE!==void 0)return!0}var X0=new Wt;import{mkdir as Ib,readFile as Cb,writeFile as Pb}from"node:fs/promises";import{dirname as Ob,join as Nb,relative as Rb,resolve as jb}from"node:path";var Ht=`/**
38
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Vm(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",n="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:t})}function Wm(){if(F.env.NO_COLOR||F.env.FORCE_COLOR==="0"||F.env.FORCE_COLOR==="false")return!1;if(F.env.FORCE_COLOR||F.env.CLICOLOR_FORCE!==void 0)return!0}var TC=new Wt;import{mkdir as Qb,readFile as ew,writeFile as tw}from"node:fs/promises";import{dirname as nw,join as rw,relative as ow,resolve as iw}from"node:path";var Ht=`/**
39
39
  * @monterosa/gamestage-player, bundled for a browser.
40
40
  *
41
41
  * Generated by the Gamestage CLI. Do not edit: it is replaced whenever the CLI
@@ -162,7 +162,7 @@ export {
162
162
  createPlayerClient,
163
163
  newIdempotencyKey
164
164
  };
165
- `,tr="d783262b079500e8",be="gamestage-player.js",Jt=`/**
165
+ `,rr="d783262b079500e8",we="gamestage-player.js",Jt=`/**
166
166
  * @monterosa/gamestage, bundled for a browser.
167
167
  *
168
168
  * Generated by the Gamestage CLI. Do not edit: it is replaced whenever the CLI
@@ -472,14 +472,14 @@ function createRouter(options) {
472
472
  let withheld = 0;
473
473
  let sent = 0;
474
474
  return {
475
- track(event2) {
475
+ track(event) {
476
476
  if (!analyticsAllowed(options.policy, options.consent())) {
477
477
  withheld += 1;
478
478
  return false;
479
479
  }
480
480
  for (const destination of options.destinations) {
481
481
  try {
482
- destination.send(event2);
482
+ destination.send(event);
483
483
  } catch {
484
484
  }
485
485
  }
@@ -718,12 +718,12 @@ var init_dist = __esm({
718
718
  * @param handler - The callback function
719
719
  * @returns A function that unsubscribes the handler when called
720
720
  */
721
- on(event2, handler) {
722
- if (!this.listeners.has(event2)) {
723
- this.listeners.set(event2, /* @__PURE__ */ new Set());
721
+ on(event, handler) {
722
+ if (!this.listeners.has(event)) {
723
+ this.listeners.set(event, /* @__PURE__ */ new Set());
724
724
  }
725
- this.listeners.get(event2).add(handler);
726
- return () => this.off(event2, handler);
725
+ this.listeners.get(event).add(handler);
726
+ return () => this.off(event, handler);
727
727
  }
728
728
  /**
729
729
  * Unsubscribes from an event.
@@ -731,13 +731,13 @@ var init_dist = __esm({
731
731
  * @param event - The event name
732
732
  * @param handler - The handler to remove. If omitted, all handlers for the event are removed.
733
733
  */
734
- off(event2, handler) {
734
+ off(event, handler) {
735
735
  var _a4;
736
736
  if (handler === void 0) {
737
- this.listeners.delete(event2);
737
+ this.listeners.delete(event);
738
738
  return;
739
739
  }
740
- (_a4 = this.listeners.get(event2)) === null || _a4 === void 0 ? void 0 : _a4.delete(handler);
740
+ (_a4 = this.listeners.get(event)) === null || _a4 === void 0 ? void 0 : _a4.delete(handler);
741
741
  }
742
742
  /**
743
743
  * Emits an event with optional arguments.
@@ -745,9 +745,9 @@ var init_dist = __esm({
745
745
  * @param event - The event name
746
746
  * @param args - Arguments to pass to handlers
747
747
  */
748
- emit(event2, ...args) {
748
+ emit(event, ...args) {
749
749
  var _a4;
750
- (_a4 = this.listeners.get(event2)) === null || _a4 === void 0 ? void 0 : _a4.forEach((handler) => handler(...args));
750
+ (_a4 = this.listeners.get(event)) === null || _a4 === void 0 ? void 0 : _a4.forEach((handler) => handler(...args));
751
751
  }
752
752
  /**
753
753
  * Subscribes to an event and automatically unsubscribes after the first call.
@@ -756,17 +756,17 @@ var init_dist = __esm({
756
756
  * @param handler - The callback function
757
757
  * @returns A function that unsubscribes the handler when called
758
758
  */
759
- once(event2, handler) {
759
+ once(event, handler) {
760
760
  const wrapper = (...args) => {
761
761
  handler(...args);
762
- this.off(event2, wrapper);
762
+ this.off(event, wrapper);
763
763
  };
764
- return this.on(event2, wrapper);
764
+ return this.on(event, wrapper);
765
765
  }
766
766
  };
767
- subscribe = (emitter2, event2, callback) => {
768
- emitter2.on(event2, callback);
769
- return () => emitter2.off(event2, callback);
767
+ subscribe = (emitter2, event, callback) => {
768
+ emitter2.on(event, callback);
769
+ return () => emitter2.off(event, callback);
770
770
  };
771
771
  /**
772
772
  * @license
@@ -3823,42 +3823,42 @@ function buildEvent(options, context) {
3823
3823
  if (events.has(options.id)) {
3824
3824
  return events.get(options.id);
3825
3825
  }
3826
- const event2 = new EventImpl(options, context);
3827
- event2.on("internal_state", handleEventInternalState.bind(event2));
3828
- events.set(options.id, event2);
3829
- return event2;
3826
+ const event = new EventImpl(options, context);
3827
+ event.on("internal_state", handleEventInternalState.bind(event));
3828
+ events.set(options.id, event);
3829
+ return event;
3830
3830
  }
3831
- async function init(event2) {
3832
- if (event2.initState === InitState2.Initialising) {
3831
+ async function init(event) {
3832
+ if (event.initState === InitState2.Initialising) {
3833
3833
  throw new Error("can't initialise event, event is already being initialised");
3834
3834
  }
3835
- if (event2.initState === InitState2.Initialised) {
3835
+ if (event.initState === InitState2.Initialised) {
3836
3836
  throw new Error("can't initialise event, event is already initialised");
3837
3837
  }
3838
- event2.initState = InitState2.Initialising;
3839
- if (event2.canLoadHistory && event2.history === null) {
3840
- const history = await fetchHistory(event2.context.project.host, event2.id);
3841
- event2.history = history;
3838
+ event.initState = InitState2.Initialising;
3839
+ if (event.canLoadHistory && event.history === null) {
3840
+ const history = await fetchHistory(event.context.project.host, event.id);
3841
+ event.history = history;
3842
3842
  }
3843
- if (event2.canSubscribe) {
3844
- await subscribe3(event2);
3843
+ if (event.canSubscribe) {
3844
+ await subscribe3(event);
3845
3845
  }
3846
- await listenConnHealth(event2);
3847
- event2.initState = InitState2.Initialised;
3846
+ await listenConnHealth(event);
3847
+ event.initState = InitState2.Initialised;
3848
3848
  }
3849
- async function subscribe3(event2) {
3850
- if (!event2.canSubscribe) {
3849
+ async function subscribe3(event) {
3850
+ if (!event.canSubscribe) {
3851
3851
  throw new Error("Event can't be subscribed");
3852
3852
  }
3853
- const connect2 = await getConnect2(event2.context.project.host);
3854
- await connect2.subscribeEvent(event2.id);
3853
+ const connect2 = await getConnect2(event.context.project.host);
3854
+ await connect2.subscribeEvent(event.id);
3855
3855
  }
3856
- async function unsubscribe2(event2) {
3857
- const connect2 = await getConnect2(event2.context.project.host);
3858
- connect2.unsubscribeEvent(event2.id);
3856
+ async function unsubscribe2(event) {
3857
+ const connect2 = await getConnect2(event.context.project.host);
3858
+ connect2.unsubscribeEvent(event.id);
3859
3859
  }
3860
- async function listenConnHealth(event2) {
3861
- const { project } = event2.context;
3860
+ async function listenConnHealth(event) {
3861
+ const { project } = event.context;
3862
3862
  if (healthListeners.has(project.id)) {
3863
3863
  return;
3864
3864
  }
@@ -3874,10 +3874,10 @@ async function handleEventInternalState(state) {
3874
3874
  }
3875
3875
  }
3876
3876
  async function handleEnmasseConnected() {
3877
- for (const event2 of Array.from(events.values())) {
3878
- if (event2.initState === InitState2.Initialised) {
3879
- const history = await fetchHistory(event2.context.project.host, event2.id);
3880
- event2.history = history;
3877
+ for (const event of Array.from(events.values())) {
3878
+ if (event.initState === InitState2.Initialised) {
3879
+ const history = await fetchHistory(event.context.project.host, event.id);
3880
+ event.history = history;
3881
3881
  }
3882
3882
  }
3883
3883
  }
@@ -3887,8 +3887,8 @@ function getEvents(project) {
3887
3887
  function getEvent(id, project) {
3888
3888
  return getEventMemoized(trimWhitespace(id), project);
3889
3889
  }
3890
- function onEventUpdated(event2, callback) {
3891
- return subscribe(event2, "updated", callback);
3890
+ function onEventUpdated(event, callback) {
3891
+ return subscribe(event, "updated", callback);
3892
3892
  }
3893
3893
  async function buildElement(options, context) {
3894
3894
  if (elements.has(options.id)) {
@@ -3902,8 +3902,8 @@ async function buildElement(options, context) {
3902
3902
  function getElementByPolld(pollId) {
3903
3903
  return Array.from(elements.values()).find((element) => element.pollId === pollId);
3904
3904
  }
3905
- async function configureEvent(event2) {
3906
- return configureEventMemoized(event2);
3905
+ async function configureEvent(event) {
3906
+ return configureEventMemoized(event);
3907
3907
  }
3908
3908
  async function configureConnect(host) {
3909
3909
  return configureConnectMemoized(host);
@@ -3928,8 +3928,8 @@ async function handleConnectMessage(message) {
3928
3928
  async function handleCreateMessage(message) {
3929
3929
  const { id, data } = message;
3930
3930
  const options = JSON.parse(data[0]);
3931
- const event2 = await getEvent(id);
3932
- if (event2 === null) {
3931
+ const event = await getEvent(id);
3932
+ if (event === null) {
3933
3933
  return;
3934
3934
  }
3935
3935
  if (elements.has(options.id)) {
@@ -3942,12 +3942,12 @@ async function handleCreateMessage(message) {
3942
3942
  // the element is updated correctly.
3943
3943
  options.duration !== element.duration) {
3944
3944
  element.update(options);
3945
- event2.emit("update", element);
3945
+ event.emit("update", element);
3946
3946
  }
3947
3947
  } else {
3948
- const context = Object.assign(Object.assign({}, event2.context), { event: event2 });
3948
+ const context = Object.assign(Object.assign({}, event.context), { event });
3949
3949
  const element = await buildElement(options, context);
3950
- event2.emit("publish", element);
3950
+ event.emit("publish", element);
3951
3951
  }
3952
3952
  }
3953
3953
  function handleRevokeMessage(message) {
@@ -3994,11 +3994,11 @@ async function handleEventHistory(history) {
3994
3994
  if (history.timeline.length === 0) {
3995
3995
  return;
3996
3996
  }
3997
- const event2 = await getEvent(history.config.id);
3998
- if (event2 === null) {
3997
+ const event = await getEvent(history.config.id);
3998
+ if (event === null) {
3999
3999
  return;
4000
4000
  }
4001
- const context = Object.assign(Object.assign({}, event2.context), { event: event2 });
4001
+ const context = Object.assign(Object.assign({}, event.context), { event });
4002
4002
  for (const snapshot of history.timeline) {
4003
4003
  if (!elements.has(snapshot.id)) {
4004
4004
  await buildElement(snapshot, context);
@@ -4011,9 +4011,9 @@ async function restoreAnswer(element) {
4011
4011
  element.userAnswer = Answer.fromJSON(userAnswer);
4012
4012
  }
4013
4013
  }
4014
- function onElementUpdated(event2, callback) {
4015
- configureEvent(event2);
4016
- return subscribe(event2, "update", callback);
4014
+ function onElementUpdated(event, callback) {
4015
+ configureEvent(event);
4016
+ return subscribe(event, "update", callback);
4017
4017
  }
4018
4018
  var State, Klass2, Channel, ConnectImpl2, getConnectMemoized2, ConnectionHealthState, ConnectionHealthImpl, getConnectionHealthMemoized, DEFAULT_IGNORE_TIME, ProjectImpl, logger4, projects, connects, getProjectMemoized, EventState, InitState2, EventImpl, events, healthListeners, getEventsMemoized, getEventMemoized, AnswerError, AnswerErrorMessages, ElementState, Answer, ElementType, ShowResultsMode, ElementImpl, elements, configureEventMemoized, configureConnectMemoized, getElementMemoized, getElementsMemoized, PresenceCounterState, PresenceCounterImpl, presenceCounters, getPresenceCounterMemoized;
4019
4019
  var init_dist10 = __esm({
@@ -4287,7 +4287,7 @@ var init_dist10 = __esm({
4287
4287
  if (!this._listings) {
4288
4288
  return [];
4289
4289
  }
4290
- return newListings.events.filter(({ id }) => !this._listings.events.some((event2) => id === event2.id));
4290
+ return newListings.events.filter(({ id }) => !this._listings.events.some((event) => id === event.id));
4291
4291
  }
4292
4292
  /**
4293
4293
  * Calculates events that were updated (present in old listings and new,
@@ -4297,9 +4297,9 @@ var init_dist10 = __esm({
4297
4297
  if (!this._listings) {
4298
4298
  return [];
4299
4299
  }
4300
- return newListings.events.filter((event2) => {
4301
- const existingEvent = this._listings.events.find(({ id }) => event2.id === id);
4302
- return existingEvent && event2.digest !== existingEvent.digest;
4300
+ return newListings.events.filter((event) => {
4301
+ const existingEvent = this._listings.events.find(({ id }) => event.id === id);
4302
+ return existingEvent && event.digest !== existingEvent.digest;
4303
4303
  });
4304
4304
  }
4305
4305
  /**
@@ -4309,7 +4309,7 @@ var init_dist10 = __esm({
4309
4309
  if (!this._listings) {
4310
4310
  return [];
4311
4311
  }
4312
- return this._listings.events.filter(({ id }) => !newListings.events.some((event2) => id === event2.id));
4312
+ return this._listings.events.filter(({ id }) => !newListings.events.some((event) => id === event.id));
4313
4313
  }
4314
4314
  /**
4315
4315
  * Processes and updates locales from project listings
@@ -4322,7 +4322,7 @@ var init_dist10 = __esm({
4322
4322
  * Updates the events checksum based on new listings
4323
4323
  */
4324
4324
  _updateEventsChecksum(newListings) {
4325
- this.eventsChecksum = checksum(newListings.events.map((event2) => event2.digest).join(""));
4325
+ this.eventsChecksum = checksum(newListings.events.map((event) => event.digest).join(""));
4326
4326
  }
4327
4327
  /**
4328
4328
  * Emits events based on created and deleted events
@@ -4656,18 +4656,18 @@ var init_dist10 = __esm({
4656
4656
  const context = Object.assign(Object.assign({}, project.context), { project });
4657
4657
  const data = project.events.find((eventData) => eventData.id === id);
4658
4658
  if (data !== void 0) {
4659
- const event2 = buildEvent(data, context);
4660
- if (event2.canLoadHistory) {
4659
+ const event = buildEvent(data, context);
4660
+ if (event.canLoadHistory) {
4661
4661
  const history = await fetchHistory(project.host, id);
4662
- event2.history = history;
4662
+ event.history = history;
4663
4663
  }
4664
- return event2;
4664
+ return event;
4665
4665
  }
4666
4666
  try {
4667
4667
  const history = await fetchHistory(project.host, id);
4668
- const event2 = buildEvent(history.config, context);
4669
- event2.history = history;
4670
- return event2;
4668
+ const event = buildEvent(history.config, context);
4669
+ event.history = history;
4670
+ return event;
4671
4671
  } catch (err) {
4672
4672
  return null;
4673
4673
  }
@@ -4977,14 +4977,14 @@ var init_dist10 = __esm({
4977
4977
  * More details on the license can be found at https://www.monterosa.co/sdk/license
4978
4978
  */
4979
4979
  elements = /* @__PURE__ */ new Map();
4980
- configureEventMemoized = memoizePromise(async (event2) => {
4981
- event2.on("history", handleEventHistory);
4982
- if (event2.history !== null) {
4983
- handleEventHistory(event2.history);
4984
- }
4985
- await configureConnect(event2.context.sdk.options.host);
4986
- await init(event2);
4987
- }, (event2) => event2.id);
4980
+ configureEventMemoized = memoizePromise(async (event) => {
4981
+ event.on("history", handleEventHistory);
4982
+ if (event.history !== null) {
4983
+ handleEventHistory(event.history);
4984
+ }
4985
+ await configureConnect(event.context.sdk.options.host);
4986
+ await init(event);
4987
+ }, (event) => event.id);
4988
4988
  configureConnectMemoized = memoizePromise(async (host) => {
4989
4989
  const connect2 = await getConnect2(host);
4990
4990
  connect2.on("message", handleConnectMessage);
@@ -4997,15 +4997,15 @@ var init_dist10 = __esm({
4997
4997
  *
4998
4998
  * More details on the license can be found at https://www.monterosa.co/sdk/license
4999
4999
  */
5000
- getElementMemoized = memoizePromise(async (event2, id) => {
5001
- await configureEvent(event2);
5000
+ getElementMemoized = memoizePromise(async (event, id) => {
5001
+ await configureEvent(event);
5002
5002
  const element = Array.from(elements.values()).find((el) => el.id === id);
5003
5003
  return element || null;
5004
- }, (event2, id) => id);
5005
- getElementsMemoized = memoizePromise(async (event2) => {
5006
- await configureEvent(event2);
5007
- return Array.from(elements.values()).filter((element) => element.eventId === event2.id).sort((a, b) => a.publishedAt - b.publishedAt);
5008
- }, (event2) => event2.id, {
5004
+ }, (event, id) => id);
5005
+ getElementsMemoized = memoizePromise(async (event) => {
5006
+ await configureEvent(event);
5007
+ return Array.from(elements.values()).filter((element) => element.eventId === event.id).sort((a, b) => a.publishedAt - b.publishedAt);
5008
+ }, (event) => event.id, {
5009
5009
  clearOnResolve: true
5010
5010
  });
5011
5011
  /**
@@ -5133,7 +5133,7 @@ function read() {
5133
5133
  async function liveEvent(project, named) {
5134
5134
  if (named) return await getEvent(named, project ?? void 0);
5135
5135
  const listed = await getEvents(project ?? void 0);
5136
- return listed.find((event2) => event2.state === "active");
5136
+ return listed.find((event) => event.state === "active");
5137
5137
  }
5138
5138
  async function createMonterosaPlatform(ids2) {
5139
5139
  const clock = createClock();
@@ -5148,8 +5148,8 @@ async function createMonterosaPlatform(ids2) {
5148
5148
  try {
5149
5149
  const project = await getProject();
5150
5150
  const next = readPresentation(project?.fields);
5151
- const event2 = await liveEvent(project, ids2.eventId);
5152
- if (event2) Object.assign(next, readPresentation(event2.fields));
5151
+ const event = await liveEvent(project, ids2.eventId);
5152
+ if (event) Object.assign(next, readPresentation(event.fields));
5153
5153
  for (const key of Object.keys(presentation)) {
5154
5154
  delete presentation[key];
5155
5155
  }
@@ -5174,17 +5174,17 @@ async function createMonterosaPlatform(ids2) {
5174
5174
  ]);
5175
5175
  const project = await getProject();
5176
5176
  Object.assign(presentation, readPresentation(project?.fields));
5177
- const event2 = await liveEvent(project, ids2.eventId);
5178
- if (event2) {
5179
- Object.assign(presentation, readPresentation(event2.fields));
5180
- teardown.push(onElementUpdated(event2, announce));
5181
- teardown.push(onEventUpdated(event2, () => void refreshPresentation()));
5177
+ const event = await liveEvent(project, ids2.eventId);
5178
+ if (event) {
5179
+ Object.assign(presentation, readPresentation(event.fields));
5180
+ teardown.push(onElementUpdated(event, announce));
5181
+ teardown.push(onEventUpdated(event, () => void refreshPresentation()));
5182
5182
  }
5183
5183
  if (project) {
5184
5184
  teardown.push(onProjectFieldsUpdated(project, () => void refreshPresentation()));
5185
5185
  }
5186
5186
  teardown.push(() => disconnect(conn));
5187
- return Boolean(event2);
5187
+ return Boolean(event);
5188
5188
  } catch {
5189
5189
  return false;
5190
5190
  }
@@ -5245,8 +5245,8 @@ async function createMonterosaPlatform(ids2) {
5245
5245
  * site, because the shape a kit accepts is exactly the sort of thing a facade
5246
5246
  * exists to absorb.
5247
5247
  */
5248
- emit(event2) {
5249
- trackEvent(event2.name, { ...flatten(event2.properties), at: event2.at });
5248
+ emit(event) {
5249
+ trackEvent(event.name, { ...flatten(event.properties), at: event.at });
5250
5250
  },
5251
5251
  storage: {
5252
5252
  read: (key) => storageRead(key),
@@ -5522,11 +5522,11 @@ function installDebugPanel(facts, view) {
5522
5522
  doc.body?.append(styled(view, debugReport(facts(), view)));
5523
5523
  };
5524
5524
  let typed = "";
5525
- const onKey = (event2) => {
5526
- const target = event2.target;
5525
+ const onKey = (event) => {
5526
+ const target = event.target;
5527
5527
  const editing = target?.isContentEditable || target?.tagName === "INPUT" || target?.tagName === "TEXTAREA";
5528
- if (editing || event2.key.length !== 1) return;
5529
- typed = (typed + event2.key.toLowerCase()).slice(-COMBINATION.length);
5528
+ if (editing || event.key.length !== 1) return;
5529
+ typed = (typed + event.key.toLowerCase()).slice(-COMBINATION.length);
5530
5530
  if (typed === COMBINATION) open();
5531
5531
  };
5532
5532
  doc.addEventListener("keydown", onKey);
@@ -5593,8 +5593,8 @@ function createLocalPlatform(options = {}) {
5593
5593
  return () => announced.delete(listener);
5594
5594
  },
5595
5595
  announce,
5596
- emit(event2) {
5597
- emitted.push(event2);
5596
+ emit(event) {
5597
+ emitted.push(event);
5598
5598
  },
5599
5599
  storage: {
5600
5600
  read: async (key) => store.get(key) ?? null,
@@ -5645,224 +5645,6 @@ function applyPresentation(presentation, targets = {}) {
5645
5645
  }
5646
5646
  }
5647
5647
 
5648
- // packages/gamestage/src/platform-conformance.ts
5649
- init_consent();
5650
- function check(condition, message) {
5651
- if (!condition) throw new Error(message);
5652
- }
5653
- var event = (name, at) => ({
5654
- name,
5655
- properties: {},
5656
- at
5657
- });
5658
- var PLATFORM_CONFORMANCE = [
5659
- {
5660
- /**
5661
- * A platform always answers about presentation, and absence is an answer.
5662
- *
5663
- * Both implementations expose the producer's settings, and both must say
5664
- * "nothing set" the same way: an object with no keys rather than one full of
5665
- * empty strings. A game that received \`displayName: ""\` would render a blank
5666
- * heading the first time somebody opened Studio and saved without typing,
5667
- * which is the whole reason \`readPresentation\` drops what it cannot use.
5668
- */
5669
- name: "presentation is an object, and an unset field is absent rather than empty",
5670
- async run(make) {
5671
- const { platform } = await make();
5672
- const presentation = platform.presentation;
5673
- check(typeof presentation === "object" && presentation !== null, "presentation must be an object");
5674
- for (const [key, value] of Object.entries(presentation)) {
5675
- check(
5676
- typeof value === "string" && value.trim().length > 0,
5677
- \`\${key} is present and empty, which a game cannot tell from a choice\`
5678
- );
5679
- }
5680
- platform.stop();
5681
- }
5682
- },
5683
- {
5684
- /**
5685
- * Every platform can be asked to say when the producer's words changed.
5686
- *
5687
- * What a change looks like differs: Monterosa hears it over the Mesh, and
5688
- * local mode has no Studio project to change at all. What cannot differ is
5689
- * that a game may subscribe and unsubscribe without knowing which it is on.
5690
- * A game written against a platform that lacked this would crash on the
5691
- * other one, which is the whole reason the port has a conformance suite.
5692
- */
5693
- name: "a game can subscribe to presentation changes and unsubscribe again",
5694
- async run(make) {
5695
- const { platform } = await make();
5696
- const undo = platform.onPresentationChanged(() => {
5697
- });
5698
- check(typeof undo === "function", "subscribing must return an unsubscribe");
5699
- undo();
5700
- undo();
5701
- platform.stop();
5702
- }
5703
- },
5704
- {
5705
- /**
5706
- * The default is the one that records nothing.
5707
- *
5708
- * consent-kit's own \`hasConsent\` answers true for every category when no
5709
- * authority has declared one, documented as backwards compatibility. A
5710
- * standalone game has no authority, so a facade built on that function would
5711
- * report full consent for a game that has never asked anybody anything. This
5712
- * case is the reason \`consent.ts\` does not call it.
5713
- */
5714
- name: "consent is withheld until something declares it, on both platforms",
5715
- async run(make) {
5716
- const { platform } = await make();
5717
- const reading = platform.consent();
5718
- check(reading.declared === false, "a fresh platform must have no declaration");
5719
- check(
5720
- granted(reading, "analytics") === false,
5721
- "nothing declared must not read as granted"
5722
- );
5723
- check(
5724
- analyticsAllowed({ analyticsRequiresConsent: true }, reading) === false,
5725
- "a policy requiring consent must be closed before one is given"
5726
- );
5727
- platform.stop();
5728
- }
5729
- },
5730
- {
5731
- name: "a declaration opens only the categories it names",
5732
- async run(make) {
5733
- const { platform, declareConsent } = await make();
5734
- declareConsent({ necessary: true, analytics: true });
5735
- const reading = platform.consent();
5736
- check(reading.declared === true, "a declaration must read as declared");
5737
- check(granted(reading, "analytics") === true, "a granted category must read granted");
5738
- check(
5739
- granted(reading, "marketing") === false,
5740
- "an absent category is not a grant, it is an absence"
5741
- );
5742
- platform.stop();
5743
- }
5744
- },
5745
- {
5746
- name: "a declaration that withholds a category keeps it withheld",
5747
- async run(make) {
5748
- const { platform, declareConsent } = await make();
5749
- declareConsent({ necessary: true, analytics: false });
5750
- check(
5751
- granted(platform.consent(), "analytics") === false,
5752
- "false must not be read as a grant"
5753
- );
5754
- platform.stop();
5755
- }
5756
- },
5757
- {
5758
- name: "a consent change reaches a listener, and unsubscribing stops it",
5759
- async run(make) {
5760
- const { platform, declareConsent } = await make();
5761
- let seen = 0;
5762
- const undo = platform.onConsentChanged(() => seen += 1);
5763
- declareConsent({ necessary: true, analytics: true });
5764
- check(seen === 1, \`a change must reach the listener once, saw \${seen}\`);
5765
- undo();
5766
- declareConsent({ necessary: true, analytics: false });
5767
- check(seen === 1, \`an unsubscribed listener must hear nothing, saw \${seen}\`);
5768
- platform.stop();
5769
- }
5770
- },
5771
- {
5772
- name: "an announcement reaches a listener, and unsubscribing stops it",
5773
- async run(make) {
5774
- const { platform, announce } = await make();
5775
- let seen = 0;
5776
- const undo = platform.onRoundAnnounced(() => seen += 1);
5777
- announce();
5778
- check(seen === 1, \`an announcement must reach the listener once, saw \${seen}\`);
5779
- undo();
5780
- announce();
5781
- check(seen === 1, \`an unsubscribed listener must hear nothing, saw \${seen}\`);
5782
- platform.stop();
5783
- }
5784
- },
5785
- {
5786
- name: "an announcement carries nothing a client could act on",
5787
- async run(make) {
5788
- const { platform, announce } = await make();
5789
- const payloads = [];
5790
- platform.onRoundAnnounced((...args) => payloads.push(args));
5791
- announce();
5792
- check(payloads.length === 1, "the announcement must have fired");
5793
- check(
5794
- Array.isArray(payloads[0]) && payloads[0].length === 0,
5795
- "an announcement must carry no arguments: the round is re-read, never received"
5796
- );
5797
- platform.stop();
5798
- }
5799
- },
5800
- {
5801
- name: "the clock takes a server's word for the time",
5802
- async run(make) {
5803
- const { platform } = await make();
5804
- const server = Date.now() + 36e5;
5805
- platform.clock.sample(server);
5806
- check(platform.clock.synchronised, "a sampled clock must report itself synchronised");
5807
- const drift = Math.abs(platform.clock.now() - server);
5808
- check(drift < 5e3, \`now() must follow the sample, drifted \${drift}ms\`);
5809
- platform.stop();
5810
- }
5811
- },
5812
- {
5813
- name: "an unparseable sample is ignored rather than believed",
5814
- async run(make) {
5815
- const { platform } = await make();
5816
- platform.clock.sample(Number.NaN);
5817
- check(
5818
- !platform.clock.synchronised,
5819
- "a clock must not call itself synchronised on a sample it could not read"
5820
- );
5821
- const drift = Math.abs(platform.clock.now() - Date.now());
5822
- check(drift < 5e3, \`an ignored sample must leave the clock alone, drifted \${drift}ms\`);
5823
- platform.stop();
5824
- }
5825
- },
5826
- {
5827
- name: "the egress receives what it is given, in order",
5828
- async run(make) {
5829
- const { platform, emitted } = await make();
5830
- platform.emit(event("first", 1));
5831
- platform.emit(event("second", 2));
5832
- const names = emitted().map((e) => e.name);
5833
- check(
5834
- names.length === 2 && names[0] === "first" && names[1] === "second",
5835
- \`the egress must keep order, saw \${JSON.stringify(names)}\`
5836
- );
5837
- platform.stop();
5838
- }
5839
- },
5840
- {
5841
- name: "storage round-trips, and a removed key is gone",
5842
- async run(make) {
5843
- const { platform } = await make();
5844
- check(await platform.storage.read("absent") === null, "an unwritten key must read null");
5845
- await platform.storage.write("streak", "4");
5846
- check(await platform.storage.read("streak") === "4", "a written key must read back");
5847
- await platform.storage.remove("streak");
5848
- check(await platform.storage.read("streak") === null, "a removed key must read null");
5849
- platform.stop();
5850
- }
5851
- },
5852
- {
5853
- name: "stop is idempotent, and a stopped platform announces nothing",
5854
- async run(make) {
5855
- const { platform, announce } = await make();
5856
- let seen = 0;
5857
- platform.onRoundAnnounced(() => seen += 1);
5858
- platform.stop();
5859
- platform.stop();
5860
- announce();
5861
- check(seen === 0, \`a stopped platform must not announce, saw \${seen}\`);
5862
- }
5863
- }
5864
- ];
5865
-
5866
5648
  // packages/gamestage/src/index.ts
5867
5649
  function ids(globals4) {
5868
5650
  const api = globals4.GAMESTAGE_API;
@@ -6095,7 +5877,6 @@ async function start(options = {}) {
6095
5877
  }
6096
5878
  export {
6097
5879
  ANALYTICS_CATEGORY,
6098
- PLATFORM_CONFORMANCE,
6099
5880
  analyticsAllowed,
6100
5881
  applyPresentation,
6101
5882
  createClock,
@@ -6112,7 +5893,7 @@ export {
6112
5893
  storageAllowed,
6113
5894
  tokenOf
6114
5895
  };
6115
- `,qt="7237f1a98af2518d",we="gamestage.js",Sb=`<!doctype html>
5896
+ `,Yt="be3cfb500a7cc446",ke="gamestage.js",Hb=`<!doctype html>
6116
5897
  <html lang="en">
6117
5898
  <head>
6118
5899
  <meta charset="utf-8" />
@@ -6360,7 +6141,7 @@ main().catch((error) => {
6360
6141
  </script>
6361
6142
  </body>
6362
6143
  </html>
6363
- `,$b=`<!doctype html>
6144
+ `,Jb=`<!doctype html>
6364
6145
  <html lang="en">
6365
6146
  <head>
6366
6147
  <meta charset="utf-8" />
@@ -6657,7 +6438,7 @@ main().catch((error) => {
6657
6438
  </script>
6658
6439
  </body>
6659
6440
  </html>
6660
- `,Eb=`<!doctype html>
6441
+ `,Yb=`<!doctype html>
6661
6442
  <html lang="en">
6662
6443
  <head>
6663
6444
  <meta charset="utf-8" />
@@ -7008,7 +6789,7 @@ main().catch((error) => {
7008
6789
  </script>
7009
6790
  </body>
7010
6791
  </html>
7011
- `,Tb=`<!doctype html>
6792
+ `,qb=`<!doctype html>
7012
6793
  <html lang="en">
7013
6794
  <head>
7014
6795
  <meta charset="utf-8" />
@@ -7257,15 +7038,15 @@ main().catch((error) => {
7257
7038
  </script>
7258
7039
  </body>
7259
7040
  </html>
7260
- `,Za={hunt:Sb,push:$b,group:Eb,forecast:Tb};var Xt=!1;function Lm(e){Xt=e}function L(){return Xt}var Ab=()=>!Xt&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,Yt=(e,t)=>Ab()?`\x1B[${e}m${t}\x1B[0m`:t,$={bold:e=>Yt("1",e),dim:e=>Yt("2",e),red:e=>Yt("31",e),green:e=>Yt("32",e),yellow:e=>Yt("33",e),cyan:e=>Yt("36",e)};function Ba(e=process.argv,t=process.env){if(t.GAMESTAGE_INVOCATION)return t.GAMESTAGE_INVOCATION;let r=(e[1]??"").split(/[\\/]/).pop()??"";return r==="gamestage.mjs"||r==="cli.mjs"?`node ${r}`:"gamestage"}function je(e){return`${Ba()} ${e}`}function v(e=""){Xt||process.stdout.write(e+`
7261
- `)}function I(e){v(),v($.bold(e))}function A(e,t="-"){v(` ${$.dim(t)} ${e}`)}function T(e,t){v(` ${$.dim(e.padEnd(18))} ${t}`)}function M(e){Xt&&process.stdout.write(JSON.stringify(e,null,2)+`
7262
- `)}function P(e,t){if(Xt)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
7041
+ `,Xa={hunt:Hb,push:Jb,group:Yb,forecast:qb};var Xt=!1;function Hm(e){Xt=e}function R(){return Xt}var Xb=()=>!Xt&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,qt=(e,t)=>Xb()?`\x1B[${e}m${t}\x1B[0m`:t,$={bold:e=>qt("1",e),dim:e=>qt("2",e),red:e=>qt("31",e),green:e=>qt("32",e),yellow:e=>qt("33",e),cyan:e=>qt("36",e)};function Qa(e=process.argv,t=process.env){if(t.GAMESTAGE_INVOCATION)return t.GAMESTAGE_INVOCATION;let r=(e[1]??"").split(/[\\/]/).pop()??"";return r==="gamestage.mjs"||r==="cli.mjs"?`node ${r}`:"gamestage"}function Ie(e){return`${Qa()} ${e}`}function v(e=""){Xt||process.stdout.write(e+`
7042
+ `)}function I(e){v(),v($.bold(e))}function A(e,t="-"){v(` ${$.dim(t)} ${e}`)}function E(e,t){v(` ${$.dim(e.padEnd(18))} ${t}`)}function j(e){Xt&&process.stdout.write(JSON.stringify(e,null,2)+`
7043
+ `)}function C(e,t){if(Xt)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
7263
7044
  `);else{process.stderr.write(`${$.red("Error")} ${e}
7264
7045
  `);for(let r of t??[])process.stderr.write(` ${r}
7265
- `)}process.exit(1)}async function Db(e,t){let r;try{r=await Cb(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function zm(e,t,r){let o=Nb(e,t),n=await Db(o,r);try{await Ib(Ob(o),{recursive:!0}),await Pb(o,r,"utf8")}catch{throw P(`Cannot write ${o}.`),new Error("unreachable")}return{where:Rb(process.cwd(),o)||t,state:n}}async function Mm(e){let t=jb(e.out??"."),r=await zm(t,we,Jt),o=await zm(t,be,Ht),n=`import { start } from "./${we}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${be}";`,a=r.state==="same"&&o.state==="same";if(L())return M({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:qt,import:n},{path:o.where,digest:tr,import:i}],path:r.where,digest:qt,import:n});I(a?"Already current":"Wrote the Gamestage client"),T("Facade",`${r.where} (${qt})`),T("Player client",`${o.where} (${tr})`),v(),A(`Import it: ${$.cyan(n)}`),A(`The player API on its own: ${$.cyan(i)}`),(r.state==="different"||o.state==="different")&&A("An earlier copy was replaced. It is generated, so nothing of yours was in it."),v()}import{writeFile as Zr}from"node:fs/promises";import{createHash as hT}from"node:crypto";var Qt="Round";function It(e,t={}){let r=e?.trim()||Qt;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var Lb={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"forecast"};function We(e){return Lb[e]??e}function Um(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=We(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var Ka={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",forecast:"gamestage-prediction-element"},Fm={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",forecast:"Prediction"};var u={};Ke(u,{$brand:()=>Wa,$input:()=>fl,$output:()=>ml,NEVER:()=>Va,TimePrecision:()=>vl,ZodAny:()=>sd,ZodArray:()=>dd,ZodBase64:()=>Oi,ZodBase64URL:()=>Ni,ZodBigInt:()=>Pn,ZodBigIntFormat:()=>Di,ZodBoolean:()=>Cn,ZodCIDRv4:()=>Ci,ZodCIDRv6:()=>Pi,ZodCUID:()=>xi,ZodCUID2:()=>Si,ZodCatch:()=>Nd,ZodCodec:()=>Nr,ZodCustom:()=>Rr,ZodCustomStringFormat:()=>An,ZodDate:()=>Ar,ZodDefault:()=>Td,ZodDiscriminatedUnion:()=>md,ZodE164:()=>Ri,ZodEmail:()=>bi,ZodEmoji:()=>wi,ZodEnum:()=>En,ZodError:()=>fx,ZodExactOptional:()=>Sd,ZodFile:()=>kd,ZodFirstPartyTypeKind:()=>Vd,ZodFunction:()=>Zd,ZodGUID:()=>xr,ZodIPv4:()=>Ai,ZodIPv6:()=>Ii,ZodISODate:()=>fi,ZodISODateTime:()=>mi,ZodISODuration:()=>gi,ZodISOTime:()=>hi,ZodIntersection:()=>fd,ZodIssueCode:()=>gx,ZodJWT:()=>ji,ZodKSUID:()=>Ti,ZodLazy:()=>Ud,ZodLiteral:()=>wd,ZodMAC:()=>ed,ZodMap:()=>_d,ZodNaN:()=>jd,ZodNanoID:()=>ki,ZodNever:()=>ld,ZodNonOptional:()=>Gi,ZodNull:()=>id,ZodNullable:()=>Ed,ZodNumber:()=>In,ZodNumberFormat:()=>zt,ZodObject:()=>Cr,ZodOptional:()=>Fi,ZodPipe:()=>Or,ZodPrefault:()=>Id,ZodPreprocess:()=>Dd,ZodPromise:()=>Gd,ZodReadonly:()=>Ld,ZodRealError:()=>ge,ZodRecord:()=>$n,ZodSet:()=>bd,ZodString:()=>Tn,ZodStringFormat:()=>K,ZodSuccess:()=>Od,ZodSymbol:()=>rd,ZodTemplateLiteral:()=>Md,ZodTransform:()=>xd,ZodTuple:()=>gd,ZodType:()=>z,ZodULID:()=>$i,ZodURL:()=>Tr,ZodUUID:()=>Me,ZodUndefined:()=>od,ZodUnion:()=>Pr,ZodUnknown:()=>cd,ZodVoid:()=>ud,ZodXID:()=>Ei,ZodXor:()=>pd,_ZodString:()=>_i,_default:()=>Ad,_function:()=>Cg,any:()=>sg,array:()=>Ir,base64:()=>Bh,base64url:()=>Kh,bigint:()=>ng,boolean:()=>nd,catch:()=>Rd,check:()=>Pg,cidrv4:()=>Gh,cidrv6:()=>Zh,clone:()=>ce,codec:()=>Eg,coerce:()=>Wd,config:()=>J,core:()=>qe,cuid:()=>Rh,cuid2:()=>jh,custom:()=>Og,date:()=>lg,decode:()=>Wu,decodeAsync:()=>Ju,describe:()=>Ng,discriminatedUnion:()=>hg,e164:()=>Vh,email:()=>Sh,emoji:()=>Oh,encode:()=>Vu,encodeAsync:()=>Hu,endsWith:()=>hn,enum:()=>Mi,exactOptional:()=>$d,file:()=>kg,flattenError:()=>lr,float32:()=>Xh,float64:()=>Qh,formatError:()=>ur,fromJSONSchema:()=>Ug,function:()=>Cg,getErrorMap:()=>vx,globalRegistry:()=>ne,gt:()=>Le,gte:()=>ue,guid:()=>$h,hash:()=>Yh,hex:()=>qh,hostname:()=>Jh,httpUrl:()=>Ph,includes:()=>mn,instanceof:()=>jg,int:()=>yi,int32:()=>eg,int64:()=>rg,intersection:()=>hd,invertCodec:()=>Tg,ipv4:()=>Mh,ipv6:()=>Fh,iso:()=>Sn,json:()=>Lg,jwt:()=>Wh,keyof:()=>ug,ksuid:()=>zh,lazy:()=>Fd,length:()=>Dt,literal:()=>wg,locales:()=>vr,looseObject:()=>mg,looseRecord:()=>yg,lowercase:()=>dn,lt:()=>De,lte:()=>xe,mac:()=>Uh,map:()=>vg,maxLength:()=>jt,maxSize:()=>mt,meta:()=>Rg,mime:()=>gn,minLength:()=>Je,minSize:()=>ze,multipleOf:()=>pt,nan:()=>$g,nanoid:()=>Nh,nativeEnum:()=>bg,negative:()=>ri,never:()=>Li,nonnegative:()=>ii,nonoptional:()=>Pd,nonpositive:()=>oi,normalize:()=>yn,null:()=>ad,nullable:()=>$r,nullish:()=>xg,number:()=>td,object:()=>dg,optional:()=>Sr,overwrite:()=>Ie,parse:()=>Gu,parseAsync:()=>Zu,partialRecord:()=>gg,pipe:()=>vi,positive:()=>ni,prefault:()=>Cd,preprocess:()=>zg,prettifyError:()=>as,promise:()=>Ig,property:()=>ai,readonly:()=>zd,record:()=>vd,refine:()=>Bd,regex:()=>un,regexes:()=>ke,registry:()=>jo,safeDecode:()=>Yu,safeDecodeAsync:()=>Qu,safeEncode:()=>qu,safeEncodeAsync:()=>Xu,safeParse:()=>Bu,safeParseAsync:()=>Ku,set:()=>_g,setErrorMap:()=>yx,size:()=>Rt,slugify:()=>wn,startsWith:()=>fn,strictObject:()=>pg,string:()=>kr,stringFormat:()=>Hh,stringbool:()=>Dg,success:()=>Sg,superRefine:()=>Kd,symbol:()=>ig,templateLiteral:()=>Ag,toJSONSchema:()=>ui,toLowerCase:()=>_n,toUpperCase:()=>bn,transform:()=>Ui,treeifyError:()=>is,trim:()=>vn,tuple:()=>yd,uint32:()=>tg,uint64:()=>og,ulid:()=>Dh,undefined:()=>ag,union:()=>zi,unknown:()=>Lt,uppercase:()=>pn,url:()=>Ch,util:()=>k,uuid:()=>Eh,uuidv4:()=>Th,uuidv6:()=>Ah,uuidv7:()=>Ih,void:()=>cg,xid:()=>Lh,xor:()=>fg});var qe={};Ke(qe,{$ZodAny:()=>jc,$ZodArray:()=>Uc,$ZodAsyncError:()=>Ae,$ZodBase64:()=>$c,$ZodBase64URL:()=>Ec,$ZodBigInt:()=>To,$ZodBigIntFormat:()=>Pc,$ZodBoolean:()=>fr,$ZodCIDRv4:()=>kc,$ZodCIDRv6:()=>xc,$ZodCUID:()=>uc,$ZodCUID2:()=>dc,$ZodCatch:()=>ol,$ZodCheck:()=>V,$ZodCheckBigIntFormat:()=>Us,$ZodCheckEndsWith:()=>Xs,$ZodCheckGreaterThan:()=>wo,$ZodCheckIncludes:()=>qs,$ZodCheckLengthEquals:()=>Vs,$ZodCheckLessThan:()=>bo,$ZodCheckLowerCase:()=>Hs,$ZodCheckMaxLength:()=>Bs,$ZodCheckMaxSize:()=>Fs,$ZodCheckMimeType:()=>ec,$ZodCheckMinLength:()=>Ks,$ZodCheckMinSize:()=>Gs,$ZodCheckMultipleOf:()=>zs,$ZodCheckNumberFormat:()=>Ms,$ZodCheckOverwrite:()=>tc,$ZodCheckProperty:()=>Qs,$ZodCheckRegex:()=>Ws,$ZodCheckSizeEquals:()=>Zs,$ZodCheckStartsWith:()=>Ys,$ZodCheckStringFormat:()=>cn,$ZodCheckUpperCase:()=>Js,$ZodCodec:()=>gr,$ZodCustom:()=>pl,$ZodCustomStringFormat:()=>Ic,$ZodDate:()=>Mc,$ZodDefault:()=>el,$ZodDiscriminatedUnion:()=>Zc,$ZodE164:()=>Tc,$ZodEmail:()=>ac,$ZodEmoji:()=>cc,$ZodEncodeError:()=>st,$ZodEnum:()=>Hc,$ZodError:()=>cr,$ZodExactOptional:()=>Xc,$ZodFile:()=>qc,$ZodFunction:()=>ll,$ZodGUID:()=>oc,$ZodIPv4:()=>_c,$ZodIPv6:()=>bc,$ZodISODate:()=>gc,$ZodISODateTime:()=>hc,$ZodISODuration:()=>vc,$ZodISOTime:()=>yc,$ZodIntersection:()=>Bc,$ZodJWT:()=>Ac,$ZodKSUID:()=>fc,$ZodLazy:()=>dl,$ZodLiteral:()=>Jc,$ZodMAC:()=>wc,$ZodMap:()=>Vc,$ZodNaN:()=>il,$ZodNanoID:()=>lc,$ZodNever:()=>Lc,$ZodNonOptional:()=>nl,$ZodNull:()=>Rc,$ZodNullable:()=>Qc,$ZodNumber:()=>Eo,$ZodNumberFormat:()=>Cc,$ZodObject:()=>_f,$ZodObjectJIT:()=>Fc,$ZodOptional:()=>Io,$ZodPipe:()=>Co,$ZodPrefault:()=>tl,$ZodPreprocess:()=>al,$ZodPromise:()=>ul,$ZodReadonly:()=>sl,$ZodRealError:()=>he,$ZodRecord:()=>Kc,$ZodRegistry:()=>Ro,$ZodSet:()=>Wc,$ZodString:()=>Nt,$ZodStringFormat:()=>B,$ZodSuccess:()=>rl,$ZodSymbol:()=>Oc,$ZodTemplateLiteral:()=>cl,$ZodTransform:()=>Yc,$ZodTuple:()=>Ao,$ZodType:()=>R,$ZodULID:()=>pc,$ZodURL:()=>sc,$ZodUUID:()=>ic,$ZodUndefined:()=>Nc,$ZodUnion:()=>hr,$ZodUnknown:()=>Dc,$ZodVoid:()=>zc,$ZodXID:()=>mc,$ZodXor:()=>Gc,$brand:()=>Wa,$constructor:()=>g,$input:()=>fl,$output:()=>ml,Doc:()=>mr,JSONSchema:()=>wh,JSONSchemaGenerator:()=>di,NEVER:()=>Va,TimePrecision:()=>vl,_any:()=>Ml,_array:()=>Vl,_base64:()=>Xo,_base64url:()=>Qo,_bigint:()=>Ol,_boolean:()=>Cl,_catch:()=>ax,_check:()=>bh,_cidrv4:()=>qo,_cidrv6:()=>Yo,_coercedBigint:()=>Nl,_coercedBoolean:()=>Pl,_coercedDate:()=>Bl,_coercedNumber:()=>Sl,_coercedString:()=>gl,_cuid:()=>Zo,_cuid2:()=>Bo,_custom:()=>Hl,_date:()=>Zl,_decode:()=>uo,_decodeAsync:()=>mo,_default:()=>rx,_discriminatedUnion:()=>Kk,_e164:()=>ei,_email:()=>Do,_emoji:()=>Fo,_encode:()=>lo,_encodeAsync:()=>po,_endsWith:()=>hn,_enum:()=>Yk,_file:()=>Wl,_float32:()=>El,_float64:()=>Tl,_gt:()=>Le,_gte:()=>ue,_guid:()=>_r,_includes:()=>mn,_int:()=>$l,_int32:()=>Al,_int64:()=>Rl,_intersection:()=>Vk,_ipv4:()=>Ho,_ipv6:()=>Jo,_isoDate:()=>bl,_isoDateTime:()=>_l,_isoDuration:()=>kl,_isoTime:()=>wl,_jwt:()=>ti,_ksuid:()=>Wo,_lazy:()=>ux,_length:()=>Dt,_literal:()=>Qk,_lowercase:()=>dn,_lt:()=>De,_lte:()=>xe,_mac:()=>yl,_map:()=>Jk,_max:()=>xe,_maxLength:()=>jt,_maxSize:()=>mt,_mime:()=>gn,_min:()=>ue,_minLength:()=>Je,_minSize:()=>ze,_multipleOf:()=>pt,_nan:()=>Kl,_nanoid:()=>Go,_nativeEnum:()=>Xk,_negative:()=>ri,_never:()=>Fl,_nonnegative:()=>ii,_nonoptional:()=>ox,_nonpositive:()=>oi,_normalize:()=>yn,_null:()=>zl,_nullable:()=>nx,_number:()=>xl,_optional:()=>tx,_overwrite:()=>Ie,_parse:()=>rn,_parseAsync:()=>on,_pipe:()=>sx,_positive:()=>ni,_promise:()=>dx,_property:()=>ai,_readonly:()=>cx,_record:()=>Hk,_refine:()=>Jl,_regex:()=>un,_safeDecode:()=>ho,_safeDecodeAsync:()=>yo,_safeEncode:()=>fo,_safeEncodeAsync:()=>go,_safeParse:()=>an,_safeParseAsync:()=>sn,_set:()=>qk,_size:()=>Rt,_slugify:()=>wn,_startsWith:()=>fn,_string:()=>hl,_stringFormat:()=>kn,_stringbool:()=>Ql,_success:()=>ix,_superRefine:()=>ql,_symbol:()=>Dl,_templateLiteral:()=>lx,_toLowerCase:()=>_n,_toUpperCase:()=>bn,_transform:()=>ex,_trim:()=>vn,_tuple:()=>Wk,_uint32:()=>Il,_uint64:()=>jl,_ulid:()=>Ko,_undefined:()=>Ll,_union:()=>Zk,_unknown:()=>Ul,_uppercase:()=>pn,_url:()=>br,_uuid:()=>Lo,_uuidv4:()=>zo,_uuidv6:()=>Mo,_uuidv7:()=>Uo,_void:()=>Gl,_xid:()=>Vo,_xor:()=>Bk,clone:()=>ce,config:()=>J,createStandardJSONSchemaMethod:()=>xn,createToJSONSchemaMethod:()=>eu,decode:()=>dw,decodeAsync:()=>mw,describe:()=>Yl,encode:()=>uw,encodeAsync:()=>pw,extractDefs:()=>ht,finalize:()=>gt,flattenError:()=>lr,formatError:()=>ur,globalConfig:()=>Ct,globalRegistry:()=>ne,initializeContext:()=>ft,isValidBase64:()=>Sc,isValidBase64URL:()=>hf,isValidJWT:()=>gf,locales:()=>vr,meta:()=>Xl,parse:()=>so,parseAsync:()=>co,prettifyError:()=>as,process:()=>Z,regexes:()=>ke,registry:()=>jo,safeDecode:()=>hw,safeDecodeAsync:()=>yw,safeEncode:()=>fw,safeEncodeAsync:()=>gw,safeParse:()=>ss,safeParseAsync:()=>cs,toDotPath:()=>Wm,toJSONSchema:()=>ui,treeifyError:()=>is,util:()=>k,version:()=>nc});var Gm,Va=Object.freeze({status:"aborted"});function g(e,t,r){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let l=a.prototype,d=Object.keys(l);for(let p=0;p<d.length;p++){let m=d[p];m in s||(s[m]=l[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let l=r?.Parent?new i:this;o(l,s),(c=l._zod).deferred??(c.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Wa=Symbol("zod_brand"),Ae=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},st=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Gm=globalThis).__zod_globalConfig??(Gm.__zod_globalConfig={});var Ct=globalThis.__zod_globalConfig;function J(e){return e&&Object.assign(Ct,e),Ct}var k={};Ke(k,{BIGINT_FORMAT_RANGES:()=>rs,Class:()=>Ja,NUMBER_FORMAT_RANGES:()=>ns,aborted:()=>dt,allowsEval:()=>Xa,assert:()=>Gb,assertEqual:()=>zb,assertIs:()=>Ub,assertNever:()=>Fb,assertNotEqual:()=>Mb,assignProp:()=>lt,base64ToUint8Array:()=>Bm,base64urlToUint8Array:()=>iw,cached:()=>tn,captureStackTrace:()=>ao,cleanEnum:()=>ow,cleanRegex:()=>or,clone:()=>ce,cloneDef:()=>Bb,createTransparentProxy:()=>qb,defineLazy:()=>U,esc:()=>io,escapeRegex:()=>Ee,explicitlyAborted:()=>os,extend:()=>Qb,finalizeIssue:()=>le,floatSafeRemainder:()=>qa,getElementAtPath:()=>Kb,getEnumValues:()=>rr,getLengthableOrigin:()=>sr,getParsedType:()=>Jb,getSizableOrigin:()=>ar,hexToUint8Array:()=>sw,isObject:()=>Pt,isPlainObject:()=>ut,issue:()=>nn,joinValues:()=>y,jsonStringifyReplacer:()=>en,merge:()=>tw,mergeDefs:()=>He,normalizeParams:()=>x,nullish:()=>ct,numKeys:()=>Hb,objectClone:()=>Zb,omit:()=>Xb,optionalKeys:()=>ts,parsedType:()=>w,partial:()=>nw,pick:()=>Yb,prefixIssues:()=>fe,primitiveTypes:()=>es,promiseAllObject:()=>Vb,propertyKeyTypes:()=>ir,randomString:()=>Wb,required:()=>rw,safeExtend:()=>ew,shallowClone:()=>Qa,slugify:()=>Ya,stringifyPrimitive:()=>_,uint8ArrayToBase64:()=>Km,uint8ArrayToBase64url:()=>aw,uint8ArrayToHex:()=>cw,unwrapMessage:()=>nr});function zb(e){return e}function Mb(e){return e}function Ub(e){}function Fb(e){throw new Error("Unexpected value in exhaustive check")}function Gb(e){}function rr(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function y(e,t="|"){return e.map(r=>_(r)).join(t)}function en(e,t){return typeof t=="bigint"?t.toString():t}function tn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ct(e){return e==null}function or(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qa(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Zm=Symbol("evaluating");function U(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Zm)return o===void 0&&(o=Zm,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Zb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function lt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function He(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Bb(e){return He(e._zod.def)}function Kb(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Vb(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function Wb(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function io(e){return JSON.stringify(e)}function Ya(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ao="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Xa=tn(()=>{if(Ct.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ut(e){if(Pt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Pt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Qa(e){return ut(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Hb(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Jb=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ir=new Set(["string","number","symbol"]),es=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ce(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function qb(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function _(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ts(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ns={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]},rs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Yb(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=He(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return lt(this,"shape",a),a},checks:[]});return ce(e,i)}function Xb(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=He(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return lt(this,"shape",a),a},checks:[]});return ce(e,i)}function Qb(e,t){if(!ut(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=He(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return lt(this,"shape",i),i}});return ce(e,n)}function ew(e,t){if(!ut(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=He(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return lt(this,"shape",o),o}});return ce(e,r)}function tw(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=He(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return lt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ce(e,r)}function nw(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=He(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)c[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return lt(this,"shape",c),c},checks:[]});return ce(t,a)}function rw(e,t,r){let o=He(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return lt(this,"shape",i),i}});return ce(t,o)}function dt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function os(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function fe(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function nr(e){return typeof e=="string"?e:e?.message}function le(e,t,r){let o=e.message?e.message:nr(e.inst?._zod.def?.error?.(e))??nr(t?.error?.(e))??nr(r.customError?.(e))??nr(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function ar(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function sr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function w(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function nn(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function ow(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Bm(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Km(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function iw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Bm(t+r)}function aw(e){return Km(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function sw(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function cw(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ja=class{constructor(...t){}};var Vm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,en,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cr=g("$ZodError",Vm),he=g("$ZodError",Vm,{Parent:Error});function lr(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function ur(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,l=0;for(;l<s.length;){let d=s[l];l===s.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(a))):c[d]=c[d]||{_errors:[]},c=c[d],l++}}}};return o(e),r}function is(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let l=[...i,...c.path];if(l.length===0){r.errors.push(t(c));continue}let d=r,p=0;for(;p<l.length;){let m=l[p],f=p===l.length-1;typeof m=="string"?(d.properties??(d.properties={}),(a=d.properties)[m]??(a[m]={errors:[]}),d=d.properties[m]):(d.items??(d.items=[]),(s=d.items)[m]??(s[m]={errors:[]}),d=d.items[m]),f&&d.errors.push(t(c)),p++}}};return o(e),r}function Wm(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function as(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Wm(o.path)}`);return t.join(`
7266
- `)}var rn=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Ae;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>le(c,i,J())));throw ao(s,n?.callee),s}return a.value},so=rn(he),on=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>le(c,i,J())));throw ao(s,n?.callee),s}return a.value},co=on(he),an=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Ae;return i.issues.length?{success:!1,error:new(e??cr)(i.issues.map(a=>le(a,n,J())))}:{success:!0,data:i.value}},ss=an(he),sn=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>le(a,n,J())))}:{success:!0,data:i.value}},cs=sn(he),lo=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return rn(e)(t,r,n)},uw=lo(he),uo=e=>(t,r,o)=>rn(e)(t,r,o),dw=uo(he),po=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return on(e)(t,r,n)},pw=po(he),mo=e=>async(t,r,o)=>on(e)(t,r,o),mw=mo(he),fo=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return an(e)(t,r,n)},fw=fo(he),ho=e=>(t,r,o)=>an(e)(t,r,o),hw=ho(he),go=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return sn(e)(t,r,n)},gw=go(he),yo=e=>async(t,r,o)=>sn(e)(t,r,o),yw=yo(he);var ke={};Ke(ke,{base64:()=>Ss,base64url:()=>vo,bigint:()=>Ps,boolean:()=>Ns,browserEmail:()=>$w,cidrv4:()=>ks,cidrv6:()=>xs,cuid:()=>ls,cuid2:()=>us,date:()=>Ts,datetime:()=>Is,domain:()=>Aw,duration:()=>hs,e164:()=>Es,email:()=>ys,emoji:()=>vs,extendedDuration:()=>vw,guid:()=>gs,hex:()=>Iw,hostname:()=>Tw,html5Email:()=>kw,httpProtocol:()=>$s,idnEmail:()=>Sw,integer:()=>Os,ipv4:()=>_s,ipv6:()=>bs,ksuid:()=>ms,lowercase:()=>Ds,mac:()=>ws,md5_base64:()=>Pw,md5_base64url:()=>Ow,md5_hex:()=>Cw,nanoid:()=>fs,null:()=>Rs,number:()=>_o,rfc5322Email:()=>xw,sha1_base64:()=>Rw,sha1_base64url:()=>jw,sha1_hex:()=>Nw,sha256_base64:()=>Lw,sha256_base64url:()=>zw,sha256_hex:()=>Dw,sha384_base64:()=>Uw,sha384_base64url:()=>Fw,sha384_hex:()=>Mw,sha512_base64:()=>Zw,sha512_base64url:()=>Bw,sha512_hex:()=>Gw,string:()=>Cs,time:()=>As,ulid:()=>ds,undefined:()=>js,unicodeEmail:()=>Hm,uppercase:()=>Ls,uuid:()=>Ot,uuid4:()=>_w,uuid6:()=>bw,uuid7:()=>ww,xid:()=>ps});var ls=/^[cC][0-9a-z]{6,}$/,us=/^[0-9a-z]+$/,ds=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ps=/^[0-9a-vA-V]{20}$/,ms=/^[A-Za-z0-9]{27}$/,fs=/^[a-zA-Z0-9_-]{21}$/,hs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vw=/^[-+]?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)?)??$/,gs=/^([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})$/,Ot=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_w=Ot(4),bw=Ot(6),ww=Ot(7),ys=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kw=/^[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])?)*$/,xw=/^(([^<>()\[\]\\.,;:\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,}))$/,Hm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Sw=Hm,$w=/^[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])?)*$/,Ew="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vs(){return new RegExp(Ew,"u")}var _s=/^(?:(?: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])$/,bs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ws=e=>{let t=Ee(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ks=/^((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])$/,xs=/^(([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])$/,Ss=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vo=/^[A-Za-z0-9_-]*$/,Tw=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Aw=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$s=/^https?$/,Es=/^\+[1-9]\d{6,14}$/,Jm="(?:(?:\\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])))",Ts=new RegExp(`^${Jm}$`);function qm(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function As(e){return new RegExp(`^${qm(e)}$`)}function Is(e){let t=qm({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Jm}T(?:${o})$`)}var Cs=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ps=/^-?\d+n?$/,Os=/^-?\d+$/,_o=/^-?\d+(?:\.\d+)?$/,Ns=/^(?:true|false)$/i,Rs=/^null$/i;var js=/^undefined$/i;var Ds=/^[^A-Z]*$/,Ls=/^[^a-z]*$/,Iw=/^[0-9a-fA-F]*$/;function dr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function pr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Cw=/^[0-9a-fA-F]{32}$/,Pw=dr(22,"=="),Ow=pr(22),Nw=/^[0-9a-fA-F]{40}$/,Rw=dr(27,"="),jw=pr(27),Dw=/^[0-9a-fA-F]{64}$/,Lw=dr(43,"="),zw=pr(43),Mw=/^[0-9a-fA-F]{96}$/,Uw=dr(64,""),Fw=pr(64),Gw=/^[0-9a-fA-F]{128}$/,Zw=dr(86,"=="),Bw=pr(86);var V=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Xm={number:"number",bigint:"bigint",object:"date"},bo=g("$ZodCheckLessThan",(e,t)=>{V.init(e,t);let r=Xm[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wo=g("$ZodCheckGreaterThan",(e,t)=>{V.init(e,t);let r=Xm[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zs=g("$ZodCheckMultipleOf",(e,t)=>{V.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):qa(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ms=g("$ZodCheckNumberFormat",(e,t)=>{V.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=ns[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Os)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Us=g("$ZodCheckBigIntFormat",(e,t)=>{V.init(e,t);let[r,o]=rs[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Fs=g("$ZodCheckMaxSize",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!ct(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:ar(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Gs=g("$ZodCheckMinSize",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!ct(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:ar(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Zs=g("$ZodCheckSizeEquals",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!ct(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:ar(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Bs=g("$ZodCheckMaxLength",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!ct(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=sr(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ks=g("$ZodCheckMinLength",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!ct(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=sr(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Vs=g("$ZodCheckLengthEquals",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!ct(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=sr(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),cn=g("$ZodCheckStringFormat",(e,t)=>{var r,o;V.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ws=g("$ZodCheckRegex",(e,t)=>{cn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hs=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ds),cn.init(e,t)}),Js=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ls),cn.init(e,t)}),qs=g("$ZodCheckIncludes",(e,t)=>{V.init(e,t);let r=Ee(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ys=g("$ZodCheckStartsWith",(e,t)=>{V.init(e,t);let r=new RegExp(`^${Ee(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Xs=g("$ZodCheckEndsWith",(e,t)=>{V.init(e,t);let r=new RegExp(`.*${Ee(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Ym(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues))}var Qs=g("$ZodCheckProperty",(e,t)=>{V.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Ym(n,r,t.property));Ym(o,r,t.property)}}),ec=g("$ZodCheckMimeType",(e,t)=>{V.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),tc=g("$ZodCheckOverwrite",(e,t)=>{V.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var mr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
7046
+ `)}process.exit(1)}async function aw(e,t){let r;try{r=await ew(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function Jm(e,t,r){let o=rw(e,t),n=await aw(o,r);try{await Qb(nw(o),{recursive:!0}),await tw(o,r,"utf8")}catch{throw C(`Cannot write ${o}.`),new Error("unreachable")}return{where:ow(process.cwd(),o)||t,state:n}}async function Ym(e){let t=iw(e.out??"."),r=await Jm(t,ke,Jt),o=await Jm(t,we,Ht),n=`import { start } from "./${ke}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${we}";`,a=r.state==="same"&&o.state==="same";if(R())return j({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:Yt,import:n},{path:o.where,digest:rr,import:i}],path:r.where,digest:Yt,import:n});I(a?"Already current":"Wrote the Gamestage client"),E("Facade",`${r.where} (${Yt})`),E("Player client",`${o.where} (${rr})`),v(),A(`Import it: ${$.cyan(n)}`),A(`The player API on its own: ${$.cyan(i)}`),(r.state==="different"||o.state==="different")&&A("An earlier copy was replaced. It is generated, so nothing of yours was in it."),v()}import{writeFile as Wr}from"node:fs/promises";import{createHash as UT}from"node:crypto";var Qt="Round";function Tt(e,t={}){let r=e?.trim()||Qt;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var sw={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"forecast"};function We(e){return sw[e]??e}function qm(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=We(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var es={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",forecast:"gamestage-prediction-element"},Xm={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",forecast:"Prediction"};var u={};Ke(u,{$brand:()=>ns,$input:()=>xl,$output:()=>kl,NEVER:()=>ts,TimePrecision:()=>Tl,ZodAny:()=>gd,ZodArray:()=>bd,ZodBase64:()=>Li,ZodBase64URL:()=>zi,ZodBigInt:()=>Pn,ZodBigIntFormat:()=>Fi,ZodBoolean:()=>Cn,ZodCIDRv4:()=>ji,ZodCIDRv6:()=>Di,ZodCUID:()=>Ai,ZodCUID2:()=>Ii,ZodCatch:()=>Gd,ZodCodec:()=>jr,ZodCustom:()=>Dr,ZodCustomStringFormat:()=>An,ZodDate:()=>Cr,ZodDefault:()=>Dd,ZodDiscriminatedUnion:()=>kd,ZodE164:()=>Mi,ZodEmail:()=>$i,ZodEmoji:()=>Ei,ZodEnum:()=>En,ZodError:()=>zx,ZodExactOptional:()=>Nd,ZodFile:()=>Pd,ZodFirstPartyTypeKind:()=>tp,ZodFunction:()=>Xd,ZodGUID:()=>$r,ZodIPv4:()=>Ni,ZodIPv6:()=>Ri,ZodISODate:()=>_i,ZodISODateTime:()=>vi,ZodISODuration:()=>wi,ZodISOTime:()=>bi,ZodIntersection:()=>xd,ZodIssueCode:()=>Ux,ZodJWT:()=>Ui,ZodKSUID:()=>Oi,ZodLazy:()=>Jd,ZodLiteral:()=>Cd,ZodMAC:()=>ld,ZodMap:()=>Ad,ZodNaN:()=>Bd,ZodNanoID:()=>Ti,ZodNever:()=>vd,ZodNonOptional:()=>Wi,ZodNull:()=>fd,ZodNullable:()=>jd,ZodNumber:()=>In,ZodNumberFormat:()=>Dt,ZodObject:()=>Or,ZodOptional:()=>Vi,ZodPipe:()=>Rr,ZodPrefault:()=>zd,ZodPreprocess:()=>Kd,ZodPromise:()=>qd,ZodReadonly:()=>Vd,ZodRealError:()=>ge,ZodRecord:()=>$n,ZodSet:()=>Id,ZodString:()=>Tn,ZodStringFormat:()=>K,ZodSuccess:()=>Fd,ZodSymbol:()=>pd,ZodTemplateLiteral:()=>Hd,ZodTransform:()=>Od,ZodTuple:()=>$d,ZodType:()=>M,ZodULID:()=>Ci,ZodURL:()=>Ir,ZodUUID:()=>Me,ZodUndefined:()=>md,ZodUnion:()=>Nr,ZodUnknown:()=>yd,ZodVoid:()=>_d,ZodXID:()=>Pi,ZodXor:()=>wd,_ZodString:()=>Si,_default:()=>Ld,_function:()=>Fg,any:()=>vg,array:()=>Pr,base64:()=>tg,base64url:()=>ng,bigint:()=>mg,boolean:()=>dd,catch:()=>Zd,check:()=>Gg,cidrv4:()=>Qh,cidrv6:()=>eg,clone:()=>le,codec:()=>Lg,coerce:()=>np,config:()=>J,core:()=>Ye,cuid:()=>Kh,cuid2:()=>Vh,custom:()=>Zg,date:()=>bg,decode:()=>nd,decodeAsync:()=>od,describe:()=>Bg,discriminatedUnion:()=>Eg,e164:()=>rg,email:()=>jh,emoji:()=>Zh,encode:()=>td,encodeAsync:()=>rd,endsWith:()=>hn,enum:()=>Bi,exactOptional:()=>Rd,file:()=>Ng,flattenError:()=>dr,float32:()=>lg,float64:()=>ug,formatError:()=>pr,fromJSONSchema:()=>qg,function:()=>Fg,getErrorMap:()=>Gx,globalRegistry:()=>re,gt:()=>Le,gte:()=>de,guid:()=>Dh,hash:()=>cg,hex:()=>sg,hostname:()=>ag,httpUrl:()=>Gh,includes:()=>mn,instanceof:()=>Vg,int:()=>ki,int32:()=>dg,int64:()=>fg,intersection:()=>Sd,invertCodec:()=>zg,ipv4:()=>Yh,ipv6:()=>Xh,iso:()=>Sn,json:()=>Hg,jwt:()=>og,keyof:()=>wg,ksuid:()=>Jh,lazy:()=>Yd,length:()=>Rt,literal:()=>Og,locales:()=>br,looseObject:()=>Sg,looseRecord:()=>Ag,lowercase:()=>dn,lt:()=>De,lte:()=>Se,mac:()=>qh,map:()=>Ig,maxLength:()=>Nt,maxSize:()=>pt,meta:()=>Kg,mime:()=>gn,minLength:()=>Je,minSize:()=>ze,multipleOf:()=>dt,nan:()=>Dg,nanoid:()=>Bh,nativeEnum:()=>Pg,negative:()=>ci,never:()=>Gi,nonnegative:()=>ui,nonoptional:()=>Ud,nonpositive:()=>li,normalize:()=>yn,null:()=>hd,nullable:()=>Tr,nullish:()=>Rg,number:()=>ud,object:()=>kg,optional:()=>Er,overwrite:()=>Ne,parse:()=>qu,parseAsync:()=>Xu,partialRecord:()=>Tg,pipe:()=>xi,positive:()=>si,prefault:()=>Md,preprocess:()=>Jg,prettifyError:()=>hs,promise:()=>Ug,property:()=>di,readonly:()=>Wd,record:()=>Td,refine:()=>Qd,regex:()=>un,regexes:()=>xe,registry:()=>Uo,safeDecode:()=>ad,safeDecodeAsync:()=>cd,safeEncode:()=>id,safeEncodeAsync:()=>sd,safeParse:()=>Qu,safeParseAsync:()=>ed,set:()=>Cg,setErrorMap:()=>Fx,size:()=>Ot,slugify:()=>wn,startsWith:()=>fn,strictObject:()=>xg,string:()=>Sr,stringFormat:()=>ig,stringbool:()=>Wg,success:()=>jg,superRefine:()=>ep,symbol:()=>gg,templateLiteral:()=>Mg,toJSONSchema:()=>hi,toLowerCase:()=>_n,toUpperCase:()=>bn,transform:()=>Ki,treeifyError:()=>fs,trim:()=>vn,tuple:()=>Ed,uint32:()=>pg,uint64:()=>hg,ulid:()=>Wh,undefined:()=>yg,union:()=>Zi,unknown:()=>jt,uppercase:()=>pn,url:()=>Fh,util:()=>k,uuid:()=>Lh,uuidv4:()=>zh,uuidv6:()=>Mh,uuidv7:()=>Uh,void:()=>_g,xid:()=>Hh,xor:()=>$g});var Ye={};Ke(Ye,{$ZodAny:()=>Bc,$ZodArray:()=>Jc,$ZodAsyncError:()=>Oe,$ZodBase64:()=>Rc,$ZodBase64URL:()=>jc,$ZodBigInt:()=>Oo,$ZodBigIntFormat:()=>Uc,$ZodBoolean:()=>gr,$ZodCIDRv4:()=>Pc,$ZodCIDRv6:()=>Oc,$ZodCUID:()=>_c,$ZodCUID2:()=>bc,$ZodCatch:()=>ml,$ZodCheck:()=>V,$ZodCheckBigIntFormat:()=>Js,$ZodCheckEndsWith:()=>sc,$ZodCheckGreaterThan:()=>Eo,$ZodCheckIncludes:()=>ic,$ZodCheckLengthEquals:()=>tc,$ZodCheckLessThan:()=>$o,$ZodCheckLowerCase:()=>rc,$ZodCheckMaxLength:()=>Qs,$ZodCheckMaxSize:()=>Ys,$ZodCheckMimeType:()=>lc,$ZodCheckMinLength:()=>ec,$ZodCheckMinSize:()=>qs,$ZodCheckMultipleOf:()=>Ws,$ZodCheckNumberFormat:()=>Hs,$ZodCheckOverwrite:()=>uc,$ZodCheckProperty:()=>cc,$ZodCheckRegex:()=>nc,$ZodCheckSizeEquals:()=>Xs,$ZodCheckStartsWith:()=>ac,$ZodCheckStringFormat:()=>cn,$ZodCheckUpperCase:()=>oc,$ZodCodec:()=>vr,$ZodCustom:()=>wl,$ZodCustomStringFormat:()=>zc,$ZodDate:()=>Hc,$ZodDefault:()=>ll,$ZodDiscriminatedUnion:()=>Xc,$ZodE164:()=>Dc,$ZodEmail:()=>hc,$ZodEmoji:()=>yc,$ZodEncodeError:()=>at,$ZodEnum:()=>rl,$ZodError:()=>ur,$ZodExactOptional:()=>sl,$ZodFile:()=>il,$ZodFunction:()=>vl,$ZodGUID:()=>mc,$ZodIPv4:()=>Ac,$ZodIPv6:()=>Ic,$ZodISODate:()=>$c,$ZodISODateTime:()=>Sc,$ZodISODuration:()=>Tc,$ZodISOTime:()=>Ec,$ZodIntersection:()=>Qc,$ZodJWT:()=>Lc,$ZodKSUID:()=>xc,$ZodLazy:()=>bl,$ZodLiteral:()=>ol,$ZodMAC:()=>Cc,$ZodMap:()=>tl,$ZodNaN:()=>fl,$ZodNanoID:()=>vc,$ZodNever:()=>Vc,$ZodNonOptional:()=>dl,$ZodNull:()=>Zc,$ZodNullable:()=>cl,$ZodNumber:()=>Po,$ZodNumberFormat:()=>Mc,$ZodObject:()=>Cf,$ZodObjectJIT:()=>Yc,$ZodOptional:()=>Ro,$ZodPipe:()=>jo,$ZodPrefault:()=>ul,$ZodPreprocess:()=>hl,$ZodPromise:()=>_l,$ZodReadonly:()=>gl,$ZodRealError:()=>he,$ZodRecord:()=>el,$ZodRegistry:()=>Mo,$ZodSet:()=>nl,$ZodString:()=>Pt,$ZodStringFormat:()=>B,$ZodSuccess:()=>pl,$ZodSymbol:()=>Fc,$ZodTemplateLiteral:()=>yl,$ZodTransform:()=>al,$ZodTuple:()=>No,$ZodType:()=>L,$ZodULID:()=>wc,$ZodURL:()=>gc,$ZodUUID:()=>fc,$ZodUndefined:()=>Gc,$ZodUnion:()=>yr,$ZodUnknown:()=>Kc,$ZodVoid:()=>Wc,$ZodXID:()=>kc,$ZodXor:()=>qc,$brand:()=>ns,$constructor:()=>g,$input:()=>xl,$output:()=>kl,Doc:()=>hr,JSONSchema:()=>Oh,JSONSchemaGenerator:()=>gi,NEVER:()=>ts,TimePrecision:()=>Tl,_any:()=>Hl,_array:()=>tu,_base64:()=>ri,_base64url:()=>oi,_bigint:()=>Fl,_boolean:()=>Ml,_catch:()=>Cx,_check:()=>Ph,_cidrv4:()=>ti,_cidrv6:()=>ni,_coercedBigint:()=>Gl,_coercedBoolean:()=>Ul,_coercedDate:()=>Ql,_coercedNumber:()=>Nl,_coercedString:()=>$l,_cuid:()=>Ho,_cuid2:()=>Jo,_custom:()=>ru,_date:()=>Xl,_decode:()=>go,_decodeAsync:()=>vo,_default:()=>Tx,_discriminatedUnion:()=>hx,_e164:()=>ii,_email:()=>Fo,_emoji:()=>Vo,_encode:()=>ho,_encodeAsync:()=>yo,_endsWith:()=>hn,_enum:()=>wx,_file:()=>nu,_float32:()=>jl,_float64:()=>Dl,_gt:()=>Le,_gte:()=>de,_guid:()=>wr,_includes:()=>mn,_int:()=>Rl,_int32:()=>Ll,_int64:()=>Zl,_intersection:()=>gx,_ipv4:()=>Qo,_ipv6:()=>ei,_isoDate:()=>Il,_isoDateTime:()=>Al,_isoDuration:()=>Pl,_isoTime:()=>Cl,_jwt:()=>ai,_ksuid:()=>Xo,_lazy:()=>Rx,_length:()=>Rt,_literal:()=>xx,_lowercase:()=>dn,_lt:()=>De,_lte:()=>Se,_mac:()=>El,_map:()=>_x,_max:()=>Se,_maxLength:()=>Nt,_maxSize:()=>pt,_mime:()=>gn,_min:()=>de,_minLength:()=>Je,_minSize:()=>ze,_multipleOf:()=>dt,_nan:()=>eu,_nanoid:()=>Wo,_nativeEnum:()=>kx,_negative:()=>ci,_never:()=>Yl,_nonnegative:()=>ui,_nonoptional:()=>Ax,_nonpositive:()=>li,_normalize:()=>yn,_null:()=>Wl,_nullable:()=>Ex,_number:()=>Ol,_optional:()=>$x,_overwrite:()=>Ne,_parse:()=>rn,_parseAsync:()=>on,_pipe:()=>Px,_positive:()=>si,_promise:()=>jx,_property:()=>di,_readonly:()=>Ox,_record:()=>vx,_refine:()=>ou,_regex:()=>un,_safeDecode:()=>bo,_safeDecodeAsync:()=>ko,_safeEncode:()=>_o,_safeEncodeAsync:()=>wo,_safeParse:()=>an,_safeParseAsync:()=>sn,_set:()=>bx,_size:()=>Ot,_slugify:()=>wn,_startsWith:()=>fn,_string:()=>Sl,_stringFormat:()=>kn,_stringbool:()=>cu,_success:()=>Ix,_superRefine:()=>iu,_symbol:()=>Kl,_templateLiteral:()=>Nx,_toLowerCase:()=>_n,_toUpperCase:()=>bn,_transform:()=>Sx,_trim:()=>vn,_tuple:()=>yx,_uint32:()=>zl,_uint64:()=>Bl,_ulid:()=>Yo,_undefined:()=>Vl,_union:()=>mx,_unknown:()=>Jl,_uppercase:()=>pn,_url:()=>kr,_uuid:()=>Go,_uuidv4:()=>Zo,_uuidv6:()=>Bo,_uuidv7:()=>Ko,_void:()=>ql,_xid:()=>qo,_xor:()=>fx,clone:()=>le,config:()=>J,createStandardJSONSchemaMethod:()=>xn,createToJSONSchemaMethod:()=>lu,decode:()=>jw,decodeAsync:()=>Lw,describe:()=>au,encode:()=>Rw,encodeAsync:()=>Dw,extractDefs:()=>ft,finalize:()=>ht,flattenError:()=>dr,formatError:()=>pr,globalConfig:()=>At,globalRegistry:()=>re,initializeContext:()=>mt,isValidBase64:()=>Nc,isValidBase64URL:()=>Ef,isValidJWT:()=>Tf,locales:()=>br,meta:()=>su,parse:()=>mo,parseAsync:()=>fo,prettifyError:()=>hs,process:()=>Z,regexes:()=>xe,registry:()=>Uo,safeDecode:()=>Mw,safeDecodeAsync:()=>Fw,safeEncode:()=>zw,safeEncodeAsync:()=>Uw,safeParse:()=>gs,safeParseAsync:()=>ys,toDotPath:()=>of,toJSONSchema:()=>hi,treeifyError:()=>fs,util:()=>k,version:()=>dc});var Qm,ts=Object.freeze({status:"aborted"});function g(e,t,r){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let l=a.prototype,p=Object.keys(l);for(let d=0;d<p.length;d++){let m=p[d];m in s||(s[m]=l[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let l=r?.Parent?new i:this;o(l,s),(c=l._zod).deferred??(c.deferred=[]);for(let p of l._zod.deferred)p();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var ns=Symbol("zod_brand"),Oe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},at=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Qm=globalThis).__zod_globalConfig??(Qm.__zod_globalConfig={});var At=globalThis.__zod_globalConfig;function J(e){return e&&Object.assign(At,e),At}var k={};Ke(k,{BIGINT_FORMAT_RANGES:()=>ps,Class:()=>os,NUMBER_FORMAT_RANGES:()=>ds,aborted:()=>ut,allowsEval:()=>ss,assert:()=>pw,assertEqual:()=>cw,assertIs:()=>uw,assertNever:()=>dw,assertNotEqual:()=>lw,assignProp:()=>ct,base64ToUint8Array:()=>tf,base64urlToUint8Array:()=>Iw,cached:()=>tn,captureStackTrace:()=>po,cleanEnum:()=>Aw,cleanRegex:()=>ar,clone:()=>le,cloneDef:()=>fw,createTransparentProxy:()=>bw,defineLazy:()=>U,esc:()=>uo,escapeRegex:()=>Ce,explicitlyAborted:()=>ms,extend:()=>xw,finalizeIssue:()=>ue,floatSafeRemainder:()=>is,getElementAtPath:()=>hw,getEnumValues:()=>ir,getLengthableOrigin:()=>lr,getParsedType:()=>_w,getSizableOrigin:()=>cr,hexToUint8Array:()=>Pw,isObject:()=>It,isPlainObject:()=>lt,issue:()=>nn,joinValues:()=>y,jsonStringifyReplacer:()=>en,merge:()=>$w,mergeDefs:()=>He,normalizeParams:()=>x,nullish:()=>st,numKeys:()=>vw,objectClone:()=>mw,omit:()=>kw,optionalKeys:()=>us,parsedType:()=>w,partial:()=>Ew,pick:()=>ww,prefixIssues:()=>fe,primitiveTypes:()=>ls,promiseAllObject:()=>gw,propertyKeyTypes:()=>sr,randomString:()=>yw,required:()=>Tw,safeExtend:()=>Sw,shallowClone:()=>cs,slugify:()=>as,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>nf,uint8ArrayToBase64url:()=>Cw,uint8ArrayToHex:()=>Ow,unwrapMessage:()=>or});function cw(e){return e}function lw(e){return e}function uw(e){}function dw(e){throw new Error("Unexpected value in exhaustive check")}function pw(e){}function ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function y(e,t="|"){return e.map(r=>b(r)).join(t)}function en(e,t){return typeof t=="bigint"?t.toString():t}function tn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function st(e){return e==null}function ar(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function is(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var ef=Symbol("evaluating");function U(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==ef)return o===void 0&&(o=ef,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function mw(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ct(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function He(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function fw(e){return He(e._zod.def)}function hw(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function gw(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function yw(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function uo(e){return JSON.stringify(e)}function as(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var po="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ss=tn(()=>{if(At.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function lt(e){if(It(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(It(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function cs(e){return lt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function vw(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var _w=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},sr=new Set(["string","number","symbol"]),ls=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bw(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function b(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function us(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ds={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]},ps={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ww(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=He(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return ct(this,"shape",a),a},checks:[]});return le(e,i)}function kw(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=He(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return ct(this,"shape",a),a},checks:[]});return le(e,i)}function xw(e,t){if(!lt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=He(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return ct(this,"shape",i),i}});return le(e,n)}function Sw(e,t){if(!lt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=He(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return ct(this,"shape",o),o}});return le(e,r)}function $w(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=He(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return ct(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return le(e,r)}function Ew(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=He(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)c[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return ct(this,"shape",c),c},checks:[]});return le(t,a)}function Tw(e,t,r){let o=He(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return ct(this,"shape",i),i}});return le(t,o)}function ut(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ms(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function fe(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function or(e){return typeof e=="string"?e:e?.message}function ue(e,t,r){let o=e.message?e.message:or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(r.customError?.(e))??or(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function cr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function lr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function w(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function nn(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function Aw(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function tf(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function nf(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Iw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return tf(t+r)}function Cw(e){return nf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Pw(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function Ow(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var os=class{constructor(...t){}};var rf=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,en,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ur=g("$ZodError",rf),he=g("$ZodError",rf,{Parent:Error});function dr(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function pr(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,l=0;for(;l<s.length;){let p=s[l];l===s.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(a))):c[p]=c[p]||{_errors:[]},c=c[p],l++}}}};return o(e),r}function fs(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let l=[...i,...c.path];if(l.length===0){r.errors.push(t(c));continue}let p=r,d=0;for(;d<l.length;){let m=l[d],f=d===l.length-1;typeof m=="string"?(p.properties??(p.properties={}),(a=p.properties)[m]??(a[m]={errors:[]}),p=p.properties[m]):(p.items??(p.items=[]),(s=p.items)[m]??(s[m]={errors:[]}),p=p.items[m]),f&&p.errors.push(t(c)),d++}}};return o(e),r}function of(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function hs(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${of(o.path)}`);return t.join(`
7047
+ `)}var rn=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Oe;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>ue(c,i,J())));throw po(s,n?.callee),s}return a.value},mo=rn(he),on=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>ue(c,i,J())));throw po(s,n?.callee),s}return a.value},fo=on(he),an=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Oe;return i.issues.length?{success:!1,error:new(e??ur)(i.issues.map(a=>ue(a,n,J())))}:{success:!0,data:i.value}},gs=an(he),sn=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>ue(a,n,J())))}:{success:!0,data:i.value}},ys=sn(he),ho=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return rn(e)(t,r,n)},Rw=ho(he),go=e=>(t,r,o)=>rn(e)(t,r,o),jw=go(he),yo=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return on(e)(t,r,n)},Dw=yo(he),vo=e=>async(t,r,o)=>on(e)(t,r,o),Lw=vo(he),_o=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return an(e)(t,r,n)},zw=_o(he),bo=e=>(t,r,o)=>an(e)(t,r,o),Mw=bo(he),wo=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return sn(e)(t,r,n)},Uw=wo(he),ko=e=>async(t,r,o)=>sn(e)(t,r,o),Fw=ko(he);var xe={};Ke(xe,{base64:()=>Ns,base64url:()=>xo,bigint:()=>Us,boolean:()=>Gs,browserEmail:()=>Jw,cidrv4:()=>Ps,cidrv6:()=>Os,cuid:()=>vs,cuid2:()=>_s,date:()=>Ds,datetime:()=>zs,domain:()=>Xw,duration:()=>Ss,e164:()=>js,email:()=>Es,emoji:()=>Ts,extendedDuration:()=>Gw,guid:()=>$s,hex:()=>Qw,hostname:()=>qw,html5Email:()=>Vw,httpProtocol:()=>Rs,idnEmail:()=>Hw,integer:()=>Fs,ipv4:()=>As,ipv6:()=>Is,ksuid:()=>ks,lowercase:()=>Ks,mac:()=>Cs,md5_base64:()=>tk,md5_base64url:()=>nk,md5_hex:()=>ek,nanoid:()=>xs,null:()=>Zs,number:()=>So,rfc5322Email:()=>Ww,sha1_base64:()=>ok,sha1_base64url:()=>ik,sha1_hex:()=>rk,sha256_base64:()=>sk,sha256_base64url:()=>ck,sha256_hex:()=>ak,sha384_base64:()=>uk,sha384_base64url:()=>dk,sha384_hex:()=>lk,sha512_base64:()=>mk,sha512_base64url:()=>fk,sha512_hex:()=>pk,string:()=>Ms,time:()=>Ls,ulid:()=>bs,undefined:()=>Bs,unicodeEmail:()=>af,uppercase:()=>Vs,uuid:()=>Ct,uuid4:()=>Zw,uuid6:()=>Bw,uuid7:()=>Kw,xid:()=>ws});var vs=/^[cC][0-9a-z]{6,}$/,_s=/^[0-9a-z]+$/,bs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ws=/^[0-9a-vA-V]{20}$/,ks=/^[A-Za-z0-9]{27}$/,xs=/^[a-zA-Z0-9_-]{21}$/,Ss=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gw=/^[-+]?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)?)??$/,$s=/^([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})$/,Ct=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Zw=Ct(4),Bw=Ct(6),Kw=Ct(7),Es=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vw=/^[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])?)*$/,Ww=/^(([^<>()\[\]\\.,;:\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,}))$/,af=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Hw=af,Jw=/^[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])?)*$/,Yw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ts(){return new RegExp(Yw,"u")}var As=/^(?:(?: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])$/,Is=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Cs=e=>{let t=Ce(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ps=/^((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])$/,Os=/^(([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])$/,Ns=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xo=/^[A-Za-z0-9_-]*$/,qw=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Xw=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Rs=/^https?$/,js=/^\+[1-9]\d{6,14}$/,sf="(?:(?:\\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])))",Ds=new RegExp(`^${sf}$`);function cf(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ls(e){return new RegExp(`^${cf(e)}$`)}function zs(e){let t=cf({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${sf}T(?:${o})$`)}var Ms=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Us=/^-?\d+n?$/,Fs=/^-?\d+$/,So=/^-?\d+(?:\.\d+)?$/,Gs=/^(?:true|false)$/i,Zs=/^null$/i;var Bs=/^undefined$/i;var Ks=/^[^A-Z]*$/,Vs=/^[^a-z]*$/,Qw=/^[0-9a-fA-F]*$/;function mr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function fr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var ek=/^[0-9a-fA-F]{32}$/,tk=mr(22,"=="),nk=fr(22),rk=/^[0-9a-fA-F]{40}$/,ok=mr(27,"="),ik=fr(27),ak=/^[0-9a-fA-F]{64}$/,sk=mr(43,"="),ck=fr(43),lk=/^[0-9a-fA-F]{96}$/,uk=mr(64,""),dk=fr(64),pk=/^[0-9a-fA-F]{128}$/,mk=mr(86,"=="),fk=fr(86);var V=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),uf={number:"number",bigint:"bigint",object:"date"},$o=g("$ZodCheckLessThan",(e,t)=>{V.init(e,t);let r=uf[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Eo=g("$ZodCheckGreaterThan",(e,t)=>{V.init(e,t);let r=uf[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ws=g("$ZodCheckMultipleOf",(e,t)=>{V.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):is(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Hs=g("$ZodCheckNumberFormat",(e,t)=>{V.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=ds[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Fs)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Js=g("$ZodCheckBigIntFormat",(e,t)=>{V.init(e,t);let[r,o]=ps[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Ys=g("$ZodCheckMaxSize",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!st(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:cr(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qs=g("$ZodCheckMinSize",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!st(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:cr(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xs=g("$ZodCheckSizeEquals",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!st(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:cr(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Qs=g("$ZodCheckMaxLength",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!st(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=lr(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ec=g("$ZodCheckMinLength",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!st(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=lr(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tc=g("$ZodCheckLengthEquals",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!st(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=lr(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),cn=g("$ZodCheckStringFormat",(e,t)=>{var r,o;V.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),nc=g("$ZodCheckRegex",(e,t)=>{cn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rc=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ks),cn.init(e,t)}),oc=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Vs),cn.init(e,t)}),ic=g("$ZodCheckIncludes",(e,t)=>{V.init(e,t);let r=Ce(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ac=g("$ZodCheckStartsWith",(e,t)=>{V.init(e,t);let r=new RegExp(`^${Ce(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),sc=g("$ZodCheckEndsWith",(e,t)=>{V.init(e,t);let r=new RegExp(`.*${Ce(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function lf(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues))}var cc=g("$ZodCheckProperty",(e,t)=>{V.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>lf(n,r,t.property));lf(o,r,t.property)}}),lc=g("$ZodCheckMimeType",(e,t)=>{V.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),uc=g("$ZodCheckOverwrite",(e,t)=>{V.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var hr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
7267
7048
  `).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
7268
- `))}};var nc={major:4,minor:4,patch:3};var R=g("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nc;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,c)=>{let l=dt(a),d;for(let p of s){if(p._zod.def.when){if(os(a)||!p._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&c?.async===!1)throw new Ae;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(l||(l=dt(a,m)))});else{if(a.issues.length===m)continue;l||(l=dt(a,m))}}return d?d.then(()=>a):a},i=(a,s,c)=>{if(dt(a))return a.aborted=!0,a;let l=n(s,o,c);if(l instanceof Promise){if(c.async===!1)throw new Ae;return l.then(d=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,a,s)):i(l,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Ae;return c.then(l=>n(l,o,s))}return n(c,o,s)}}U(e,"~standard",()=>({validate:n=>{try{let i=ss(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return cs(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Nt=g("$ZodString",(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Cs(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),B=g("$ZodStringFormat",(e,t)=>{cn.init(e,t),Nt.init(e,t)}),oc=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gs),B.init(e,t)}),ic=g("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ot(o))}else t.pattern??(t.pattern=Ot());B.init(e,t)}),ac=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ys),B.init(e,t)}),sc=g("$ZodURL",(e,t)=>{B.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===$s.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),cc=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vs()),B.init(e,t)}),lc=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=fs),B.init(e,t)}),uc=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ls),B.init(e,t)}),dc=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=us),B.init(e,t)}),pc=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ds),B.init(e,t)}),mc=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ps),B.init(e,t)}),fc=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ms),B.init(e,t)}),hc=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Is(t)),B.init(e,t)}),gc=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ts),B.init(e,t)}),yc=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=As(t)),B.init(e,t)}),vc=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hs),B.init(e,t)}),_c=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_s),B.init(e,t),e._zod.bag.format="ipv4"}),bc=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=bs),B.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),wc=g("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=ws(t.delimiter)),B.init(e,t),e._zod.bag.format="mac"}),kc=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ks),B.init(e,t)}),xc=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=xs),B.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Sc(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var $c=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ss),B.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Sc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function hf(e){if(!vo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Sc(r)}var Ec=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=vo),B.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{hf(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Tc=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Es),B.init(e,t)});function gf(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Ac=g("$ZodJWT",(e,t)=>{B.init(e,t),e._zod.check=r=>{gf(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Ic=g("$ZodCustomStringFormat",(e,t)=>{B.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Eo=g("$ZodNumber",(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??_o,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Cc=g("$ZodNumberFormat",(e,t)=>{Ms.init(e,t),Eo.init(e,t)}),fr=g("$ZodBoolean",(e,t)=>{R.init(e,t),e._zod.pattern=Ns,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),To=g("$ZodBigInt",(e,t)=>{R.init(e,t),e._zod.pattern=Ps,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Pc=g("$ZodBigIntFormat",(e,t)=>{Us.init(e,t),To.init(e,t)}),Oc=g("$ZodSymbol",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Nc=g("$ZodUndefined",(e,t)=>{R.init(e,t),e._zod.pattern=js,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Rc=g("$ZodNull",(e,t)=>{R.init(e,t),e._zod.pattern=Rs,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),jc=g("$ZodAny",(e,t)=>{R.init(e,t),e._zod.parse=r=>r}),Dc=g("$ZodUnknown",(e,t)=>{R.init(e,t),e._zod.parse=r=>r}),Lc=g("$ZodNever",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),zc=g("$ZodVoid",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Mc=g("$ZodDate",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function ef(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues)),t.value[r]=e.value}var Uc=g("$ZodArray",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(l=>ef(l,r,a))):ef(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function $o(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...fe(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function yf(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=ts(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function vf(e,t,r,o,n,i){let a=[],s=n.keySet,c=n.catchall._zod,l=c.def.type,d=c.optin==="optional",p=c.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(l==="never"){a.push(m);continue}let f=c.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(h=>$o(h,r,m,t,d,p))):$o(f,r,m,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var _f=g("$ZodObject",(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=tn(()=>yf(t));U(e._zod,"propValues",()=>{let s=t.shape,c={};for(let l in s){let d=s[l]._zod;if(d.values){c[l]??(c[l]=new Set);for(let p of d.values)c[l].add(p)}}return c});let n=Pt,i=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=o.value);let l=s.value;if(!n(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let d=[],p=a.shape;for(let m of a.keys){let f=p[m],h=f._zod.optin==="optional",b=f._zod.optout==="optional",S=f._zod.run({value:l[m],issues:[]},c);S instanceof Promise?d.push(S.then(O=>$o(O,s,m,l,h,b))):$o(S,s,m,l,h,b)}return i?vf(d,l,s,c,o.value,e):d.length?Promise.all(d).then(()=>s):s}}),Fc=g("$ZodObjectJIT",(e,t)=>{_f.init(e,t);let r=e._zod.parse,o=tn(()=>yf(t)),n=m=>{let f=new mr(["shape","payload","ctx"]),h=o.value,b=te=>{let G=io(te);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};f.write("const input = payload.value;");let S=Object.create(null),O=0;for(let te of h.keys)S[te]=`key_${O++}`;f.write("const newResult = {};");for(let te of h.keys){let G=S[te],N=io(te),q=m[te],Et=q?._zod?.optin==="optional",ot=q?._zod?.optout==="optional";f.write(`const ${G} = ${b(te)};`),Et&&ot?f.write(`
7049
+ `))}};var dc={major:4,minor:4,patch:3};var L=g("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dc;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,c)=>{let l=ut(a),p;for(let d of s){if(d._zod.def.when){if(ms(a)||!d._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,f=d._zod.check(a);if(f instanceof Promise&&c?.async===!1)throw new Oe;if(p||f instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(l||(l=ut(a,m)))});else{if(a.issues.length===m)continue;l||(l=ut(a,m))}}return p?p.then(()=>a):a},i=(a,s,c)=>{if(ut(a))return a.aborted=!0,a;let l=n(s,o,c);if(l instanceof Promise){if(c.async===!1)throw new Oe;return l.then(p=>e._zod.parse(p,c))}return e._zod.parse(l,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(p=>i(p,a,s)):i(l,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Oe;return c.then(l=>n(l,o,s))}return n(c,o,s)}}U(e,"~standard",()=>({validate:n=>{try{let i=gs(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ys(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Pt=g("$ZodString",(e,t)=>{L.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ms(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),B=g("$ZodStringFormat",(e,t)=>{cn.init(e,t),Pt.init(e,t)}),mc=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$s),B.init(e,t)}),fc=g("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ct(o))}else t.pattern??(t.pattern=Ct());B.init(e,t)}),hc=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Es),B.init(e,t)}),gc=g("$ZodURL",(e,t)=>{B.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Rs.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),yc=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ts()),B.init(e,t)}),vc=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xs),B.init(e,t)}),_c=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vs),B.init(e,t)}),bc=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=_s),B.init(e,t)}),wc=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bs),B.init(e,t)}),kc=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ws),B.init(e,t)}),xc=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ks),B.init(e,t)}),Sc=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=zs(t)),B.init(e,t)}),$c=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ds),B.init(e,t)}),Ec=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ls(t)),B.init(e,t)}),Tc=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ss),B.init(e,t)}),Ac=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=As),B.init(e,t),e._zod.bag.format="ipv4"}),Ic=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Is),B.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Cc=g("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Cs(t.delimiter)),B.init(e,t),e._zod.bag.format="mac"}),Pc=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ps),B.init(e,t)}),Oc=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Os),B.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Nc(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Rc=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ns),B.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Nc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ef(e){if(!xo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Nc(r)}var jc=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=xo),B.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ef(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Dc=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=js),B.init(e,t)});function Tf(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Lc=g("$ZodJWT",(e,t)=>{B.init(e,t),e._zod.check=r=>{Tf(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),zc=g("$ZodCustomStringFormat",(e,t)=>{B.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Po=g("$ZodNumber",(e,t)=>{L.init(e,t),e._zod.pattern=e._zod.bag.pattern??So,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Mc=g("$ZodNumberFormat",(e,t)=>{Hs.init(e,t),Po.init(e,t)}),gr=g("$ZodBoolean",(e,t)=>{L.init(e,t),e._zod.pattern=Gs,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Oo=g("$ZodBigInt",(e,t)=>{L.init(e,t),e._zod.pattern=Us,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Uc=g("$ZodBigIntFormat",(e,t)=>{Js.init(e,t),Oo.init(e,t)}),Fc=g("$ZodSymbol",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Gc=g("$ZodUndefined",(e,t)=>{L.init(e,t),e._zod.pattern=Bs,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Zc=g("$ZodNull",(e,t)=>{L.init(e,t),e._zod.pattern=Zs,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Bc=g("$ZodAny",(e,t)=>{L.init(e,t),e._zod.parse=r=>r}),Kc=g("$ZodUnknown",(e,t)=>{L.init(e,t),e._zod.parse=r=>r}),Vc=g("$ZodNever",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Wc=g("$ZodVoid",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Hc=g("$ZodDate",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function pf(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues)),t.value[r]=e.value}var Jc=g("$ZodArray",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(l=>pf(l,r,a))):pf(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Co(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...fe(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function Af(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=us(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function If(e,t,r,o,n,i){let a=[],s=n.keySet,c=n.catchall._zod,l=c.def.type,p=c.optin==="optional",d=c.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(l==="never"){a.push(m);continue}let f=c.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(h=>Co(h,r,m,t,p,d))):Co(f,r,m,t,p,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var Cf=g("$ZodObject",(e,t)=>{if(L.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=tn(()=>Af(t));U(e._zod,"propValues",()=>{let s=t.shape,c={};for(let l in s){let p=s[l]._zod;if(p.values){c[l]??(c[l]=new Set);for(let d of p.values)c[l].add(d)}}return c});let n=It,i=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=o.value);let l=s.value;if(!n(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let p=[],d=a.shape;for(let m of a.keys){let f=d[m],h=f._zod.optin==="optional",_=f._zod.optout==="optional",S=f._zod.run({value:l[m],issues:[]},c);S instanceof Promise?p.push(S.then(O=>Co(O,s,m,l,h,_))):Co(S,s,m,l,h,_)}return i?If(p,l,s,c,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),Yc=g("$ZodObjectJIT",(e,t)=>{Cf.init(e,t);let r=e._zod.parse,o=tn(()=>Af(t)),n=m=>{let f=new hr(["shape","payload","ctx"]),h=o.value,_=ne=>{let G=uo(ne);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};f.write("const input = payload.value;");let S=Object.create(null),O=0;for(let ne of h.keys)S[ne]=`key_${O++}`;f.write("const newResult = {};");for(let ne of h.keys){let G=S[ne],N=uo(ne),Y=m[ne],$t=Y?._zod?.optin==="optional",ot=Y?._zod?.optout==="optional";f.write(`const ${G} = ${_(ne)};`),$t&&ot?f.write(`
7269
7050
  if (${G}.issues.length) {
7270
7051
  if (${N} in input) {
7271
7052
  payload.issues = payload.issues.concat(${G}.issues.map(iss => ({
@@ -7283,7 +7064,7 @@ main().catch((error) => {
7283
7064
  newResult[${N}] = ${G}.value;
7284
7065
  }
7285
7066
 
7286
- `):Et?f.write(`
7067
+ `):$t?f.write(`
7287
7068
  if (${G}.issues.length) {
7288
7069
  payload.issues = payload.issues.concat(${G}.issues.map(iss => ({
7289
7070
  ...iss,
@@ -7324,55 +7105,55 @@ main().catch((error) => {
7324
7105
  }
7325
7106
  }
7326
7107
 
7327
- `)}f.write("payload.value = newResult;"),f.write("return payload;");let j=f.compile();return(te,G)=>j(m,te,G)},i,a=Pt,s=!Ct.jitless,l=s&&Xa.value,d=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=o.value);let h=m.value;return a(h)?s&&l&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),m=i(m,f),d?vf([],h,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m)}});function tf(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!dt(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>le(a,o,J())))}),t)}var hr=g("$ZodUnion",(e,t)=>{R.init(e,t),U(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),U(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),U(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),U(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>or(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(s=>tf(s,o,e,n)):tf(a,o,e,n)}});function nf(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>le(a,o,J())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Gc=g("$ZodXor",(e,t)=>{hr.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);c instanceof Promise?(a.push(c),i=!0):a.push(c)}return i?Promise.all(a).then(s=>nf(s,o,e,n)):nf(a,o,e,n)}}),Zc=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.init(e,t);let r=e._zod.parse;U(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of c)n[s].add(l)}}return n});let o=tn(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Pt(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),Bc=g("$ZodIntersection",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,l])=>rf(r,c,l)):rf(r,i,a)}});function rc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ut(e)&&ut(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=rc(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=rc(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function rf(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),dt(e))return e;let a=rc(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var Ao=g("$ZodTuple",(e,t)=>{R.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=of(r,"optin"),c=of(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let l=new Array(r.length);for(let d=0;d<r.length;d++){let p=r[d]._zod.run({value:i[d],issues:[]},n);p instanceof Promise?a.push(p.then(m=>{l[d]=m})):l[d]=p}if(t.rest){let d=r.length-1,p=i.slice(r.length);for(let m of p){d++;let f=t.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?a.push(f.then(h=>af(h,o,d))):af(f,o,d)}}return a.length?Promise.all(a).then(()=>sf(l,o,r,i,c)):sf(l,o,r,i,c)}});function of(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function af(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues)),t.value[r]=e.value}function sf(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...fe(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var Kc=g("$ZodRecord",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!ut(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);let d=t.keyType._zod.run({value:l,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>le(f,o,J())),input:l,path:[l],inst:e});continue}let p=d.value,m=t.valueType._zod.run({value:n[l],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&r.issues.push(...fe(l,f.issues)),r.value[p]=f.value})):(m.issues.length&&r.issues.push(...fe(l,m.issues)),r.value[p]=m.value)}let c;for(let l in n)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&_o.test(s)&&c.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>le(p,o,J())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:n[s],issues:[]},o);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&r.issues.push(...fe(s,p.issues)),r.value[c.value]=p.value})):(d.issues.length&&r.issues.push(...fe(s,d.issues)),r.value[c.value]=d.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Vc=g("$ZodMap",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let c=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise||l instanceof Promise?i.push(Promise.all([c,l]).then(([d,p])=>{cf(d,p,r,a,n,e,o)})):cf(c,l,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function cf(e,t,r,o,n,i,a){e.issues.length&&(ir.has(typeof o)?r.issues.push(...fe(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>le(s,a,J()))})),t.issues.length&&(ir.has(typeof o)?r.issues.push(...fe(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>le(s,a,J()))})),r.value.set(e.value,t.value)}var Wc=g("$ZodSet",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(c=>lf(c,r))):lf(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function lf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Hc=g("$ZodEnum",(e,t)=>{R.init(e,t);let r=rr(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>ir.has(typeof n)).map(n=>typeof n=="string"?Ee(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Jc=g("$ZodLiteral",(e,t)=>{if(R.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ee(o):o?Ee(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),qc=g("$ZodFile",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Yc=g("$ZodTransform",(e,t)=>{R.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new st(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Ae;return r.value=n,r.fallback=!0,r}});function uf(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Io=g("$ZodOptional",(e,t)=>{R.init(e,t),e._zod.optin="optional",e._zod.optout="optional",U(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),U(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${or(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>uf(a,n)):uf(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Xc=g("$ZodExactOptional",(e,t)=>{Io.init(e,t),U(e._zod,"values",()=>t.innerType._zod.values),U(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Qc=g("$ZodNullable",(e,t)=>{R.init(e,t),U(e._zod,"optin",()=>t.innerType._zod.optin),U(e._zod,"optout",()=>t.innerType._zod.optout),U(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${or(r.source)}|null)$`):void 0}),U(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),el=g("$ZodDefault",(e,t)=>{R.init(e,t),e._zod.optin="optional",U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>df(i,t)):df(n,t)}});function df(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var tl=g("$ZodPrefault",(e,t)=>{R.init(e,t),e._zod.optin="optional",U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),nl=g("$ZodNonOptional",(e,t)=>{R.init(e,t),U(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>pf(i,e)):pf(n,e)}});function pf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var rl=g("$ZodSuccess",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new st("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),ol=g("$ZodCatch",(e,t)=>{R.init(e,t),e._zod.optin="optional",U(e._zod,"optout",()=>t.innerType._zod.optout),U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>le(a,o,J()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>le(i,o,J()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),il=g("$ZodNaN",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Co=g("$ZodPipe",(e,t)=>{R.init(e,t),U(e._zod,"values",()=>t.in._zod.values),U(e._zod,"optin",()=>t.in._zod.optin),U(e._zod,"optout",()=>t.out._zod.optout),U(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>ko(a,t.in,o)):ko(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>ko(i,t.out,o)):ko(n,t.out,o)}});function ko(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var gr=g("$ZodCodec",(e,t)=>{R.init(e,t),U(e._zod,"values",()=>t.in._zod.values),U(e._zod,"optin",()=>t.in._zod.optin),U(e._zod,"optout",()=>t.out._zod.optout),U(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>xo(a,t,o)):xo(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>xo(a,t,o)):xo(i,t,o)}}});function xo(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>So(e,i,t.out,r)):So(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>So(e,i,t.in,r)):So(e,n,t.in,r)}}function So(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var al=g("$ZodPreprocess",(e,t)=>{Co.init(e,t)}),sl=g("$ZodReadonly",(e,t)=>{R.init(e,t),U(e._zod,"propValues",()=>t.innerType._zod.propValues),U(e._zod,"values",()=>t.innerType._zod.values),U(e._zod,"optin",()=>t.innerType?._zod?.optin),U(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(mf):mf(n)}});function mf(e){return e.value=Object.freeze(e.value),e}var cl=g("$ZodTemplateLiteral",(e,t)=>{R.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||es.has(typeof o))r.push(Ee(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),ll=g("$ZodFunction",(e,t)=>(R.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?so(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?so(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await co(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await co(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Ao({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),ul=g("$ZodPromise",(e,t)=>{R.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),dl=g("$ZodLazy",(e,t)=>{R.init(e,t),U(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),U(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),U(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),U(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),U(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),pl=g("$ZodCustom",(e,t)=>{V.init(e,t),R.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>ff(i,r,o,e));ff(n,r,o,e)}});function ff(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(nn(n))}}var vr={};Ke(vr,{ar:()=>bf,az:()=>wf,be:()=>xf,bg:()=>Sf,ca:()=>$f,cs:()=>Ef,da:()=>Tf,de:()=>Af,el:()=>If,en:()=>Po,eo:()=>Cf,es:()=>Pf,fa:()=>Of,fi:()=>Nf,fr:()=>Rf,frCA:()=>jf,he:()=>Df,hr:()=>Lf,hu:()=>zf,hy:()=>Uf,id:()=>Ff,is:()=>Gf,it:()=>Zf,ja:()=>Bf,ka:()=>Kf,kh:()=>Vf,km:()=>Oo,ko:()=>Wf,lt:()=>Jf,mk:()=>qf,ms:()=>Yf,nl:()=>Xf,no:()=>Qf,ota:()=>eh,pl:()=>nh,ps:()=>th,pt:()=>rh,ro:()=>oh,ru:()=>ah,sl:()=>sh,sv:()=>ch,ta:()=>lh,th:()=>uh,tr:()=>dh,ua:()=>ph,uk:()=>No,ur:()=>mh,uz:()=>fh,vi:()=>hh,yo:()=>vh,zhCN:()=>gh,zhTW:()=>yh});var Vw=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\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 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.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 ${_(n.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: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${n.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${y(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.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 ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function bf(){return{localeError:Vw()}}var Ww=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${_(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function wf(){return{localeError:Ww()}}function kf(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var Hw=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.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 ${_(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=kf(s,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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${c}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=kf(s,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 ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function xf(){return{localeError:Hw()}}var Jw=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${_(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function Sf(){return{localeError:Jw()}}var qw=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${_(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${y(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function $f(){return{localeError:qw()}}var Yw=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${_(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${y(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Ef(){return{localeError:Yw()}}var Xw=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${_(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function Tf(){return{localeError:Xw()}}var Qw=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${_(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function Af(){return{localeError:Qw()}}var ek=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${_(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function If(){return{localeError:ek()}}var tk=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${_(n.values[0])}`:`Invalid option: expected one of ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Po(){return{localeError:tk()}}var nk=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${_(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function Cf(){return{localeError:nk()}}var rk=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${_(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function Pf(){return{localeError:rk()}}var ok=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${_(n.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 ${y(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.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 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${y(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.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 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Of(){return{localeError:ok()}}var ik=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${_(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${y(n.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 Nf(){return{localeError:ik()}}var ak=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={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"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${_(n.values[0])} attendu`:`Option invalide : une valeur parmi ${y(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${y(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function Rf(){return{localeError:ak()}}var sk=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${_(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${y(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function jf(){return{localeError:sk()}}var ck=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?e[l]:void 0,o=l=>{let d=r(l);return d?d.label:l??e.unknown.label},n=l=>`\u05D4${o(l)}`,i=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=l=>l?t[l]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let d=l.expected,p=c[d??""]??o(d),m=w(l.input),f=c[m]??e[m]?.label??m;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${_(l.values[0])}`;let d=l.values.map(f=>_(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=a(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${d?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",b=l.inclusive?`${l.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let m=l.inclusive?"<=":"<",f=i(l.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${l.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${l.maximum.toString()}`}case"too_small":{let d=a(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${d?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let S=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let b=l.inclusive?`${l.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let m=l.inclusive?">=":">",f=i(l.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${l.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${l.minimum.toString()}`}case"invalid_format":{let d=l;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=s[d.format],m=p?.label??d.format,h=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${h}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${y(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Df(){return{localeError:ck()}}var lk=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${_(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${y(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function Lf(){return{localeError:lk()}}var uk=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${_(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function zf(){return{localeError:uk()}}function Mf(e,t,r){return Math.abs(e)===1?t:r}function ln(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var dk=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${_(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=Mf(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=Mf(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${y(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ln(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${ln(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Uf(){return{localeError:dk()}}var pk=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${_(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function Ff(){return{localeError:pk()}}var mk=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${_(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${y(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function Gf(){return{localeError:mk()}}var fk=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${_(n.values[0])}`:`Opzione non valida: atteso uno tra ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${y(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function Zf(){return{localeError:fk()}}var hk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${_(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${y(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.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${n.keys.length>1?"\u7FA4":""}: ${y(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Bf(){return{localeError:hk()}}var gk=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${_(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${y(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Kf(){return{localeError:gk()}}var yk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\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 ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.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 ${_(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${y(n.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 ${n.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 ${n.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 Oo(){return{localeError:yk()}}function Vf(){return Oo()}var vk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${_(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${y(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${y(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Wf(){return{localeError:vk()}}var yr=e=>e.charAt(0).toUpperCase()+e.slice(1);function Hf(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var _k=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let c=e[n]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${_(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${y(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,Hf(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${yr(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${yr(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,Hf(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${yr(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${yr(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${y(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${yr(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Jf(){return{localeError:_k()}}var bk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${_(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`Invalid ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`${n.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"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.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 ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function qf(){return{localeError:bk()}}var wk=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${_(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${y(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Yf(){return{localeError:wk()}}var kk=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${_(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function Xf(){return{localeError:kk()}}var xk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${_(n.values[0])}`:`Ugyldig valg: forventet en av ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Qf(){return{localeError:xk()}}var Sk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${_(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function eh(){return{localeError:Sk()}}var $k=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${_(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${y(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.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 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function th(){return{localeError:$k()}}var Ek=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${_(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function nh(){return{localeError:Ek()}}var Tk=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${_(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function rh(){return{localeError:Tk()}}var Ak=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${_(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${y(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function oh(){return{localeError:Ak()}}function ih(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var Ik=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${_(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=ih(s,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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${c}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=ih(s,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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${c}`}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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.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 ah(){return{localeError:Ik()}}var Ck=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${_(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${y(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function sh(){return{localeError:Ck()}}var Pk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${_(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function ch(){return{localeError:Pk()}}var Ok=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\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 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.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 ${_(n.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 ${y(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.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 ${n.origin} ${i}${n.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 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.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 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.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${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.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`${n.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 lh(){return{localeError:Ok()}}var Nk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\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 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${_(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.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 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.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 ${n.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: ${y(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.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 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function uh(){return{localeError:Nk()}}var Rk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${_(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function dh(){return{localeError:Rk()}}var jk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\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 ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.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 ${_(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.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 ${n.origin} ${a.verb} ${i}${n.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 ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.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 No(){return{localeError:jk()}}function ph(){return No()}var Dk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${_(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${y(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.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: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.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${n.keys.length>1?"\u0632":""}: ${y(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function mh(){return{localeError:Dk()}}var Lk=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${_(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function fh(){return{localeError:Lk()}}var zk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${_(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${y(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.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 ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function hh(){return{localeError:zk()}}var Mk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${_(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function gh(){return{localeError:Mk()}}var Uk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${_(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${y(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function yh(){return{localeError:Uk()}}var Fk=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${_(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${y(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function vh(){return{localeError:Fk()}}var _h,ml=Symbol("ZodOutput"),fl=Symbol("ZodInput"),Ro=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function jo(){return new Ro}(_h=globalThis).__zod_globalRegistry??(_h.__zod_globalRegistry=jo());var ne=globalThis.__zod_globalRegistry;function hl(e,t){return new e({type:"string",...x(t)})}function gl(e,t){return new e({type:"string",coerce:!0,...x(t)})}function Do(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...x(t)})}function _r(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...x(t)})}function Lo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...x(t)})}function zo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(t)})}function Mo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(t)})}function Uo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(t)})}function br(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...x(t)})}function Fo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...x(t)})}function Go(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(t)})}function Zo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...x(t)})}function Bo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(t)})}function Ko(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...x(t)})}function Vo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...x(t)})}function Wo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(t)})}function Ho(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(t)})}function Jo(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(t)})}function yl(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...x(t)})}function qo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(t)})}function Yo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(t)})}function Xo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...x(t)})}function Qo(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...x(t)})}function ei(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...x(t)})}function ti(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...x(t)})}var vl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function _l(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(t)})}function bl(e,t){return new e({type:"string",format:"date",check:"string_format",...x(t)})}function wl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...x(t)})}function kl(e,t){return new e({type:"string",format:"duration",check:"string_format",...x(t)})}function xl(e,t){return new e({type:"number",checks:[],...x(t)})}function Sl(e,t){return new e({type:"number",coerce:!0,checks:[],...x(t)})}function $l(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...x(t)})}function El(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...x(t)})}function Tl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...x(t)})}function Al(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...x(t)})}function Il(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...x(t)})}function Cl(e,t){return new e({type:"boolean",...x(t)})}function Pl(e,t){return new e({type:"boolean",coerce:!0,...x(t)})}function Ol(e,t){return new e({type:"bigint",...x(t)})}function Nl(e,t){return new e({type:"bigint",coerce:!0,...x(t)})}function Rl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...x(t)})}function jl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...x(t)})}function Dl(e,t){return new e({type:"symbol",...x(t)})}function Ll(e,t){return new e({type:"undefined",...x(t)})}function zl(e,t){return new e({type:"null",...x(t)})}function Ml(e){return new e({type:"any"})}function Ul(e){return new e({type:"unknown"})}function Fl(e,t){return new e({type:"never",...x(t)})}function Gl(e,t){return new e({type:"void",...x(t)})}function Zl(e,t){return new e({type:"date",...x(t)})}function Bl(e,t){return new e({type:"date",coerce:!0,...x(t)})}function Kl(e,t){return new e({type:"nan",...x(t)})}function De(e,t){return new bo({check:"less_than",...x(t),value:e,inclusive:!1})}function xe(e,t){return new bo({check:"less_than",...x(t),value:e,inclusive:!0})}function Le(e,t){return new wo({check:"greater_than",...x(t),value:e,inclusive:!1})}function ue(e,t){return new wo({check:"greater_than",...x(t),value:e,inclusive:!0})}function ni(e){return Le(0,e)}function ri(e){return De(0,e)}function oi(e){return xe(0,e)}function ii(e){return ue(0,e)}function pt(e,t){return new zs({check:"multiple_of",...x(t),value:e})}function mt(e,t){return new Fs({check:"max_size",...x(t),maximum:e})}function ze(e,t){return new Gs({check:"min_size",...x(t),minimum:e})}function Rt(e,t){return new Zs({check:"size_equals",...x(t),size:e})}function jt(e,t){return new Bs({check:"max_length",...x(t),maximum:e})}function Je(e,t){return new Ks({check:"min_length",...x(t),minimum:e})}function Dt(e,t){return new Vs({check:"length_equals",...x(t),length:e})}function un(e,t){return new Ws({check:"string_format",format:"regex",...x(t),pattern:e})}function dn(e){return new Hs({check:"string_format",format:"lowercase",...x(e)})}function pn(e){return new Js({check:"string_format",format:"uppercase",...x(e)})}function mn(e,t){return new qs({check:"string_format",format:"includes",...x(t),includes:e})}function fn(e,t){return new Ys({check:"string_format",format:"starts_with",...x(t),prefix:e})}function hn(e,t){return new Xs({check:"string_format",format:"ends_with",...x(t),suffix:e})}function ai(e,t,r){return new Qs({check:"property",property:e,schema:t,...x(r)})}function gn(e,t){return new ec({check:"mime_type",mime:e,...x(t)})}function Ie(e){return new tc({check:"overwrite",tx:e})}function yn(e){return Ie(t=>t.normalize(e))}function vn(){return Ie(e=>e.trim())}function _n(){return Ie(e=>e.toLowerCase())}function bn(){return Ie(e=>e.toUpperCase())}function wn(){return Ie(e=>Ya(e))}function Vl(e,t,r){return new e({type:"array",element:t,...x(r)})}function Zk(e,t,r){return new e({type:"union",options:t,...x(r)})}function Bk(e,t,r){return new e({type:"union",options:t,inclusive:!1,...x(r)})}function Kk(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...x(o)})}function Vk(e,t,r){return new e({type:"intersection",left:t,right:r})}function Wk(e,t,r,o){let n=r instanceof R,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...x(i)})}function Hk(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...x(o)})}function Jk(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...x(o)})}function qk(e,t,r){return new e({type:"set",valueType:t,...x(r)})}function Yk(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...x(r)})}function Xk(e,t,r){return new e({type:"enum",entries:t,...x(r)})}function Qk(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...x(r)})}function Wl(e,t){return new e({type:"file",...x(t)})}function ex(e,t){return new e({type:"transform",transform:t})}function tx(e,t){return new e({type:"optional",innerType:t})}function nx(e,t){return new e({type:"nullable",innerType:t})}function rx(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Qa(r)}})}function ox(e,t,r){return new e({type:"nonoptional",innerType:t,...x(r)})}function ix(e,t){return new e({type:"success",innerType:t})}function ax(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function sx(e,t,r){return new e({type:"pipe",in:t,out:r})}function cx(e,t){return new e({type:"readonly",innerType:t})}function lx(e,t,r){return new e({type:"template_literal",parts:t,...x(r)})}function ux(e,t){return new e({type:"lazy",getter:t})}function dx(e,t){return new e({type:"promise",innerType:t})}function Hl(e,t,r){let o=x(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Jl(e,t,r){return new e({type:"custom",check:"custom",fn:t,...x(r)})}function ql(e,t){let r=bh(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(nn(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(nn(i))}},e(o.value,o)),t);return r}function bh(e,t){let r=new V({check:"custom",...x(t)});return r._zod.check=e,r}function Yl(e){let t=new V({check:"describe"});return t._zod.onattach=[r=>{let o=ne.get(r)??{};ne.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Xl(e){let t=new V({check:"meta"});return t._zod.onattach=[r=>{let o=ne.get(r)??{};ne.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Ql(e,t){let r=x(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(n),s=e.Codec??gr,c=e.Boolean??fr,l=e.String??Nt,d=new l({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),m=new s({type:"pipe",in:d,out:p,transform:((f,h)=>{let b=f;return r.case!=="sensitive"&&(b=b.toLowerCase()),i.has(b)?!0:a.has(b)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:h.value,inst:m,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function kn(e,t,r,o={}){let n=x(o),i={...x(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function ft(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ne,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Z(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let m=a.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),Z(p,t,d),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&de(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function ht(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=o.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(h=>h);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let l=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+d}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);let d=s.schema;for(let p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
7328
-
7329
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function gt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,d={...l},p=c.ref;if(c.ref=null,p){o(p);let f=e.seen.get(p),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,d),s._zod.parent===p)for(let S in l)S==="$ref"||S==="allOf"||S in d||delete l[S];if(h.$ref&&f.def)for(let S in l)S==="$ref"||S==="allOf"||S in f.def&&JSON.stringify(l[S])===JSON.stringify(f.def[S])&&delete l[S]}let m=s._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:xn(t,"input",e.processors),output:xn(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function de(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return de(o.element,r);if(o.type==="set")return de(o.valueType,r);if(o.type==="lazy")return de(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return de(o.innerType,r);if(o.type==="intersection")return de(o.left,r)||de(o.right,r);if(o.type==="record"||o.type==="map")return de(o.keyType,r)||de(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:de(o.in,r)||de(o.out,r);if(o.type==="object"){for(let n in o.shape)if(de(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(de(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(de(n,r))return!0;return!!(o.rest&&de(o.rest,r))}return!1}var eu=(e,t={})=>r=>{let o=ft({...r,processors:t});return Z(e,o),ht(o,e),gt(o,e)},xn=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=ft({...n??{},target:i,io:t,processors:r});return Z(e,a),ht(a,e),gt(a,e)};var px={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tu=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=px[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let d=[...c];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},nu=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";p?f?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof a=="number"&&(n.maximum=a),typeof c=="number"&&(n.multipleOf=c)},ru=(e,t,r,o)=>{r.type="boolean"},ou=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},iu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},au=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},su=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},cu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},lu=(e,t,r,o)=>{r.not={}},uu=(e,t,r,o)=>{},du=(e,t,r,o)=>{},pu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},mu=(e,t,r,o)=>{let n=e._zod.def,i=rr(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},fu=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},hu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},gu=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},yu=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),c?c.length===1?(i.contentMediaType=c[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,i)},vu=(e,t,r,o)=>{r.type="boolean"},_u=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},wu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ku=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},xu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Su=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=Z(i.element,t,{...o,path:[...o.path,"items"]})},$u=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let l in a)n.properties[l]=Z(a[l],t,{...o,path:[...o.path,"properties",l]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(l=>{let d=i.shape[l]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(n.required=Array.from(c)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=Z(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ci=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,c)=>Z(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},Eu=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=Z(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},Tu=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((m,f)=>Z(m,t,{...o,path:[...o.path,a,f]})),l=i.rest?Z(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},Au=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,c=a._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let d=Z(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of c)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Z(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=Z(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let l=a._zod.values;if(l){let d=[...l].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},Iu=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Cu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Pu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Ou=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Nu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Ru=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;Z(a,t,o);let s=t.seen.get(e);s.ref=a},ju=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Du=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},li=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Lu=(e,t,r,o)=>{let n=e._zod.innerType;Z(n,t,o);let i=t.seen.get(e);i.ref=n},si={string:tu,number:nu,boolean:ru,bigint:ou,symbol:iu,null:au,undefined:su,void:cu,never:lu,any:uu,unknown:du,date:pu,enum:mu,literal:fu,nan:hu,template_literal:gu,file:yu,success:vu,custom:_u,function:bu,transform:wu,map:ku,set:xu,array:Su,object:$u,union:ci,intersection:Eu,tuple:Tu,record:Au,nullable:Iu,nonoptional:Cu,default:Pu,prefault:Ou,catch:Nu,pipe:Ru,readonly:ju,promise:Du,optional:li,lazy:Lu};function ui(e,t){if("_idmap"in e){let o=e,n=ft({...t,processors:si}),i={};for(let c of o._idmap.entries()){let[l,d]=c;Z(d,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let c of o._idmap.entries()){let[l,d]=c;ht(n,d),a[l]=gt(n,d)}if(Object.keys(i).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}let r=ft({...t,processors:si});return Z(e,r),ht(r,e),gt(r,e)}var di=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=ft({processors:si,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Z(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),ht(this.ctx,t);let o=gt(this.ctx,t),{"~standard":n,...i}=o;return i}};var wh={};var wr={};Ke(wr,{ZodAny:()=>sd,ZodArray:()=>dd,ZodBase64:()=>Oi,ZodBase64URL:()=>Ni,ZodBigInt:()=>Pn,ZodBigIntFormat:()=>Di,ZodBoolean:()=>Cn,ZodCIDRv4:()=>Ci,ZodCIDRv6:()=>Pi,ZodCUID:()=>xi,ZodCUID2:()=>Si,ZodCatch:()=>Nd,ZodCodec:()=>Nr,ZodCustom:()=>Rr,ZodCustomStringFormat:()=>An,ZodDate:()=>Ar,ZodDefault:()=>Td,ZodDiscriminatedUnion:()=>md,ZodE164:()=>Ri,ZodEmail:()=>bi,ZodEmoji:()=>wi,ZodEnum:()=>En,ZodExactOptional:()=>Sd,ZodFile:()=>kd,ZodFunction:()=>Zd,ZodGUID:()=>xr,ZodIPv4:()=>Ai,ZodIPv6:()=>Ii,ZodIntersection:()=>fd,ZodJWT:()=>ji,ZodKSUID:()=>Ti,ZodLazy:()=>Ud,ZodLiteral:()=>wd,ZodMAC:()=>ed,ZodMap:()=>_d,ZodNaN:()=>jd,ZodNanoID:()=>ki,ZodNever:()=>ld,ZodNonOptional:()=>Gi,ZodNull:()=>id,ZodNullable:()=>Ed,ZodNumber:()=>In,ZodNumberFormat:()=>zt,ZodObject:()=>Cr,ZodOptional:()=>Fi,ZodPipe:()=>Or,ZodPrefault:()=>Id,ZodPreprocess:()=>Dd,ZodPromise:()=>Gd,ZodReadonly:()=>Ld,ZodRecord:()=>$n,ZodSet:()=>bd,ZodString:()=>Tn,ZodStringFormat:()=>K,ZodSuccess:()=>Od,ZodSymbol:()=>rd,ZodTemplateLiteral:()=>Md,ZodTransform:()=>xd,ZodTuple:()=>gd,ZodType:()=>z,ZodULID:()=>$i,ZodURL:()=>Tr,ZodUUID:()=>Me,ZodUndefined:()=>od,ZodUnion:()=>Pr,ZodUnknown:()=>cd,ZodVoid:()=>ud,ZodXID:()=>Ei,ZodXor:()=>pd,_ZodString:()=>_i,_default:()=>Ad,_function:()=>Cg,any:()=>sg,array:()=>Ir,base64:()=>Bh,base64url:()=>Kh,bigint:()=>ng,boolean:()=>nd,catch:()=>Rd,check:()=>Pg,cidrv4:()=>Gh,cidrv6:()=>Zh,codec:()=>Eg,cuid:()=>Rh,cuid2:()=>jh,custom:()=>Og,date:()=>lg,describe:()=>Ng,discriminatedUnion:()=>hg,e164:()=>Vh,email:()=>Sh,emoji:()=>Oh,enum:()=>Mi,exactOptional:()=>$d,file:()=>kg,float32:()=>Xh,float64:()=>Qh,function:()=>Cg,guid:()=>$h,hash:()=>Yh,hex:()=>qh,hostname:()=>Jh,httpUrl:()=>Ph,instanceof:()=>jg,int:()=>yi,int32:()=>eg,int64:()=>rg,intersection:()=>hd,invertCodec:()=>Tg,ipv4:()=>Mh,ipv6:()=>Fh,json:()=>Lg,jwt:()=>Wh,keyof:()=>ug,ksuid:()=>zh,lazy:()=>Fd,literal:()=>wg,looseObject:()=>mg,looseRecord:()=>yg,mac:()=>Uh,map:()=>vg,meta:()=>Rg,nan:()=>$g,nanoid:()=>Nh,nativeEnum:()=>bg,never:()=>Li,nonoptional:()=>Pd,null:()=>ad,nullable:()=>$r,nullish:()=>xg,number:()=>td,object:()=>dg,optional:()=>Sr,partialRecord:()=>gg,pipe:()=>vi,prefault:()=>Cd,preprocess:()=>zg,promise:()=>Ig,readonly:()=>zd,record:()=>vd,refine:()=>Bd,set:()=>_g,strictObject:()=>pg,string:()=>kr,stringFormat:()=>Hh,stringbool:()=>Dg,success:()=>Sg,superRefine:()=>Kd,symbol:()=>ig,templateLiteral:()=>Ag,transform:()=>Ui,tuple:()=>yd,uint32:()=>tg,uint64:()=>og,ulid:()=>Dh,undefined:()=>ag,union:()=>zi,unknown:()=>Lt,url:()=>Ch,uuid:()=>Eh,uuidv4:()=>Th,uuidv6:()=>Ah,uuidv7:()=>Ih,void:()=>cg,xid:()=>Lh,xor:()=>fg});var pi={};Ke(pi,{endsWith:()=>hn,gt:()=>Le,gte:()=>ue,includes:()=>mn,length:()=>Dt,lowercase:()=>dn,lt:()=>De,lte:()=>xe,maxLength:()=>jt,maxSize:()=>mt,mime:()=>gn,minLength:()=>Je,minSize:()=>ze,multipleOf:()=>pt,negative:()=>ri,nonnegative:()=>ii,nonpositive:()=>oi,normalize:()=>yn,overwrite:()=>Ie,positive:()=>ni,property:()=>ai,regex:()=>un,size:()=>Rt,slugify:()=>wn,startsWith:()=>fn,toLowerCase:()=>_n,toUpperCase:()=>bn,trim:()=>vn,uppercase:()=>pn});var Sn={};Ke(Sn,{ZodISODate:()=>fi,ZodISODateTime:()=>mi,ZodISODuration:()=>gi,ZodISOTime:()=>hi,date:()=>Mu,datetime:()=>zu,duration:()=>Fu,time:()=>Uu});var mi=g("ZodISODateTime",(e,t)=>{hc.init(e,t),K.init(e,t)});function zu(e){return _l(mi,e)}var fi=g("ZodISODate",(e,t)=>{gc.init(e,t),K.init(e,t)});function Mu(e){return bl(fi,e)}var hi=g("ZodISOTime",(e,t)=>{yc.init(e,t),K.init(e,t)});function Uu(e){return wl(hi,e)}var gi=g("ZodISODuration",(e,t)=>{vc.init(e,t),K.init(e,t)});function Fu(e){return kl(gi,e)}var kh=(e,t)=>{cr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ur(e,r)},flatten:{value:r=>lr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,en,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,en,2)}},isEmpty:{get(){return e.issues.length===0}}})},fx=g("ZodError",kh),ge=g("ZodError",kh,{Parent:Error});var Gu=rn(ge),Zu=on(ge),Bu=an(ge),Ku=sn(ge),Vu=lo(ge),Wu=uo(ge),Hu=po(ge),Ju=mo(ge),qu=fo(ge),Yu=ho(ge),Xu=go(ge),Qu=yo(ge);var xh=new WeakMap;function Er(e,t,r){let o=Object.getPrototypeOf(e),n=xh.get(o);if(n||(n=new Set,xh.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var z=g("ZodType",(e,t)=>(R.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:xn(e,"input"),output:xn(e,"output")}}),e.toJSONSchema=eu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Gu(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Bu(e,r,o),e.parseAsync=async(r,o)=>Zu(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Ku(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Vu(e,r,o),e.decode=(r,o)=>Wu(e,r,o),e.encodeAsync=async(r,o)=>Hu(e,r,o),e.decodeAsync=async(r,o)=>Ju(e,r,o),e.safeEncode=(r,o)=>qu(e,r,o),e.safeDecode=(r,o)=>Yu(e,r,o),e.safeEncodeAsync=async(r,o)=>Xu(e,r,o),e.safeDecodeAsync=async(r,o)=>Qu(e,r,o),Er(e,"ZodType",{check(...r){let o=this.def;return this.clone(k.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return ce(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Bd(r,o))},superRefine(r,o){return this.check(Kd(r,o))},overwrite(r){return this.check(Ie(r))},optional(){return Sr(this)},exactOptional(){return $d(this)},nullable(){return $r(this)},nullish(){return Sr($r(this))},nonoptional(r){return Pd(this,r)},array(){return Ir(this)},or(r){return zi([this,r])},and(r){return hd(this,r)},transform(r){return vi(this,Ui(r))},default(r){return Ad(this,r)},prefault(r){return Cd(this,r)},catch(r){return Rd(this,r)},pipe(r){return vi(this,r)},readonly(){return zd(this)},describe(r){let o=this.clone();return ne.add(o,{description:r}),o},meta(...r){if(r.length===0)return ne.get(this);let o=this.clone();return ne.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return ne.get(e)?.description},configurable:!0}),e)),_i=g("_ZodString",(e,t)=>{Nt.init(e,t),z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>tu(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Er(e,"_ZodString",{regex(...o){return this.check(un(...o))},includes(...o){return this.check(mn(...o))},startsWith(...o){return this.check(fn(...o))},endsWith(...o){return this.check(hn(...o))},min(...o){return this.check(Je(...o))},max(...o){return this.check(jt(...o))},length(...o){return this.check(Dt(...o))},nonempty(...o){return this.check(Je(1,...o))},lowercase(o){return this.check(dn(o))},uppercase(o){return this.check(pn(o))},trim(){return this.check(vn())},normalize(...o){return this.check(yn(...o))},toLowerCase(){return this.check(_n())},toUpperCase(){return this.check(bn())},slugify(){return this.check(wn())}})}),Tn=g("ZodString",(e,t)=>{Nt.init(e,t),_i.init(e,t),e.email=r=>e.check(Do(bi,r)),e.url=r=>e.check(br(Tr,r)),e.jwt=r=>e.check(ti(ji,r)),e.emoji=r=>e.check(Fo(wi,r)),e.guid=r=>e.check(_r(xr,r)),e.uuid=r=>e.check(Lo(Me,r)),e.uuidv4=r=>e.check(zo(Me,r)),e.uuidv6=r=>e.check(Mo(Me,r)),e.uuidv7=r=>e.check(Uo(Me,r)),e.nanoid=r=>e.check(Go(ki,r)),e.guid=r=>e.check(_r(xr,r)),e.cuid=r=>e.check(Zo(xi,r)),e.cuid2=r=>e.check(Bo(Si,r)),e.ulid=r=>e.check(Ko($i,r)),e.base64=r=>e.check(Xo(Oi,r)),e.base64url=r=>e.check(Qo(Ni,r)),e.xid=r=>e.check(Vo(Ei,r)),e.ksuid=r=>e.check(Wo(Ti,r)),e.ipv4=r=>e.check(Ho(Ai,r)),e.ipv6=r=>e.check(Jo(Ii,r)),e.cidrv4=r=>e.check(qo(Ci,r)),e.cidrv6=r=>e.check(Yo(Pi,r)),e.e164=r=>e.check(ei(Ri,r)),e.datetime=r=>e.check(zu(r)),e.date=r=>e.check(Mu(r)),e.time=r=>e.check(Uu(r)),e.duration=r=>e.check(Fu(r))});function kr(e){return hl(Tn,e)}var K=g("ZodStringFormat",(e,t)=>{B.init(e,t),_i.init(e,t)}),bi=g("ZodEmail",(e,t)=>{ac.init(e,t),K.init(e,t)});function Sh(e){return Do(bi,e)}var xr=g("ZodGUID",(e,t)=>{oc.init(e,t),K.init(e,t)});function $h(e){return _r(xr,e)}var Me=g("ZodUUID",(e,t)=>{ic.init(e,t),K.init(e,t)});function Eh(e){return Lo(Me,e)}function Th(e){return zo(Me,e)}function Ah(e){return Mo(Me,e)}function Ih(e){return Uo(Me,e)}var Tr=g("ZodURL",(e,t)=>{sc.init(e,t),K.init(e,t)});function Ch(e){return br(Tr,e)}function Ph(e){return br(Tr,{protocol:ke.httpProtocol,hostname:ke.domain,...k.normalizeParams(e)})}var wi=g("ZodEmoji",(e,t)=>{cc.init(e,t),K.init(e,t)});function Oh(e){return Fo(wi,e)}var ki=g("ZodNanoID",(e,t)=>{lc.init(e,t),K.init(e,t)});function Nh(e){return Go(ki,e)}var xi=g("ZodCUID",(e,t)=>{uc.init(e,t),K.init(e,t)});function Rh(e){return Zo(xi,e)}var Si=g("ZodCUID2",(e,t)=>{dc.init(e,t),K.init(e,t)});function jh(e){return Bo(Si,e)}var $i=g("ZodULID",(e,t)=>{pc.init(e,t),K.init(e,t)});function Dh(e){return Ko($i,e)}var Ei=g("ZodXID",(e,t)=>{mc.init(e,t),K.init(e,t)});function Lh(e){return Vo(Ei,e)}var Ti=g("ZodKSUID",(e,t)=>{fc.init(e,t),K.init(e,t)});function zh(e){return Wo(Ti,e)}var Ai=g("ZodIPv4",(e,t)=>{_c.init(e,t),K.init(e,t)});function Mh(e){return Ho(Ai,e)}var ed=g("ZodMAC",(e,t)=>{wc.init(e,t),K.init(e,t)});function Uh(e){return yl(ed,e)}var Ii=g("ZodIPv6",(e,t)=>{bc.init(e,t),K.init(e,t)});function Fh(e){return Jo(Ii,e)}var Ci=g("ZodCIDRv4",(e,t)=>{kc.init(e,t),K.init(e,t)});function Gh(e){return qo(Ci,e)}var Pi=g("ZodCIDRv6",(e,t)=>{xc.init(e,t),K.init(e,t)});function Zh(e){return Yo(Pi,e)}var Oi=g("ZodBase64",(e,t)=>{$c.init(e,t),K.init(e,t)});function Bh(e){return Xo(Oi,e)}var Ni=g("ZodBase64URL",(e,t)=>{Ec.init(e,t),K.init(e,t)});function Kh(e){return Qo(Ni,e)}var Ri=g("ZodE164",(e,t)=>{Tc.init(e,t),K.init(e,t)});function Vh(e){return ei(Ri,e)}var ji=g("ZodJWT",(e,t)=>{Ac.init(e,t),K.init(e,t)});function Wh(e){return ti(ji,e)}var An=g("ZodCustomStringFormat",(e,t)=>{Ic.init(e,t),K.init(e,t)});function Hh(e,t,r={}){return kn(An,e,t,r)}function Jh(e){return kn(An,"hostname",ke.hostname,e)}function qh(e){return kn(An,"hex",ke.hex,e)}function Yh(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=ke[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return kn(An,o,n,t)}var In=g("ZodNumber",(e,t)=>{Eo.init(e,t),z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>nu(e,o,n,i),Er(e,"ZodNumber",{gt(o,n){return this.check(Le(o,n))},gte(o,n){return this.check(ue(o,n))},min(o,n){return this.check(ue(o,n))},lt(o,n){return this.check(De(o,n))},lte(o,n){return this.check(xe(o,n))},max(o,n){return this.check(xe(o,n))},int(o){return this.check(yi(o))},safe(o){return this.check(yi(o))},positive(o){return this.check(Le(0,o))},nonnegative(o){return this.check(ue(0,o))},negative(o){return this.check(De(0,o))},nonpositive(o){return this.check(xe(0,o))},multipleOf(o,n){return this.check(pt(o,n))},step(o,n){return this.check(pt(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function td(e){return xl(In,e)}var zt=g("ZodNumberFormat",(e,t)=>{Cc.init(e,t),In.init(e,t)});function yi(e){return $l(zt,e)}function Xh(e){return El(zt,e)}function Qh(e){return Tl(zt,e)}function eg(e){return Al(zt,e)}function tg(e){return Il(zt,e)}var Cn=g("ZodBoolean",(e,t)=>{fr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ru(e,r,o,n)});function nd(e){return Cl(Cn,e)}var Pn=g("ZodBigInt",(e,t)=>{To.init(e,t),z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>ou(e,o,n,i),e.gte=(o,n)=>e.check(ue(o,n)),e.min=(o,n)=>e.check(ue(o,n)),e.gt=(o,n)=>e.check(Le(o,n)),e.gte=(o,n)=>e.check(ue(o,n)),e.min=(o,n)=>e.check(ue(o,n)),e.lt=(o,n)=>e.check(De(o,n)),e.lte=(o,n)=>e.check(xe(o,n)),e.max=(o,n)=>e.check(xe(o,n)),e.positive=o=>e.check(Le(BigInt(0),o)),e.negative=o=>e.check(De(BigInt(0),o)),e.nonpositive=o=>e.check(xe(BigInt(0),o)),e.nonnegative=o=>e.check(ue(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(pt(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function ng(e){return Ol(Pn,e)}var Di=g("ZodBigIntFormat",(e,t)=>{Pc.init(e,t),Pn.init(e,t)});function rg(e){return Rl(Di,e)}function og(e){return jl(Di,e)}var rd=g("ZodSymbol",(e,t)=>{Oc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iu(e,r,o,n)});function ig(e){return Dl(rd,e)}var od=g("ZodUndefined",(e,t)=>{Nc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>su(e,r,o,n)});function ag(e){return Ll(od,e)}var id=g("ZodNull",(e,t)=>{Rc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>au(e,r,o,n)});function ad(e){return zl(id,e)}var sd=g("ZodAny",(e,t)=>{jc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uu(e,r,o,n)});function sg(){return Ml(sd)}var cd=g("ZodUnknown",(e,t)=>{Dc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>du(e,r,o,n)});function Lt(){return Ul(cd)}var ld=g("ZodNever",(e,t)=>{Lc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lu(e,r,o,n)});function Li(e){return Fl(ld,e)}var ud=g("ZodVoid",(e,t)=>{zc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cu(e,r,o,n)});function cg(e){return Gl(ud,e)}var Ar=g("ZodDate",(e,t)=>{Mc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>pu(e,o,n,i),e.min=(o,n)=>e.check(ue(o,n)),e.max=(o,n)=>e.check(xe(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function lg(e){return Zl(Ar,e)}var dd=g("ZodArray",(e,t)=>{Uc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(e,r,o,n),e.element=t.element,Er(e,"ZodArray",{min(r,o){return this.check(Je(r,o))},nonempty(r){return this.check(Je(1,r))},max(r,o){return this.check(jt(r,o))},length(r,o){return this.check(Dt(r,o))},unwrap(){return this.element}})});function Ir(e,t){return Vl(dd,e,t)}function ug(e){let t=e._zod.def.shape;return Mi(Object.keys(t))}var Cr=g("ZodObject",(e,t)=>{Fc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n),k.defineLazy(e,"shape",()=>t.shape),Er(e,"ZodObject",{keyof(){return Mi(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Lt()})},loose(){return this.clone({...this._zod.def,catchall:Lt()})},strict(){return this.clone({...this._zod.def,catchall:Li()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return k.extend(this,r)},safeExtend(r){return k.safeExtend(this,r)},merge(r){return k.merge(this,r)},pick(r){return k.pick(this,r)},omit(r){return k.omit(this,r)},partial(...r){return k.partial(Fi,this,r[0])},required(...r){return k.required(Gi,this,r[0])}})});function dg(e,t){let r={type:"object",shape:e??{},...k.normalizeParams(t)};return new Cr(r)}function pg(e,t){return new Cr({type:"object",shape:e,catchall:Li(),...k.normalizeParams(t)})}function mg(e,t){return new Cr({type:"object",shape:e,catchall:Lt(),...k.normalizeParams(t)})}var Pr=g("ZodUnion",(e,t)=>{hr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ci(e,r,o,n),e.options=t.options});function zi(e,t){return new Pr({type:"union",options:e,...k.normalizeParams(t)})}var pd=g("ZodXor",(e,t)=>{Pr.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ci(e,r,o,n),e.options=t.options});function fg(e,t){return new pd({type:"union",options:e,inclusive:!1,...k.normalizeParams(t)})}var md=g("ZodDiscriminatedUnion",(e,t)=>{Pr.init(e,t),Zc.init(e,t)});function hg(e,t,r){return new md({type:"union",options:t,discriminator:e,...k.normalizeParams(r)})}var fd=g("ZodIntersection",(e,t)=>{Bc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(e,r,o,n)});function hd(e,t){return new fd({type:"intersection",left:e,right:t})}var gd=g("ZodTuple",(e,t)=>{Ao.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function yd(e,t,r){let o=t instanceof R,n=o?r:t,i=o?t:null;return new gd({type:"tuple",items:e,rest:i,...k.normalizeParams(n)})}var $n=g("ZodRecord",(e,t)=>{Kc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function vd(e,t,r){return!t||!t._zod?new $n({type:"record",keyType:kr(),valueType:e,...k.normalizeParams(t)}):new $n({type:"record",keyType:e,valueType:t,...k.normalizeParams(r)})}function gg(e,t,r){let o=ce(e);return o._zod.values=void 0,new $n({type:"record",keyType:o,valueType:t,...k.normalizeParams(r)})}function yg(e,t,r){return new $n({type:"record",keyType:e,valueType:t,mode:"loose",...k.normalizeParams(r)})}var _d=g("ZodMap",(e,t)=>{Vc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(ze(...r)),e.nonempty=r=>e.check(ze(1,r)),e.max=(...r)=>e.check(mt(...r)),e.size=(...r)=>e.check(Rt(...r))});function vg(e,t,r){return new _d({type:"map",keyType:e,valueType:t,...k.normalizeParams(r)})}var bd=g("ZodSet",(e,t)=>{Wc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.min=(...r)=>e.check(ze(...r)),e.nonempty=r=>e.check(ze(1,r)),e.max=(...r)=>e.check(mt(...r)),e.size=(...r)=>e.check(Rt(...r))});function _g(e,t){return new bd({type:"set",valueType:e,...k.normalizeParams(t)})}var En=g("ZodEnum",(e,t)=>{Hc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>mu(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new En({...t,checks:[],...k.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new En({...t,checks:[],...k.normalizeParams(n),entries:i})}});function Mi(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new En({type:"enum",entries:r,...k.normalizeParams(t)})}function bg(e,t){return new En({type:"enum",entries:e,...k.normalizeParams(t)})}var wd=g("ZodLiteral",(e,t)=>{Jc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fu(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function wg(e,t){return new wd({type:"literal",values:Array.isArray(e)?e:[e],...k.normalizeParams(t)})}var kd=g("ZodFile",(e,t)=>{qc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(e,r,o,n),e.min=(r,o)=>e.check(ze(r,o)),e.max=(r,o)=>e.check(mt(r,o)),e.mime=(r,o)=>e.check(gn(Array.isArray(r)?r:[r],o))});function kg(e){return Wl(kd,e)}var xd=g("ZodTransform",(e,t)=>{Yc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wu(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new st(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(k.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(k.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Ui(e){return new xd({type:"transform",transform:e})}var Fi=g("ZodOptional",(e,t)=>{Io.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>li(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sr(e){return new Fi({type:"optional",innerType:e})}var Sd=g("ZodExactOptional",(e,t)=>{Xc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>li(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function $d(e){return new Sd({type:"optional",innerType:e})}var Ed=g("ZodNullable",(e,t)=>{Qc.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function $r(e){return new Ed({type:"nullable",innerType:e})}function xg(e){return Sr($r(e))}var Td=g("ZodDefault",(e,t)=>{el.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ad(e,t){return new Td({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():k.shallowClone(t)}})}var Id=g("ZodPrefault",(e,t)=>{tl.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Cd(e,t){return new Id({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():k.shallowClone(t)}})}var Gi=g("ZodNonOptional",(e,t)=>{nl.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Pd(e,t){return new Gi({type:"nonoptional",innerType:e,...k.normalizeParams(t)})}var Od=g("ZodSuccess",(e,t)=>{rl.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sg(e){return new Od({type:"success",innerType:e})}var Nd=g("ZodCatch",(e,t)=>{ol.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rd(e,t){return new Nd({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var jd=g("ZodNaN",(e,t)=>{il.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hu(e,r,o,n)});function $g(e){return Kl(jd,e)}var Or=g("ZodPipe",(e,t)=>{Co.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n),e.in=t.in,e.out=t.out});function vi(e,t){return new Or({type:"pipe",in:e,out:t})}var Nr=g("ZodCodec",(e,t)=>{Or.init(e,t),gr.init(e,t)});function Eg(e,t,r){return new Nr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Tg(e){let t=e._zod.def;return new Nr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Dd=g("ZodPreprocess",(e,t)=>{Or.init(e,t),al.init(e,t)}),Ld=g("ZodReadonly",(e,t)=>{sl.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function zd(e){return new Ld({type:"readonly",innerType:e})}var Md=g("ZodTemplateLiteral",(e,t)=>{cl.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gu(e,r,o,n)});function Ag(e,t){return new Md({type:"template_literal",parts:e,...k.normalizeParams(t)})}var Ud=g("ZodLazy",(e,t)=>{dl.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Fd(e){return new Ud({type:"lazy",getter:e})}var Gd=g("ZodPromise",(e,t)=>{ul.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ig(e){return new Gd({type:"promise",innerType:e})}var Zd=g("ZodFunction",(e,t)=>{ll.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n)});function Cg(e){return new Zd({type:"function",input:Array.isArray(e?.input)?yd(e?.input):e?.input??Ir(Lt()),output:e?.output??Lt()})}var Rr=g("ZodCustom",(e,t)=>{pl.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_u(e,r,o,n)});function Pg(e){let t=new V({check:"custom"});return t._zod.check=e,t}function Og(e,t){return Hl(Rr,e??(()=>!0),t)}function Bd(e,t={}){return Jl(Rr,e,t)}function Kd(e,t){return ql(e,t)}var Ng=Yl,Rg=Xl;function jg(e,t={}){let r=new Rr({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...k.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Dg=(...e)=>Ql({Codec:Nr,Boolean:Cn,String:Tn},...e);function Lg(e){let t=Fd(()=>zi([kr(e),td(),nd(),ad(),Ir(t),vd(kr(),t)]));return t}function zg(e,t){return new Dd({type:"pipe",in:Ui(e),out:t})}var gx={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"};function yx(e){J({customError:e})}function vx(){return J().customError}var Vd;Vd||(Vd={});var E={...wr,...pi,iso:Sn},_x=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function bx(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function wx(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function Mg(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return E.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return E.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=wx(n,t),a=ie(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return E.null();if(n.length===0)return E.never();if(n.length===1)return E.literal(n[0]);if(n.every(a=>typeof a=="string"))return E.enum(n);let i=n.map(a=>E.literal(a));return i.length<2?i[0]:E.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return E.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return Mg(a,t)});return n.length===0?E.never():n.length===1?n[0]:E.union(n)}if(!r)return E.any();let o;switch(r){case"string":{let n=E.string();if(e.format){let i=e.format;i==="email"?n=n.check(E.email()):i==="uri"||i==="uri-reference"?n=n.check(E.url()):i==="uuid"||i==="guid"?n=n.check(E.uuid()):i==="date-time"?n=n.check(E.iso.datetime()):i==="date"?n=n.check(E.iso.date()):i==="time"?n=n.check(E.iso.time()):i==="duration"?n=n.check(E.iso.duration()):i==="ipv4"?n=n.check(E.ipv4()):i==="ipv6"?n=n.check(E.ipv6()):i==="mac"?n=n.check(E.mac()):i==="cidr"?n=n.check(E.cidrv4()):i==="cidr-v6"?n=n.check(E.cidrv6()):i==="base64"?n=n.check(E.base64()):i==="base64url"?n=n.check(E.base64url()):i==="e164"?n=n.check(E.e164()):i==="jwt"?n=n.check(E.jwt()):i==="emoji"?n=n.check(E.emoji()):i==="nanoid"?n=n.check(E.nanoid()):i==="cuid"?n=n.check(E.cuid()):i==="cuid2"?n=n.check(E.cuid2()):i==="ulid"?n=n.check(E.ulid()):i==="xid"?n=n.check(E.xid()):i==="ksuid"&&(n=n.check(E.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?E.number().int():E.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=E.boolean();break}case"null":{o=E.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[c,l]of Object.entries(i)){let d=ie(l,t);n[c]=a.has(c)?d:d.optional()}if(e.propertyNames){let c=ie(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?ie(e.additionalProperties,t):E.any();if(Object.keys(n).length===0){o=E.record(c,l);break}let d=E.object(n).passthrough(),p=E.looseRecord(c,l);o=E.intersection(d,p);break}if(e.patternProperties){let c=e.patternProperties,l=Object.keys(c),d=[];for(let m of l){let f=ie(c[m],t),h=E.string().regex(new RegExp(m));d.push(E.looseRecord(h,f))}let p=[];if(Object.keys(n).length>0&&p.push(E.object(n).passthrough()),p.push(...d),p.length===0)o=E.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=E.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=E.intersection(m,p[f]);o=m}break}let s=E.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(ie(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(c=>ie(c,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?ie(i,t):void 0;s?o=E.tuple(a).rest(s):o=E.tuple(a),typeof e.minItems=="number"&&(o=o.check(E.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(E.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(c=>ie(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?ie(e.additionalItems,t):void 0;s?o=E.tuple(a).rest(s):o=E.tuple(a),typeof e.minItems=="number"&&(o=o.check(E.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(E.maxLength(e.maxItems)))}else if(i!==void 0){let a=ie(i,t),s=E.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=E.array(E.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function ie(e,t){if(typeof e=="boolean")return e?E.any():E.never();let r=Mg(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>ie(l,t)),c=E.union(s);r=o?E.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>ie(l,t)),c=E.xor(s);r=o?E.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:E.any();else{let s=o?r:ie(e.allOf[0],t),c=o?0:1;for(let l=c;l<e.allOf.length;l++)s=E.intersection(s,ie(e.allOf[l],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=E.nullable(r)),e.readOnly===!0&&(r=E.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))_x.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function Ug(e,t){if(typeof e=="boolean")return e?E.any():E.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=bx(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??ne};return ie(r,i)}var Wd={};Ke(Wd,{bigint:()=>$x,boolean:()=>Sx,date:()=>Ex,number:()=>xx,string:()=>kx});function kx(e){return gl(Tn,e)}function xx(e){return Sl(In,e)}function Sx(e){return Pl(Cn,e)}function $x(e){return Nl(Pn,e)}function Ex(e){return Bl(Ar,e)}J(Po());var Tx=[".localhost",".local",".internal",".test",".localdomain"],Ax=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"]);function Fg(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(Ax.has(t)||Tx.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return Fg(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function Gg(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(Fg(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var jr=u.discriminatedUnion("source",[u.object({source:u.literal("manifest")}),u.object({source:u.literal("studio"),element_id:u.string().min(1),edition_id:u.string().min(1)})]);var Ix=u.object({archetype:u.literal("hunt"),number:u.number().int().positive().default(1),prompt:u.string().default(""),board:u.array(u.string().min(1)).min(2),targets:u.array(u.string().min(1)).min(1),required:u.number().int().positive().optional(),pointsPerTarget:u.number().int().nonnegative().default(10),completionBonus:u.number().int().nonnegative().default(0),attemptsAllowed:u.number().int().positive().default(10),mistakesAllowed:u.number().int().positive().default(4),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),Cx=u.object({key:u.string().min(1),label:u.string().min(1),value:u.number().int().nonnegative()}),Px=u.object({id:u.string().min(1),label:u.string().default(""),entries:u.array(Cx).min(1)}),Ox=u.object({within:u.number().min(0).max(1),label:u.string().min(1)}),Nx=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],Zg=u.object({archetype:u.literal("push"),number:u.number().int().positive().default(1),prompt:u.string().default(""),target:u.number().int().positive(),targetLabel:u.string().default(""),slates:u.array(Px).min(1),tiers:u.array(Ox).default(Nx),floorLabel:u.string().default("Rookie"),bustLabel:u.string().default("Busted"),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(c=>c.key)),n=[...new Set(o.filter((s,c)=>o.indexOf(s)!==c))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,c)=>s+Math.min(...c.entries.map(l=>l.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,c)=>c===0||s.within>e.tiers[c-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),Rx=u.object({key:u.string().min(1),label:u.string().min(1),members:u.array(u.string().min(1)).min(2)}),jx=u.object({archetype:u.literal("group"),number:u.number().int().positive().default(1),prompt:u.string().default(""),board:u.array(u.string().min(1)).min(4),groups:u.array(Rx).min(2),pointsPerGroup:u.number().int().nonnegative().default(10),completionBonus:u.number().int().nonnegative().default(0),attemptsAllowed:u.number().int().positive().default(10),mistakesAllowed:u.number().int().positive().default(4),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let c=r.get(s);c&&c!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${c} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),Dx=u.object({key:u.string().min(1),label:u.string().min(1),points:u.number().int().nonnegative().optional()}),Lx=u.object({archetype:u.literal("forecast"),number:u.number().int().positive().default(1),prompt:u.string().default(""),options:u.array(Dx).min(2),result:u.string().min(1).optional(),pointsForCorrect:u.number().int().nonnegative().default(10),attemptsAllowed:u.number().int().positive().default(1),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})}),zx=u.discriminatedUnion("archetype",[Ix,Zg,jx,Lx]),Te=u.preprocess(Um,zx);function On(e){return`round-${e.number}`}var uN=u.object({game:u.string().min(1),round:Te,origin:jr.optional(),snapshot:u.string().default(""),source:u.string().optional(),roundId:u.string().min(1).optional(),selection:u.object({mode:u.literal("rotation"),windowSeconds:u.number().int().positive(),rounds:u.array(u.object({id:u.string().min(1),round:Te,origin:jr.optional()})).min(1)}).optional()}),dN=u.object({roundId:u.string(),version:u.number().int().nonnegative(),changed:u.boolean(),current:u.boolean()});var Zi="1.0",Hd=u.enum(["missing","proposed","confirmed","verified","approved"]),Jd={missing:0,proposed:1,confirmed:2,verified:3,approved:4},qd=u.enum(["runtime","live","enterprise"]);var yt=u.enum(["L0","L1","L2","L3","L4","L5"]),Nn={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},Bg={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},Mx=u.discriminatedUnion("kind",[u.object({kind:u.literal("human_decision"),owner:u.string(),date:u.string(),note:u.string().optional()}),u.object({kind:u.literal("generated_proposal"),tool:u.string(),model:u.string().optional(),source_context:u.string().optional()}),u.object({kind:u.literal("repository_evidence"),file:u.string(),commit:u.string().optional(),package:u.string().optional()}),u.object({kind:u.literal("platform_evidence"),system:u.string(),id:u.string()}),u.object({kind:u.literal("external_evidence"),supplier:u.string(),licence:u.string().optional(),dataset_version:u.string().optional()})]),Ue={status:Hd.default("missing"),provenance:u.array(Mx).default([])},Ux=u.object({schema_version:u.string(),revision:u.number().int().nonnegative().default(0),conformance:yt.default("L0")}),Fx=u.object({repository:u.string().url(),branch:u.string().default("main")}),Gx=u.object({id:u.string().min(1),title:u.string().min(1),summary:u.string().optional(),source:Fx.optional(),owners:u.object({ip:u.string().optional(),delivery:u.string().optional(),platform:u.string().optional()}).prefault({}),...Ue}),Zx=u.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Bx=u.enum(["trivia","forecast","group","timed_round","synchronous_event","collection_ranking","hunt","push"]),vt=u.preprocess(e=>typeof e=="string"?We(e):e,Bx),Kx=u.object({route:Zx.optional(),archetype:vt.optional(),component:u.string().optional(),version:u.string().optional(),variant:u.string().optional(),configuration:u.record(u.string(),u.unknown()).default({}),round:Te.optional(),...Ue}),Vx=u.object({surfaces:u.array(u.string()).default([]),container_label:u.string().min(1).default(Qt),screen_graph:u.string().optional(),design:u.object({figma_file:u.string().optional(),figma_version:u.string().optional(),tokens:u.string().optional(),fidelity:yt.optional()}).optional(),...Ue}),Wx=u.object({spec_url:u.string().optional(),version:u.string().optional(),...Ue}),Hx=u.object({family:u.string().optional(),version:u.string().optional(),configuration_schema:u.string().optional(),...Ue}),Jx=u.object({project_template:u.string().optional(),project_id:u.string().optional(),events:u.array(u.string()).default([]),elements:u.array(u.string()).default([]),...Ue}),qx=u.object({required:u.boolean().default(!1),minimum_age:u.number().int().positive().max(120).optional(),method:u.enum(["self_declared","verified"]).default("self_declared"),verifier:u.string().optional()}),Yx=u.object({issuer:u.string().url(),jwks_uri:u.string().url(),audience:u.string().optional()}),Xx=u.object({provider:u.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:Yx.optional(),require_authenticated_writes:u.boolean().default(!0),age_gate:qx.prefault({}),consent:u.object({analytics_requires_consent:u.boolean().default(!0),provider:u.string().optional()}).prefault({}),...Ue}),Qx=u.object({type:u.enum(["monterosa","posthog","ga4","webhook"]),enabled:u.boolean().default(!0),config:u.record(u.string(),u.string()).default({})}),eS=u.object({destinations:u.array(Qx).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:u.array(u.string()).default([]),signal:u.object({enabled:u.boolean().default(!1),application_id:u.string().optional(),write_key:u.string().optional(),monterosa:u.object({enabled:u.boolean().default(!1),organisation_id:u.string().optional(),project_id:u.string().optional()}).prefault({})}).prefault({}),...Ue}),tS=u.object({hosting:u.string().optional(),space_spec:u.string().optional(),environments:u.array(u.enum(["local","playground","staging","production"])).default(["local"]),...Ue}),nS=u.object({offers_prize:u.boolean().default(!1),free_entry_route:u.string().optional(),skill_based:u.boolean().default(!1),terms_url:u.string().optional(),jurisdictions:u.array(u.string()).default([])}),rS=u.object({support_tier:qd.optional(),runbook:u.string().optional(),promotion:nS.prefault({}),...Ue}),Mt=u.object({manifest:Ux,app:Gx,experience:Vx.prefault({}),studio_app:Wx.prefault({}),studio_surface:Hx.prefault({}),backend:Kx.prefault({}),interaction_cloud:Jx.prefault({}),identity:Xx.prefault({}),measurement:eS.prefault({}),deployment:tS.prefault({}),operations:rS.prefault({})});function Kg(e){let t=[];e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let r=e.operations.promotion;if(r.offers_prize&&(r.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),r.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!r.skill_based&&!r.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let o of["issuer","jwks_uri"]){let n=e.identity.jwt[o],i=Gg(n);i&&t.push({path:`identity.jwt.${o}`,message:i==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":i==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var Rn=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"];var Ye=(e,t,r)=>{let o=e[t];return Jd[o?.status??"missing"]>=Jd[r]},ye=e=>typeof e=="string"?e.trim().length>0:e!=null,oS=[{level:"L0",id:"L0.app.identity",requirement:"app.id and app.title are set",check:e=>ye(e.app.id)&&ye(e.app.title)},{level:"L0",id:"L0.app.status",requirement:"app section is at least proposed",check:e=>Ye(e,"app","proposed")},{level:"L0",id:"L0.schema.version",requirement:"manifest.schema_version is set",check:e=>ye(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",requirement:"experience declares a screen graph or at least one player surface",check:e=>ye(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",requirement:"experience section is at least proposed",check:e=>Ye(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>ye(e.backend.route)},{level:"L2",id:"L2.backend.pinned",requirement:"backend names a component and version, confirmed or better",check:e=>ye(e.backend.component)&&ye(e.backend.version)&&Ye(e,"backend","confirmed")},{level:"L2",id:"L2.identity.policy",requirement:"identity provider is set and the section is confirmed",check:e=>ye(e.identity.provider)&&Ye(e,"identity","confirmed")},{level:"L2",id:"L2.measurement.destination",requirement:"at least one enabled analytics destination is declared",check:e=>e.measurement.destinations.some(t=>t.enabled)},{level:"L2",id:"L2.platform.identifiers",requirement:"a real platform identity exists (Studio App Spec or Interaction Cloud project)",check:e=>ye(e.studio_app.spec_url)||ye(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",requirement:"deployment names a Space spec and a non-local environment",check:e=>ye(e.deployment.space_spec)&&e.deployment.environments.some(t=>t!=="local")},{level:"L3",id:"L3.surface.declared",requirement:"a Studio Surface family is declared for operator control",check:e=>ye(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",requirement:"experience, backend and deployment are all confirmed or better",check:e=>Ye(e,"experience","confirmed")&&Ye(e,"backend","confirmed")&&Ye(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>Ye(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",requirement:"operations declares a support tier and a runbook",check:e=>ye(e.operations.support_tier)&&ye(e.operations.runbook)},{level:"L5",id:"L5.production.approved",requirement:"the manifest is approved and deployed to a production environment",check:e=>Ye(e,"operations","approved")&&e.deployment.environments.includes("production")}],Vg=["L0","L1","L2","L3","L4","L5"];function Ce(e){let t=oS.map(l=>({id:l.id,level:l.level,requirement:l.requirement,passed:l.check(e)})),r="L0",o=!0;for(let l of Vg)t.filter(m=>m.level===l).every(m=>m.passed)&&o?r=l:o=!1;let n=t.filter(l=>l.level==="L0").every(l=>l.passed),i=Nn[r]+1,a=Vg[i],s=a?t.filter(l=>l.level===a&&!l.passed):[],c=e.manifest.conformance;return{computed:r,computedName:Bg[r],claimed:c,overclaimed:!n||Nn[c]>Nn[r],results:t,blockers:n?s:t.filter(l=>l.level==="L0"&&!l.passed)}}function Wg(e,t){let o=Ce(e).results.filter(n=>!n.passed&&Nn[n.level]<=Nn[t]);return{ok:o.length===0,missing:o}}function ly(e){return typeof e>"u"||e===null}function iS(e){return typeof e=="object"&&e!==null}function aS(e){return Array.isArray(e)?e:ly(e)?[]:[e]}function sS(e,t){var r,o,n,i;if(t)for(i=Object.keys(t),r=0,o=i.length;r<o;r+=1)n=i[r],e[n]=t[n];return e}function cS(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function lS(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var uS=ly,dS=iS,pS=aS,mS=cS,fS=lS,hS=sS,X={isNothing:uS,isObject:dS,toArray:pS,repeat:mS,isNegativeZero:fS,extend:hS};function uy(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
7330
-
7331
- `+e.mark.snippet),o+" "+r):o}function Lr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=uy(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Lr.prototype=Object.create(Error.prototype);Lr.prototype.constructor=Lr;Lr.prototype.toString=function(t){return this.name+": "+uy(this,t)};var pe=Lr;function Yd(e,t,r,o,n){var i="",a="",s=Math.floor(n/2)-1;return o-t>s&&(i=" ... ",t=o-s+i.length),r-o>s&&(a=" ...",r=o+s-a.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+a,pos:o-t+i.length}}function Xd(e,t){return X.repeat(" ",t-e.length)+e}function gS(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,o=[0],n=[],i,a=-1;i=r.exec(e.buffer);)n.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&a<0&&(a=o.length-2);a<0&&(a=o.length-1);var s="",c,l,d=Math.min(e.line+t.linesAfter,n.length).toString().length,p=t.maxLength-(t.indent+d+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)l=Yd(e.buffer,o[a-c],n[a-c],e.position-(o[a]-o[a-c]),p),s=X.repeat(" ",t.indent)+Xd((e.line-c+1).toString(),d)+" | "+l.str+`
7332
- `+s;for(l=Yd(e.buffer,o[a],n[a],e.position,p),s+=X.repeat(" ",t.indent)+Xd((e.line+1).toString(),d)+" | "+l.str+`
7333
- `,s+=X.repeat("-",t.indent+d+3+l.pos)+`^
7334
- `,c=1;c<=t.linesAfter&&!(a+c>=n.length);c++)l=Yd(e.buffer,o[a+c],n[a+c],e.position-(o[a]-o[a+c]),p),s+=X.repeat(" ",t.indent)+Xd((e.line+c+1).toString(),d)+" | "+l.str+`
7335
- `;return s.replace(/\n$/,"")}var yS=gS,vS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_S=["scalar","sequence","mapping"];function bS(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){t[String(o)]=r})}),t}function wS(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(vS.indexOf(r)===-1)throw new pe('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=bS(t.styleAliases||null),_S.indexOf(this.kind)===-1)throw new pe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var re=wS;function Hg(e,t){var r=[];return e[t].forEach(function(o){var n=r.length;r.forEach(function(i,a){i.tag===o.tag&&i.kind===o.kind&&i.multi===o.multi&&(n=a)}),r[n]=o}),r}function kS(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function o(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(o);return e}function ep(e){return this.extend(e)}ep.prototype.extend=function(t){var r=[],o=[];if(t instanceof re)o.push(t);else if(Array.isArray(t))o=o.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(o=o.concat(t.explicit));else throw new pe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof re))throw new pe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new pe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new pe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(i){if(!(i instanceof re))throw new pe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(ep.prototype);return n.implicit=(this.implicit||[]).concat(r),n.explicit=(this.explicit||[]).concat(o),n.compiledImplicit=Hg(n,"implicit"),n.compiledExplicit=Hg(n,"explicit"),n.compiledTypeMap=kS(n.compiledImplicit,n.compiledExplicit),n};var dy=ep,py=new re("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),my=new re("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),fy=new re("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),hy=new dy({explicit:[py,my,fy]});function xS(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function SS(){return null}function $S(e){return e===null}var gy=new re("tag:yaml.org,2002:null",{kind:"scalar",resolve:xS,construct:SS,predicate:$S,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function ES(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function TS(e){return e==="true"||e==="True"||e==="TRUE"}function AS(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var yy=new re("tag:yaml.org,2002:bool",{kind:"scalar",resolve:ES,construct:TS,predicate:AS,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function IS(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function CS(e){return 48<=e&&e<=55}function PS(e){return 48<=e&&e<=57}function OS(e){if(e===null)return!1;var t=e.length,r=0,o=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;o=!0}return o&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!IS(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!CS(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!PS(e.charCodeAt(r)))return!1;o=!0}return!(!o||n==="_")}function NS(e){var t=e,r=1,o;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),o=t[0],(o==="-"||o==="+")&&(o==="-"&&(r=-1),t=t.slice(1),o=t[0]),t==="0")return 0;if(o==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function RS(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!X.isNegativeZero(e)}var vy=new re("tag:yaml.org,2002:int",{kind:"scalar",resolve:OS,construct:NS,predicate:RS,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),jS=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function DS(e){return!(e===null||!jS.test(e)||e[e.length-1]==="_")}function LS(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var zS=/^[-+]?[0-9]+e/;function MS(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(X.isNegativeZero(e))return"-0.0";return r=e.toString(10),zS.test(r)?r.replace("e",".e"):r}function US(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||X.isNegativeZero(e))}var _y=new re("tag:yaml.org,2002:float",{kind:"scalar",resolve:DS,construct:LS,predicate:US,represent:MS,defaultStyle:"lowercase"}),by=hy.extend({implicit:[gy,yy,vy,_y]}),wy=by,ky=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),xy=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function FS(e){return e===null?!1:ky.exec(e)!==null||xy.exec(e)!==null}function GS(e){var t,r,o,n,i,a,s,c=0,l=null,d,p,m;if(t=ky.exec(e),t===null&&(t=xy.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],o=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,o,n));if(i=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(d=+t[10],p=+(t[11]||0),l=(d*60+p)*6e4,t[9]==="-"&&(l=-l)),m=new Date(Date.UTC(r,o,n,i,a,s,c)),l&&m.setTime(m.getTime()-l),m}function ZS(e){return e.toISOString()}var Sy=new re("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:FS,construct:GS,instanceOf:Date,represent:ZS});function BS(e){return e==="<<"||e===null}var $y=new re("tag:yaml.org,2002:merge",{kind:"scalar",resolve:BS}),ip=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
7336
- \r`;function KS(e){if(e===null)return!1;var t,r,o=0,n=e.length,i=ip;for(r=0;r<n;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function VS(e){var t,r,o=e.replace(/[\r\n=]/g,""),n=o.length,i=ip,a=0,s=[];for(t=0;t<n;t++)t%4===0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|i.indexOf(o.charAt(t));return r=n%4*6,r===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):r===18?(s.push(a>>10&255),s.push(a>>2&255)):r===12&&s.push(a>>4&255),new Uint8Array(s)}function WS(e){var t="",r=0,o,n,i=e.length,a=ip;for(o=0;o<i;o++)o%3===0&&o&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[o];return n=i%3,n===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):n===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):n===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function HS(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ey=new re("tag:yaml.org,2002:binary",{kind:"scalar",resolve:KS,construct:VS,predicate:HS,represent:WS}),JS=Object.prototype.hasOwnProperty,qS=Object.prototype.toString;function YS(e){if(e===null)return!0;var t=[],r,o,n,i,a,s=e;for(r=0,o=s.length;r<o;r+=1){if(n=s[r],a=!1,qS.call(n)!=="[object Object]")return!1;for(i in n)if(JS.call(n,i))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function XS(e){return e!==null?e:[]}var Ty=new re("tag:yaml.org,2002:omap",{kind:"sequence",resolve:YS,construct:XS}),QS=Object.prototype.toString;function e$(e){if(e===null)return!0;var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(o=a[t],QS.call(o)!=="[object Object]"||(n=Object.keys(o),n.length!==1))return!1;i[t]=[n[0],o[n[0]]]}return!0}function t$(e){if(e===null)return[];var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1)o=a[t],n=Object.keys(o),i[t]=[n[0],o[n[0]]];return i}var Ay=new re("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:e$,construct:t$}),n$=Object.prototype.hasOwnProperty;function r$(e){if(e===null)return!0;var t,r=e;for(t in r)if(n$.call(r,t)&&r[t]!==null)return!1;return!0}function o$(e){return e!==null?e:{}}var Iy=new re("tag:yaml.org,2002:set",{kind:"mapping",resolve:r$,construct:o$}),ap=wy.extend({implicit:[Sy,$y],explicit:[Ey,Ty,Ay,Iy]}),bt=Object.prototype.hasOwnProperty,Bi=1,Cy=2,Py=3,Ki=4,Qd=1,i$=2,Jg=3,a$=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,s$=/[\x85\u2028\u2029]/,c$=/[,\[\]\{\}]/,Oy=/^(?:!|!!|![a-z\-]+!)$/i,Ny=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function qg(e){return Object.prototype.toString.call(e)}function Fe(e){return e===10||e===13}function Ft(e){return e===9||e===32}function ve(e){return e===9||e===32||e===10||e===13}function Dn(e){return e===44||e===91||e===93||e===123||e===125}function l$(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function u$(e){return e===120?2:e===117?4:e===85?8:0}function d$(e){return 48<=e&&e<=57?e-48:-1}function Yg(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
7337
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function p$(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Ry(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}var jy=new Array(256),Dy=new Array(256);for(Ut=0;Ut<256;Ut++)jy[Ut]=Yg(Ut)?1:0,Dy[Ut]=Yg(Ut);var Ut;function m$(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ap,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ly(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=yS(r),new pe(t,r)}function C(e,t){throw Ly(e,t)}function Vi(e,t){e.onWarning&&e.onWarning.call(null,Ly(e,t))}var Xg={YAML:function(t,r,o){var n,i,a;t.version!==null&&C(t,"duplication of %YAML directive"),o.length!==1&&C(t,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),n===null&&C(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),a=parseInt(n[2],10),i!==1&&C(t,"unacceptable YAML version of the document"),t.version=o[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Vi(t,"unsupported YAML version of the document")},TAG:function(t,r,o){var n,i;o.length!==2&&C(t,"TAG directive accepts exactly two arguments"),n=o[0],i=o[1],Oy.test(n)||C(t,"ill-formed tag handle (first argument) of the TAG directive"),bt.call(t.tagMap,n)&&C(t,'there is a previously declared suffix for "'+n+'" tag handle'),Ny.test(i)||C(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{C(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}};function _t(e,t,r,o){var n,i,a,s;if(t<r){if(s=e.input.slice(t,r),o)for(n=0,i=s.length;n<i;n+=1)a=s.charCodeAt(n),a===9||32<=a&&a<=1114111||C(e,"expected valid JSON character");else a$.test(s)&&C(e,"the stream contains non-printable characters");e.result+=s}}function Qg(e,t,r,o){var n,i,a,s;for(X.isObject(r)||C(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),a=0,s=n.length;a<s;a+=1)i=n[a],bt.call(t,i)||(Ry(t,i,r[i]),o[i]=!0)}function Ln(e,t,r,o,n,i,a,s,c){var l,d;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),l=0,d=n.length;l<d;l+=1)Array.isArray(n[l])&&C(e,"nested arrays are not supported inside keys"),typeof n=="object"&&qg(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&qg(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(l=0,d=i.length;l<d;l+=1)Qg(e,t,i[l],r);else Qg(e,t,i,r);else!e.json&&!bt.call(r,n)&&bt.call(t,n)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,C(e,"duplicated mapping key")),Ry(t,n,i),delete r[n];return t}function sp(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):C(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Y(e,t,r){for(var o=0,n=e.input.charCodeAt(e.position);n!==0;){for(;Ft(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(Fe(n))for(sp(e),n=e.input.charCodeAt(e.position),o++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&o!==0&&e.lineIndent<r&&Vi(e,"deficient indentation"),o}function Ji(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||ve(r)))}function cp(e,t){t===1?e.result+=" ":t>1&&(e.result+=X.repeat(`
7338
- `,t-1))}function f$(e,t,r){var o,n,i,a,s,c,l,d,p=e.kind,m=e.result,f;if(f=e.input.charCodeAt(e.position),ve(f)||Dn(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(n=e.input.charCodeAt(e.position+1),ve(n)||r&&Dn(n)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,s=!1;f!==0;){if(f===58){if(n=e.input.charCodeAt(e.position+1),ve(n)||r&&Dn(n))break}else if(f===35){if(o=e.input.charCodeAt(e.position-1),ve(o))break}else{if(e.position===e.lineStart&&Ji(e)||r&&Dn(f))break;if(Fe(f))if(c=e.line,l=e.lineStart,d=e.lineIndent,Y(e,!1,-1),e.lineIndent>=t){s=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=c,e.lineStart=l,e.lineIndent=d;break}}s&&(_t(e,i,a,!1),cp(e,e.line-c),i=a=e.position,s=!1),Ft(f)||(a=e.position+1),f=e.input.charCodeAt(++e.position)}return _t(e,i,a,!1),e.result?!0:(e.kind=p,e.result=m,!1)}function h$(e,t){var r,o,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(_t(e,o,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)o=e.position,e.position++,n=e.position;else return!0;else Fe(r)?(_t(e,o,n,!0),cp(e,Y(e,!1,t)),o=n=e.position):e.position===e.lineStart&&Ji(e)?C(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);C(e,"unexpected end of the stream within a single quoted scalar")}function g$(e,t){var r,o,n,i,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return _t(e,r,e.position,!0),e.position++,!0;if(s===92){if(_t(e,r,e.position,!0),s=e.input.charCodeAt(++e.position),Fe(s))Y(e,!1,t);else if(s<256&&jy[s])e.result+=Dy[s],e.position++;else if((a=u$(s))>0){for(n=a,i=0;n>0;n--)s=e.input.charCodeAt(++e.position),(a=l$(s))>=0?i=(i<<4)+a:C(e,"expected hexadecimal character");e.result+=p$(i),e.position++}else C(e,"unknown escape sequence");r=o=e.position}else Fe(s)?(_t(e,r,o,!0),cp(e,Y(e,!1,t)),r=o=e.position):e.position===e.lineStart&&Ji(e)?C(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}C(e,"unexpected end of the stream within a double quoted scalar")}function y$(e,t){var r=!0,o,n,i,a=e.tag,s,c=e.anchor,l,d,p,m,f,h=Object.create(null),b,S,O,j;if(j=e.input.charCodeAt(e.position),j===91)d=93,f=!1,s=[];else if(j===123)d=125,f=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),j=e.input.charCodeAt(++e.position);j!==0;){if(Y(e,!0,t),j=e.input.charCodeAt(e.position),j===d)return e.position++,e.tag=a,e.anchor=c,e.kind=f?"mapping":"sequence",e.result=s,!0;r?j===44&&C(e,"expected the node content, but found ','"):C(e,"missed comma between flow collection entries"),S=b=O=null,p=m=!1,j===63&&(l=e.input.charCodeAt(e.position+1),ve(l)&&(p=m=!0,e.position++,Y(e,!0,t))),o=e.line,n=e.lineStart,i=e.position,zn(e,t,Bi,!1,!0),S=e.tag,b=e.result,Y(e,!0,t),j=e.input.charCodeAt(e.position),(m||e.line===o)&&j===58&&(p=!0,j=e.input.charCodeAt(++e.position),Y(e,!0,t),zn(e,t,Bi,!1,!0),O=e.result),f?Ln(e,s,h,S,b,O,o,n,i):p?s.push(Ln(e,null,h,S,b,O,o,n,i)):s.push(b),Y(e,!0,t),j=e.input.charCodeAt(e.position),j===44?(r=!0,j=e.input.charCodeAt(++e.position)):r=!1}C(e,"unexpected end of the stream within a flow collection")}function v$(e,t){var r,o,n=Qd,i=!1,a=!1,s=t,c=0,l=!1,d,p;if(p=e.input.charCodeAt(e.position),p===124)o=!1;else if(p===62)o=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Qd===n?n=p===43?Jg:i$:C(e,"repeat of a chomping mode identifier");else if((d=d$(p))>=0)d===0?C(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?C(e,"repeat of an indentation width identifier"):(s=t+d-1,a=!0);else break;if(Ft(p)){do p=e.input.charCodeAt(++e.position);while(Ft(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Fe(p)&&p!==0)}for(;p!==0;){for(sp(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),Fe(p)){c++;continue}if(e.lineIndent<s){n===Jg?e.result+=X.repeat(`
7339
- `,i?1+c:c):n===Qd&&i&&(e.result+=`
7340
- `);break}for(o?Ft(p)?(l=!0,e.result+=X.repeat(`
7341
- `,i?1+c:c)):l?(l=!1,e.result+=X.repeat(`
7342
- `,c+1)):c===0?i&&(e.result+=" "):e.result+=X.repeat(`
7343
- `,c):e.result+=X.repeat(`
7344
- `,i?1+c:c),i=!0,a=!0,c=0,r=e.position;!Fe(p)&&p!==0;)p=e.input.charCodeAt(++e.position);_t(e,r,e.position,!1)}return!0}function ey(e,t){var r,o=e.tag,n=e.anchor,i=[],a,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!ve(a))));){if(s=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,zn(e,t,Py,!1,!0),i.push(e.result),Y(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)C(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=o,e.anchor=n,e.kind="sequence",e.result=i,!0):!1}function _$(e,t,r){var o,n,i,a,s,c,l=e.tag,d=e.anchor,p={},m=Object.create(null),f=null,h=null,b=null,S=!1,O=!1,j;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),j=e.input.charCodeAt(e.position);j!==0;){if(!S&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),i=e.line,(j===63||j===58)&&ve(o))j===63?(S&&(Ln(e,p,m,f,h,null,a,s,c),f=h=b=null),O=!0,S=!0,n=!0):S?(S=!1,n=!0):C(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,j=o;else{if(a=e.line,s=e.lineStart,c=e.position,!zn(e,r,Cy,!1,!0))break;if(e.line===i){for(j=e.input.charCodeAt(e.position);Ft(j);)j=e.input.charCodeAt(++e.position);if(j===58)j=e.input.charCodeAt(++e.position),ve(j)||C(e,"a whitespace character is expected after the key-value separator within a block mapping"),S&&(Ln(e,p,m,f,h,null,a,s,c),f=h=b=null),O=!0,S=!1,n=!1,f=e.tag,h=e.result;else if(O)C(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=l,e.anchor=d,!0}else if(O)C(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=l,e.anchor=d,!0}if((e.line===i||e.lineIndent>t)&&(S&&(a=e.line,s=e.lineStart,c=e.position),zn(e,t,Ki,!0,n)&&(S?h=e.result:b=e.result),S||(Ln(e,p,m,f,h,b,a,s,c),f=h=b=null),Y(e,!0,-1),j=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&j!==0)C(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return S&&Ln(e,p,m,f,h,null,a,s,c),O&&(e.tag=l,e.anchor=d,e.kind="mapping",e.result=p),O}function b$(e){var t,r=!1,o=!1,n,i,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&C(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(i=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):C(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!ve(a);)a===33&&(o?C(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),Oy.test(n)||C(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),c$.test(i)&&C(e,"tag suffix cannot contain flow indicator characters")}i&&!Ny.test(i)&&C(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{C(e,"tag name is malformed: "+i)}return r?e.tag=i:bt.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:n==="!"?e.tag="!"+i:n==="!!"?e.tag="tag:yaml.org,2002:"+i:C(e,'undeclared tag handle "'+n+'"'),!0}function w$(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&C(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ve(r)&&!Dn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function k$(e){var t,r,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;o!==0&&!ve(o)&&!Dn(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),bt.call(e.anchorMap,r)||C(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Y(e,!0,-1),!0}function zn(e,t,r,o,n){var i,a,s,c=1,l=!1,d=!1,p,m,f,h,b,S;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=a=s=Ki===r||Py===r,o&&Y(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;b$(e)||w$(e);)Y(e,!0,-1)?(l=!0,s=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&(s=l||n),(c===1||Ki===r)&&(Bi===r||Cy===r?b=t:b=t+1,S=e.position-e.lineStart,c===1?s&&(ey(e,S)||_$(e,S,b))||y$(e,b)?d=!0:(a&&v$(e,b)||h$(e,b)||g$(e,b)?d=!0:k$(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&C(e,"alias node should not have any properties")):f$(e,b,Bi===r)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(d=s&&ey(e,S))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&C(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,m=e.implicitTypes.length;p<m;p+=1)if(h=e.implicitTypes[p],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(bt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,f=e.typeMap.multi[e.kind||"fallback"],p=0,m=f.length;p<m;p+=1)if(e.tag.slice(0,f[p].tag.length)===f[p].tag){h=f[p];break}h||C(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&C(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):C(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function x$(e){var t=e.position,r,o,n,i=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Y(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(i=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ve(a);)a=e.input.charCodeAt(++e.position);for(o=e.input.slice(r,e.position),n=[],o.length<1&&C(e,"directive name must not be less than one character in length");a!==0;){for(;Ft(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Fe(a));break}if(Fe(a))break;for(r=e.position;a!==0&&!ve(a);)a=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}a!==0&&sp(e),bt.call(Xg,o)?Xg[o](e,o,n):Vi(e,'unknown document directive "'+o+'"')}if(Y(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Y(e,!0,-1)):i&&C(e,"directives end mark is expected"),zn(e,e.lineIndent-1,Ki,!1,!0),Y(e,!0,-1),e.checkLineBreaks&&s$.test(e.input.slice(t,e.position))&&Vi(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ji(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Y(e,!0,-1));return}if(e.position<e.length-1)C(e,"end of the stream or a document separator is expected");else return}function zy(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
7345
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new m$(e,t),o=e.indexOf("\0");for(o!==-1&&(r.position=o,C(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)x$(r);return r.documents}function S$(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var o=zy(e,r);if(typeof t!="function")return o;for(var n=0,i=o.length;n<i;n+=1)t(o[n])}function $$(e,t){var r=zy(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new pe("expected a single document in the stream, but found more")}}var E$=S$,T$=$$,My={loadAll:E$,load:T$},Uy=Object.prototype.toString,Fy=Object.prototype.hasOwnProperty,lp=65279,A$=9,zr=10,I$=13,C$=32,P$=33,O$=34,tp=35,N$=37,R$=38,j$=39,D$=42,Gy=44,L$=45,Wi=58,z$=61,M$=62,U$=63,F$=64,Zy=91,By=93,G$=96,Ky=123,Z$=124,Vy=125,ae={};ae[0]="\\0";ae[7]="\\a";ae[8]="\\b";ae[9]="\\t";ae[10]="\\n";ae[11]="\\v";ae[12]="\\f";ae[13]="\\r";ae[27]="\\e";ae[34]='\\"';ae[92]="\\\\";ae[133]="\\N";ae[160]="\\_";ae[8232]="\\L";ae[8233]="\\P";var B$=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],K$=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function V$(e,t){var r,o,n,i,a,s,c;if(t===null)return{};for(r={},o=Object.keys(t),n=0,i=o.length;n<i;n+=1)a=o[n],s=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&Fy.call(c.styleAliases,s)&&(s=c.styleAliases[s]),r[a]=s;return r}function W$(e){var t,r,o;if(t=e.toString(16).toUpperCase(),e<=255)r="x",o=2;else if(e<=65535)r="u",o=4;else if(e<=4294967295)r="U",o=8;else throw new pe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+X.repeat("0",o-t.length)+t}var H$=1,Mr=2;function J$(e){this.schema=e.schema||ap,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=X.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=V$(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Mr:H$,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function ty(e,t){for(var r=X.repeat(" ",t),o=0,n=-1,i="",a,s=e.length;o<s;)n=e.indexOf(`
7108
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let z=f.compile();return(ne,G)=>z(m,ne,G)},i,a=It,s=!At.jitless,l=s&&ss.value,p=t.catchall,d;e._zod.parse=(m,f)=>{d??(d=o.value);let h=m.value;return a(h)?s&&l&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),m=i(m,f),p?If([],h,m,f,d,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m)}});function mf(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!ut(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>ue(a,o,J())))}),t)}var yr=g("$ZodUnion",(e,t)=>{L.init(e,t),U(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),U(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),U(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),U(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>ar(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(s=>mf(s,o,e,n)):mf(a,o,e,n)}});function ff(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>ue(a,o,J())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var qc=g("$ZodXor",(e,t)=>{yr.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);c instanceof Promise?(a.push(c),i=!0):a.push(c)}return i?Promise.all(a).then(s=>ff(s,o,e,n)):ff(a,o,e,n)}}),Xc=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,yr.init(e,t);let r=e._zod.parse;U(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of c)n[s].add(l)}}return n});let o=tn(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!It(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),Qc=g("$ZodIntersection",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,l])=>hf(r,c,l)):hf(r,i,a)}});function pc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(lt(e)&&lt(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=pc(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=pc(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function hf(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),ut(e))return e;let a=pc(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var No=g("$ZodTuple",(e,t)=>{L.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=gf(r,"optin"),c=gf(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let l=new Array(r.length);for(let p=0;p<r.length;p++){let d=r[p]._zod.run({value:i[p],issues:[]},n);d instanceof Promise?a.push(d.then(m=>{l[p]=m})):l[p]=d}if(t.rest){let p=r.length-1,d=i.slice(r.length);for(let m of d){p++;let f=t.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?a.push(f.then(h=>yf(h,o,p))):yf(f,o,p)}}return a.length?Promise.all(a).then(()=>vf(l,o,r,i,c)):vf(l,o,r,i,c)}});function gf(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function yf(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues)),t.value[r]=e.value}function vf(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...fe(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var el=g("$ZodRecord",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!lt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);let p=t.keyType._zod.run({value:l,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(f=>ue(f,o,J())),input:l,path:[l],inst:e});continue}let d=p.value,m=t.valueType._zod.run({value:n[l],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&r.issues.push(...fe(l,f.issues)),r.value[d]=f.value})):(m.issues.length&&r.issues.push(...fe(l,m.issues)),r.value[d]=m.value)}let c;for(let l in n)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&So.test(s)&&c.issues.length){let d=t.keyType._zod.run({value:Number(s),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>ue(d,o,J())),input:s,path:[s],inst:e});continue}let p=t.valueType._zod.run({value:n[s],issues:[]},o);p instanceof Promise?i.push(p.then(d=>{d.issues.length&&r.issues.push(...fe(s,d.issues)),r.value[c.value]=d.value})):(p.issues.length&&r.issues.push(...fe(s,p.issues)),r.value[c.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),tl=g("$ZodMap",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let c=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise||l instanceof Promise?i.push(Promise.all([c,l]).then(([p,d])=>{_f(p,d,r,a,n,e,o)})):_f(c,l,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function _f(e,t,r,o,n,i,a){e.issues.length&&(sr.has(typeof o)?r.issues.push(...fe(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>ue(s,a,J()))})),t.issues.length&&(sr.has(typeof o)?r.issues.push(...fe(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>ue(s,a,J()))})),r.value.set(e.value,t.value)}var nl=g("$ZodSet",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(c=>bf(c,r))):bf(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function bf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var rl=g("$ZodEnum",(e,t)=>{L.init(e,t);let r=ir(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>sr.has(typeof n)).map(n=>typeof n=="string"?Ce(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),ol=g("$ZodLiteral",(e,t)=>{if(L.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ce(o):o?Ce(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),il=g("$ZodFile",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),al=g("$ZodTransform",(e,t)=>{L.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new at(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Oe;return r.value=n,r.fallback=!0,r}});function wf(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ro=g("$ZodOptional",(e,t)=>{L.init(e,t),e._zod.optin="optional",e._zod.optout="optional",U(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),U(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ar(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>wf(a,n)):wf(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),sl=g("$ZodExactOptional",(e,t)=>{Ro.init(e,t),U(e._zod,"values",()=>t.innerType._zod.values),U(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),cl=g("$ZodNullable",(e,t)=>{L.init(e,t),U(e._zod,"optin",()=>t.innerType._zod.optin),U(e._zod,"optout",()=>t.innerType._zod.optout),U(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ar(r.source)}|null)$`):void 0}),U(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),ll=g("$ZodDefault",(e,t)=>{L.init(e,t),e._zod.optin="optional",U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>kf(i,t)):kf(n,t)}});function kf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ul=g("$ZodPrefault",(e,t)=>{L.init(e,t),e._zod.optin="optional",U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),dl=g("$ZodNonOptional",(e,t)=>{L.init(e,t),U(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>xf(i,e)):xf(n,e)}});function xf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var pl=g("$ZodSuccess",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new at("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),ml=g("$ZodCatch",(e,t)=>{L.init(e,t),e._zod.optin="optional",U(e._zod,"optout",()=>t.innerType._zod.optout),U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>ue(a,o,J()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>ue(i,o,J()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),fl=g("$ZodNaN",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),jo=g("$ZodPipe",(e,t)=>{L.init(e,t),U(e._zod,"values",()=>t.in._zod.values),U(e._zod,"optin",()=>t.in._zod.optin),U(e._zod,"optout",()=>t.out._zod.optout),U(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>To(a,t.in,o)):To(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>To(i,t.out,o)):To(n,t.out,o)}});function To(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var vr=g("$ZodCodec",(e,t)=>{L.init(e,t),U(e._zod,"values",()=>t.in._zod.values),U(e._zod,"optin",()=>t.in._zod.optin),U(e._zod,"optout",()=>t.out._zod.optout),U(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Ao(a,t,o)):Ao(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ao(a,t,o)):Ao(i,t,o)}}});function Ao(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Io(e,i,t.out,r)):Io(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Io(e,i,t.in,r)):Io(e,n,t.in,r)}}function Io(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var hl=g("$ZodPreprocess",(e,t)=>{jo.init(e,t)}),gl=g("$ZodReadonly",(e,t)=>{L.init(e,t),U(e._zod,"propValues",()=>t.innerType._zod.propValues),U(e._zod,"values",()=>t.innerType._zod.values),U(e._zod,"optin",()=>t.innerType?._zod?.optin),U(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Sf):Sf(n)}});function Sf(e){return e.value=Object.freeze(e.value),e}var yl=g("$ZodTemplateLiteral",(e,t)=>{L.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||ls.has(typeof o))r.push(Ce(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),vl=g("$ZodFunction",(e,t)=>(L.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?mo(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?mo(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await fo(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await fo(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new No({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),_l=g("$ZodPromise",(e,t)=>{L.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),bl=g("$ZodLazy",(e,t)=>{L.init(e,t),U(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),U(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),U(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),U(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),U(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),wl=g("$ZodCustom",(e,t)=>{V.init(e,t),L.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>$f(i,r,o,e));$f(n,r,o,e)}});function $f(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(nn(n))}}var br={};Ke(br,{ar:()=>Pf,az:()=>Of,be:()=>Rf,bg:()=>jf,ca:()=>Df,cs:()=>Lf,da:()=>zf,de:()=>Mf,el:()=>Uf,en:()=>Do,eo:()=>Ff,es:()=>Gf,fa:()=>Zf,fi:()=>Bf,fr:()=>Kf,frCA:()=>Vf,he:()=>Wf,hr:()=>Hf,hu:()=>Jf,hy:()=>qf,id:()=>Xf,is:()=>Qf,it:()=>eh,ja:()=>th,ka:()=>nh,kh:()=>rh,km:()=>Lo,ko:()=>oh,lt:()=>ah,mk:()=>sh,ms:()=>ch,nl:()=>lh,no:()=>uh,ota:()=>dh,pl:()=>mh,ps:()=>ph,pt:()=>fh,ro:()=>hh,ru:()=>yh,sl:()=>vh,sv:()=>_h,ta:()=>bh,th:()=>wh,tr:()=>kh,ua:()=>xh,uk:()=>zo,ur:()=>Sh,uz:()=>$h,vi:()=>Eh,yo:()=>Ih,zhCN:()=>Th,zhTW:()=>Ah});var gk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\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 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.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 ${b(n.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: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${n.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${y(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.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 ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Pf(){return{localeError:gk()}}var yk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${b(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Of(){return{localeError:yk()}}function Nf(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var vk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.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 ${b(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=Nf(s,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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${c}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=Nf(s,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 ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Rf(){return{localeError:vk()}}var _k=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${b(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function jf(){return{localeError:_k()}}var bk=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${b(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${y(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function Df(){return{localeError:bk()}}var wk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${b(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${y(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Lf(){return{localeError:wk()}}var kk=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${b(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function zf(){return{localeError:kk()}}var xk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${b(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function Mf(){return{localeError:xk()}}var Sk=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${b(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function Uf(){return{localeError:Sk()}}var $k=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${b(n.values[0])}`:`Invalid option: expected one of ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Do(){return{localeError:$k()}}var Ek=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${b(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function Ff(){return{localeError:Ek()}}var Tk=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${b(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function Gf(){return{localeError:Tk()}}var Ak=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${b(n.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 ${y(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.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 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${y(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.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 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Zf(){return{localeError:Ak()}}var Ik=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${b(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${y(n.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 Bf(){return{localeError:Ik()}}var Ck=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={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"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${b(n.values[0])} attendu`:`Option invalide : une valeur parmi ${y(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${y(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function Kf(){return{localeError:Ck()}}var Pk=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${b(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${y(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function Vf(){return{localeError:Pk()}}var Ok=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?e[l]:void 0,o=l=>{let p=r(l);return p?p.label:l??e.unknown.label},n=l=>`\u05D4${o(l)}`,i=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=l=>l?t[l]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let p=l.expected,d=c[p??""]??o(p),m=w(l.input),f=c[m]??e[m]?.label??m;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${b(l.values[0])}`;let p=l.values.map(f=>b(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let d=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let p=a(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",_=l.inclusive?`${l.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let m=l.inclusive?"<=":"<",f=i(l.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.maximum.toString()}`}case"too_small":{let p=a(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let S=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let _=l.inclusive?`${l.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let m=l.inclusive?">=":">",f=i(l.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.minimum.toString()}`}case"invalid_format":{let p=l;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let d=s[p.format],m=d?.label??p.format,h=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${h}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${y(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Wf(){return{localeError:Ok()}}var Nk=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${b(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${y(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function Hf(){return{localeError:Nk()}}var Rk=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${b(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Jf(){return{localeError:Rk()}}function Yf(e,t,r){return Math.abs(e)===1?t:r}function ln(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var jk=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${b(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=Yf(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=Yf(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ln(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${y(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ln(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${ln(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function qf(){return{localeError:jk()}}var Dk=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${b(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function Xf(){return{localeError:Dk()}}var Lk=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${b(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${y(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function Qf(){return{localeError:Lk()}}var zk=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${b(n.values[0])}`:`Opzione non valida: atteso uno tra ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${y(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function eh(){return{localeError:zk()}}var Mk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${b(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${y(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.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${n.keys.length>1?"\u7FA4":""}: ${y(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function th(){return{localeError:Mk()}}var Uk=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${b(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${y(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function nh(){return{localeError:Uk()}}var Fk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\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 ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.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 ${b(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${y(n.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 ${n.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 ${n.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 Lo(){return{localeError:Fk()}}function rh(){return Lo()}var Gk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${b(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${y(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${y(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function oh(){return{localeError:Gk()}}var _r=e=>e.charAt(0).toUpperCase()+e.slice(1);function ih(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var Zk=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let c=e[n]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${b(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${y(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,ih(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${_r(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${_r(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,ih(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${_r(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${_r(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${y(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${_r(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function ah(){return{localeError:Zk()}}var Bk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${b(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`Invalid ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`${n.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"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.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 ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function sh(){return{localeError:Bk()}}var Kk=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${b(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${y(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function ch(){return{localeError:Kk()}}var Vk=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${b(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function lh(){return{localeError:Vk()}}var Wk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${b(n.values[0])}`:`Ugyldig valg: forventet en av ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function uh(){return{localeError:Wk()}}var Hk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${b(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function dh(){return{localeError:Hk()}}var Jk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${b(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${y(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${y(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.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 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function ph(){return{localeError:Jk()}}var Yk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${b(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function mh(){return{localeError:Yk()}}var qk=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${b(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function fh(){return{localeError:qk()}}var Xk=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${b(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${y(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function hh(){return{localeError:Xk()}}function gh(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var Qk=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${b(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=gh(s,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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${c}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=gh(s,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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${c}`}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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.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 yh(){return{localeError:Qk()}}var ex=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${b(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${y(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function vh(){return{localeError:ex()}}var tx=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${b(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function _h(){return{localeError:tx()}}var nx=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\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 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.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 ${b(n.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 ${y(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.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 ${n.origin} ${i}${n.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 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.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 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.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${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.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`${n.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 bh(){return{localeError:nx()}}var rx=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\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 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${b(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.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 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.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 ${n.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: ${y(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.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 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function wh(){return{localeError:rx()}}var ox=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${b(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function kh(){return{localeError:ox()}}var ix=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\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 ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.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 ${b(n.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 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.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 ${n.origin} ${a.verb} ${i}${n.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 ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.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 zo(){return{localeError:ix()}}function xh(){return zo()}var ax=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${b(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${y(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.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: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.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${n.keys.length>1?"\u0632":""}: ${y(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Sh(){return{localeError:ax()}}var sx=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${b(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function $h(){return{localeError:sx()}}var cx=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${b(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${y(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.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 ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Eh(){return{localeError:cx()}}var lx=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${b(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Th(){return{localeError:lx()}}var ux=()=>{let e={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 t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${b(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${y(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Ah(){return{localeError:ux()}}var dx=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=w(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${b(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${y(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${y(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Ih(){return{localeError:dx()}}var Ch,kl=Symbol("ZodOutput"),xl=Symbol("ZodInput"),Mo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Uo(){return new Mo}(Ch=globalThis).__zod_globalRegistry??(Ch.__zod_globalRegistry=Uo());var re=globalThis.__zod_globalRegistry;function Sl(e,t){return new e({type:"string",...x(t)})}function $l(e,t){return new e({type:"string",coerce:!0,...x(t)})}function Fo(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...x(t)})}function wr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...x(t)})}function Go(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...x(t)})}function Zo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(t)})}function Bo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(t)})}function Ko(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(t)})}function kr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...x(t)})}function Vo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...x(t)})}function Wo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(t)})}function Ho(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...x(t)})}function Jo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(t)})}function Yo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...x(t)})}function qo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...x(t)})}function Xo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(t)})}function Qo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(t)})}function ei(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(t)})}function El(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...x(t)})}function ti(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(t)})}function ni(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(t)})}function ri(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...x(t)})}function oi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...x(t)})}function ii(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...x(t)})}function ai(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...x(t)})}var Tl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Al(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(t)})}function Il(e,t){return new e({type:"string",format:"date",check:"string_format",...x(t)})}function Cl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...x(t)})}function Pl(e,t){return new e({type:"string",format:"duration",check:"string_format",...x(t)})}function Ol(e,t){return new e({type:"number",checks:[],...x(t)})}function Nl(e,t){return new e({type:"number",coerce:!0,checks:[],...x(t)})}function Rl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...x(t)})}function jl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...x(t)})}function Dl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...x(t)})}function Ll(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...x(t)})}function zl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...x(t)})}function Ml(e,t){return new e({type:"boolean",...x(t)})}function Ul(e,t){return new e({type:"boolean",coerce:!0,...x(t)})}function Fl(e,t){return new e({type:"bigint",...x(t)})}function Gl(e,t){return new e({type:"bigint",coerce:!0,...x(t)})}function Zl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...x(t)})}function Bl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...x(t)})}function Kl(e,t){return new e({type:"symbol",...x(t)})}function Vl(e,t){return new e({type:"undefined",...x(t)})}function Wl(e,t){return new e({type:"null",...x(t)})}function Hl(e){return new e({type:"any"})}function Jl(e){return new e({type:"unknown"})}function Yl(e,t){return new e({type:"never",...x(t)})}function ql(e,t){return new e({type:"void",...x(t)})}function Xl(e,t){return new e({type:"date",...x(t)})}function Ql(e,t){return new e({type:"date",coerce:!0,...x(t)})}function eu(e,t){return new e({type:"nan",...x(t)})}function De(e,t){return new $o({check:"less_than",...x(t),value:e,inclusive:!1})}function Se(e,t){return new $o({check:"less_than",...x(t),value:e,inclusive:!0})}function Le(e,t){return new Eo({check:"greater_than",...x(t),value:e,inclusive:!1})}function de(e,t){return new Eo({check:"greater_than",...x(t),value:e,inclusive:!0})}function si(e){return Le(0,e)}function ci(e){return De(0,e)}function li(e){return Se(0,e)}function ui(e){return de(0,e)}function dt(e,t){return new Ws({check:"multiple_of",...x(t),value:e})}function pt(e,t){return new Ys({check:"max_size",...x(t),maximum:e})}function ze(e,t){return new qs({check:"min_size",...x(t),minimum:e})}function Ot(e,t){return new Xs({check:"size_equals",...x(t),size:e})}function Nt(e,t){return new Qs({check:"max_length",...x(t),maximum:e})}function Je(e,t){return new ec({check:"min_length",...x(t),minimum:e})}function Rt(e,t){return new tc({check:"length_equals",...x(t),length:e})}function un(e,t){return new nc({check:"string_format",format:"regex",...x(t),pattern:e})}function dn(e){return new rc({check:"string_format",format:"lowercase",...x(e)})}function pn(e){return new oc({check:"string_format",format:"uppercase",...x(e)})}function mn(e,t){return new ic({check:"string_format",format:"includes",...x(t),includes:e})}function fn(e,t){return new ac({check:"string_format",format:"starts_with",...x(t),prefix:e})}function hn(e,t){return new sc({check:"string_format",format:"ends_with",...x(t),suffix:e})}function di(e,t,r){return new cc({check:"property",property:e,schema:t,...x(r)})}function gn(e,t){return new lc({check:"mime_type",mime:e,...x(t)})}function Ne(e){return new uc({check:"overwrite",tx:e})}function yn(e){return Ne(t=>t.normalize(e))}function vn(){return Ne(e=>e.trim())}function _n(){return Ne(e=>e.toLowerCase())}function bn(){return Ne(e=>e.toUpperCase())}function wn(){return Ne(e=>as(e))}function tu(e,t,r){return new e({type:"array",element:t,...x(r)})}function mx(e,t,r){return new e({type:"union",options:t,...x(r)})}function fx(e,t,r){return new e({type:"union",options:t,inclusive:!1,...x(r)})}function hx(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...x(o)})}function gx(e,t,r){return new e({type:"intersection",left:t,right:r})}function yx(e,t,r,o){let n=r instanceof L,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...x(i)})}function vx(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...x(o)})}function _x(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...x(o)})}function bx(e,t,r){return new e({type:"set",valueType:t,...x(r)})}function wx(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...x(r)})}function kx(e,t,r){return new e({type:"enum",entries:t,...x(r)})}function xx(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...x(r)})}function nu(e,t){return new e({type:"file",...x(t)})}function Sx(e,t){return new e({type:"transform",transform:t})}function $x(e,t){return new e({type:"optional",innerType:t})}function Ex(e,t){return new e({type:"nullable",innerType:t})}function Tx(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():cs(r)}})}function Ax(e,t,r){return new e({type:"nonoptional",innerType:t,...x(r)})}function Ix(e,t){return new e({type:"success",innerType:t})}function Cx(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function Px(e,t,r){return new e({type:"pipe",in:t,out:r})}function Ox(e,t){return new e({type:"readonly",innerType:t})}function Nx(e,t,r){return new e({type:"template_literal",parts:t,...x(r)})}function Rx(e,t){return new e({type:"lazy",getter:t})}function jx(e,t){return new e({type:"promise",innerType:t})}function ru(e,t,r){let o=x(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function ou(e,t,r){return new e({type:"custom",check:"custom",fn:t,...x(r)})}function iu(e,t){let r=Ph(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(nn(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(nn(i))}},e(o.value,o)),t);return r}function Ph(e,t){let r=new V({check:"custom",...x(t)});return r._zod.check=e,r}function au(e){let t=new V({check:"describe"});return t._zod.onattach=[r=>{let o=re.get(r)??{};re.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function su(e){let t=new V({check:"meta"});return t._zod.onattach=[r=>{let o=re.get(r)??{};re.add(r,{...o,...e})}],t._zod.check=()=>{},t}function cu(e,t){let r=x(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(n),s=e.Codec??vr,c=e.Boolean??gr,l=e.String??Pt,p=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),m=new s({type:"pipe",in:p,out:d,transform:((f,h)=>{let _=f;return r.case!=="sensitive"&&(_=_.toLowerCase()),i.has(_)?!0:a.has(_)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:h.value,inst:m,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function kn(e,t,r,o={}){let n=x(o),i={...x(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function mt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Z(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,p);else{let m=a.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,p)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),Z(d,t,p),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&pe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function ft(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=o.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,m=e.external.uri??(h=>h);if(d)return{ref:m(d)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let l=`#/${s}/`,p=a[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:l+p}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);let p=s.schema;for(let d in p)delete p[d];p.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
7109
+
7110
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function ht(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,p={...l},d=c.ref;if(c.ref=null,d){o(d);let f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,p),s._zod.parent===d)for(let S in l)S==="$ref"||S==="allOf"||S in p||delete l[S];if(h.$ref&&f.def)for(let S in l)S==="$ref"||S==="allOf"||S in f.def&&JSON.stringify(l[S])===JSON.stringify(f.def[S])&&delete l[S]}let m=s._zod.parent;if(m&&m!==d){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:xn(t,"input",e.processors),output:xn(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function pe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return pe(o.element,r);if(o.type==="set")return pe(o.valueType,r);if(o.type==="lazy")return pe(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return pe(o.innerType,r);if(o.type==="intersection")return pe(o.left,r)||pe(o.right,r);if(o.type==="record"||o.type==="map")return pe(o.keyType,r)||pe(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:pe(o.in,r)||pe(o.out,r);if(o.type==="object"){for(let n in o.shape)if(pe(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(pe(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(pe(n,r))return!0;return!!(o.rest&&pe(o.rest,r))}return!1}var lu=(e,t={})=>r=>{let o=mt({...r,processors:t});return Z(e,o),ft(o,e),ht(o,e)},xn=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=mt({...n??{},target:i,io:t,processors:r});return Z(e,a),ft(a,e),ht(a,e)};var Dx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uu=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=Dx[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let p=[...c];p.length===1?n.pattern=p[0].source:p.length>1&&(n.allOf=[...p.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},du=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:p}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let d=typeof p=="number"&&p>=(i??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";d?f?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof a=="number"&&(n.maximum=a),typeof c=="number"&&(n.multipleOf=c)},pu=(e,t,r,o)=>{r.type="boolean"},mu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},fu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},hu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},gu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},yu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},vu=(e,t,r,o)=>{r.not={}},_u=(e,t,r,o)=>{},bu=(e,t,r,o)=>{},wu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},ku=(e,t,r,o)=>{let n=e._zod.def,i=ir(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},xu=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Su=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},$u=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},Eu=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),c?c.length===1?(i.contentMediaType=c[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,i)},Tu=(e,t,r,o)=>{r.type="boolean"},Au=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Iu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Cu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Pu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ou=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Nu=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=Z(i.element,t,{...o,path:[...o.path,"items"]})},Ru=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let l in a)n.properties[l]=Z(a[l],t,{...o,path:[...o.path,"properties",l]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(l=>{let p=i.shape[l]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));c.size>0&&(n.required=Array.from(c)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=Z(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},mi=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,c)=>Z(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},ju=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=Z(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},Du=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((m,f)=>Z(m,t,{...o,path:[...o.path,a,f]})),l=i.rest?Z(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));let{minimum:p,maximum:d}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof d=="number"&&(n.maxItems=d)},Lu=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,c=a._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let p=Z(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Z(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=Z(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let l=a._zod.values;if(l){let p=[...l].filter(d=>typeof d=="string"||typeof d=="number");p.length>0&&(n.required=p)}},zu=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Mu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Uu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Fu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Gu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Zu=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;Z(a,t,o);let s=t.seen.get(e);s.ref=a},Bu=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Ku=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},fi=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Vu=(e,t,r,o)=>{let n=e._zod.innerType;Z(n,t,o);let i=t.seen.get(e);i.ref=n},pi={string:uu,number:du,boolean:pu,bigint:mu,symbol:fu,null:hu,undefined:gu,void:yu,never:vu,any:_u,unknown:bu,date:wu,enum:ku,literal:xu,nan:Su,template_literal:$u,file:Eu,success:Tu,custom:Au,function:Iu,transform:Cu,map:Pu,set:Ou,array:Nu,object:Ru,union:mi,intersection:ju,tuple:Du,record:Lu,nullable:zu,nonoptional:Mu,default:Uu,prefault:Fu,catch:Gu,pipe:Zu,readonly:Bu,promise:Ku,optional:fi,lazy:Vu};function hi(e,t){if("_idmap"in e){let o=e,n=mt({...t,processors:pi}),i={};for(let c of o._idmap.entries()){let[l,p]=c;Z(p,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let c of o._idmap.entries()){let[l,p]=c;ft(n,p),a[l]=ht(n,p)}if(Object.keys(i).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}let r=mt({...t,processors:pi});return Z(e,r),ft(r,e),ht(r,e)}var gi=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=mt({processors:pi,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Z(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),ft(this.ctx,t);let o=ht(this.ctx,t),{"~standard":n,...i}=o;return i}};var Oh={};var xr={};Ke(xr,{ZodAny:()=>gd,ZodArray:()=>bd,ZodBase64:()=>Li,ZodBase64URL:()=>zi,ZodBigInt:()=>Pn,ZodBigIntFormat:()=>Fi,ZodBoolean:()=>Cn,ZodCIDRv4:()=>ji,ZodCIDRv6:()=>Di,ZodCUID:()=>Ai,ZodCUID2:()=>Ii,ZodCatch:()=>Gd,ZodCodec:()=>jr,ZodCustom:()=>Dr,ZodCustomStringFormat:()=>An,ZodDate:()=>Cr,ZodDefault:()=>Dd,ZodDiscriminatedUnion:()=>kd,ZodE164:()=>Mi,ZodEmail:()=>$i,ZodEmoji:()=>Ei,ZodEnum:()=>En,ZodExactOptional:()=>Nd,ZodFile:()=>Pd,ZodFunction:()=>Xd,ZodGUID:()=>$r,ZodIPv4:()=>Ni,ZodIPv6:()=>Ri,ZodIntersection:()=>xd,ZodJWT:()=>Ui,ZodKSUID:()=>Oi,ZodLazy:()=>Jd,ZodLiteral:()=>Cd,ZodMAC:()=>ld,ZodMap:()=>Ad,ZodNaN:()=>Bd,ZodNanoID:()=>Ti,ZodNever:()=>vd,ZodNonOptional:()=>Wi,ZodNull:()=>fd,ZodNullable:()=>jd,ZodNumber:()=>In,ZodNumberFormat:()=>Dt,ZodObject:()=>Or,ZodOptional:()=>Vi,ZodPipe:()=>Rr,ZodPrefault:()=>zd,ZodPreprocess:()=>Kd,ZodPromise:()=>qd,ZodReadonly:()=>Vd,ZodRecord:()=>$n,ZodSet:()=>Id,ZodString:()=>Tn,ZodStringFormat:()=>K,ZodSuccess:()=>Fd,ZodSymbol:()=>pd,ZodTemplateLiteral:()=>Hd,ZodTransform:()=>Od,ZodTuple:()=>$d,ZodType:()=>M,ZodULID:()=>Ci,ZodURL:()=>Ir,ZodUUID:()=>Me,ZodUndefined:()=>md,ZodUnion:()=>Nr,ZodUnknown:()=>yd,ZodVoid:()=>_d,ZodXID:()=>Pi,ZodXor:()=>wd,_ZodString:()=>Si,_default:()=>Ld,_function:()=>Fg,any:()=>vg,array:()=>Pr,base64:()=>tg,base64url:()=>ng,bigint:()=>mg,boolean:()=>dd,catch:()=>Zd,check:()=>Gg,cidrv4:()=>Qh,cidrv6:()=>eg,codec:()=>Lg,cuid:()=>Kh,cuid2:()=>Vh,custom:()=>Zg,date:()=>bg,describe:()=>Bg,discriminatedUnion:()=>Eg,e164:()=>rg,email:()=>jh,emoji:()=>Zh,enum:()=>Bi,exactOptional:()=>Rd,file:()=>Ng,float32:()=>lg,float64:()=>ug,function:()=>Fg,guid:()=>Dh,hash:()=>cg,hex:()=>sg,hostname:()=>ag,httpUrl:()=>Gh,instanceof:()=>Vg,int:()=>ki,int32:()=>dg,int64:()=>fg,intersection:()=>Sd,invertCodec:()=>zg,ipv4:()=>Yh,ipv6:()=>Xh,json:()=>Hg,jwt:()=>og,keyof:()=>wg,ksuid:()=>Jh,lazy:()=>Yd,literal:()=>Og,looseObject:()=>Sg,looseRecord:()=>Ag,mac:()=>qh,map:()=>Ig,meta:()=>Kg,nan:()=>Dg,nanoid:()=>Bh,nativeEnum:()=>Pg,never:()=>Gi,nonoptional:()=>Ud,null:()=>hd,nullable:()=>Tr,nullish:()=>Rg,number:()=>ud,object:()=>kg,optional:()=>Er,partialRecord:()=>Tg,pipe:()=>xi,prefault:()=>Md,preprocess:()=>Jg,promise:()=>Ug,readonly:()=>Wd,record:()=>Td,refine:()=>Qd,set:()=>Cg,strictObject:()=>xg,string:()=>Sr,stringFormat:()=>ig,stringbool:()=>Wg,success:()=>jg,superRefine:()=>ep,symbol:()=>gg,templateLiteral:()=>Mg,transform:()=>Ki,tuple:()=>Ed,uint32:()=>pg,uint64:()=>hg,ulid:()=>Wh,undefined:()=>yg,union:()=>Zi,unknown:()=>jt,url:()=>Fh,uuid:()=>Lh,uuidv4:()=>zh,uuidv6:()=>Mh,uuidv7:()=>Uh,void:()=>_g,xid:()=>Hh,xor:()=>$g});var yi={};Ke(yi,{endsWith:()=>hn,gt:()=>Le,gte:()=>de,includes:()=>mn,length:()=>Rt,lowercase:()=>dn,lt:()=>De,lte:()=>Se,maxLength:()=>Nt,maxSize:()=>pt,mime:()=>gn,minLength:()=>Je,minSize:()=>ze,multipleOf:()=>dt,negative:()=>ci,nonnegative:()=>ui,nonpositive:()=>li,normalize:()=>yn,overwrite:()=>Ne,positive:()=>si,property:()=>di,regex:()=>un,size:()=>Ot,slugify:()=>wn,startsWith:()=>fn,toLowerCase:()=>_n,toUpperCase:()=>bn,trim:()=>vn,uppercase:()=>pn});var Sn={};Ke(Sn,{ZodISODate:()=>_i,ZodISODateTime:()=>vi,ZodISODuration:()=>wi,ZodISOTime:()=>bi,date:()=>Hu,datetime:()=>Wu,duration:()=>Yu,time:()=>Ju});var vi=g("ZodISODateTime",(e,t)=>{Sc.init(e,t),K.init(e,t)});function Wu(e){return Al(vi,e)}var _i=g("ZodISODate",(e,t)=>{$c.init(e,t),K.init(e,t)});function Hu(e){return Il(_i,e)}var bi=g("ZodISOTime",(e,t)=>{Ec.init(e,t),K.init(e,t)});function Ju(e){return Cl(bi,e)}var wi=g("ZodISODuration",(e,t)=>{Tc.init(e,t),K.init(e,t)});function Yu(e){return Pl(wi,e)}var Nh=(e,t)=>{ur.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>pr(e,r)},flatten:{value:r=>dr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,en,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,en,2)}},isEmpty:{get(){return e.issues.length===0}}})},zx=g("ZodError",Nh),ge=g("ZodError",Nh,{Parent:Error});var qu=rn(ge),Xu=on(ge),Qu=an(ge),ed=sn(ge),td=ho(ge),nd=go(ge),rd=yo(ge),od=vo(ge),id=_o(ge),ad=bo(ge),sd=wo(ge),cd=ko(ge);var Rh=new WeakMap;function Ar(e,t,r){let o=Object.getPrototypeOf(e),n=Rh.get(o);if(n||(n=new Set,Rh.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var M=g("ZodType",(e,t)=>(L.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:xn(e,"input"),output:xn(e,"output")}}),e.toJSONSchema=lu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>qu(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Qu(e,r,o),e.parseAsync=async(r,o)=>Xu(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>ed(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>td(e,r,o),e.decode=(r,o)=>nd(e,r,o),e.encodeAsync=async(r,o)=>rd(e,r,o),e.decodeAsync=async(r,o)=>od(e,r,o),e.safeEncode=(r,o)=>id(e,r,o),e.safeDecode=(r,o)=>ad(e,r,o),e.safeEncodeAsync=async(r,o)=>sd(e,r,o),e.safeDecodeAsync=async(r,o)=>cd(e,r,o),Ar(e,"ZodType",{check(...r){let o=this.def;return this.clone(k.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return le(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Qd(r,o))},superRefine(r,o){return this.check(ep(r,o))},overwrite(r){return this.check(Ne(r))},optional(){return Er(this)},exactOptional(){return Rd(this)},nullable(){return Tr(this)},nullish(){return Er(Tr(this))},nonoptional(r){return Ud(this,r)},array(){return Pr(this)},or(r){return Zi([this,r])},and(r){return Sd(this,r)},transform(r){return xi(this,Ki(r))},default(r){return Ld(this,r)},prefault(r){return Md(this,r)},catch(r){return Zd(this,r)},pipe(r){return xi(this,r)},readonly(){return Wd(this)},describe(r){let o=this.clone();return re.add(o,{description:r}),o},meta(...r){if(r.length===0)return re.get(this);let o=this.clone();return re.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return re.get(e)?.description},configurable:!0}),e)),Si=g("_ZodString",(e,t)=>{Pt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,n,i)=>uu(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ar(e,"_ZodString",{regex(...o){return this.check(un(...o))},includes(...o){return this.check(mn(...o))},startsWith(...o){return this.check(fn(...o))},endsWith(...o){return this.check(hn(...o))},min(...o){return this.check(Je(...o))},max(...o){return this.check(Nt(...o))},length(...o){return this.check(Rt(...o))},nonempty(...o){return this.check(Je(1,...o))},lowercase(o){return this.check(dn(o))},uppercase(o){return this.check(pn(o))},trim(){return this.check(vn())},normalize(...o){return this.check(yn(...o))},toLowerCase(){return this.check(_n())},toUpperCase(){return this.check(bn())},slugify(){return this.check(wn())}})}),Tn=g("ZodString",(e,t)=>{Pt.init(e,t),Si.init(e,t),e.email=r=>e.check(Fo($i,r)),e.url=r=>e.check(kr(Ir,r)),e.jwt=r=>e.check(ai(Ui,r)),e.emoji=r=>e.check(Vo(Ei,r)),e.guid=r=>e.check(wr($r,r)),e.uuid=r=>e.check(Go(Me,r)),e.uuidv4=r=>e.check(Zo(Me,r)),e.uuidv6=r=>e.check(Bo(Me,r)),e.uuidv7=r=>e.check(Ko(Me,r)),e.nanoid=r=>e.check(Wo(Ti,r)),e.guid=r=>e.check(wr($r,r)),e.cuid=r=>e.check(Ho(Ai,r)),e.cuid2=r=>e.check(Jo(Ii,r)),e.ulid=r=>e.check(Yo(Ci,r)),e.base64=r=>e.check(ri(Li,r)),e.base64url=r=>e.check(oi(zi,r)),e.xid=r=>e.check(qo(Pi,r)),e.ksuid=r=>e.check(Xo(Oi,r)),e.ipv4=r=>e.check(Qo(Ni,r)),e.ipv6=r=>e.check(ei(Ri,r)),e.cidrv4=r=>e.check(ti(ji,r)),e.cidrv6=r=>e.check(ni(Di,r)),e.e164=r=>e.check(ii(Mi,r)),e.datetime=r=>e.check(Wu(r)),e.date=r=>e.check(Hu(r)),e.time=r=>e.check(Ju(r)),e.duration=r=>e.check(Yu(r))});function Sr(e){return Sl(Tn,e)}var K=g("ZodStringFormat",(e,t)=>{B.init(e,t),Si.init(e,t)}),$i=g("ZodEmail",(e,t)=>{hc.init(e,t),K.init(e,t)});function jh(e){return Fo($i,e)}var $r=g("ZodGUID",(e,t)=>{mc.init(e,t),K.init(e,t)});function Dh(e){return wr($r,e)}var Me=g("ZodUUID",(e,t)=>{fc.init(e,t),K.init(e,t)});function Lh(e){return Go(Me,e)}function zh(e){return Zo(Me,e)}function Mh(e){return Bo(Me,e)}function Uh(e){return Ko(Me,e)}var Ir=g("ZodURL",(e,t)=>{gc.init(e,t),K.init(e,t)});function Fh(e){return kr(Ir,e)}function Gh(e){return kr(Ir,{protocol:xe.httpProtocol,hostname:xe.domain,...k.normalizeParams(e)})}var Ei=g("ZodEmoji",(e,t)=>{yc.init(e,t),K.init(e,t)});function Zh(e){return Vo(Ei,e)}var Ti=g("ZodNanoID",(e,t)=>{vc.init(e,t),K.init(e,t)});function Bh(e){return Wo(Ti,e)}var Ai=g("ZodCUID",(e,t)=>{_c.init(e,t),K.init(e,t)});function Kh(e){return Ho(Ai,e)}var Ii=g("ZodCUID2",(e,t)=>{bc.init(e,t),K.init(e,t)});function Vh(e){return Jo(Ii,e)}var Ci=g("ZodULID",(e,t)=>{wc.init(e,t),K.init(e,t)});function Wh(e){return Yo(Ci,e)}var Pi=g("ZodXID",(e,t)=>{kc.init(e,t),K.init(e,t)});function Hh(e){return qo(Pi,e)}var Oi=g("ZodKSUID",(e,t)=>{xc.init(e,t),K.init(e,t)});function Jh(e){return Xo(Oi,e)}var Ni=g("ZodIPv4",(e,t)=>{Ac.init(e,t),K.init(e,t)});function Yh(e){return Qo(Ni,e)}var ld=g("ZodMAC",(e,t)=>{Cc.init(e,t),K.init(e,t)});function qh(e){return El(ld,e)}var Ri=g("ZodIPv6",(e,t)=>{Ic.init(e,t),K.init(e,t)});function Xh(e){return ei(Ri,e)}var ji=g("ZodCIDRv4",(e,t)=>{Pc.init(e,t),K.init(e,t)});function Qh(e){return ti(ji,e)}var Di=g("ZodCIDRv6",(e,t)=>{Oc.init(e,t),K.init(e,t)});function eg(e){return ni(Di,e)}var Li=g("ZodBase64",(e,t)=>{Rc.init(e,t),K.init(e,t)});function tg(e){return ri(Li,e)}var zi=g("ZodBase64URL",(e,t)=>{jc.init(e,t),K.init(e,t)});function ng(e){return oi(zi,e)}var Mi=g("ZodE164",(e,t)=>{Dc.init(e,t),K.init(e,t)});function rg(e){return ii(Mi,e)}var Ui=g("ZodJWT",(e,t)=>{Lc.init(e,t),K.init(e,t)});function og(e){return ai(Ui,e)}var An=g("ZodCustomStringFormat",(e,t)=>{zc.init(e,t),K.init(e,t)});function ig(e,t,r={}){return kn(An,e,t,r)}function ag(e){return kn(An,"hostname",xe.hostname,e)}function sg(e){return kn(An,"hex",xe.hex,e)}function cg(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=xe[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return kn(An,o,n,t)}var In=g("ZodNumber",(e,t)=>{Po.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,n,i)=>du(e,o,n,i),Ar(e,"ZodNumber",{gt(o,n){return this.check(Le(o,n))},gte(o,n){return this.check(de(o,n))},min(o,n){return this.check(de(o,n))},lt(o,n){return this.check(De(o,n))},lte(o,n){return this.check(Se(o,n))},max(o,n){return this.check(Se(o,n))},int(o){return this.check(ki(o))},safe(o){return this.check(ki(o))},positive(o){return this.check(Le(0,o))},nonnegative(o){return this.check(de(0,o))},negative(o){return this.check(De(0,o))},nonpositive(o){return this.check(Se(0,o))},multipleOf(o,n){return this.check(dt(o,n))},step(o,n){return this.check(dt(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ud(e){return Ol(In,e)}var Dt=g("ZodNumberFormat",(e,t)=>{Mc.init(e,t),In.init(e,t)});function ki(e){return Rl(Dt,e)}function lg(e){return jl(Dt,e)}function ug(e){return Dl(Dt,e)}function dg(e){return Ll(Dt,e)}function pg(e){return zl(Dt,e)}var Cn=g("ZodBoolean",(e,t)=>{gr.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pu(e,r,o,n)});function dd(e){return Ml(Cn,e)}var Pn=g("ZodBigInt",(e,t)=>{Oo.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,n,i)=>mu(e,o,n,i),e.gte=(o,n)=>e.check(de(o,n)),e.min=(o,n)=>e.check(de(o,n)),e.gt=(o,n)=>e.check(Le(o,n)),e.gte=(o,n)=>e.check(de(o,n)),e.min=(o,n)=>e.check(de(o,n)),e.lt=(o,n)=>e.check(De(o,n)),e.lte=(o,n)=>e.check(Se(o,n)),e.max=(o,n)=>e.check(Se(o,n)),e.positive=o=>e.check(Le(BigInt(0),o)),e.negative=o=>e.check(De(BigInt(0),o)),e.nonpositive=o=>e.check(Se(BigInt(0),o)),e.nonnegative=o=>e.check(de(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(dt(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function mg(e){return Fl(Pn,e)}var Fi=g("ZodBigIntFormat",(e,t)=>{Uc.init(e,t),Pn.init(e,t)});function fg(e){return Zl(Fi,e)}function hg(e){return Bl(Fi,e)}var pd=g("ZodSymbol",(e,t)=>{Fc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fu(e,r,o,n)});function gg(e){return Kl(pd,e)}var md=g("ZodUndefined",(e,t)=>{Gc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gu(e,r,o,n)});function yg(e){return Vl(md,e)}var fd=g("ZodNull",(e,t)=>{Zc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hu(e,r,o,n)});function hd(e){return Wl(fd,e)}var gd=g("ZodAny",(e,t)=>{Bc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_u(e,r,o,n)});function vg(){return Hl(gd)}var yd=g("ZodUnknown",(e,t)=>{Kc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n)});function jt(){return Jl(yd)}var vd=g("ZodNever",(e,t)=>{Vc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vu(e,r,o,n)});function Gi(e){return Yl(vd,e)}var _d=g("ZodVoid",(e,t)=>{Wc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(e,r,o,n)});function _g(e){return ql(_d,e)}var Cr=g("ZodDate",(e,t)=>{Hc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,n,i)=>wu(e,o,n,i),e.min=(o,n)=>e.check(de(o,n)),e.max=(o,n)=>e.check(Se(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function bg(e){return Xl(Cr,e)}var bd=g("ZodArray",(e,t)=>{Jc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.element=t.element,Ar(e,"ZodArray",{min(r,o){return this.check(Je(r,o))},nonempty(r){return this.check(Je(1,r))},max(r,o){return this.check(Nt(r,o))},length(r,o){return this.check(Rt(r,o))},unwrap(){return this.element}})});function Pr(e,t){return tu(bd,e,t)}function wg(e){let t=e._zod.def.shape;return Bi(Object.keys(t))}var Or=g("ZodObject",(e,t)=>{Yc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n),k.defineLazy(e,"shape",()=>t.shape),Ar(e,"ZodObject",{keyof(){return Bi(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:jt()})},loose(){return this.clone({...this._zod.def,catchall:jt()})},strict(){return this.clone({...this._zod.def,catchall:Gi()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return k.extend(this,r)},safeExtend(r){return k.safeExtend(this,r)},merge(r){return k.merge(this,r)},pick(r){return k.pick(this,r)},omit(r){return k.omit(this,r)},partial(...r){return k.partial(Vi,this,r[0])},required(...r){return k.required(Wi,this,r[0])}})});function kg(e,t){let r={type:"object",shape:e??{},...k.normalizeParams(t)};return new Or(r)}function xg(e,t){return new Or({type:"object",shape:e,catchall:Gi(),...k.normalizeParams(t)})}function Sg(e,t){return new Or({type:"object",shape:e,catchall:jt(),...k.normalizeParams(t)})}var Nr=g("ZodUnion",(e,t)=>{yr.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mi(e,r,o,n),e.options=t.options});function Zi(e,t){return new Nr({type:"union",options:e,...k.normalizeParams(t)})}var wd=g("ZodXor",(e,t)=>{Nr.init(e,t),qc.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mi(e,r,o,n),e.options=t.options});function $g(e,t){return new wd({type:"union",options:e,inclusive:!1,...k.normalizeParams(t)})}var kd=g("ZodDiscriminatedUnion",(e,t)=>{Nr.init(e,t),Xc.init(e,t)});function Eg(e,t,r){return new kd({type:"union",options:t,discriminator:e,...k.normalizeParams(r)})}var xd=g("ZodIntersection",(e,t)=>{Qc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n)});function Sd(e,t){return new xd({type:"intersection",left:e,right:t})}var $d=g("ZodTuple",(e,t)=>{No.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Ed(e,t,r){let o=t instanceof L,n=o?r:t,i=o?t:null;return new $d({type:"tuple",items:e,rest:i,...k.normalizeParams(n)})}var $n=g("ZodRecord",(e,t)=>{el.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Td(e,t,r){return!t||!t._zod?new $n({type:"record",keyType:Sr(),valueType:e,...k.normalizeParams(t)}):new $n({type:"record",keyType:e,valueType:t,...k.normalizeParams(r)})}function Tg(e,t,r){let o=le(e);return o._zod.values=void 0,new $n({type:"record",keyType:o,valueType:t,...k.normalizeParams(r)})}function Ag(e,t,r){return new $n({type:"record",keyType:e,valueType:t,mode:"loose",...k.normalizeParams(r)})}var Ad=g("ZodMap",(e,t)=>{tl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(ze(...r)),e.nonempty=r=>e.check(ze(1,r)),e.max=(...r)=>e.check(pt(...r)),e.size=(...r)=>e.check(Ot(...r))});function Ig(e,t,r){return new Ad({type:"map",keyType:e,valueType:t,...k.normalizeParams(r)})}var Id=g("ZodSet",(e,t)=>{nl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n),e.min=(...r)=>e.check(ze(...r)),e.nonempty=r=>e.check(ze(1,r)),e.max=(...r)=>e.check(pt(...r)),e.size=(...r)=>e.check(Ot(...r))});function Cg(e,t){return new Id({type:"set",valueType:e,...k.normalizeParams(t)})}var En=g("ZodEnum",(e,t)=>{rl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,n,i)=>ku(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new En({...t,checks:[],...k.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new En({...t,checks:[],...k.normalizeParams(n),entries:i})}});function Bi(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new En({type:"enum",entries:r,...k.normalizeParams(t)})}function Pg(e,t){return new En({type:"enum",entries:e,...k.normalizeParams(t)})}var Cd=g("ZodLiteral",(e,t)=>{ol.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Og(e,t){return new Cd({type:"literal",values:Array.isArray(e)?e:[e],...k.normalizeParams(t)})}var Pd=g("ZodFile",(e,t)=>{il.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(e,r,o,n),e.min=(r,o)=>e.check(ze(r,o)),e.max=(r,o)=>e.check(pt(r,o)),e.mime=(r,o)=>e.check(gn(Array.isArray(r)?r:[r],o))});function Ng(e){return nu(Pd,e)}var Od=g("ZodTransform",(e,t)=>{al.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new at(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(k.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(k.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Ki(e){return new Od({type:"transform",transform:e})}var Vi=g("ZodOptional",(e,t)=>{Ro.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Er(e){return new Vi({type:"optional",innerType:e})}var Nd=g("ZodExactOptional",(e,t)=>{sl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Rd(e){return new Nd({type:"optional",innerType:e})}var jd=g("ZodNullable",(e,t)=>{cl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Tr(e){return new jd({type:"nullable",innerType:e})}function Rg(e){return Er(Tr(e))}var Dd=g("ZodDefault",(e,t)=>{ll.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ld(e,t){return new Dd({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():k.shallowClone(t)}})}var zd=g("ZodPrefault",(e,t)=>{ul.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Md(e,t){return new zd({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():k.shallowClone(t)}})}var Wi=g("ZodNonOptional",(e,t)=>{dl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ud(e,t){return new Wi({type:"nonoptional",innerType:e,...k.normalizeParams(t)})}var Fd=g("ZodSuccess",(e,t)=>{pl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function jg(e){return new Fd({type:"success",innerType:e})}var Gd=g("ZodCatch",(e,t)=>{ml.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Zd(e,t){return new Gd({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Bd=g("ZodNaN",(e,t)=>{fl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(e,r,o,n)});function Dg(e){return eu(Bd,e)}var Rr=g("ZodPipe",(e,t)=>{jo.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zu(e,r,o,n),e.in=t.in,e.out=t.out});function xi(e,t){return new Rr({type:"pipe",in:e,out:t})}var jr=g("ZodCodec",(e,t)=>{Rr.init(e,t),vr.init(e,t)});function Lg(e,t,r){return new jr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function zg(e){let t=e._zod.def;return new jr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Kd=g("ZodPreprocess",(e,t)=>{Rr.init(e,t),hl.init(e,t)}),Vd=g("ZodReadonly",(e,t)=>{gl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Wd(e){return new Vd({type:"readonly",innerType:e})}var Hd=g("ZodTemplateLiteral",(e,t)=>{yl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n)});function Mg(e,t){return new Hd({type:"template_literal",parts:e,...k.normalizeParams(t)})}var Jd=g("ZodLazy",(e,t)=>{bl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Yd(e){return new Jd({type:"lazy",getter:e})}var qd=g("ZodPromise",(e,t)=>{_l.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ku(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ug(e){return new qd({type:"promise",innerType:e})}var Xd=g("ZodFunction",(e,t)=>{vl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iu(e,r,o,n)});function Fg(e){return new Xd({type:"function",input:Array.isArray(e?.input)?Ed(e?.input):e?.input??Pr(jt()),output:e?.output??jt()})}var Dr=g("ZodCustom",(e,t)=>{wl.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n)});function Gg(e){let t=new V({check:"custom"});return t._zod.check=e,t}function Zg(e,t){return ru(Dr,e??(()=>!0),t)}function Qd(e,t={}){return ou(Dr,e,t)}function ep(e,t){return iu(e,t)}var Bg=au,Kg=su;function Vg(e,t={}){let r=new Dr({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...k.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Wg=(...e)=>cu({Codec:jr,Boolean:Cn,String:Tn},...e);function Hg(e){let t=Yd(()=>Zi([Sr(e),ud(),dd(),hd(),Pr(t),Td(Sr(),t)]));return t}function Jg(e,t){return new Kd({type:"pipe",in:Ki(e),out:t})}var Ux={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"};function Fx(e){J({customError:e})}function Gx(){return J().customError}var tp;tp||(tp={});var T={...xr,...yi,iso:Sn},Zx=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Bx(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function Kx(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function Yg(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return T.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return T.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=Kx(n,t),a=ie(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return T.null();if(n.length===0)return T.never();if(n.length===1)return T.literal(n[0]);if(n.every(a=>typeof a=="string"))return T.enum(n);let i=n.map(a=>T.literal(a));return i.length<2?i[0]:T.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return T.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return Yg(a,t)});return n.length===0?T.never():n.length===1?n[0]:T.union(n)}if(!r)return T.any();let o;switch(r){case"string":{let n=T.string();if(e.format){let i=e.format;i==="email"?n=n.check(T.email()):i==="uri"||i==="uri-reference"?n=n.check(T.url()):i==="uuid"||i==="guid"?n=n.check(T.uuid()):i==="date-time"?n=n.check(T.iso.datetime()):i==="date"?n=n.check(T.iso.date()):i==="time"?n=n.check(T.iso.time()):i==="duration"?n=n.check(T.iso.duration()):i==="ipv4"?n=n.check(T.ipv4()):i==="ipv6"?n=n.check(T.ipv6()):i==="mac"?n=n.check(T.mac()):i==="cidr"?n=n.check(T.cidrv4()):i==="cidr-v6"?n=n.check(T.cidrv6()):i==="base64"?n=n.check(T.base64()):i==="base64url"?n=n.check(T.base64url()):i==="e164"?n=n.check(T.e164()):i==="jwt"?n=n.check(T.jwt()):i==="emoji"?n=n.check(T.emoji()):i==="nanoid"?n=n.check(T.nanoid()):i==="cuid"?n=n.check(T.cuid()):i==="cuid2"?n=n.check(T.cuid2()):i==="ulid"?n=n.check(T.ulid()):i==="xid"?n=n.check(T.xid()):i==="ksuid"&&(n=n.check(T.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?T.number().int():T.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=T.boolean();break}case"null":{o=T.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[c,l]of Object.entries(i)){let p=ie(l,t);n[c]=a.has(c)?p:p.optional()}if(e.propertyNames){let c=ie(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?ie(e.additionalProperties,t):T.any();if(Object.keys(n).length===0){o=T.record(c,l);break}let p=T.object(n).passthrough(),d=T.looseRecord(c,l);o=T.intersection(p,d);break}if(e.patternProperties){let c=e.patternProperties,l=Object.keys(c),p=[];for(let m of l){let f=ie(c[m],t),h=T.string().regex(new RegExp(m));p.push(T.looseRecord(h,f))}let d=[];if(Object.keys(n).length>0&&d.push(T.object(n).passthrough()),d.push(...p),d.length===0)o=T.object({}).passthrough();else if(d.length===1)o=d[0];else{let m=T.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)m=T.intersection(m,d[f]);o=m}break}let s=T.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(ie(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(c=>ie(c,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?ie(i,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(c=>ie(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?ie(e.additionalItems,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(i!==void 0){let a=ie(i,t),s=T.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=T.array(T.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function ie(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r=Yg(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>ie(l,t)),c=T.union(s);r=o?T.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>ie(l,t)),c=T.xor(s);r=o?T.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:T.any();else{let s=o?r:ie(e.allOf[0],t),c=o?0:1;for(let l=c;l<e.allOf.length;l++)s=T.intersection(s,ie(e.allOf[l],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=T.nullable(r)),e.readOnly===!0&&(r=T.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))Zx.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function qg(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=Bx(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??re};return ie(r,i)}var np={};Ke(np,{bigint:()=>Jx,boolean:()=>Hx,date:()=>Yx,number:()=>Wx,string:()=>Vx});function Vx(e){return $l(Tn,e)}function Wx(e){return Nl(In,e)}function Hx(e){return Ul(Cn,e)}function Jx(e){return Gl(Pn,e)}function Yx(e){return Ql(Cr,e)}J(Do());var qx=[".localhost",".local",".internal",".test",".localdomain"],Xx=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"]);function Xg(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(Xx.has(t)||qx.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return Xg(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function Qg(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(Xg(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var Lr=u.discriminatedUnion("source",[u.object({source:u.literal("manifest")}),u.object({source:u.literal("studio"),element_id:u.string().min(1),edition_id:u.string().min(1)})]);var Qx=u.object({archetype:u.literal("hunt"),number:u.number().int().positive().default(1),prompt:u.string().default(""),board:u.array(u.string().min(1)).min(2),targets:u.array(u.string().min(1)).min(1),required:u.number().int().positive().optional(),pointsPerTarget:u.number().int().nonnegative().default(10),completionBonus:u.number().int().nonnegative().default(0),attemptsAllowed:u.number().int().positive().default(10),mistakesAllowed:u.number().int().positive().default(4),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),eS=u.object({key:u.string().min(1),label:u.string().min(1),value:u.number().int().nonnegative()}),tS=u.object({id:u.string().min(1),label:u.string().default(""),entries:u.array(eS).min(1)}),nS=u.object({within:u.number().min(0).max(1),label:u.string().min(1)}),rS=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],ey=u.object({archetype:u.literal("push"),number:u.number().int().positive().default(1),prompt:u.string().default(""),target:u.number().int().positive(),targetLabel:u.string().default(""),slates:u.array(tS).min(1),tiers:u.array(nS).default(rS),floorLabel:u.string().default("Rookie"),bustLabel:u.string().default("Busted"),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(c=>c.key)),n=[...new Set(o.filter((s,c)=>o.indexOf(s)!==c))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,c)=>s+Math.min(...c.entries.map(l=>l.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,c)=>c===0||s.within>e.tiers[c-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),oS=u.object({key:u.string().min(1),label:u.string().min(1),members:u.array(u.string().min(1)).min(2)}),iS=u.object({archetype:u.literal("group"),number:u.number().int().positive().default(1),prompt:u.string().default(""),board:u.array(u.string().min(1)).min(4),groups:u.array(oS).min(2),pointsPerGroup:u.number().int().nonnegative().default(10),completionBonus:u.number().int().nonnegative().default(0),attemptsAllowed:u.number().int().positive().default(10),mistakesAllowed:u.number().int().positive().default(4),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let c=r.get(s);c&&c!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${c} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),aS=u.object({key:u.string().min(1),label:u.string().min(1),points:u.number().int().nonnegative().optional()}),sS=u.object({archetype:u.literal("forecast"),number:u.number().int().positive().default(1),prompt:u.string().default(""),options:u.array(aS).min(2),result:u.string().min(1).optional(),pointsForCorrect:u.number().int().nonnegative().default(10),attemptsAllowed:u.number().int().positive().default(1),open:u.boolean().default(!0),playsPerSecond:u.number().int().positive().optional()}).superRefine((e,t)=>{new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})}),cS=u.discriminatedUnion("archetype",[Qx,ey,iS,sS]),Pe=u.preprocess(qm,cS);function On(e){return`round-${e.number}`}var MN=u.object({game:u.string().min(1),round:Pe,origin:Lr.optional(),snapshot:u.string().default(""),source:u.string().optional(),roundId:u.string().min(1).optional(),selection:u.object({mode:u.literal("rotation"),windowSeconds:u.number().int().positive(),rounds:u.array(u.object({id:u.string().min(1),round:Pe,origin:Lr.optional()})).min(1)}).optional()}),UN=u.object({roundId:u.string(),version:u.number().int().nonnegative(),changed:u.boolean(),current:u.boolean()});var Hi="1.0",rp=u.enum(["missing","proposed","confirmed","verified","approved"]),op={missing:0,proposed:1,confirmed:2,verified:3,approved:4},ip=u.enum(["runtime","live","enterprise"]);var gt=u.enum(["L0","L1","L2","L3","L4","L5"]),Nn={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},ty={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},lS=u.discriminatedUnion("kind",[u.object({kind:u.literal("human_decision"),owner:u.string(),date:u.string(),note:u.string().optional()}),u.object({kind:u.literal("generated_proposal"),tool:u.string(),model:u.string().optional(),source_context:u.string().optional()}),u.object({kind:u.literal("repository_evidence"),file:u.string(),commit:u.string().optional(),package:u.string().optional()}),u.object({kind:u.literal("platform_evidence"),system:u.string(),id:u.string()}),u.object({kind:u.literal("external_evidence"),supplier:u.string(),licence:u.string().optional(),dataset_version:u.string().optional()})]),Ue={status:rp.default("missing"),provenance:u.array(lS).default([])},uS=u.object({schema_version:u.string(),revision:u.number().int().nonnegative().default(0),conformance:gt.default("L0")}),dS=u.object({repository:u.string().url(),branch:u.string().default("main")}),pS=u.object({id:u.string().min(1),title:u.string().min(1),summary:u.string().optional(),source:dS.optional(),owners:u.object({ip:u.string().optional(),delivery:u.string().optional(),platform:u.string().optional()}).prefault({}),...Ue}),mS=u.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),fS=u.enum(["trivia","forecast","group","timed_round","synchronous_event","collection_ranking","hunt","push"]),yt=u.preprocess(e=>typeof e=="string"?We(e):e,fS),hS=u.object({route:mS.optional(),archetype:yt.optional(),component:u.string().optional(),version:u.string().optional(),variant:u.string().optional(),configuration:u.record(u.string(),u.unknown()).default({}),round:Pe.optional(),...Ue}),gS=u.object({surfaces:u.array(u.string()).default([]),container_label:u.string().min(1).default(Qt),screen_graph:u.string().optional(),design:u.object({figma_file:u.string().optional(),figma_version:u.string().optional(),tokens:u.string().optional(),fidelity:gt.optional()}).optional(),...Ue}),yS=u.object({spec_url:u.string().optional(),version:u.string().optional(),...Ue}),vS=u.object({family:u.string().optional(),version:u.string().optional(),configuration_schema:u.string().optional(),...Ue}),_S=u.object({project_template:u.string().optional(),project_id:u.string().optional(),events:u.array(u.string()).default([]),elements:u.array(u.string()).default([]),...Ue}),bS=u.object({required:u.boolean().default(!1),minimum_age:u.number().int().positive().max(120).optional(),method:u.enum(["self_declared","verified"]).default("self_declared"),verifier:u.string().optional()}),wS=u.object({issuer:u.string().url(),jwks_uri:u.string().url(),audience:u.string().optional()}),kS=u.object({provider:u.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:wS.optional(),require_authenticated_writes:u.boolean().default(!0),age_gate:bS.prefault({}),consent:u.object({analytics_requires_consent:u.boolean().default(!0),provider:u.string().optional()}).prefault({}),...Ue}),xS=u.object({type:u.enum(["monterosa","posthog","ga4","webhook"]),enabled:u.boolean().default(!0),config:u.record(u.string(),u.string()).default({})}),SS=u.object({destinations:u.array(xS).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:u.array(u.string()).default([]),signal:u.object({enabled:u.boolean().default(!1),application_id:u.string().optional(),write_key:u.string().optional(),monterosa:u.object({enabled:u.boolean().default(!1),organisation_id:u.string().optional(),project_id:u.string().optional()}).prefault({})}).prefault({}),...Ue}),$S=u.object({hosting:u.string().optional(),space_spec:u.string().optional(),environments:u.array(u.enum(["local","playground","staging","production"])).default(["local"]),...Ue}),ES=u.object({offers_prize:u.boolean().default(!1),free_entry_route:u.string().optional(),skill_based:u.boolean().default(!1),terms_url:u.string().optional(),jurisdictions:u.array(u.string()).default([])}),TS=u.object({support_tier:ip.optional(),runbook:u.string().optional(),promotion:ES.prefault({}),...Ue}),Lt=u.object({manifest:uS,app:pS,experience:gS.prefault({}),studio_app:yS.prefault({}),studio_surface:vS.prefault({}),backend:hS.prefault({}),interaction_cloud:_S.prefault({}),identity:kS.prefault({}),measurement:SS.prefault({}),deployment:$S.prefault({}),operations:TS.prefault({})});function ny(e){let t=[];e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let r=e.operations.promotion;if(r.offers_prize&&(r.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),r.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!r.skill_based&&!r.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let o of["issuer","jwks_uri"]){let n=e.identity.jwt[o],i=Qg(n);i&&t.push({path:`identity.jwt.${o}`,message:i==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":i==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var Rn=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"];var qe=(e,t,r)=>{let o=e[t];return op[o?.status??"missing"]>=op[r]},ye=e=>typeof e=="string"?e.trim().length>0:e!=null,AS=[{level:"L0",id:"L0.app.identity",requirement:"app.id and app.title are set",check:e=>ye(e.app.id)&&ye(e.app.title)},{level:"L0",id:"L0.app.status",requirement:"app section is at least proposed",check:e=>qe(e,"app","proposed")},{level:"L0",id:"L0.schema.version",requirement:"manifest.schema_version is set",check:e=>ye(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",requirement:"experience declares a screen graph or at least one player surface",check:e=>ye(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",requirement:"experience section is at least proposed",check:e=>qe(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>ye(e.backend.route)},{level:"L2",id:"L2.backend.pinned",requirement:"backend names a component and version, confirmed or better",check:e=>ye(e.backend.component)&&ye(e.backend.version)&&qe(e,"backend","confirmed")},{level:"L2",id:"L2.identity.policy",requirement:"identity provider is set and the section is confirmed",check:e=>ye(e.identity.provider)&&qe(e,"identity","confirmed")},{level:"L2",id:"L2.measurement.destination",requirement:"at least one enabled analytics destination is declared",check:e=>e.measurement.destinations.some(t=>t.enabled)},{level:"L2",id:"L2.platform.identifiers",requirement:"a real platform identity exists (Studio App Spec or Interaction Cloud project)",check:e=>ye(e.studio_app.spec_url)||ye(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",requirement:"deployment names a Space spec and a non-local environment",check:e=>ye(e.deployment.space_spec)&&e.deployment.environments.some(t=>t!=="local")},{level:"L3",id:"L3.surface.declared",requirement:"a Studio Surface family is declared for operator control",check:e=>ye(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",requirement:"experience, backend and deployment are all confirmed or better",check:e=>qe(e,"experience","confirmed")&&qe(e,"backend","confirmed")&&qe(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>qe(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",requirement:"operations declares a support tier and a runbook",check:e=>ye(e.operations.support_tier)&&ye(e.operations.runbook)},{level:"L5",id:"L5.production.approved",requirement:"the manifest is approved and deployed to a production environment",check:e=>qe(e,"operations","approved")&&e.deployment.environments.includes("production")}],ry=["L0","L1","L2","L3","L4","L5"];function Re(e){let t=AS.map(l=>({id:l.id,level:l.level,requirement:l.requirement,passed:l.check(e)})),r="L0",o=!0;for(let l of ry)t.filter(m=>m.level===l).every(m=>m.passed)&&o?r=l:o=!1;let n=t.filter(l=>l.level==="L0").every(l=>l.passed),i=Nn[r]+1,a=ry[i],s=a?t.filter(l=>l.level===a&&!l.passed):[],c=e.manifest.conformance;return{computed:r,computedName:ty[r],claimed:c,overclaimed:!n||Nn[c]>Nn[r],results:t,blockers:n?s:t.filter(l=>l.level==="L0"&&!l.passed)}}function oy(e,t){let o=Re(e).results.filter(n=>!n.passed&&Nn[n.level]<=Nn[t]);return{ok:o.length===0,missing:o}}function by(e){return typeof e>"u"||e===null}function IS(e){return typeof e=="object"&&e!==null}function CS(e){return Array.isArray(e)?e:by(e)?[]:[e]}function PS(e,t){var r,o,n,i;if(t)for(i=Object.keys(t),r=0,o=i.length;r<o;r+=1)n=i[r],e[n]=t[n];return e}function OS(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function NS(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var RS=by,jS=IS,DS=CS,LS=OS,zS=NS,MS=PS,Q={isNothing:RS,isObject:jS,toArray:DS,repeat:LS,isNegativeZero:zS,extend:MS};function wy(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
7111
+
7112
+ `+e.mark.snippet),o+" "+r):o}function Mr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=wy(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Mr.prototype=Object.create(Error.prototype);Mr.prototype.constructor=Mr;Mr.prototype.toString=function(t){return this.name+": "+wy(this,t)};var me=Mr;function ap(e,t,r,o,n){var i="",a="",s=Math.floor(n/2)-1;return o-t>s&&(i=" ... ",t=o-s+i.length),r-o>s&&(a=" ...",r=o+s-a.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+a,pos:o-t+i.length}}function sp(e,t){return Q.repeat(" ",t-e.length)+e}function US(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,o=[0],n=[],i,a=-1;i=r.exec(e.buffer);)n.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&a<0&&(a=o.length-2);a<0&&(a=o.length-1);var s="",c,l,p=Math.min(e.line+t.linesAfter,n.length).toString().length,d=t.maxLength-(t.indent+p+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)l=ap(e.buffer,o[a-c],n[a-c],e.position-(o[a]-o[a-c]),d),s=Q.repeat(" ",t.indent)+sp((e.line-c+1).toString(),p)+" | "+l.str+`
7113
+ `+s;for(l=ap(e.buffer,o[a],n[a],e.position,d),s+=Q.repeat(" ",t.indent)+sp((e.line+1).toString(),p)+" | "+l.str+`
7114
+ `,s+=Q.repeat("-",t.indent+p+3+l.pos)+`^
7115
+ `,c=1;c<=t.linesAfter&&!(a+c>=n.length);c++)l=ap(e.buffer,o[a+c],n[a+c],e.position-(o[a]-o[a+c]),d),s+=Q.repeat(" ",t.indent)+sp((e.line+c+1).toString(),p)+" | "+l.str+`
7116
+ `;return s.replace(/\n$/,"")}var FS=US,GS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ZS=["scalar","sequence","mapping"];function BS(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){t[String(o)]=r})}),t}function KS(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(GS.indexOf(r)===-1)throw new me('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=BS(t.styleAliases||null),ZS.indexOf(this.kind)===-1)throw new me('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var oe=KS;function iy(e,t){var r=[];return e[t].forEach(function(o){var n=r.length;r.forEach(function(i,a){i.tag===o.tag&&i.kind===o.kind&&i.multi===o.multi&&(n=a)}),r[n]=o}),r}function VS(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function o(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(o);return e}function lp(e){return this.extend(e)}lp.prototype.extend=function(t){var r=[],o=[];if(t instanceof oe)o.push(t);else if(Array.isArray(t))o=o.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(o=o.concat(t.explicit));else throw new me("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof oe))throw new me("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new me("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new me("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(i){if(!(i instanceof oe))throw new me("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(lp.prototype);return n.implicit=(this.implicit||[]).concat(r),n.explicit=(this.explicit||[]).concat(o),n.compiledImplicit=iy(n,"implicit"),n.compiledExplicit=iy(n,"explicit"),n.compiledTypeMap=VS(n.compiledImplicit,n.compiledExplicit),n};var ky=lp,xy=new oe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Sy=new oe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),$y=new oe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ey=new ky({explicit:[xy,Sy,$y]});function WS(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function HS(){return null}function JS(e){return e===null}var Ty=new oe("tag:yaml.org,2002:null",{kind:"scalar",resolve:WS,construct:HS,predicate:JS,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function YS(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function qS(e){return e==="true"||e==="True"||e==="TRUE"}function XS(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Ay=new oe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:YS,construct:qS,predicate:XS,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function QS(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function e$(e){return 48<=e&&e<=55}function t$(e){return 48<=e&&e<=57}function n$(e){if(e===null)return!1;var t=e.length,r=0,o=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;o=!0}return o&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!QS(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!e$(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!t$(e.charCodeAt(r)))return!1;o=!0}return!(!o||n==="_")}function r$(e){var t=e,r=1,o;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),o=t[0],(o==="-"||o==="+")&&(o==="-"&&(r=-1),t=t.slice(1),o=t[0]),t==="0")return 0;if(o==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function o$(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Q.isNegativeZero(e)}var Iy=new oe("tag:yaml.org,2002:int",{kind:"scalar",resolve:n$,construct:r$,predicate:o$,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),i$=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function a$(e){return!(e===null||!i$.test(e)||e[e.length-1]==="_")}function s$(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var c$=/^[-+]?[0-9]+e/;function l$(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q.isNegativeZero(e))return"-0.0";return r=e.toString(10),c$.test(r)?r.replace("e",".e"):r}function u$(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Q.isNegativeZero(e))}var Cy=new oe("tag:yaml.org,2002:float",{kind:"scalar",resolve:a$,construct:s$,predicate:u$,represent:l$,defaultStyle:"lowercase"}),Py=Ey.extend({implicit:[Ty,Ay,Iy,Cy]}),Oy=Py,Ny=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ry=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function d$(e){return e===null?!1:Ny.exec(e)!==null||Ry.exec(e)!==null}function p$(e){var t,r,o,n,i,a,s,c=0,l=null,p,d,m;if(t=Ny.exec(e),t===null&&(t=Ry.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],o=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,o,n));if(i=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(p=+t[10],d=+(t[11]||0),l=(p*60+d)*6e4,t[9]==="-"&&(l=-l)),m=new Date(Date.UTC(r,o,n,i,a,s,c)),l&&m.setTime(m.getTime()-l),m}function m$(e){return e.toISOString()}var jy=new oe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:d$,construct:p$,instanceOf:Date,represent:m$});function f$(e){return e==="<<"||e===null}var Dy=new oe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:f$}),fp=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
7117
+ \r`;function h$(e){if(e===null)return!1;var t,r,o=0,n=e.length,i=fp;for(r=0;r<n;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function g$(e){var t,r,o=e.replace(/[\r\n=]/g,""),n=o.length,i=fp,a=0,s=[];for(t=0;t<n;t++)t%4===0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|i.indexOf(o.charAt(t));return r=n%4*6,r===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):r===18?(s.push(a>>10&255),s.push(a>>2&255)):r===12&&s.push(a>>4&255),new Uint8Array(s)}function y$(e){var t="",r=0,o,n,i=e.length,a=fp;for(o=0;o<i;o++)o%3===0&&o&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[o];return n=i%3,n===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):n===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):n===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function v$(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ly=new oe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:h$,construct:g$,predicate:v$,represent:y$}),_$=Object.prototype.hasOwnProperty,b$=Object.prototype.toString;function w$(e){if(e===null)return!0;var t=[],r,o,n,i,a,s=e;for(r=0,o=s.length;r<o;r+=1){if(n=s[r],a=!1,b$.call(n)!=="[object Object]")return!1;for(i in n)if(_$.call(n,i))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function k$(e){return e!==null?e:[]}var zy=new oe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:w$,construct:k$}),x$=Object.prototype.toString;function S$(e){if(e===null)return!0;var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(o=a[t],x$.call(o)!=="[object Object]"||(n=Object.keys(o),n.length!==1))return!1;i[t]=[n[0],o[n[0]]]}return!0}function $$(e){if(e===null)return[];var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1)o=a[t],n=Object.keys(o),i[t]=[n[0],o[n[0]]];return i}var My=new oe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:S$,construct:$$}),E$=Object.prototype.hasOwnProperty;function T$(e){if(e===null)return!0;var t,r=e;for(t in r)if(E$.call(r,t)&&r[t]!==null)return!1;return!0}function A$(e){return e!==null?e:{}}var Uy=new oe("tag:yaml.org,2002:set",{kind:"mapping",resolve:T$,construct:A$}),hp=Oy.extend({implicit:[jy,Dy],explicit:[Ly,zy,My,Uy]}),_t=Object.prototype.hasOwnProperty,Ji=1,Fy=2,Gy=3,Yi=4,cp=1,I$=2,ay=3,C$=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,P$=/[\x85\u2028\u2029]/,O$=/[,\[\]\{\}]/,Zy=/^(?:!|!!|![a-z\-]+!)$/i,By=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function sy(e){return Object.prototype.toString.call(e)}function Fe(e){return e===10||e===13}function Mt(e){return e===9||e===32}function ve(e){return e===9||e===32||e===10||e===13}function Dn(e){return e===44||e===91||e===93||e===123||e===125}function N$(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function R$(e){return e===120?2:e===117?4:e===85?8:0}function j$(e){return 48<=e&&e<=57?e-48:-1}function cy(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
7118
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function D$(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Ky(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}var Vy=new Array(256),Wy=new Array(256);for(zt=0;zt<256;zt++)Vy[zt]=cy(zt)?1:0,Wy[zt]=cy(zt);var zt;function L$(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||hp,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Hy(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=FS(r),new me(t,r)}function P(e,t){throw Hy(e,t)}function qi(e,t){e.onWarning&&e.onWarning.call(null,Hy(e,t))}var ly={YAML:function(t,r,o){var n,i,a;t.version!==null&&P(t,"duplication of %YAML directive"),o.length!==1&&P(t,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),n===null&&P(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),a=parseInt(n[2],10),i!==1&&P(t,"unacceptable YAML version of the document"),t.version=o[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&qi(t,"unsupported YAML version of the document")},TAG:function(t,r,o){var n,i;o.length!==2&&P(t,"TAG directive accepts exactly two arguments"),n=o[0],i=o[1],Zy.test(n)||P(t,"ill-formed tag handle (first argument) of the TAG directive"),_t.call(t.tagMap,n)&&P(t,'there is a previously declared suffix for "'+n+'" tag handle'),By.test(i)||P(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{P(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}};function vt(e,t,r,o){var n,i,a,s;if(t<r){if(s=e.input.slice(t,r),o)for(n=0,i=s.length;n<i;n+=1)a=s.charCodeAt(n),a===9||32<=a&&a<=1114111||P(e,"expected valid JSON character");else C$.test(s)&&P(e,"the stream contains non-printable characters");e.result+=s}}function uy(e,t,r,o){var n,i,a,s;for(Q.isObject(r)||P(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),a=0,s=n.length;a<s;a+=1)i=n[a],_t.call(t,i)||(Ky(t,i,r[i]),o[i]=!0)}function Ln(e,t,r,o,n,i,a,s,c){var l,p;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),l=0,p=n.length;l<p;l+=1)Array.isArray(n[l])&&P(e,"nested arrays are not supported inside keys"),typeof n=="object"&&sy(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&sy(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(l=0,p=i.length;l<p;l+=1)uy(e,t,i[l],r);else uy(e,t,i,r);else!e.json&&!_t.call(r,n)&&_t.call(t,n)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,P(e,"duplicated mapping key")),Ky(t,n,i),delete r[n];return t}function gp(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):P(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function X(e,t,r){for(var o=0,n=e.input.charCodeAt(e.position);n!==0;){for(;Mt(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(Fe(n))for(gp(e),n=e.input.charCodeAt(e.position),o++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&o!==0&&e.lineIndent<r&&qi(e,"deficient indentation"),o}function ea(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||ve(r)))}function yp(e,t){t===1?e.result+=" ":t>1&&(e.result+=Q.repeat(`
7119
+ `,t-1))}function z$(e,t,r){var o,n,i,a,s,c,l,p,d=e.kind,m=e.result,f;if(f=e.input.charCodeAt(e.position),ve(f)||Dn(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(n=e.input.charCodeAt(e.position+1),ve(n)||r&&Dn(n)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,s=!1;f!==0;){if(f===58){if(n=e.input.charCodeAt(e.position+1),ve(n)||r&&Dn(n))break}else if(f===35){if(o=e.input.charCodeAt(e.position-1),ve(o))break}else{if(e.position===e.lineStart&&ea(e)||r&&Dn(f))break;if(Fe(f))if(c=e.line,l=e.lineStart,p=e.lineIndent,X(e,!1,-1),e.lineIndent>=t){s=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=c,e.lineStart=l,e.lineIndent=p;break}}s&&(vt(e,i,a,!1),yp(e,e.line-c),i=a=e.position,s=!1),Mt(f)||(a=e.position+1),f=e.input.charCodeAt(++e.position)}return vt(e,i,a,!1),e.result?!0:(e.kind=d,e.result=m,!1)}function M$(e,t){var r,o,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(vt(e,o,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)o=e.position,e.position++,n=e.position;else return!0;else Fe(r)?(vt(e,o,n,!0),yp(e,X(e,!1,t)),o=n=e.position):e.position===e.lineStart&&ea(e)?P(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);P(e,"unexpected end of the stream within a single quoted scalar")}function U$(e,t){var r,o,n,i,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return vt(e,r,e.position,!0),e.position++,!0;if(s===92){if(vt(e,r,e.position,!0),s=e.input.charCodeAt(++e.position),Fe(s))X(e,!1,t);else if(s<256&&Vy[s])e.result+=Wy[s],e.position++;else if((a=R$(s))>0){for(n=a,i=0;n>0;n--)s=e.input.charCodeAt(++e.position),(a=N$(s))>=0?i=(i<<4)+a:P(e,"expected hexadecimal character");e.result+=D$(i),e.position++}else P(e,"unknown escape sequence");r=o=e.position}else Fe(s)?(vt(e,r,o,!0),yp(e,X(e,!1,t)),r=o=e.position):e.position===e.lineStart&&ea(e)?P(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}P(e,"unexpected end of the stream within a double quoted scalar")}function F$(e,t){var r=!0,o,n,i,a=e.tag,s,c=e.anchor,l,p,d,m,f,h=Object.create(null),_,S,O,z;if(z=e.input.charCodeAt(e.position),z===91)p=93,f=!1,s=[];else if(z===123)p=125,f=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),z=e.input.charCodeAt(++e.position);z!==0;){if(X(e,!0,t),z=e.input.charCodeAt(e.position),z===p)return e.position++,e.tag=a,e.anchor=c,e.kind=f?"mapping":"sequence",e.result=s,!0;r?z===44&&P(e,"expected the node content, but found ','"):P(e,"missed comma between flow collection entries"),S=_=O=null,d=m=!1,z===63&&(l=e.input.charCodeAt(e.position+1),ve(l)&&(d=m=!0,e.position++,X(e,!0,t))),o=e.line,n=e.lineStart,i=e.position,zn(e,t,Ji,!1,!0),S=e.tag,_=e.result,X(e,!0,t),z=e.input.charCodeAt(e.position),(m||e.line===o)&&z===58&&(d=!0,z=e.input.charCodeAt(++e.position),X(e,!0,t),zn(e,t,Ji,!1,!0),O=e.result),f?Ln(e,s,h,S,_,O,o,n,i):d?s.push(Ln(e,null,h,S,_,O,o,n,i)):s.push(_),X(e,!0,t),z=e.input.charCodeAt(e.position),z===44?(r=!0,z=e.input.charCodeAt(++e.position)):r=!1}P(e,"unexpected end of the stream within a flow collection")}function G$(e,t){var r,o,n=cp,i=!1,a=!1,s=t,c=0,l=!1,p,d;if(d=e.input.charCodeAt(e.position),d===124)o=!1;else if(d===62)o=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)cp===n?n=d===43?ay:I$:P(e,"repeat of a chomping mode identifier");else if((p=j$(d))>=0)p===0?P(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?P(e,"repeat of an indentation width identifier"):(s=t+p-1,a=!0);else break;if(Mt(d)){do d=e.input.charCodeAt(++e.position);while(Mt(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Fe(d)&&d!==0)}for(;d!==0;){for(gp(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),Fe(d)){c++;continue}if(e.lineIndent<s){n===ay?e.result+=Q.repeat(`
7120
+ `,i?1+c:c):n===cp&&i&&(e.result+=`
7121
+ `);break}for(o?Mt(d)?(l=!0,e.result+=Q.repeat(`
7122
+ `,i?1+c:c)):l?(l=!1,e.result+=Q.repeat(`
7123
+ `,c+1)):c===0?i&&(e.result+=" "):e.result+=Q.repeat(`
7124
+ `,c):e.result+=Q.repeat(`
7125
+ `,i?1+c:c),i=!0,a=!0,c=0,r=e.position;!Fe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);vt(e,r,e.position,!1)}return!0}function dy(e,t){var r,o=e.tag,n=e.anchor,i=[],a,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,P(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!ve(a))));){if(s=!0,e.position++,X(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,zn(e,t,Gy,!1,!0),i.push(e.result),X(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)P(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=o,e.anchor=n,e.kind="sequence",e.result=i,!0):!1}function Z$(e,t,r){var o,n,i,a,s,c,l=e.tag,p=e.anchor,d={},m=Object.create(null),f=null,h=null,_=null,S=!1,O=!1,z;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),z=e.input.charCodeAt(e.position);z!==0;){if(!S&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,P(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),i=e.line,(z===63||z===58)&&ve(o))z===63?(S&&(Ln(e,d,m,f,h,null,a,s,c),f=h=_=null),O=!0,S=!0,n=!0):S?(S=!1,n=!0):P(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,z=o;else{if(a=e.line,s=e.lineStart,c=e.position,!zn(e,r,Fy,!1,!0))break;if(e.line===i){for(z=e.input.charCodeAt(e.position);Mt(z);)z=e.input.charCodeAt(++e.position);if(z===58)z=e.input.charCodeAt(++e.position),ve(z)||P(e,"a whitespace character is expected after the key-value separator within a block mapping"),S&&(Ln(e,d,m,f,h,null,a,s,c),f=h=_=null),O=!0,S=!1,n=!1,f=e.tag,h=e.result;else if(O)P(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=l,e.anchor=p,!0}else if(O)P(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=l,e.anchor=p,!0}if((e.line===i||e.lineIndent>t)&&(S&&(a=e.line,s=e.lineStart,c=e.position),zn(e,t,Yi,!0,n)&&(S?h=e.result:_=e.result),S||(Ln(e,d,m,f,h,_,a,s,c),f=h=_=null),X(e,!0,-1),z=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&z!==0)P(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return S&&Ln(e,d,m,f,h,null,a,s,c),O&&(e.tag=l,e.anchor=p,e.kind="mapping",e.result=d),O}function B$(e){var t,r=!1,o=!1,n,i,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&P(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(i=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):P(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!ve(a);)a===33&&(o?P(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),Zy.test(n)||P(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),O$.test(i)&&P(e,"tag suffix cannot contain flow indicator characters")}i&&!By.test(i)&&P(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{P(e,"tag name is malformed: "+i)}return r?e.tag=i:_t.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:n==="!"?e.tag="!"+i:n==="!!"?e.tag="tag:yaml.org,2002:"+i:P(e,'undeclared tag handle "'+n+'"'),!0}function K$(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&P(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ve(r)&&!Dn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&P(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function V$(e){var t,r,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;o!==0&&!ve(o)&&!Dn(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&P(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),_t.call(e.anchorMap,r)||P(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],X(e,!0,-1),!0}function zn(e,t,r,o,n){var i,a,s,c=1,l=!1,p=!1,d,m,f,h,_,S;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=a=s=Yi===r||Gy===r,o&&X(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;B$(e)||K$(e);)X(e,!0,-1)?(l=!0,s=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&(s=l||n),(c===1||Yi===r)&&(Ji===r||Fy===r?_=t:_=t+1,S=e.position-e.lineStart,c===1?s&&(dy(e,S)||Z$(e,S,_))||F$(e,_)?p=!0:(a&&G$(e,_)||M$(e,_)||U$(e,_)?p=!0:V$(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&P(e,"alias node should not have any properties")):z$(e,_,Ji===r)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=s&&dy(e,S))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&P(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,m=e.implicitTypes.length;d<m;d+=1)if(h=e.implicitTypes[d],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(_t.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,f=e.typeMap.multi[e.kind||"fallback"],d=0,m=f.length;d<m;d+=1)if(e.tag.slice(0,f[d].tag.length)===f[d].tag){h=f[d];break}h||P(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&P(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):P(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function W$(e){var t=e.position,r,o,n,i=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(X(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(i=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ve(a);)a=e.input.charCodeAt(++e.position);for(o=e.input.slice(r,e.position),n=[],o.length<1&&P(e,"directive name must not be less than one character in length");a!==0;){for(;Mt(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Fe(a));break}if(Fe(a))break;for(r=e.position;a!==0&&!ve(a);)a=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}a!==0&&gp(e),_t.call(ly,o)?ly[o](e,o,n):qi(e,'unknown document directive "'+o+'"')}if(X(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,X(e,!0,-1)):i&&P(e,"directives end mark is expected"),zn(e,e.lineIndent-1,Yi,!1,!0),X(e,!0,-1),e.checkLineBreaks&&P$.test(e.input.slice(t,e.position))&&qi(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ea(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,X(e,!0,-1));return}if(e.position<e.length-1)P(e,"end of the stream or a document separator is expected");else return}function Jy(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
7126
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new L$(e,t),o=e.indexOf("\0");for(o!==-1&&(r.position=o,P(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)W$(r);return r.documents}function H$(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var o=Jy(e,r);if(typeof t!="function")return o;for(var n=0,i=o.length;n<i;n+=1)t(o[n])}function J$(e,t){var r=Jy(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new me("expected a single document in the stream, but found more")}}var Y$=H$,q$=J$,Yy={loadAll:Y$,load:q$},qy=Object.prototype.toString,Xy=Object.prototype.hasOwnProperty,vp=65279,X$=9,Ur=10,Q$=13,eE=32,tE=33,nE=34,up=35,rE=37,oE=38,iE=39,aE=42,Qy=44,sE=45,Xi=58,cE=61,lE=62,uE=63,dE=64,ev=91,tv=93,pE=96,nv=123,mE=124,rv=125,ae={};ae[0]="\\0";ae[7]="\\a";ae[8]="\\b";ae[9]="\\t";ae[10]="\\n";ae[11]="\\v";ae[12]="\\f";ae[13]="\\r";ae[27]="\\e";ae[34]='\\"';ae[92]="\\\\";ae[133]="\\N";ae[160]="\\_";ae[8232]="\\L";ae[8233]="\\P";var fE=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],hE=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function gE(e,t){var r,o,n,i,a,s,c;if(t===null)return{};for(r={},o=Object.keys(t),n=0,i=o.length;n<i;n+=1)a=o[n],s=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&Xy.call(c.styleAliases,s)&&(s=c.styleAliases[s]),r[a]=s;return r}function yE(e){var t,r,o;if(t=e.toString(16).toUpperCase(),e<=255)r="x",o=2;else if(e<=65535)r="u",o=4;else if(e<=4294967295)r="U",o=8;else throw new me("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Q.repeat("0",o-t.length)+t}var vE=1,Fr=2;function _E(e){this.schema=e.schema||hp,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Q.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=gE(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Fr:vE,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function py(e,t){for(var r=Q.repeat(" ",t),o=0,n=-1,i="",a,s=e.length;o<s;)n=e.indexOf(`
7346
7127
  `,o),n===-1?(a=e.slice(o),o=s):(a=e.slice(o,n+1),o=n+1),a.length&&a!==`
7347
- `&&(i+=r),i+=a;return i}function np(e,t){return`
7348
- `+X.repeat(" ",e.indent*t)}function q$(e,t){var r,o,n;for(r=0,o=e.implicitTypes.length;r<o;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function Hi(e){return e===C$||e===A$}function Ur(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==lp||65536<=e&&e<=1114111}function ny(e){return Ur(e)&&e!==lp&&e!==I$&&e!==zr}function ry(e,t,r){var o=ny(e),n=o&&!Hi(e);return(r?o:o&&e!==Gy&&e!==Zy&&e!==By&&e!==Ky&&e!==Vy)&&e!==tp&&!(t===Wi&&!n)||ny(t)&&!Hi(t)&&e===tp||t===Wi&&n}function Y$(e){return Ur(e)&&e!==lp&&!Hi(e)&&e!==L$&&e!==U$&&e!==Wi&&e!==Gy&&e!==Zy&&e!==By&&e!==Ky&&e!==Vy&&e!==tp&&e!==R$&&e!==D$&&e!==P$&&e!==Z$&&e!==z$&&e!==M$&&e!==j$&&e!==O$&&e!==N$&&e!==F$&&e!==G$}function X$(e){return!Hi(e)&&e!==Wi}function Dr(e,t){var r=e.charCodeAt(t),o;return r>=55296&&r<=56319&&t+1<e.length&&(o=e.charCodeAt(t+1),o>=56320&&o<=57343)?(r-55296)*1024+o-56320+65536:r}function Wy(e){var t=/^\n* /;return t.test(e)}var Hy=1,rp=2,Jy=3,qy=4,jn=5;function Q$(e,t,r,o,n,i,a,s){var c,l=0,d=null,p=!1,m=!1,f=o!==-1,h=-1,b=Y$(Dr(e,0))&&X$(Dr(e,e.length-1));if(t||a)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=Dr(e,c),!Ur(l))return jn;b=b&&ry(l,d,s),d=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=Dr(e,c),l===zr)p=!0,f&&(m=m||c-h-1>o&&e[h+1]!==" ",h=c);else if(!Ur(l))return jn;b=b&&ry(l,d,s),d=l}m=m||f&&c-h-1>o&&e[h+1]!==" "}return!p&&!m?b&&!a&&!n(e)?Hy:i===Mr?jn:rp:r>9&&Wy(e)?jn:a?i===Mr?jn:rp:m?qy:Jy}function eE(e,t,r,o,n){e.dump=(function(){if(t.length===0)return e.quotingType===Mr?'""':"''";if(!e.noCompatMode&&(B$.indexOf(t)!==-1||K$.test(t)))return e.quotingType===Mr?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=o||e.flowLevel>-1&&r>=e.flowLevel;function c(l){return q$(e,l)}switch(Q$(t,s,e.indent,a,c,e.quotingType,e.forceQuotes&&!o,n)){case Hy:return t;case rp:return"'"+t.replace(/'/g,"''")+"'";case Jy:return"|"+oy(t,e.indent)+iy(ty(t,i));case qy:return">"+oy(t,e.indent)+iy(ty(tE(t,a),i));case jn:return'"'+nE(t)+'"';default:throw new pe("impossible error: invalid scalar style")}})()}function oy(e,t){var r=Wy(e)?String(t):"",o=e[e.length-1]===`
7128
+ `&&(i+=r),i+=a;return i}function dp(e,t){return`
7129
+ `+Q.repeat(" ",e.indent*t)}function bE(e,t){var r,o,n;for(r=0,o=e.implicitTypes.length;r<o;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function Qi(e){return e===eE||e===X$}function Gr(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==vp||65536<=e&&e<=1114111}function my(e){return Gr(e)&&e!==vp&&e!==Q$&&e!==Ur}function fy(e,t,r){var o=my(e),n=o&&!Qi(e);return(r?o:o&&e!==Qy&&e!==ev&&e!==tv&&e!==nv&&e!==rv)&&e!==up&&!(t===Xi&&!n)||my(t)&&!Qi(t)&&e===up||t===Xi&&n}function wE(e){return Gr(e)&&e!==vp&&!Qi(e)&&e!==sE&&e!==uE&&e!==Xi&&e!==Qy&&e!==ev&&e!==tv&&e!==nv&&e!==rv&&e!==up&&e!==oE&&e!==aE&&e!==tE&&e!==mE&&e!==cE&&e!==lE&&e!==iE&&e!==nE&&e!==rE&&e!==dE&&e!==pE}function kE(e){return!Qi(e)&&e!==Xi}function zr(e,t){var r=e.charCodeAt(t),o;return r>=55296&&r<=56319&&t+1<e.length&&(o=e.charCodeAt(t+1),o>=56320&&o<=57343)?(r-55296)*1024+o-56320+65536:r}function ov(e){var t=/^\n* /;return t.test(e)}var iv=1,pp=2,av=3,sv=4,jn=5;function xE(e,t,r,o,n,i,a,s){var c,l=0,p=null,d=!1,m=!1,f=o!==-1,h=-1,_=wE(zr(e,0))&&kE(zr(e,e.length-1));if(t||a)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=zr(e,c),!Gr(l))return jn;_=_&&fy(l,p,s),p=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=zr(e,c),l===Ur)d=!0,f&&(m=m||c-h-1>o&&e[h+1]!==" ",h=c);else if(!Gr(l))return jn;_=_&&fy(l,p,s),p=l}m=m||f&&c-h-1>o&&e[h+1]!==" "}return!d&&!m?_&&!a&&!n(e)?iv:i===Fr?jn:pp:r>9&&ov(e)?jn:a?i===Fr?jn:pp:m?sv:av}function SE(e,t,r,o,n){e.dump=(function(){if(t.length===0)return e.quotingType===Fr?'""':"''";if(!e.noCompatMode&&(fE.indexOf(t)!==-1||hE.test(t)))return e.quotingType===Fr?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=o||e.flowLevel>-1&&r>=e.flowLevel;function c(l){return bE(e,l)}switch(xE(t,s,e.indent,a,c,e.quotingType,e.forceQuotes&&!o,n)){case iv:return t;case pp:return"'"+t.replace(/'/g,"''")+"'";case av:return"|"+hy(t,e.indent)+gy(py(t,i));case sv:return">"+hy(t,e.indent)+gy(py($E(t,a),i));case jn:return'"'+EE(t)+'"';default:throw new me("impossible error: invalid scalar style")}})()}function hy(e,t){var r=ov(e)?String(t):"",o=e[e.length-1]===`
7349
7130
  `,n=o&&(e[e.length-2]===`
7350
7131
  `||e===`
7351
7132
  `),i=n?"+":o?"":"-";return r+i+`
7352
- `}function iy(e){return e[e.length-1]===`
7353
- `?e.slice(0,-1):e}function tE(e,t){for(var r=/(\n+)([^\n]*)/g,o=(function(){var l=e.indexOf(`
7354
- `);return l=l!==-1?l:e.length,r.lastIndex=l,ay(e.slice(0,l),t)})(),n=e[0]===`
7133
+ `}function gy(e){return e[e.length-1]===`
7134
+ `?e.slice(0,-1):e}function $E(e,t){for(var r=/(\n+)([^\n]*)/g,o=(function(){var l=e.indexOf(`
7135
+ `);return l=l!==-1?l:e.length,r.lastIndex=l,yy(e.slice(0,l),t)})(),n=e[0]===`
7355
7136
  `||e[0]===" ",i,a;a=r.exec(e);){var s=a[1],c=a[2];i=c[0]===" ",o+=s+(!n&&!i&&c!==""?`
7356
- `:"")+ay(c,t),n=i}return o}function ay(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,o,n=0,i,a=0,s=0,c="";o=r.exec(e);)s=o.index,s-n>t&&(i=a>n?a:s,c+=`
7137
+ `:"")+yy(c,t),n=i}return o}function yy(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,o,n=0,i,a=0,s=0,c="";o=r.exec(e);)s=o.index,s-n>t&&(i=a>n?a:s,c+=`
7357
7138
  `+e.slice(n,i),n=i+1),a=s;return c+=`
7358
7139
  `,e.length-n>t&&a>n?c+=e.slice(n,a)+`
7359
- `+e.slice(a+1):c+=e.slice(n),c.slice(1)}function nE(e){for(var t="",r=0,o,n=0;n<e.length;r>=65536?n+=2:n++)r=Dr(e,n),o=ae[r],!o&&Ur(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=o||W$(r);return t}function rE(e,t,r){var o="",n=e.tag,i,a,s;for(i=0,a=r.length;i<a;i+=1)s=r[i],e.replacer&&(s=e.replacer.call(r,String(i),s)),(Xe(e,t,s,!1,!1)||typeof s>"u"&&Xe(e,t,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=n,e.dump="["+o+"]"}function sy(e,t,r,o){var n="",i=e.tag,a,s,c;for(a=0,s=r.length;a<s;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(Xe(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Xe(e,t+1,null,!0,!0,!1,!0))&&((!o||n!=="")&&(n+=np(e,t)),e.dump&&zr===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function oE(e,t,r){var o="",n=e.tag,i=Object.keys(r),a,s,c,l,d;for(a=0,s=i.length;a<s;a+=1)d="",o!==""&&(d+=", "),e.condenseFlow&&(d+='"'),c=i[a],l=r[c],e.replacer&&(l=e.replacer.call(r,c,l)),Xe(e,t,c,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Xe(e,t,l,!1,!1)&&(d+=e.dump,o+=d));e.tag=n,e.dump="{"+o+"}"}function iE(e,t,r,o){var n="",i=e.tag,a=Object.keys(r),s,c,l,d,p,m;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new pe("sortKeys must be a boolean or a function");for(s=0,c=a.length;s<c;s+=1)m="",(!o||n!=="")&&(m+=np(e,t)),l=a[s],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),Xe(e,t+1,l,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&zr===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,p&&(m+=np(e,t)),Xe(e,t+1,d,!0,p)&&(e.dump&&zr===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,n+=m));e.tag=i,e.dump=n||"{}"}function cy(e,t,r){var o,n,i,a,s,c;for(n=r?e.explicitTypes:e.implicitTypes,i=0,a=n.length;i<a;i+=1)if(s=n[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(r?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,Uy.call(s.represent)==="[object Function]")o=s.represent(t,c);else if(Fy.call(s.represent,c))o=s.represent[c](t,c);else throw new pe("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');e.dump=o}return!0}return!1}function Xe(e,t,r,o,n,i,a){e.tag=null,e.dump=r,cy(e,r,!1)||cy(e,r,!0);var s=Uy.call(e.dump),c=o,l;o&&(o=e.flowLevel<0||e.flowLevel>t);var d=s==="[object Object]"||s==="[object Array]",p,m;if(d&&(p=e.duplicates.indexOf(r),m=p!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(n=!1),m&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(d&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),s==="[object Object]")o&&Object.keys(e.dump).length!==0?(iE(e,t,e.dump,n),m&&(e.dump="&ref_"+p+e.dump)):(oE(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?sy(e,t-1,e.dump,n):sy(e,t,e.dump,n),m&&(e.dump="&ref_"+p+e.dump)):(rE(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&eE(e,e.dump,t,i,c);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new pe("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(l=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?l="!"+l:l.slice(0,18)==="tag:yaml.org,2002:"?l="!!"+l.slice(18):l="!<"+l+">",e.dump=l+" "+e.dump)}return!0}function aE(e,t){var r=[],o=[],n,i;for(op(e,r,o),n=0,i=o.length;n<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function op(e,t,r){var o,n,i;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)op(e[n],t,r);else for(o=Object.keys(e),n=0,i=o.length;n<i;n+=1)op(e[o[n]],t,r)}function sE(e,t){t=t||{};var r=new J$(t);r.noRefs||aE(e,r);var o=e;return r.replacer&&(o=r.replacer.call({"":o},"",o)),Xe(r,0,o,!0,!0)?r.dump+`
7360
- `:""}var cE=sE,lE={dump:cE};function up(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var uE=re,dE=dy,pE=hy,mE=by,fE=wy,hE=ap,gE=My.load,yE=My.loadAll,vE=lE.dump,_E=pe,bE={binary:Ey,float:_y,map:fy,null:gy,pairs:Ay,set:Iy,timestamp:Sy,bool:yy,int:vy,merge:$y,omap:Ty,seq:my,str:py},wE=up("safeLoad","load"),kE=up("safeLoadAll","loadAll"),xE=up("safeDump","dump"),dp={Type:uE,Schema:dE,FAILSAFE_SCHEMA:pE,JSON_SCHEMA:mE,CORE_SCHEMA:fE,DEFAULT_SCHEMA:hE,load:gE,loadAll:yE,dump:vE,YAMLException:_E,types:bE,safeLoad:wE,safeLoadAll:kE,safeDump:xE};function _e(e){let t;try{t=dp.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=Mt.safeParse(t);if(!r.success)return{ok:!1,issues:SE(r.error)};let o=Kg(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function SE(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function qi(e){return dp.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function Yi(e,t){return Mt.parse({manifest:{schema_version:Zi,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var Q={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},Xi="/play";var Yy="2.0",Gt=u.object({server_time:u.string(),snapshot:u.string()}),$E=u.enum(["at_commit","at_settlement"]),EE=u.enum(["shared","per_player","feed"]),TE=u.object({kind:u.enum(["fixed","local_midnight","feed","continuous"]),timezone:u.string().optional()}),IN=Gt.extend({game:u.string(),api_version:u.literal(Yy).default(Yy),archetype:vt,marking:$E,challenge_source:EE,schedule:TE,updates:u.object({transport:u.enum(["poll","socket"]),freshness_seconds:u.number().int().positive()}),display:u.record(u.string(),u.unknown()).default({}),identity:u.object({required:u.boolean(),provider:u.string(),anonymous_play:u.boolean().default(!1)}),archive:u.boolean().default(!1),capabilities:u.array(u.string()).default([])}),AE=u.object({accepting_plays:u.boolean(),results_available:u.boolean(),solution_revealed:u.boolean(),closed:u.boolean()}),CN=Gt.extend({id:u.string(),number:u.number().int().positive().optional(),origin:jr.optional(),version:u.number().int().nonnegative(),can:AE,opens_at:u.string().optional(),locks_at:u.string().optional(),challenge_instance_id:u.string().nullable().default(null),challenge:u.record(u.string(),u.unknown()).default({}),solution:u.record(u.string(),u.unknown()).optional()}),PN=Gt.extend({token:u.string(),player_id:u.string(),kind:u.literal("anonymous")}),Qy=u.object({idempotency_key:u.string().min(8),round_version:u.number().int().nonnegative(),challenge_instance_id:u.string().nullable().default(null),payload:u.record(u.string(),u.unknown())}),IE=u.enum(["accepted","rejected","duplicate","stale","busy"]),CE=u.object({key:u.string(),verdict:u.enum(["correct","close","wrong","higher","lower","unknown"]),label:u.string().optional()}),ON=Gt.extend({play_id:u.string(),outcome:IE,reason:u.string().optional(),round_version:u.number().int().nonnegative(),retry_after_seconds:u.number().int().positive().optional(),marked:u.boolean().default(!0),feedback:u.array(CE).default([]),round_state:u.lazy(()=>OE).optional()}),PE=u.object({title:u.string(),grid:u.array(u.string()).default([]),text:u.string().optional()}),OE=Gt.extend({player_id:u.string(),round_id:u.string(),attempts_used:u.number().int().nonnegative().default(0),attempts_allowed:u.number().int().nonnegative().optional(),mistakes_used:u.number().int().nonnegative().default(0),mistakes_allowed:u.number().int().nonnegative().optional(),progress:u.record(u.string(),u.unknown()).default({}),score:u.number().default(0),score_revision:u.number().int().nonnegative().default(0),finished:u.boolean().default(!1),outcome:u.enum(["won","lost","incomplete","pending"]).optional(),share:PE.optional()}),NN=Gt.extend({player_id:u.string(),played:u.number().int().nonnegative().default(0),won:u.number().int().nonnegative().default(0),current_streak:u.number().int().nonnegative().default(0),max_streak:u.number().int().nonnegative().default(0),distribution:u.record(u.string(),u.number()).default({}),constraints:u.record(u.string(),u.unknown()).default({})}),Xy=u.object({rank:u.number().int().positive(),player_id:u.string(),display_name:u.string().optional(),score:u.number()}),RN=Gt.extend({round_id:u.string().optional(),order:u.enum(["high_first","low_first"]).default("high_first"),tie_break:u.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:u.array(Xy).default([]),total:u.number().int().nonnegative().default(0),me:Xy.optional()}),jN=u.object({error:u.object({code:u.string(),message:u.string(),retryable:u.boolean()})});var NE=u.enum(["draft","live","sleeping","throttled","expired","archived"]),RE=u.enum(["scheduled","open","locked","settled"]),ev=u.object({id:u.string(),label:u.string(),used:u.number(),limit:u.number(),unit:u.string()}),jE=u.object({date:u.string(),plays:u.number(),players:u.number()}),DE=u.object({id:u.string(),label:u.string(),state:RE,opensAt:u.string(),locksAt:u.string(),settledAt:u.string().nullable(),plays:u.number()}),LE=u.object({id:u.string(),name:u.string(),enabled:u.boolean(),consentRequired:u.boolean(),note:u.string()}),zE=u.object({number:u.number().int().positive(),title:u.string(),openedAt:u.string(),labels:u.array(u.string()).default([]),fromGame:u.boolean().default(!1)}),tv=u.object({at:u.string(),level:u.enum(["info","warn","error"]),roundId:u.string().nullable(),message:u.string()});var ME=u.enum(["absent","pending","ready","failed"]),UE=u.object({state:ME.default("absent"),url:u.string().nullable().default(null),regenerations:u.number().int().nonnegative().default(0),updatedAt:u.string().nullable().default(null)});var nv=u.object({section:u.string(),status:Hd}),FE=u.object({id:u.string(),name:u.string(),containerLabel:u.string().min(1).default(Qt),repository:u.string().nullable(),openIssues:u.number().int().nonnegative(),issues:u.array(zE).default([]),archetype:vt,offersPrize:u.boolean().default(!1),state:NE,archivePrefix:u.string().nullable().default(null),space:u.string().nullable().default(null).optional(),platformProject:u.string().nullable().default(null).optional(),platformEvent:u.string().nullable().default(null).optional(),platformElement:u.string().nullable().default(null).optional(),appSpec:u.object({version:u.string(),shape:u.string(),resource:u.string().nullable().default(null),specUrl:u.string().optional(),wording:u.array(u.string()).optional()}).nullable().default(null).optional(),art:UE.prefault({}).optional(),playgroundUrl:u.string().nullable(),playerEndpoint:u.string().nullable(),manifestRevision:u.string(),conformance:yt,contentHash:u.string(),sections:u.array(nv),meters:u.array(ev),history:u.array(jE),rounds:u.array(DE),destinations:u.array(LE),logs:u.array(tv),updatedAt:u.string()}),GE=u.object({login:u.string(),linkedAt:u.string()}),ZE=u.object({enabled:u.boolean().default(!1),applicationId:u.string().nullable().default(null),writeKey:u.string().nullable().default(null)}),BE=u.object({id:u.string(),name:u.string(),tier:qd,ownerEmail:u.string(),liveGameAllowance:u.number(),github:GE.nullable().default(null),signal:ZE.prefault({}),meters:u.array(ev),games:u.array(FE)}),GN=BE.extend({gamesTotal:u.number().int().nonnegative()}),ZN=u.object({player:u.string().nullable(),control:u.string().nullable(),playground:u.string().nullable()}),BN=u.object({id:u.string(),name:u.string(),archetype:vt,repository:u.string().nullable().default(null),manifestRevision:u.string(),contentHash:u.string(),conformance:yt,offersPrize:u.boolean().default(!1),sections:u.array(nv).default([]),containerLabel:u.string().min(1).optional()}),KN=u.object({uploadUrl:u.string(),publicUrl:u.string(),key:u.string(),expiresInSeconds:u.number().int().positive(),playerApiOrigin:u.string()}),VN=u.object({manifestRevision:u.string(),contentHash:u.string(),conformance:yt,offersPrize:u.boolean().default(!1),round:Te.optional(),wording:u.array(u.string()).optional()}),KE=u.object({limit:u.coerce.number().int().positive().max(1e3).default(100),since:u.string().nullable().default(null),level:tv.shape.level.nullable().default(null)}),WN=u.enum(["github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","game_archived","art_limit_reached","art_unavailable","round_source_unreadable"]),rv=u.enum(["workspace.created","github.linked","github.unlinked","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","game.platform_provisioned","game.platform_provision_failed","art.requested","art.generated","art.failed","game.woken","game.suspended","game.archived","game.deleted","workspace.plan_changed","destination.changed","signal.enabled","signal.disabled"]),HN=u.object({id:u.string(),at:u.string(),action:rv,actor:u.object({kind:u.enum(["creator","operator","system"]),id:u.string(),email:u.string().nullable().default(null)}),gameId:u.string().nullable().default(null),correlationId:u.string(),detail:u.record(u.string(),u.unknown()).default({})}),VE=u.object({limit:u.coerce.number().int().positive().max(1e3).default(100),action:rv.nullable().default(null),actorId:u.string().nullable().default(null),gameId:u.string().nullable().default(null),from:u.string().nullable().default(null),to:u.string().nullable().default(null)});function ov(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function iv(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var YN=3600*24;var WE=u.object({key:u.string().min(1),label:u.string().default(""),values:u.record(u.string(),u.number().int().nonnegative())}),aR=u.object({corpus:u.literal("1"),measures:u.array(WE).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})});var yR=1440*60;var mp=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its share button.",section:"Wording"}],fp=mp.map(e=>e.key),av=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Leave it empty and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"primary_colour",label:"Primary colour",type:"colour",description:"The colour of the button a fan presses. Everything else stays as the game was built.",readBy:"The game's own page, as the --gamestage-primary custom property.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...mp,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1}],hp=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"},{key:"edition_source_url",label:"Edition source",type:"freetext",description:"A link to JSON holding what this edition is about, shared by every round in it. Fetched by the Engine, never sent to a fan's browser.",readBy:"The control plane, when it provisions a round.",section:"This edition",public:!1}],gp=[{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1}],yp=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"}]}]}],sv=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],vp={display_name:"displayName",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline"};function _p(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)}function Qi(e){return mp.filter(t=>_p(e,vp[t.key])).map(t=>t.key)}var cv=Fm,uv=e=>{let t=We(e);return Ka[t]??`gamestage-${t.replaceAll("_","-")}-element`},lv={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},forecast:{derivedFrom:"prediction",duration:{mode:"flexible"}}},qE=new Set(["freetext","wysiwyg","image","file"]),YE=e=>({key:e.key,type:e.type,...qE.has(e.type)?{localisable:!1}:{},...e.type==="collection"?{...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,...t.description?{description:t.description}:{}}))}:{}});function XE(e){let t=new Map,r=o=>{for(let n of o){let i=t.get(n.key);if(i){if(i.type!==n.type)throw new Error(`The field "${n.key}" is declared as both ${i.type} and ${n.type}. One key is one declaration; a level's own label and description travel on its field set entry, its type does not.`)}else t.set(n.key,n);r(n.fieldset??[])}};return r(e),[...t.values()]}function bp(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);i?i.properties.push(n):t.push({name:r.section,properties:[n]})}return t}function QE(e){let t=e.archetypes.map(We);for(let i of t)if(!cv[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??fp),n=av.filter(i=>!fp.includes(i.key)||o.has(i.key));return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:cv[i],content_type:uv(i),derived_from:lv[i]?.derivedFrom??"data",duration:lv[i]?.duration??{mode:"instant"},label:i==="forecast"?"{{question.text}}":e.name,custom_fields:bp([...gp,...i==="push"?yp:[]]),...i==="forecast"?{label_question:"Question",label_option:"Option",reveal_results:{modes:["manual"],default:"manual"},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":XE([...n,...hp,...gp,...sv,...yp]).map(YE),"project_settings.json":{sections:bp(n)},"event_settings.json":{sections:bp(hp)}}}function dv(e){return QE({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var Mn=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},eT=e=>new Promise(t=>setTimeout(t,e));function tT(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function Un(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");async function n(a,s,c={}){let l=globalThis.location?.origin,d=new URL(`${o}${s}`,o.startsWith("/")?l:void 0);for(let[m,f]of Object.entries(c.query??{}))f!=null&&d.searchParams.set(m,String(f));let p;for(let m=1;m<=r;m++){let f=typeof e.token=="function"?await e.token():e.token,h=await t(d,{method:a,headers:{authorization:`Bearer ${f}`,...c.body===void 0?{}:{"content-type":"application/json"}},body:c.body===void 0?void 0:JSON.stringify(c.body)});if(h.ok)return await h.json();let b=await h.json().catch(()=>({}));if(p=new Mn(h.status,b.error?.code??"unknown",b.error?.message??h.statusText,b.error?.retryable??!1),!p.retryable||m===r)break;let S=Number(h.headers.get("retry-after"));await eT(Number.isFinite(S)&&S>0?S*1e3:tT(m))}throw p??new Mn(0,"unknown","Request failed.",!1)}let i=a=>({...a,containerLabel:a.containerLabel??"Round"});return{getWorkspace:async()=>{let a=await n("GET","/v1/workspace");return{...a,games:(a.games??[]).map(i)}},linkGitHub:a=>n("PUT","/v1/workspace/github",{body:{login:a}}),setPlan:a=>n("PUT","/v1/workspace/plan",{body:{tier:a}}),uploadTarget:(a,s)=>n("POST",`/v1/games/${encodeURIComponent(a)}/uploads`,{body:{filename:s}}),pruneBundle:(a,s)=>n("PUT",`/v1/games/${encodeURIComponent(a)}/bundle`,{body:{filenames:s}}),async getGame(a){try{return i(await n("GET",`/v1/games/${encodeURIComponent(a)}`))}catch(s){if(s instanceof Mn&&s.status===404)return;throw s}},setAwake:(a,s)=>n("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,c)=>n("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:c}}),registerGame:a=>n("POST","/v1/games",{body:a}),archiveGame:a=>n("POST",`/v1/games/${encodeURIComponent(a)}/archive`),requestArt:a=>n("POST",`/v1/games/${encodeURIComponent(a)}/art`),deploy:(a,s)=>n("POST",`/v1/games/${encodeURIComponent(a)}/deploy`,{body:s}),refreshRound:a=>n("POST",`/v1/games/${encodeURIComponent(a)}/round/refresh`),setSignal:a=>n("PUT","/v1/workspace/signal",{body:{enabled:a}}),async getEndpoints(a){try{return await n("GET",`/v1/games/${encodeURIComponent(a)}/endpoints`)}catch(s){if(s instanceof Mn&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:c}=await n("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return c},async getAuditLog(a){let{records:s}=await n("GET","/v1/audit",{query:a});return s}}}var qR=600*1e3;function wp(e){return e.playerId?.trim()||e.sourceIp?.trim()||"unknown"}function kp(e,t){return`${e.length}:${e}${t}`}import{spawn as pv}from"node:child_process";import{chmod as nT,mkdir as rT,readFile as oT,rm as iT,writeFile as aT}from"node:fs/promises";import{homedir as sT,platform as Fn}from"node:os";import{join as mv}from"node:path";var xp="https://api.workos.com",Sp=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";async function fv(){let e=await fetch(`${xp}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:Sp})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function hv(e){let t=await fetch(`${xp}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Sp,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function gv(e){let t=Fn()==="darwin"?"open":Fn()==="win32"?"cmd":"xdg-open",r=Fn()==="win32"?["/c","start","",e]:[e];try{pv(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}var Gn="gamestage-cli",yv=mv(sT(),".gamestage"),ea=mv(yv,"credentials.json");function $p(e,t){return new Promise(r=>{let o=pv("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function Ep(e){let t=JSON.stringify(e);return Fn()==="darwin"&&await $p(["add-generic-password","-a",Gn,"-s",Gn,"-U","-w",t])!==null?"keychain":(await rT(yv,{recursive:!0,mode:448}),await aT(ea,t,{mode:384}),await nT(ea,384),"file")}function cT(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function lT(e){if(!e.refreshToken)return null;let t=await fetch(`${xp}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Sp,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function uT(){if(Fn()==="darwin"){let e=await $p(["find-generic-password","-a",Gn,"-s",Gn,"-w"]);if(e)try{return JSON.parse(e)}catch{}}try{return JSON.parse(await oT(ea,"utf8"))}catch{return null}}async function vv(){Fn()==="darwin"&&await $p(["delete-generic-password","-a",Gn,"-s",Gn]),await iT(ea,{force:!0})}async function Pe(){let e=await uT();if(!e)return null;if(!cT(e.accessToken)||!e.refreshToken)return e;let t=await lT(e);return t?(await Ep(t),t):null}import{randomUUID as dT}from"node:crypto";var pT=/-[0-9a-f]{4}$/;function ta(e){return`${e}-${dT().replace(/-/g,"").slice(0,4)}`}function _v(e){return pT.test(e)}var me=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";function mT(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function fT(e=me,t=process.env){if(t.GAMESTAGE_TEST_RUN==="1"&&!mT(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function Zn(e=me){let t=fT(e);t&&P(t)}async function Se(){let e=await Pe();return e||P("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and local rounds keep working without one."]),{client:Un({baseUrl:me,token:async()=>(await Pe())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function bv(e){try{return await e.getWorkspace(),{ok:!0}}catch(t){let r=t.status,o=t.code;return r===404||o==="not_found"?{ok:!1,reason:`Nothing is serving a control plane at ${me}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{ok:!1,reason:"The control plane refused this account's token.",detail:[`It is at ${me}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{ok:!1,reason:`Could not reach the control plane at ${me}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function Oe(e){let t=[],r=e.status,o=e.code;r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${me}`),P(e instanceof Error?e.message:"The control plane call failed.",t)}var Qe="favicon.svg",Fr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
7140
+ `+e.slice(a+1):c+=e.slice(n),c.slice(1)}function EE(e){for(var t="",r=0,o,n=0;n<e.length;r>=65536?n+=2:n++)r=zr(e,n),o=ae[r],!o&&Gr(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=o||yE(r);return t}function TE(e,t,r){var o="",n=e.tag,i,a,s;for(i=0,a=r.length;i<a;i+=1)s=r[i],e.replacer&&(s=e.replacer.call(r,String(i),s)),(Xe(e,t,s,!1,!1)||typeof s>"u"&&Xe(e,t,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=n,e.dump="["+o+"]"}function vy(e,t,r,o){var n="",i=e.tag,a,s,c;for(a=0,s=r.length;a<s;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(Xe(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Xe(e,t+1,null,!0,!0,!1,!0))&&((!o||n!=="")&&(n+=dp(e,t)),e.dump&&Ur===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function AE(e,t,r){var o="",n=e.tag,i=Object.keys(r),a,s,c,l,p;for(a=0,s=i.length;a<s;a+=1)p="",o!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[a],l=r[c],e.replacer&&(l=e.replacer.call(r,c,l)),Xe(e,t,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Xe(e,t,l,!1,!1)&&(p+=e.dump,o+=p));e.tag=n,e.dump="{"+o+"}"}function IE(e,t,r,o){var n="",i=e.tag,a=Object.keys(r),s,c,l,p,d,m;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new me("sortKeys must be a boolean or a function");for(s=0,c=a.length;s<c;s+=1)m="",(!o||n!=="")&&(m+=dp(e,t)),l=a[s],p=r[l],e.replacer&&(p=e.replacer.call(r,l,p)),Xe(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&Ur===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,d&&(m+=dp(e,t)),Xe(e,t+1,p,!0,d)&&(e.dump&&Ur===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,n+=m));e.tag=i,e.dump=n||"{}"}function _y(e,t,r){var o,n,i,a,s,c;for(n=r?e.explicitTypes:e.implicitTypes,i=0,a=n.length;i<a;i+=1)if(s=n[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(r?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,qy.call(s.represent)==="[object Function]")o=s.represent(t,c);else if(Xy.call(s.represent,c))o=s.represent[c](t,c);else throw new me("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');e.dump=o}return!0}return!1}function Xe(e,t,r,o,n,i,a){e.tag=null,e.dump=r,_y(e,r,!1)||_y(e,r,!0);var s=qy.call(e.dump),c=o,l;o&&(o=e.flowLevel<0||e.flowLevel>t);var p=s==="[object Object]"||s==="[object Array]",d,m;if(p&&(d=e.duplicates.indexOf(r),m=d!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(n=!1),m&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(p&&m&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s==="[object Object]")o&&Object.keys(e.dump).length!==0?(IE(e,t,e.dump,n),m&&(e.dump="&ref_"+d+e.dump)):(AE(e,t,e.dump),m&&(e.dump="&ref_"+d+" "+e.dump));else if(s==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?vy(e,t-1,e.dump,n):vy(e,t,e.dump,n),m&&(e.dump="&ref_"+d+e.dump)):(TE(e,t,e.dump),m&&(e.dump="&ref_"+d+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&SE(e,e.dump,t,i,c);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new me("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(l=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?l="!"+l:l.slice(0,18)==="tag:yaml.org,2002:"?l="!!"+l.slice(18):l="!<"+l+">",e.dump=l+" "+e.dump)}return!0}function CE(e,t){var r=[],o=[],n,i;for(mp(e,r,o),n=0,i=o.length;n<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function mp(e,t,r){var o,n,i;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)mp(e[n],t,r);else for(o=Object.keys(e),n=0,i=o.length;n<i;n+=1)mp(e[o[n]],t,r)}function PE(e,t){t=t||{};var r=new _E(t);r.noRefs||CE(e,r);var o=e;return r.replacer&&(o=r.replacer.call({"":o},"",o)),Xe(r,0,o,!0,!0)?r.dump+`
7141
+ `:""}var OE=PE,NE={dump:OE};function _p(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var RE=oe,jE=ky,DE=Ey,LE=Py,zE=Oy,ME=hp,UE=Yy.load,FE=Yy.loadAll,GE=NE.dump,ZE=me,BE={binary:Ly,float:Cy,map:$y,null:Ty,pairs:My,set:Uy,timestamp:jy,bool:Ay,int:Iy,merge:Dy,omap:zy,seq:Sy,str:xy},KE=_p("safeLoad","load"),VE=_p("safeLoadAll","loadAll"),WE=_p("safeDump","dump"),bp={Type:RE,Schema:jE,FAILSAFE_SCHEMA:DE,JSON_SCHEMA:LE,CORE_SCHEMA:zE,DEFAULT_SCHEMA:ME,load:UE,loadAll:FE,dump:GE,YAMLException:ZE,types:BE,safeLoad:KE,safeLoadAll:VE,safeDump:WE};function _e(e){let t;try{t=bp.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=Lt.safeParse(t);if(!r.success)return{ok:!1,issues:HE(r.error)};let o=ny(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function HE(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function ta(e){return bp.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function na(e,t){return Lt.parse({manifest:{schema_version:Hi,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var ee={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},ra="/play";var cv="2.0",Ut=u.object({server_time:u.string(),snapshot:u.string()}),JE=u.enum(["at_commit","at_settlement"]),YE=u.enum(["shared","per_player","feed"]),qE=u.object({kind:u.enum(["fixed","local_midnight","feed","continuous"]),timezone:u.string().optional()}),oR=Ut.extend({game:u.string(),api_version:u.literal(cv).default(cv),archetype:yt,marking:JE,challenge_source:YE,schedule:qE,updates:u.object({transport:u.enum(["poll","socket"]),freshness_seconds:u.number().int().positive()}),display:u.record(u.string(),u.unknown()).default({}),identity:u.object({required:u.boolean(),provider:u.string(),anonymous_play:u.boolean().default(!1)}),archive:u.boolean().default(!1),capabilities:u.array(u.string()).default([])}),XE=u.object({accepting_plays:u.boolean(),results_available:u.boolean(),solution_revealed:u.boolean(),closed:u.boolean()}),iR=Ut.extend({id:u.string(),number:u.number().int().positive().optional(),origin:Lr.optional(),version:u.number().int().nonnegative(),can:XE,opens_at:u.string().optional(),locks_at:u.string().optional(),challenge_instance_id:u.string().nullable().default(null),challenge:u.record(u.string(),u.unknown()).default({}),solution:u.record(u.string(),u.unknown()).optional()}),aR=Ut.extend({token:u.string(),player_id:u.string(),kind:u.literal("anonymous")}),uv=u.object({idempotency_key:u.string().min(8),round_version:u.number().int().nonnegative(),challenge_instance_id:u.string().nullable().default(null),payload:u.record(u.string(),u.unknown())}),QE=u.enum(["accepted","rejected","duplicate","stale","busy"]),eT=u.object({key:u.string(),verdict:u.enum(["correct","close","wrong","higher","lower","unknown"]),label:u.string().optional()}),sR=Ut.extend({play_id:u.string(),outcome:QE,reason:u.string().optional(),round_version:u.number().int().nonnegative(),retry_after_seconds:u.number().int().positive().optional(),marked:u.boolean().default(!0),feedback:u.array(eT).default([]),round_state:u.lazy(()=>nT).optional()}),tT=u.object({title:u.string(),grid:u.array(u.string()).default([]),text:u.string().optional()}),nT=Ut.extend({player_id:u.string(),round_id:u.string(),attempts_used:u.number().int().nonnegative().default(0),attempts_allowed:u.number().int().nonnegative().optional(),mistakes_used:u.number().int().nonnegative().default(0),mistakes_allowed:u.number().int().nonnegative().optional(),progress:u.record(u.string(),u.unknown()).default({}),score:u.number().default(0),score_revision:u.number().int().nonnegative().default(0),finished:u.boolean().default(!1),outcome:u.enum(["won","lost","incomplete","pending"]).optional(),share:tT.optional()}),cR=Ut.extend({player_id:u.string(),played:u.number().int().nonnegative().default(0),won:u.number().int().nonnegative().default(0),current_streak:u.number().int().nonnegative().default(0),max_streak:u.number().int().nonnegative().default(0),distribution:u.record(u.string(),u.number()).default({}),constraints:u.record(u.string(),u.unknown()).default({})});function oa(e,t){let r=t==="won"?e.current_streak+1:t==="lost"?0:e.current_streak;return{...e,played:e.played+1,won:e.won+(t==="won"?1:0),current_streak:r,max_streak:Math.max(e.max_streak,r)}}var lv=u.object({rank:u.number().int().positive(),player_id:u.string(),display_name:u.string().optional(),score:u.number()}),lR=Ut.extend({round_id:u.string().optional(),order:u.enum(["high_first","low_first"]).default("high_first"),tie_break:u.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:u.array(lv).default([]),total:u.number().int().nonnegative().default(0),me:lv.optional()}),uR=u.object({error:u.object({code:u.string(),message:u.string(),retryable:u.boolean()})});var rT=u.enum(["draft","live","sleeping","throttled","expired","archived"]),oT=u.enum(["scheduled","open","locked","settled"]),dv=u.object({id:u.string(),label:u.string(),used:u.number(),limit:u.number(),unit:u.string()}),iT=u.object({date:u.string(),plays:u.number(),players:u.number()}),aT=u.object({id:u.string(),label:u.string(),state:oT,opensAt:u.string(),locksAt:u.string(),settledAt:u.string().nullable(),plays:u.number()}),sT=u.object({id:u.string(),name:u.string(),enabled:u.boolean(),consentRequired:u.boolean(),note:u.string()}),cT=u.object({number:u.number().int().positive(),title:u.string(),openedAt:u.string(),labels:u.array(u.string()).default([]),fromGame:u.boolean().default(!1)}),pv=u.object({at:u.string(),level:u.enum(["info","warn","error"]),roundId:u.string().nullable(),message:u.string()});var lT=u.enum(["absent","pending","ready","failed"]),uT=u.object({state:lT.default("absent"),url:u.string().nullable().default(null),regenerations:u.number().int().nonnegative().default(0),updatedAt:u.string().nullable().default(null)});function mv(e,t=new Date){let r=typeof t=="string"?Date.parse(t):t.getTime(),o,n=Number.NEGATIVE_INFINITY;for(let i of e.rounds){let a=Date.parse(i.locksAt);Number.isNaN(a)||a>n&&(n=a,o=i)}return o?n>r?{state:"live",round:o}:{state:"stale",round:o,lockedForMs:r-n}:{state:"none"}}function fv(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),r=t<1?`${Math.max(1,Math.floor(e.lockedForMs/6e4))} minutes`:t<48?`${t} hours`:`${Math.floor(t/24)} days`;return`The round this game is serving, ${e.round.label}, locked ${r} ago and nothing has replaced it. Fans are playing a closed round. Run \`gamestage deploy\` or refresh the round to move it on.`}var hv=u.object({section:u.string(),status:rp}),dT=u.object({id:u.string(),name:u.string(),containerLabel:u.string().min(1).default(Qt),repository:u.string().nullable(),openIssues:u.number().int().nonnegative(),issues:u.array(cT).default([]),archetype:yt,offersPrize:u.boolean().default(!1),state:rT,archivePrefix:u.string().nullable().default(null),space:u.string().nullable().default(null).optional(),platformProject:u.string().nullable().default(null).optional(),platformEvent:u.string().nullable().default(null).optional(),platformElement:u.string().nullable().default(null).optional(),appSpec:u.object({version:u.string(),shape:u.string(),resource:u.string().nullable().default(null),specUrl:u.string().optional(),wording:u.array(u.string()).optional()}).nullable().default(null).optional(),art:uT.prefault({}).optional(),playgroundUrl:u.string().nullable(),playerEndpoint:u.string().nullable(),manifestRevision:u.string(),conformance:gt,contentHash:u.string(),sections:u.array(hv),meters:u.array(dv),history:u.array(iT),rounds:u.array(aT),destinations:u.array(sT),logs:u.array(pv),updatedAt:u.string()}),pT=u.object({login:u.string(),linkedAt:u.string()}),mT=u.object({enabled:u.boolean().default(!1),applicationId:u.string().nullable().default(null),writeKey:u.string().nullable().default(null)}),gv=u.enum(["pending","approved","refused"]),yR=u.enum(["manual","automatic"]);function ia(e){let t=gv.safeParse(e.access);return t.success?t.data:"pending"}var vR=u.enum(["approved","refused"]),fT=u.object({id:u.string(),name:u.string(),tier:ip,ownerEmail:u.string(),access:gv.default("pending"),liveGameAllowance:u.number(),github:pT.nullable().default(null),signal:mT.prefault({}),meters:u.array(dv),games:u.array(dT)}),_R=fT.extend({gamesTotal:u.number().int().nonnegative()}),bR=u.object({player:u.string().nullable(),control:u.string().nullable(),playground:u.string().nullable()}),wR=u.object({id:u.string(),name:u.string(),archetype:yt,repository:u.string().nullable().default(null),manifestRevision:u.string(),contentHash:u.string(),conformance:gt,offersPrize:u.boolean().default(!1),sections:u.array(hv).default([]),containerLabel:u.string().min(1).optional()}),kR=u.object({uploadUrl:u.string(),publicUrl:u.string(),key:u.string(),expiresInSeconds:u.number().int().positive(),playerApiOrigin:u.string()}),xR=u.object({manifestRevision:u.string(),contentHash:u.string(),conformance:gt,offersPrize:u.boolean().default(!1),round:Pe.optional(),wording:u.array(u.string()).optional()}),hT=u.object({limit:u.coerce.number().int().positive().max(1e3).default(100),since:u.string().nullable().default(null),level:pv.shape.level.nullable().default(null)}),SR=u.enum(["access_pending","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","game_archived","art_limit_reached","art_unavailable","round_source_unreadable"]),yv=u.enum(["workspace.created","workspace.approved","workspace.refused","github.linked","github.unlinked","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","game.platform_provisioned","game.platform_provision_failed","art.requested","art.generated","art.failed","game.woken","game.suspended","game.archived","game.deleted","workspace.plan_changed","destination.changed","signal.enabled","signal.disabled"]),$R=u.object({id:u.string(),at:u.string(),action:yv,actor:u.object({kind:u.enum(["creator","operator","system"]),id:u.string(),email:u.string().nullable().default(null)}),gameId:u.string().nullable().default(null),correlationId:u.string(),detail:u.record(u.string(),u.unknown()).default({})}),gT=u.object({limit:u.coerce.number().int().positive().max(1e3).default(100),action:yv.nullable().default(null),actorId:u.string().nullable().default(null),gameId:u.string().nullable().default(null),from:u.string().nullable().default(null),to:u.string().nullable().default(null)});function vv(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function _v(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var AR=3600*24;var yT=u.object({key:u.string().min(1),label:u.string().default(""),values:u.record(u.string(),u.number().int().nonnegative())}),LR=u.object({corpus:u.literal("1"),measures:u.array(yT).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})});var HR=1440*60;var kp=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its share button.",section:"Wording"}],xp=kp.map(e=>e.key),bv=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Leave it empty and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"primary_colour",label:"Primary colour",type:"colour",description:"The colour of the button a fan presses. Everything else stays as the game was built.",readBy:"The game's own page, as the --gamestage-primary custom property.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...kp,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1}],Sp=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"},{key:"edition_source_url",label:"Edition source",type:"freetext",description:"A link to JSON holding what this edition is about, shared by every round in it. Fetched by the Engine, never sent to a fan's browser.",readBy:"The control plane, when it provisions a round.",section:"This edition",public:!1}],$p=[{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1}],Ep=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"}]}]}],wv=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],Tp={display_name:"displayName",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline"};function Ap(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)}function aa(e){return kp.filter(t=>Ap(e,Tp[t.key])).map(t=>t.key)}var kv=Xm,Sv=e=>{let t=We(e);return es[t]??`gamestage-${t.replaceAll("_","-")}-element`},xv={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},forecast:{derivedFrom:"prediction",duration:{mode:"flexible"}}},bT=new Set(["freetext","wysiwyg","image","file"]),wT=e=>({key:e.key,type:e.type,...bT.has(e.type)?{localisable:!1}:{},...e.type==="collection"?{...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,...t.description?{description:t.description}:{}}))}:{}});function kT(e){let t=new Map,r=o=>{for(let n of o){let i=t.get(n.key);if(i){if(i.type!==n.type)throw new Error(`The field "${n.key}" is declared as both ${i.type} and ${n.type}. One key is one declaration; a level's own label and description travel on its field set entry, its type does not.`)}else t.set(n.key,n);r(n.fieldset??[])}};return r(e),[...t.values()]}function Ip(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);i?i.properties.push(n):t.push({name:r.section,properties:[n]})}return t}function xT(e){let t=e.archetypes.map(We);for(let i of t)if(!kv[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??xp),n=bv.filter(i=>!xp.includes(i.key)||o.has(i.key));return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:kv[i],content_type:Sv(i),derived_from:xv[i]?.derivedFrom??"data",duration:xv[i]?.duration??{mode:"instant"},label:i==="forecast"?"{{question.text}}":e.name,custom_fields:Ip([...$p,...i==="push"?Ep:[]]),...i==="forecast"?{label_question:"Question",label_option:"Option",reveal_results:{modes:["manual"],default:"manual"},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":kT([...n,...Sp,...$p,...wv,...Ep]).map(wT),"project_settings.json":{sections:Ip(n)},"event_settings.json":{sections:Ip(Sp)}}}function $v(e){return xT({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var Mn=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},ST=e=>new Promise(t=>setTimeout(t,e));function $T(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function Ev(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let c=globalThis.location?.origin,l=new URL(`${o}${a}`,o.startsWith("/")?c:void 0);for(let[d,m]of Object.entries(s.query??{}))m!=null&&l.searchParams.set(d,String(m));let p;for(let d=1;d<=r;d++){let m=typeof e.token=="function"?await e.token():e.token,f=await t(l,{method:i,headers:{authorization:`Bearer ${m}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)});if(f.ok)return await f.json();let h=await f.json().catch(()=>({}));if(p=new Mn(f.status,h.error?.code??"unknown",h.error?.message??f.statusText,h.error?.retryable??!1),!p.retryable||d===r)break;let _=Number(f.headers.get("retry-after"));await ST(Number.isFinite(_)&&_>0?_*1e3:$T(d))}throw p??new Mn(0,"unknown","Request failed.",!1)}}function Tv(e){let t=Ev(e);return{setWorkspaceAccess:(r,o)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/access`,{body:{access:o}})}}function Un(e){let t=Ev(e),r=i=>({...i,containerLabel:i.containerLabel??"Round"}),o=i=>({...i,access:ia(i),games:(i.games??[]).map(r)}),n=i=>({...i,workspace:{...i.workspace,access:ia(i.workspace??{}),games:(i.workspace?.games??[]).map(r)}});return{getWorkspace:async()=>o(await t("GET","/v1/workspace")),linkGitHub:async i=>n(await t("PUT","/v1/workspace/github",{body:{login:i}})),setPlan:async i=>n(await t("PUT","/v1/workspace/plan",{body:{tier:i}})),uploadTarget:(i,a)=>t("POST",`/v1/games/${encodeURIComponent(i)}/uploads`,{body:{filename:a}}),pruneBundle:(i,a)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/bundle`,{body:{filenames:a}}),async getGame(i){try{return r(await t("GET",`/v1/games/${encodeURIComponent(i)}`))}catch(a){if(a instanceof Mn&&a.status===404)return;throw a}},setAwake:(i,a)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/state`,{body:{awake:a}}),setDestination:(i,a,s)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/destinations`,{body:{destination_id:a,enabled:s}}),registerGame:i=>t("POST","/v1/games",{body:i}),archiveGame:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/archive`),requestArt:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/art`),deploy:(i,a)=>t("POST",`/v1/games/${encodeURIComponent(i)}/deploy`,{body:a}),refreshRound:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/round/refresh`),setSignal:async i=>n(await t("PUT","/v1/workspace/signal",{body:{enabled:i}})),async getEndpoints(i){try{return await t("GET",`/v1/games/${encodeURIComponent(i)}/endpoints`)}catch(a){if(a instanceof Mn&&a.status===404)return;throw a}},async getLogs(i,a){let{lines:s}=await t("GET",`/v1/games/${encodeURIComponent(i)}/logs`,{query:a});return s},async getAuditLog(i){let{records:a}=await t("GET","/v1/audit",{query:i});return a}}}var Aj=600*1e3;function Cp(e){return e.playerId?.trim()||e.sourceIp?.trim()||"unknown"}function Pp(e,t){return`${e.length}:${e}${t}`}import{spawn as Av}from"node:child_process";import{chmod as ET,mkdir as TT,readFile as AT,rm as IT,writeFile as CT}from"node:fs/promises";import{homedir as PT,platform as Fn}from"node:os";import{join as Iv}from"node:path";var Op="https://api.workos.com",Np=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";async function Cv(){let e=await fetch(`${Op}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:Np})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function Pv(e){let t=await fetch(`${Op}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Np,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function Ov(e){let t=Fn()==="darwin"?"open":Fn()==="win32"?"cmd":"xdg-open",r=Fn()==="win32"?["/c","start","",e]:[e];try{Av(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}var Gn="gamestage-cli",Nv=Iv(PT(),".gamestage"),sa=Iv(Nv,"credentials.json");function Rp(e,t){return new Promise(r=>{let o=Av("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function jp(e){let t=JSON.stringify(e);return Fn()==="darwin"&&await Rp(["add-generic-password","-a",Gn,"-s",Gn,"-U","-w",t])!==null?"keychain":(await TT(Nv,{recursive:!0,mode:448}),await CT(sa,t,{mode:384}),await ET(sa,384),"file")}function OT(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function NT(e){if(!e.refreshToken)return null;let t=await fetch(`${Op}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Np,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function RT(){if(Fn()==="darwin"){let e=await Rp(["find-generic-password","-a",Gn,"-s",Gn,"-w"]);if(e)try{return JSON.parse(e)}catch{}}try{return JSON.parse(await AT(sa,"utf8"))}catch{return null}}async function Rv(){Fn()==="darwin"&&await Rp(["delete-generic-password","-a",Gn,"-s",Gn]),await IT(sa,{force:!0})}async function $e(){let e=await RT();if(!e)return null;if(!OT(e.accessToken)||!e.refreshToken)return e;let t=await NT(e);return t?(await jp(t),t):null}import{randomUUID as jT}from"node:crypto";var DT=/-[0-9a-f]{4}$/;function ca(e){return`${e}-${jT().replace(/-/g,"").slice(0,4)}`}function jv(e){return DT.test(e)}var Zr=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai";function Dv(e){return`${Zr}/stage/games/${encodeURIComponent(e)}?tab=overview`}function Lv(e){return e&&new Set(["hunt","push","group","forecast"]).has(e)?`${Zr}/docs/game-formats#${e}`:`${Zr}/docs`}var se=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";function LT(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function zT(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function MT(e=se,t=process.env){if(zT(t)&&!LT(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function Zn(e=se){let t=MT(e);t&&C(t)}async function be(){let e=await $e();return e||C("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and local rounds keep working without one."]),{client:Un({baseUrl:se,token:async()=>(await $e())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function zv(){let e=await $e();return e||C("You are not signed in.",["Run `gamestage login`. Approving a creator needs an operator's own session."]),{admin:Tv({baseUrl:se,token:async()=>(await $e())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}var Dp="access_pending";async function la(e){try{let t=await e.getWorkspace(),r=t?.access;return r==="approved"||r==="pending"||r==="refused"?{access:r,workspace:t}:{access:"unreported",workspace:t}}catch(t){let r=t.status,o=t.code;return o===Dp?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${se}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${se}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{access:"unknown",problem:"unreachable",reason:`Could not reach the control plane at ${se}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function Br(e){switch(e.access){case"approved":return{ok:!0,status:"approved",access:"approved",heading:"Approved",message:"Your account is approved, so every command works, including deploy.",next:["`gamestage status` shows the workspace, its games and what they are using."]};case"pending":return{ok:!0,status:"pending_approval",access:"pending",code:Dp,heading:"Registered, waiting for approval",message:"You are registered and your account is waiting for approval. That is the normal path for a new account, and approval is a person's decision today.",next:["Nothing is wrong and nothing is lost. There is no second form to fill in.","Inspecting a prototype, scaffolding a game and writing a round all work now and need no approval.","`gamestage status` re-checks approval. It never opens the browser again."]};case"refused":return{ok:!0,status:"access_refused",access:"refused",heading:"Access refused",message:"This account has been refused access. Signing in worked, so this is a decision about the account rather than a broken token.",next:["Nothing in the CLI changes this, and running `gamestage login` again will not.","Inspecting, scaffolding and writing a round still work and need no account.",`If you think this is wrong, say so where you registered: ${Zr}.`]};case"unreported":return{ok:!0,status:"access_not_reported",access:null,heading:"Signed in",message:"This control plane answered and does not report an access state, so whether this account is approved is not known here.",next:["It predates the access state rather than being broken, so carry on.","A deploy that is refused for approval will say so in its own words."]};default:return{ok:!1,status:e.problem==="no_control_plane"?"no_control_plane":e.problem==="token_refused"?"token_refused":"control_plane_unreachable",access:null,heading:"Signed in, and the control plane is not usable",message:e.reason,next:e.detail}}}function Mv(e){return e.changed?e.access==="approved"?{ok:!0,status:"approved",access:"approved",heading:"Approved",message:`${e.workspaceId} was ${e.previous} and is now approved.`,next:["Their next `gamestage status` says approved, and deploy works from then on."]}:{ok:!0,status:"refused",access:"refused",heading:"Refused",message:`${e.workspaceId} was ${e.previous} and is now refused.`,next:["Their next `gamestage status` says refused, and says how to argue with it."]}:{ok:!0,status:"unchanged",access:e.access,heading:"No change",message:`${e.workspaceId} was already ${e.previous}. Nothing was written.`,next:["No audit record either: the trail records transitions, and this was not one."]}}function Bn(e){if(I(e.heading),v(` ${e.message}`),e.next.length){v();for(let t of e.next)A(t)}v()}function Ee(e){let t=[],r=e.status,o=e.code;if(o===Dp){let n=Br({access:"pending"});R()?j({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):Bn(n),process.exit(0)}r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${se}`),C(e instanceof Error?e.message:"The control plane call failed.",t)}var Qe="favicon.svg",Kr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
7361
7142
  <rect width="32" height="32" rx="7" fill="#1b1c1f"/>
7362
7143
  <path d="m12 8 12 8-12 8Z" fill="#fff"/>
7363
7144
  </svg>
7364
- `;function Tp(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function Gr(e){if(Tp(e))return e;let t=`<link rel="icon" href="./${Qe}" type="image/svg+xml">
7365
- `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}var na={hunt:"Find the marked few among many. A wrong pick costs an attempt.",push:"Picks add hidden value towards a limit. Going over is a bust.",group:"Form the hidden sets in a board. The whole guess is judged at once.",forecast:"Call it before it happens. It settles when the result arrives.",trivia:"Question, answer, mark against a server answer set, score, close.",timed_round:"Open and close rounds on a schedule, using server time.",synchronous_event:"React to a real-world trigger: kick-off, goal, period change.",collection_ranking:"Accumulate verified actions and expose rank, progress and eligibility."};async function gT(e,t,r){let o=await Pe();return o?(Zn(),await Un({baseUrl:me,token:o.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${hT("sha256").update(t).digest("hex")}`,conformance:Ce(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Rn.map(i=>({section:i,status:e[i].status}))}),!0):!1}async function wv(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return P("Give the game a name with --name.");if(!e.archetype){L()&&(M({ok:!1,status:"archetype_required",message:"Choose an archetype before scaffolding. Authority is decided first, on purpose.",archetypes:Object.entries(na).map(([f,h])=>({archetype:f,summary:h})),example:`gamestage create --name "${e.name??t}" --archetype hunt`}),process.exit(1)),I("Choose the game's authority first"),v($.dim(` The archetype decides what the server owns: answers, locks, scoring
7145
+ `;function Lp(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function Vr(e){if(Lp(e))return e;let t=`<link rel="icon" href="./${Qe}" type="image/svg+xml">
7146
+ `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}var ua={hunt:"Find the marked few among many. A wrong pick costs an attempt.",push:"Picks add hidden value towards a limit. Going over is a bust.",group:"Form the hidden sets in a board. The whole guess is judged at once.",forecast:"Call it before it happens. It settles when the result arrives.",trivia:"Question, answer, mark against a server answer set, score, close.",timed_round:"Open and close rounds on a schedule, using server time.",synchronous_event:"React to a real-world trigger: kick-off, goal, period change.",collection_ranking:"Accumulate verified actions and expose rank, progress and eligibility."};async function FT(e,t,r){let o=await $e();return o?(Zn(),await Un({baseUrl:se,token:o.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${UT("sha256").update(t).digest("hex")}`,conformance:Re(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Rn.map(i=>({section:i,status:e[i].status}))}),!0):!1}async function Uv(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return C("Give the game a name with --name.");if(!e.archetype){R()&&(j({ok:!1,status:"archetype_required",message:"Choose an archetype before scaffolding. Authority is decided first, on purpose.",archetypes:Object.entries(ua).map(([f,h])=>({archetype:f,summary:h})),example:`gamestage create --name "${e.name??t}" --archetype hunt`}),process.exit(1)),I("Choose the game's authority first"),v($.dim(` The archetype decides what the server owns: answers, locks, scoring
7366
7147
  and settlement. Picking it before any client code is what keeps the
7367
- game trustworthy later.`)),v();for(let[f,h]of Object.entries(na))v(` ${$.cyan(f.padEnd(20))} ${$.dim(h)}`);v(),v(` ${$.dim("Then run:")} ${$.cyan(`gamestage create --name "${e.name??t}" --archetype <archetype>`)}`),v(),process.exit(1)}let r=vt.safeParse(e.archetype);if(!r.success)return P(`Unknown archetype "${e.archetype}".`,Object.keys(na).map(f=>$.cyan(f)));let o=ta(t),n=Yi(o,e.name??o);n.app.status="confirmed",n.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],n.experience.status="proposed",n.experience.surfaces=["web-embed"],n.backend.status="confirmed",n.backend.route="managed_runtime",n.backend.archetype=r.data,n.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${r.data}`}],n.identity.status="proposed",n.identity.provider="identify";let i=Mt.parse(n),a=qi(i),s=Ce(i),c=!1,l;try{c=await gT(i,a,r.data)}catch(f){l=f instanceof Error?f.message:"The control plane did not answer."}let d=null;e.write!==!1&&(d=typeof e.write=="string"?e.write:"gamestage.yaml",await Zr(d,a,"utf8"));let p=Za[r.data],m=!!p&&e.write!==!1;if(m&&(await Zr("index.html",Gr(p),"utf8"),await Zr(Qe,Fr,"utf8"),await Zr(we,Jt,"utf8"),await Zr(be,Ht,"utf8")),L()){M({ok:!0,manifest:i,manifest_yaml:a,written_to:d,conformance:{computed:s.computed,blockers:s.blockers},registered:c,...l?{registration_failed:l}:{},scaffolded:m,files:m?["index.html",Qe,we,be]:[],...p?{}:{scaffold_skipped:"no_engine",engines:Object.keys(Za)},next:"gamestage dev"});return}I(`Created ${i.app.title}`),T("Archetype",r.data),m&&T("Game","index.html, with the Gamestage client beside it"),T("Authority","managed runtime (server-owned)"),T("Conformance",`${s.computed} ${s.computedName}`),d&&T("Manifest",d),v(c?" Registered in Studio as a draft.":l?` Not registered in Studio: ${l} (${me})`:" No account found, so registration was skipped."),I("What the server will own"),v(` ${$.dim(na[r.data])}`),I("Next"),A(`${$.cyan("gamestage dev")} run the game locally against the archetype`),A(`${$.cyan("gamestage manifest validate "+(d??"gamestage.yaml"))} check where it stands`),v()}import{readFileSync as Op}from"node:fs";import{readFile as Np}from"node:fs/promises";import{extname as ST,resolve as $T}from"node:path";import{createHash as Ev}from"node:crypto";import{readFile as yT}from"node:fs/promises";var vT=8e6;async function Ap(e){let t;try{t=await yT(e)}catch{return}if(t.byteLength>vT)return;if(t.byteLength>=2){if(t[0]===255&&t[1]===254)return t.toString("utf16le");if(t[0]===254&&t[1]===255)return t.swap16().toString("utf16le")}let r=t.subarray(0,8192);if(!r.includes(0))return t.toString("utf8");let o=0,n=0;for(let a=0;a<r.length;a+=1)r[a]===0&&(a%2===0?o+=1:n+=1);let i=Math.floor(r.length/2);if(i>8){if(n>i*.7&&o<i*.1)return t.toString("utf16le");if(o>i*.7&&n<i*.1)return t.swap16().toString("utf16le")}}async function ra(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===we||o===be)continue;let n=await Ap(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}import{lstatSync as _T,readdirSync as bT}from"node:fs";import{relative as wT,resolve as kv,sep as kT}from"node:path";var xT=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local"]);function xv(e){let t=e.split("/").pop()??e;return xT.has(t)||t.startsWith(".env.")}function Ip(e,t={}){let r=t.symlinks??"throw",o=kv(e),n=[],i=[];function a(s){for(let c of bT(s,{withFileTypes:!0}).sort((l,d)=>l.name.localeCompare(d.name))){let l=kv(s,c.name),d=wT(o,l).split(kT).join("/");if(c.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${d}`);i.push(d);continue}if(c.isDirectory())a(l);else if(c.isFile()){if(xv(d))continue;n.push({path:l,relativePath:d})}}}if(!_T(o).isDirectory())throw new Error(`${e} is not a directory.`);return a(o),{files:n,skippedLinks:i}}function Cp(e){return Ip(e,{symlinks:"throw"}).files}var Pp=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai";function Sv(e){return`${Pp}/stage/games/${encodeURIComponent(e)}?tab=overview`}function $v(e){return e&&new Set(["hunt","push","group","forecast"]).has(e)?`${Pp}/docs/game-formats#${e}`:`${Pp}/docs`}function ia(e,t){return e.refused?L()?(M({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(I("Not done"),v(` ${e.refused}`),v(),!0):!1}function Tv(e,t=e.playgroundUrl){T("Game",`${e.name} (${e.id})`),T("State",e.state),T("Conformance",e.conformance),T("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&T("Playground",t),e.playerEndpoint&&T("Player API",e.playerEndpoint),T("Manage",Sv(e.id)),T("Docs",$v(e.archetype))}async function Av(e){let{client:t,email:r}=await Se();try{if(e){let s=await t.getGame(e);if(s||P(`No game called "${e}" in this workspace.`),L())return M({ok:!0,game:s});if(I(s.name),Tv(s),s.meters.length){v();for(let c of s.meters){let l=Math.round(iv(c)*100);T(c.label,`${c.used} of ${c.limit}${c.unit} (${l}%)`)}}v();return}let o=await t.getWorkspace(),n=o.games.length,i=typeof o.gamesTotal=="number"?o.gamesTotal:void 0;if(L())return M({ok:!0,games_total:i??null,games_shown:n,workspace:o});if(I(o.name),T("Signed in as",r),T("Tier",o.tier),T("Games",i===void 0?`${n} listed, and this control plane does not report a total`:`${i} ${i===1?"game":"games"}`),v(),i===0){A("No games yet. `gamestage create` or `gamestage inspect .` starts one."),v();return}for(let s of o.games)T(s.name,`${s.state}${s.playgroundUrl?"":" (never deployed)"}`);i!==void 0&&n<i&&(v(),A(`Showing ${n} of ${i} games.`));let a=ov(o.meters);if(a.length){v(),I("At a cap");for(let s of a)A(`${s.label}: ${s.used} of ${s.limit}${s.unit}`)}v()}catch(o){Oe(o)}}async function ET(e,t){let r;try{r=await Np(e,"utf8")}catch{t&&P(`Cannot read ${e}.`);return}let o=_e(r);if(!o.ok){P(`${e} is not a valid App Manifest, so its round cannot be provisioned.`,o.issues.map(n=>`${n.path} ${n.message}`));return}return o.manifest.backend.round}async function TT(e){try{let t=await ra(Cp(e));return Qi(t.map(r=>r.text).join(`
7368
- `))}catch{return}}async function AT(e){try{let t=await Np(e,"utf8");return`c${Ev("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function Iv(e,t){t.file&&t.dir&&P("Choose either --file or --dir for a deploy, not both.");let{client:r}=await Se(),o=await ET(t.manifest??"gamestage.yaml",!!t.manifest);try{let n;t.file?n=await CT(r,e,t.file):t.dir&&(n=await PT(r,e,t.dir));let i=t.manifest??"gamestage.yaml",a=t.revision??await AT(i),s=await r.deploy(e,{manifestRevision:a,contentHash:t.hash??`sha256:${a}`,conformance:t.level??"L0",offersPrize:!!t.prize,round:o,...t.dir?{wording:await TT(t.dir)}:{}});if(ia(s,"deploy"))return;let c=o?s.game.rounds.some(m=>m.id===`round-${o.number}`):null,l=c===!1?[...s.game.logs].reverse().find(m=>m.level==="error"):void 0;if(L())return M({ok:!0,status:"deployed",roundProvisioned:c,...l?{roundError:l.message}:{},game:n?{...s.game,playgroundUrl:n}:s.game});let d=It(s.game.containerLabel),p=It(s.game.containerLabel,{lower:!0});if(I("Deployed"),Tv(s.game,n),c&&T(d,`${o.number} is live`),v(),c===!1){I(`But there is no ${p}`),v(` ${l?.message??`The Engine did not accept the ${p}.`}`),v(),A("Anyone opening the game will find nothing on. Deploy again once it is fixed."),v();return}if(c===null){let m=s.game.rounds?.length??0;A(m?`No ${p} in the manifest, which is right: the game is playing ${m} from Studio.`:`No ${p} in the manifest and none in Studio, so the game has nothing on yet.`)}A("Share the playground URL. It sleeps when idle and wakes on a request."),v()}catch(n){Oe(n)}}async function Cv(e){let{client:t}=await Se();try{let r=await t.archiveGame(e);if(ia(r,"archive"))return;if(L()){M({ok:!0,status:"archived",game:r.game});return}I("Archived"),T("Game",`${r.game.name} (${r.game.id})`),v(),A("Taken off the air. Its record and files are retained outside the served bundle."),v()}catch(r){Oe(r)}}async function Pv(e){let{client:t}=await Se();try{let{workspace:r,refused:o}=await t.setPlan(e);if(o){v(o);return}if(L())return M({ok:!0,workspace:r});I("Plan changed"),T("Plan",r.tier),T("Live games",String(r.liveGameAllowance||"Contracted")),v()}catch(r){Oe(r)}}async function Ov(e){let t;try{t=await Np(e,"utf8")}catch{return P(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=_e(t);if(!r.ok)return P(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${$.cyan(a.path)} ${a.message}`),"",`${$.cyan(`gamestage manifest validate ${e}`)} the full report`]);let o=r.manifest,n=o.backend.archetype;if(!n)return P(`${e} declares no archetype, so there is nothing to register.`,["Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await Se();Zn();try{let a=await i.registerGame({id:o.app.id,name:o.app.title,archetype:n,repository:o.app.source?.repository??null,manifestRevision:String(o.manifest.revision),contentHash:`sha256:${Ev("sha256").update(t).digest("hex")}`,conformance:Ce(o).computed,offersPrize:o.operations.promotion.offers_prize,containerLabel:o.experience.container_label,sections:Rn.map(s=>({section:s,status:o[s].status}))});if(ia(a,"register"))return;if(L()){M({ok:!0,status:"registered",game:a.game});return}I("Registered"),T("Game",`${a.game.name} (${a.game.id})`),T("State",a.game.state),T("Conformance",a.game.conformance),v(),A(`${$.cyan(`gamestage deploy ${a.game.id} --dir .`)} publish it`),v()}catch(a){Oe(a)}}async function Rp(e,t){let{client:r}=await Se();try{let o=await r.setAwake(e,t);if(ia(o,t?"wake":"suspend"))return;if(L()){M({ok:!0,status:o.game.state,game:o.game});return}I(t?"Awake":"Suspended"),T("Game",`${o.game.name} (${o.game.id})`),T("State",o.game.state),v(),A(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),v()}catch(o){Oe(o)}}async function Nv(e,t){let{client:r}=await Se();try{let o=await r.getEndpoints(e);if(o||P(`No game called "${e}" in this workspace.`),L())return M({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||P(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),v(n);return}I("Endpoints"),T("Player",o.player??"not deployed"),T("Control",o.control??"not deployed"),T("Playground",o.playground??"not deployed"),v()}catch(o){Oe(o)}}async function Rv(e,t){let{client:r}=await Se();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null});if(L())return M({ok:!0,lines:o});if(o.length===0){I("No log lines"),v(),A("Nothing yet, or everything is older than the tier's retention."),v();return}for(let n of o){let i=n.roundId?` [${n.roundId}]`:"";v(`${n.at} ${n.level.padEnd(5)}${i} ${n.message}`)}}catch(o){Oe(o)}}function jv(e,t,r){let o=`<script>
7148
+ game trustworthy later.`)),v();for(let[f,h]of Object.entries(ua))v(` ${$.cyan(f.padEnd(20))} ${$.dim(h)}`);v(),v(` ${$.dim("Then run:")} ${$.cyan(`gamestage create --name "${e.name??t}" --archetype <archetype>`)}`),v(),process.exit(1)}let r=yt.safeParse(e.archetype);if(!r.success)return C(`Unknown archetype "${e.archetype}".`,Object.keys(ua).map(f=>$.cyan(f)));let o=ca(t),n=na(o,e.name??o);n.app.status="confirmed",n.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],n.experience.status="proposed",n.experience.surfaces=["web-embed"],n.backend.status="confirmed",n.backend.route="managed_runtime",n.backend.archetype=r.data,n.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${r.data}`}],n.identity.status="proposed",n.identity.provider="identify";let i=Lt.parse(n),a=ta(i),s=Re(i),c=!1,l;try{c=await FT(i,a,r.data)}catch(f){l=f instanceof Error?f.message:"The control plane did not answer."}let p=null;e.write!==!1&&(p=typeof e.write=="string"?e.write:"gamestage.yaml",await Wr(p,a,"utf8"));let d=Xa[r.data],m=!!d&&e.write!==!1;if(m&&(await Wr("index.html",Vr(d),"utf8"),await Wr(Qe,Kr,"utf8"),await Wr(ke,Jt,"utf8"),await Wr(we,Ht,"utf8")),R()){j({ok:!0,manifest:i,manifest_yaml:a,written_to:p,conformance:{computed:s.computed,blockers:s.blockers},registered:c,...l?{registration_failed:l}:{},scaffolded:m,files:m?["index.html",Qe,ke,we]:[],...d?{}:{scaffold_skipped:"no_engine",engines:Object.keys(Xa)},next:"gamestage dev"});return}I(`Created ${i.app.title}`),E("Game id",i.app.id),E("Game format",r.data),m&&E("Files","index.html, with the Gamestage client beside it"),E("Authority","managed runtime (server-owned)"),E("Build stage",`${s.computed} ${s.computedName}`),p&&E("Manifest",p),v(c?" Registered in Studio as a draft.":l?` Not registered in Studio: ${l} (${se})`:" No account found, so registration was skipped."),I("What the server will own"),v(` ${$.dim(ua[r.data])}`),I("Next"),A(`${$.cyan("gamestage dev")} run the game locally against the archetype`),A(`${$.cyan("gamestage manifest validate "+(p??"gamestage.yaml"))} check where it stands`),v()}import{readFileSync as Fp}from"node:fs";import{readFile as Gp}from"node:fs/promises";import{extname as JT,resolve as YT}from"node:path";import{createHash as Zv}from"node:crypto";import{readFile as GT}from"node:fs/promises";var ZT=8e6;async function zp(e){let t;try{t=await GT(e)}catch{return}if(t.byteLength>ZT)return;if(t.byteLength>=2){if(t[0]===255&&t[1]===254)return t.toString("utf16le");if(t[0]===254&&t[1]===255)return t.swap16().toString("utf16le")}let r=t.subarray(0,8192);if(!r.includes(0))return t.toString("utf8");let o=0,n=0;for(let a=0;a<r.length;a+=1)r[a]===0&&(a%2===0?o+=1:n+=1);let i=Math.floor(r.length/2);if(i>8){if(n>i*.7&&o<i*.1)return t.toString("utf16le");if(o>i*.7&&n<i*.1)return t.swap16().toString("utf16le")}}async function da(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===ke||o===we)continue;let n=await zp(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}import{lstatSync as BT,readdirSync as KT}from"node:fs";import{relative as VT,resolve as Fv,sep as WT}from"node:path";var HT=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs"]);function Gv(e){let t=e.split("/").pop()??e;return HT.has(t)||t.startsWith(".env.")}function Mp(e,t={}){let r=t.symlinks??"throw",o=Fv(e),n=[],i=[];function a(s){for(let c of KT(s,{withFileTypes:!0}).sort((l,p)=>l.name.localeCompare(p.name))){let l=Fv(s,c.name),p=VT(o,l).split(WT).join("/");if(c.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${p}`);i.push(p);continue}if(c.isDirectory())a(l);else if(c.isFile()){if(Gv(p))continue;n.push({path:l,relativePath:p})}}}if(!BT(o).isDirectory())throw new Error(`${e} is not a directory.`);return a(o),{files:n,skippedLinks:i}}function Up(e){return Mp(e,{symlinks:"throw"}).files}function ma(e,t){return e.refused?R()?(j({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(I("Not done"),v(` ${e.refused}`),v(),!0):!1}function Bv(e,t=e.playgroundUrl){E("Game",`${e.name} (${e.id})`),E("State",e.state),E("Build stage",e.conformance),E("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&E("Playground",t),e.playerEndpoint&&E("Player API",e.playerEndpoint),E("Manage",Dv(e.id)),E("Docs",Lv(e.archetype))}async function Kv(e){let{client:t,email:r}=await be(),o=await la(t),n=Br(o);if(n.ok||C(n.message,n.next),n.access==="pending"||n.access==="refused"){if(R())return j({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});I("Your account"),E("Signed in as",r),E("Access",n.access),Bn(n);return}try{if(e){let l=await t.getGame(e);if(l||C(...Xv(e)),R())return j({ok:!0,game:l});if(I(l.name),Bv(l),l.meters.length){v();for(let p of l.meters){let d=Math.round(_v(p)*100);E(p.label,`${p.used} of ${p.limit}${p.unit} (${d}%)`)}}v();return}let i="workspace"in o&&o.workspace?o.workspace:await t.getWorkspace(),a=i.games.length,s=typeof i.gamesTotal=="number"?i.gamesTotal:void 0;if(R())return j({ok:!0,status:n.status,access:n.access,games_total:s??null,games_shown:a,workspace:i});if(I(i.name),E("Signed in as",r),E("Access",n.access??"not reported by this control plane"),E("Tier",i.tier),E("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),v(),s===0){A("No games yet. `gamestage create` or `gamestage inspect .` starts one."),v();return}for(let l of i.games)E(l.name,`${l.state}${l.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(v(),A(`Showing ${a} of ${s} games.`));let c=vv(i.meters);if(c.length){v(),I("At a cap");for(let l of c)A(`${l.label}: ${l.used} of ${l.limit}${l.unit}`)}v()}catch(i){Ee(i)}}async function qT(e,t){let r;try{r=await Gp(e,"utf8")}catch{t&&C(`Cannot read ${e}.`);return}let o=_e(r);if(!o.ok){C(`${e} is not a valid App Manifest, so its round cannot be provisioned.`,o.issues.map(n=>`${n.path} ${n.message}`));return}return o.manifest.backend.round}async function XT(e){try{let t=await da(Up(e));return aa(t.map(r=>r.text).join(`
7149
+ `))}catch{return}}async function QT(e){try{let t=await Gp(e,"utf8");return`c${Zv("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function Vv(e,t){t.file&&t.dir&&C("Choose either --file or --dir for a deploy, not both.");let{client:r}=await be(),o=await qT(t.manifest??"gamestage.yaml",!!t.manifest);try{let n;t.file?n=await tA(r,e,t.file):t.dir&&(n=await nA(r,e,t.dir));let i=t.manifest??"gamestage.yaml",a=t.revision??await QT(i),s=await r.deploy(e,{manifestRevision:a,contentHash:t.hash??`sha256:${a}`,conformance:t.level??"L0",offersPrize:!!t.prize,round:o,...t.dir?{wording:await XT(t.dir)}:{}});if(ma(s,"deploy"))return;let c=o?s.game.rounds.some(m=>m.id===`round-${o.number}`):null,l=c===!1?[...s.game.logs].reverse().find(m=>m.level==="error"):void 0;if(R())return j({ok:!0,status:"deployed",roundProvisioned:c,...l?{roundError:l.message}:{},game:n?{...s.game,playgroundUrl:n}:s.game});let p=Tt(s.game.containerLabel),d=Tt(s.game.containerLabel,{lower:!0});if(I("Deployed"),Bv(s.game,n),c&&E(p,`${o.number} is live`),v(),c===!1){I(`But there is no ${d}`),v(` ${l?.message??`The Engine did not accept the ${d}.`}`),v(),A("Anyone opening the game will find nothing on. Deploy again once it is fixed."),v();return}if(c===null){let m=s.game.rounds?.length??0;A(m?`No ${d} in the manifest, which is right: the game is playing ${m} from Studio.`:`No ${d} in the manifest and none in Studio, so the game has nothing on yet.`)}A("Share the playground URL. It sleeps when idle and wakes on a request."),v()}catch(n){Ee(n)}}async function Wv(e){let{client:t}=await be();try{let r=await t.archiveGame(e);if(ma(r,"archive"))return;if(R()){j({ok:!0,status:"archived",game:r.game});return}I("Archived"),E("Game",`${r.game.name} (${r.game.id})`),v(),A("Taken off the air. Its record and files are retained outside the served bundle."),v()}catch(r){Ee(r)}}async function Hv(e){let{client:t}=await be();try{let{workspace:r,refused:o}=await t.setPlan(e);if(o){v(o);return}if(R())return j({ok:!0,workspace:r});I("Plan changed"),E("Plan",r.tier),E("Live games",String(r.liveGameAllowance||"Contracted")),v()}catch(r){Ee(r)}}async function Zp(e,t){let{admin:r,email:o}=await zv();try{let n=await r.setWorkspaceAccess(e,t),i=Mv(n);if(R())return j({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});Bn(i),n.changed&&(E("Decided by",o),v())}catch(n){Ee(n)}}async function Jv(e){let t;try{t=await Gp(e,"utf8")}catch{return C(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=_e(t);if(!r.ok)return C(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${$.cyan(a.path)} ${a.message}`),"",`${$.cyan(`gamestage manifest validate ${e}`)} the full report`]);let o=r.manifest,n=o.backend.archetype;if(!n)return C(`${e} declares no archetype, so there is nothing to register.`,["Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await be();Zn();try{let a=await i.registerGame({id:o.app.id,name:o.app.title,archetype:n,repository:o.app.source?.repository??null,manifestRevision:String(o.manifest.revision),contentHash:`sha256:${Zv("sha256").update(t).digest("hex")}`,conformance:Re(o).computed,offersPrize:o.operations.promotion.offers_prize,containerLabel:o.experience.container_label,sections:Rn.map(s=>({section:s,status:o[s].status}))});if(ma(a,"register"))return;if(R()){j({ok:!0,status:"registered",game:a.game});return}I("Registered"),E("Game",`${a.game.name} (${a.game.id})`),E("State",a.game.state),E("Conformance",a.game.conformance),v(),A(`${$.cyan(`gamestage deploy ${a.game.id} --dir .`)} publish it`),v()}catch(a){Ee(a)}}async function Bp(e,t){let{client:r}=await be();try{let o=await r.setAwake(e,t);if(ma(o,t?"wake":"suspend"))return;if(R()){j({ok:!0,status:o.game.state,game:o.game});return}I(t?"Awake":"Suspended"),E("Game",`${o.game.name} (${o.game.id})`),E("State",o.game.state),v(),A(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),v()}catch(o){Ee(o)}}async function Yv(e,t){let{client:r}=await be();try{let o=await r.getEndpoints(e);if(o||C(...Xv(e)),R())return j({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||C(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),v(n);return}I("Endpoints"),E("Player",o.player??"not deployed"),E("Control",o.control??"not deployed"),E("Playground",o.playground??"not deployed"),v()}catch(o){Ee(o)}}async function qv(e){let{client:t}=await be();try{let r=await t.requestArt(e);if(R())return j({ok:!r.refused,result:r});if(r.refused){C(r.refused);return}let o=r.game?.art;if(o?.state==="ready"&&o.url){I("Drawn"),v(),E("Game",r.game.name),E("Picture",o.url),v();return}C(`${r.game?.name??e} was not drawn.`,[`Read what happened: \`gamestage logs ${e}\`.`])}catch(r){Ee(r)}}function Xv(e){let t=/[A-Z\s]/.test(e);return[`No game with the id "${e}" in this workspace.`,t?["That looks like a game's name. Every command takes the id, which is","the name in lower case plus four characters, e.g. my-game-a3c9.","`gamestage status` lists them, and `create` prints one when it makes it."]:["`gamestage status` lists the games in this workspace and their ids."]]}async function Qv(e,t){let{client:r}=await be();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await r.getGame(e).catch(()=>{}),i=n?mv(n):{state:"none"},a=fv(i);if(R())return j({ok:!0,lines:o,freshness:i});if(a&&(I("This game is serving a closed round"),v(),A(a),v()),o.length===0){I("No log lines"),v(),A("Nothing yet, or everything is older than the tier's retention."),v();return}for(let s of o){let c=s.roundId?` [${s.roundId}]`:"";v(`${s.at} ${s.level.padEnd(5)}${c} ${s.message}`)}}catch(o){Ee(o)}}function e_(e,t,r){let o=`<script>
7369
7150
  // Written by \`gamestage deploy\`. Where this game's Engine answers.
7370
7151
  window.GAMESTAGE_API = ${JSON.stringify(t)};
7371
7152
  window.GAMESTAGE_GAME = ${JSON.stringify(r)};
7372
7153
  // This page was deployed, so it may ask which Interaction Cloud project it is.
7373
7154
  window.GAMESTAGE_IC_LOOKUP = true;
7374
7155
  </script>
7375
- `,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function Bn(e,t,r){let o=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r}});o.ok||P(`Upload refused with ${o.status}. Ask for a fresh URL and retry.`)}function oa(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function IT(e){switch(ST(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function CT(e,t,r){let o=$T(r),n;try{n=Op(o)}catch{throw P(`Cannot read ${r}.`),new Error("unreachable")}let i=await e.uploadTarget(t,"index.html"),a=jv(Gr(n.toString("utf8")),`${i.playerApiOrigin}`,t);await Bn(i.uploadUrl,a,"text/html; charset=utf-8");let s=await e.uploadTarget(t,be);await Bn(s.uploadUrl,Ht,"text/javascript; charset=utf-8");let c=await e.uploadTarget(t,we);await Bn(c.uploadUrl,Jt,"text/javascript; charset=utf-8");let l=await e.uploadTarget(t,Qe);return await Bn(l.uploadUrl,Fr,"image/svg+xml"),L()||(v(),A(`Uploaded ${r} to ${oa(i)}`),A(`Wired it to ${i.playerApiOrigin} as "${t}"`),A(`Shipped @monterosa/gamestage beside it (${qt})`),A(`Shipped the player client beside it (${tr})`)),oa(i)}async function PT(e,t,r){let o;try{o=Cp(r)}catch(m){throw P(m instanceof Error?m.message:`Cannot read ${r}.`),new Error("unreachable")}let n=o.find(m=>m.relativePath==="index.html");n||P(`Directory ${r} must contain an index.html file.`);let i=Op(n.path,"utf8"),a=Tp(i),s=o.some(m=>m.relativePath==="favicon.ico"),c=o.some(m=>m.relativePath===Qe),l=!a&&!s,d=l&&!c,p;for(let m of o){let f=await e.uploadTarget(t,m.relativePath);m.relativePath==="index.html"&&(p=f);let h=Op(m.path),b=m.relativePath==="index.html"?jv(l?Gr(h.toString("utf8")):h.toString("utf8"),f.playerApiOrigin,t):h;await Bn(f.uploadUrl,b,IT(m.relativePath))}if(d){let m=await e.uploadTarget(t,Qe);await Bn(m.uploadUrl,Fr,"image/svg+xml")}if(await e.pruneBundle(t,[...o.map(m=>m.relativePath),...d?[Qe]:[]]),!L()&&p&&(v(),A(`Uploaded ${o.length} files from ${r}`),A(`Playground: ${oa(p)}`),A(`Wired it to ${p.playerApiOrigin} as "${t}"`),d&&A("Added a replaceable starter favicon")),!p)throw new Error("The directory index was not uploaded.");return oa(p)}import{readFile as fI}from"node:fs/promises";var zv="player-conformance",jp="round-current",OT="sha256:emulator-conformance";function et(e){return structuredClone(e)}function tt(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:OT}}function NT(e){let t=e==="per-player-challenge";return{...tt(),id:jp,number:412,version:2,can:{accepting_plays:!0,results_available:!1,solution_revealed:!1,closed:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function Dv(e,t){let r=t==="mistakes";return{...tt(),player_id:zv,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function RT(e){let t=NT(e),r=new Map([[t.id,t]]),o=new Map([[t.id,Dv(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",Dv("round-revealed",e))),{runtime:{...tt(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"forecast":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...tt(),round_id:jp,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1},profile:{...tt(),player_id:zv,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,nextPlay:1}}function Lv(e,t){return{...tt(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function Dp(e){let t=RT(e);return{async getRuntime(){return et(t.runtime)},async getCurrentRound(){return et(t.rounds.get(jp))},async getRound(r){let o=t.rounds.get(r);return o?et(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return Lv(t,"round_not_found");let i=t.plays.get(o.idempotency_key);if(i)return{...et(i),outcome:"duplicate"};if(o.round_version!==n.version)return{...tt(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return Lv(t,"challenge_instance_id");let a=t.roundStates.get(r),s=t.runtime.marking==="at_settlement",c={...a,...tt(),attempts_used:a.attempts_used+1,score:a.score+(s?0:10),finished:!s,outcome:s?"pending":"won"},l={...tt(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!s,feedback:s?[]:[{key:"answer",verdict:"correct"}],round_state:et(c)};return t.roundStates.set(r,c),t.plays.set(o.idempotency_key,l),et(l)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return et(o)},async getProfile(){return et(t.profile)},async getLeaderboard(){return et(t.leaderboard)}}}function jT(){return e=>Dp(e)}var dD=jT();import{createServer as DT}from"node:http";function Zt(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var LT=Zt(Q.runtime),zT=Zt(Q.currentRound),MT=Zt(Q.round),UT=Zt(Q.plays),FT=Zt(Q.roundState),GT=Zt(Q.profile),ZT=Zt(Q.leaderboard);function wt(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function Kn(e,t,r,o){wt(e,t,{error:{code:r,message:o,retryable:!1}})}async function BT(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function KT(e,t,r){if(!e.url){Kn(t,400,"invalid_request","The request URL is missing.");return}let n=new URL(e.url,"http://localhost").pathname;if(e.method==="GET"){if(LT.test(n)){wt(t,200,await r.getRuntime());return}if(zT.test(n)){wt(t,200,await r.getCurrentRound());return}let i=MT.exec(n);if(i){let s=await r.getRound(decodeURIComponent(i[2]));if(!s){Kn(t,404,"round_not_found","The requested round was not found.");return}wt(t,200,s);return}let a=FT.exec(n);if(a){let s=decodeURIComponent(a[2]);try{wt(t,200,await r.getRoundState(s))}catch{Kn(t,404,"round_not_found","The requested round was not found.")}return}if(GT.test(n)){wt(t,200,await r.getProfile());return}if(ZT.test(n)){wt(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let i=UT.exec(n);if(i){try{let a=await BT(e);wt(t,200,await r.play(decodeURIComponent(i[2]),a))}catch(a){Kn(t,400,"invalid_request",a instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}Kn(t,404,"not_found","The requested player API route was not found.")}function aa(e="default"){let t=Dp(e);return DT((r,o)=>{KT(r,o,t).catch(()=>{o.headersSent?o.destroy():Kn(o,500,"internal_error","The emulator could not answer the request.")})})}import{createServer as lI}from"node:http";import{createHmac as VT,randomBytes as WT,timingSafeEqual as HT}from"node:crypto";var Lp="anon:";function zp(e){return e.startsWith(Lp)}function Br(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${Lp}${t||"unknown"}`}var JT={async resolve(){}};async function Mv(e){if(!e.token)return e.sessionSecret?{playerId:YT(e.anonymousId,e.sessionSecret)??Br(void 0)}:{playerId:Br(e.anonymousId)};let t=e.resolver??JT,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:Br(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}var Uv=".";function Fv(e){let t=`${Lp}${WT(16).toString("base64url")}`;return{playerId:t,token:qT(t,e)}}function Gv(e,t){return VT("sha256",t).update(e).digest("base64url")}function qT(e,t){return`${e}${Uv}${Gv(e,t)}`}function YT(e,t){if(!e)return;let r=e.lastIndexOf(Uv);if(r<=0)return;let o=e.slice(0,r);if(!zp(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(Gv(o,t));if(n.length===i.length)return HT(n,i)?o:void 0}var Mp="round_not_found";function Zv(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),c=()=>({server_time:i(),snapshot:e.runtime.snapshot}),l=f=>f;function d(f,h){return!n.settle||!f.round.can.results_available||h.outcome!=="pending"?h:n.settle({secret:f.secret,state:h,limits:f.limits,now:i()})}async function p(f,h){let b=await o.getState(t,f,r);return b?{state:b.state,version:b.version}:{state:n.initialState({playerId:r,roundId:f,limits:h,now:i()}),version:void 0}}let m=(f,h,b)=>({...c(),play_id:s(),outcome:f,reason:h,round_version:b,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...c()}},async getCurrentRound(){let f=await o.getCurrentRound(t);if(!f)throw new Error(Mp);return{...f.round,...c()}},async getRound(f){let h=await o.getRound(t,f);return h?{...h.round,...c()}:void 0},async getRoundState(f){let h=await o.getRound(t,f);if(!h)throw new Error(Mp);let b=l(h),{state:S}=await p(f,b.limits);return{...d(b,S),...c()}},async getProfile(){return{...await o.getProfile(t,r),...c()}},async getLeaderboard(){let h=(await o.getCurrentRound(t))?.round.id??"";return{...await o.getLeaderboard(t,h),...c()}},async play(f,h){let b=await o.getRound(t,f);if(!b)return m("rejected",Mp,0);let S=l(b);if(e.runtime.identity?.required&&zp(r))return m("rejected",e.identityRefusal??"identity_required",S.round.version);if(S.limits.playsPerSecond!==void 0){let it=i().slice(0,19),oe=await o.countPlay(t,f,it,r),Xn=Math.max(1,Math.ceil(S.limits.playsPerSecond/oe.buckets));if(oe.inBucket>Xn)return{...m("busy","capped",S.round.version),retry_after_seconds:1}}let O=await o.getPlay(t,r,h.idempotency_key);if(O)return{...O.result,...c(),outcome:"duplicate"};let{state:j,version:te}=await p(f,S.limits),G=n.admissible({accepting:S.round.can.accepting_plays,roundVersion:S.round.version,playedVersion:h.round_version,challengeInstanceId:S.round.challenge_instance_id??null,playedChallengeInstanceId:h.challenge_instance_id??null,state:j,secret:S.secret,limits:S.limits});if(!G.ok){let it=G.reason==="round_version"?"stale":"rejected";return m(it,G.reason,S.round.version)}let N=n.mark({payload:h.payload,secret:S.secret,state:j,limits:S.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(N.outcome!=="accepted")return m("rejected",N.reason??"rejected",S.round.version);let q={...c(),play_id:s(),outcome:N.outcome,round_version:S.round.version,marked:N.marked,feedback:N.feedback,round_state:{...N.next,...c()}},Et=`play:${JSON.stringify([t,r,h.idempotency_key])}`,ot=[{id:Et,at:q.server_time,tenant:t,round_id:f,player_id:r,action:"play.committed",detail:{play_id:q.play_id,idempotency_key:h.idempotency_key,outcome:q.outcome,marked:q.marked,round_version:q.round_version,score_before:j.score,score_after:N.next.score,attempts_used:N.next.attempts_used,attempts_allowed:N.next.attempts_allowed,mistakes_used:N.next.mistakes_used,mistakes_allowed:N.next.mistakes_allowed,...n.auditDetail({secret:S.secret,before:j,decision:N,payload:h.payload})}}];N.marked&&ot.push({id:`score:${JSON.stringify([t,r,h.idempotency_key])}`,at:q.server_time,tenant:t,round_id:f,player_id:r,action:"score.recorded",detail:{play_id:q.play_id,score_before:j.score,score_after:N.next.score,marked:!0,outcome:N.next.outcome}});let Tt=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:h.idempotency_key,play:{result:q},state:N.next,expectedVersion:te,audit:ot,...N.marked?{score:{roundId:f,score:N.next.score}}:{}});if(!Tt.ok&&Tt.reason==="play_exists"){let it=await o.getPlay(t,r,h.idempotency_key);return it?{...it.result,...c(),outcome:"duplicate"}:m("rejected","play_conflict",S.round.version)}return Tt.ok?q:(await o.appendAudit({id:Et,at:q.server_time,tenant:t,round_id:f,player_id:r,action:"play.refused",detail:{play_id:q.play_id,idempotency_key:h.idempotency_key,reason:"round_version",attempt_spent:!1}}),m("stale","round_version",S.round.version))}}}function XT(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function QT(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter(O=>r.targets.includes(O)&&!i.has(O)),s=t.picks.filter(O=>!r.targets.includes(O)),c=o.attempts_used+1,l=o.mistakes_used+(s.length>0?1:0);for(let O of a)i.add(O);let d=i.size>=r.required,p=l>=n.mistakesAllowed,m=c>=n.attemptsAllowed,f=d||p||m,h=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(d?r.completionBonus:0),b={...o,server_time:e.now,attempts_used:c,attempts_allowed:n.attemptsAllowed,mistakes_used:l,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:h,finished:f,outcome:e.markAtSettlement?"pending":d?"won":f?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:b}:{outcome:"accepted",marked:!0,feedback:t.picks.map(O=>({key:O,verdict:r.targets.includes(O)?"correct":"wrong"})),next:b}}function eA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Up={archetype:"hunt",admissible:XT,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return QT({...e,attempt:{picks:t}})},initialState:eA,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}};function Fp(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function tA(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function nA(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function rA(e){let{secret:t,state:r,limits:o}=e,n=Fp(r),i=O=>({outcome:"rejected",reason:O,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,c=a.entries.find(O=>O.key===s);if(!c)return i("not_on_slate");let l=n.total+c.value,d=l>t.target,p=[...n.picks,{slate:a.id,key:c.key,label:c.label,value:c.value}],m=r.attempts_used+1,f=m>=o.picksAllowed,h=d||f,b={...r,server_time:e.now,attempts_used:m,attempts_allowed:o.picksAllowed,progress:{total:l,picks:p,bust:d,...h?{tier:tA(t,l)}:{}},score:e.markAtSettlement?r.score:d?0:l,finished:h,outcome:e.markAtSettlement?"pending":d?"lost":h?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:b}:{outcome:"accepted",marked:!0,feedback:[{key:c.key,verdict:d?"wrong":"correct",label:String(c.value)}],next:b}}function oA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Gp={archetype:"push",admissible:nA,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return rA({...e,attempt:{picks:t}})},initialState:oA,auditDetail({secret:e,before:t,decision:r}){let o=Fp(t),n=Fp(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}};var iA=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,aA=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;function sA(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function cA(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(N=>!i.has(N.key)),c=s.find(N=>iA(N.members,t.picks)),l=o.attempts_used+1,d=o.mistakes_used+(c?0:1);c&&(i.add(c.key),a.push({key:c.key,label:c.label,members:[...c.members]}));let p=i.size>=r.groups.length,m=d>=n.mistakesAllowed,f=l>=n.attemptsAllowed,h=p||m||f,b=e.markAtSettlement?o.score:o.score+(c?r.pointsPerGroup:0)+(p?r.completionBonus:0),S={...o,server_time:e.now,attempts_used:l,attempts_allowed:n.attemptsAllowed,mistakes_used:d,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:b,finished:h,outcome:e.markAtSettlement?"pending":p?"won":h?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:S};let O=s.reduce((N,q)=>Math.max(N,aA(t.picks,q)),0),j=!c&&t.picks.length>1&&O===t.picks.length-1,te=c?"correct":j?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map(N=>({key:N,verdict:te,...c?{label:c.label}:{}})),next:S}}function lA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Bv={archetype:"group",admissible:sA,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return cA({...e,attempt:{picks:t}})},initialState:lA,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}};function uA(e,t){return e.options.find(r=>r.key===t)?.points??e.pointsForCorrect}function dA(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function pA(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=r.options.some(l=>l.key===t.pick),a=o.attempts_used+1;if(!i)return{outcome:"rejected",reason:"unknown_option",marked:!1,feedback:[],next:o};let s=[...Array.isArray(o.progress.picks)?o.progress.picks:[],t.pick],c={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,picks:s},finished:a>=n.attemptsAllowed};return r.result===void 0?{outcome:"accepted",marked:!1,feedback:[],next:{...c,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:mA(r,t.pick),next:Kv(r,c,t.pick)}}function mA(e,t){return[{key:t,verdict:t===e.result?"correct":"wrong",...e.options.find(r=>r.key===e.result)?.label?{label:e.options.find(r=>r.key===e.result).label}:{}}]}function Kv(e,t,r){let o=r===e.result;return{...t,score:o?uA(e,r):0,finished:!0,outcome:o?"won":"lost"}}function fA(e){let{secret:t,state:r}=e;if(t.result===void 0)return r;let o=Array.isArray(r.progress.picks)?r.progress.picks:[];return o.length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...Kv(t,r,o[0]),server_time:e.now}}function hA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{picks:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Vv={archetype:"forecast",admissible:dA,mark(e){let t=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:"";return pA({...e,attempt:{pick:t}})},initialState:hA,settle:fA,auditDetail({secret:e,decision:t,payload:r}){return{predicted:typeof r.pick=="string"?r.pick:null,settled_at_commit:e.result!==void 0,marked:t.marked,options_offered:e.options.length}}};var Wv={hunt:Up,push:Gp,group:Bv,forecast:Vv},Bt=Object.keys(Wv);function gA(e){return Wv[We(e)]}function Hv(e){return gA(e.archetype??"hunt")}function Jv(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard"]}}function qv(e){let t=Hv(e.round);if(t)return Zv({...e,rules:t})}import{createHash as yA}from"node:crypto";var Yv=128;function Xv(e){return yA("sha256").update(e,"utf8").digest()[0]&127}var Ne=(...e)=>e.join("#");function Qv(e){let t=new Map,r=new Map,o=new Map,n=new Map,i=new Map,a=new Map,s=e.currentRoundId,c,l=e.now??Date.now;for(let d of e.rounds)t.set(d.round.id,d);for(let d of e.states??[])r.set(Ne(e.tenant,d.round_id,d.player_id),{state:d,version:0});return{async getRound(d,p){let m=t.get(p);return m?structuredClone(m):void 0},async putRound(d,p,m){t.set(p.round.id,structuredClone(p)),m&&(s=p.round.id,c=void 0)},async setRotation(d,p,m){c={roundIds:[...p],windowSeconds:m}},async getCurrentRound(){let d=c?c.roundIds[Math.floor(l()/1e3/c.windowSeconds)%c.roundIds.length]:s,p=t.get(d);return p?structuredClone(p):void 0},async getState(d,p,m){let f=r.get(Ne(d,p,m));return f?structuredClone(f):void 0},async putStateIfVersion(d,p,m){let f=Ne(d,p.round_id,p.player_id),h=r.get(f);return m===void 0?h?!1:(r.set(f,{state:structuredClone(p),version:0}),!0):!h||h.version!==m?!1:(r.set(f,{state:structuredClone(p),version:h.version+1}),!0)},async getPlay(d,p,m){let f=o.get(Ne(d,p,m));return f?structuredClone(f):void 0},async putPlayIfAbsent(d,p,m,f){let h=Ne(d,p,m);return o.has(h)?!1:(o.set(h,structuredClone(f)),!0)},async getLeaderboard(d,p){if(e.leaderboard)return structuredClone(e.leaderboard);let m=[...n.entries()].filter(([f])=>f.startsWith(Ne(d,p)+"#")).map(([f,h])=>({rank:0,player_id:f.slice(f.lastIndexOf("#")+1),display_name:f.slice(f.lastIndexOf("#")+1),score:h})).sort((f,h)=>h.score-f.score).map((f,h)=>({...f,rank:h+1}));return{server_time:"",snapshot:"",round_id:p,order:"high_first",tie_break:"earliest_play",entries:m,total:m.length}},async getProfile(d,p){return e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:p,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(d,p,m,f){let h=Ne(d,p,m,String(Xv(f))),b=(i.get(h)??0)+1;return i.set(h,b),{inBucket:b,buckets:Yv}},async recordScore(d,p,m,f){n.set(Ne(d,p,m),f)},async appendAudit(d){if(a.has(d.id))throw new Error("audit_record_exists");a.set(d.id,structuredClone(d))},async commitPlay(d){let p=Ne(d.tenant,d.playerId,d.idempotencyKey);if(o.has(p))return{ok:!1,reason:"play_exists"};let m=Ne(d.tenant,d.state.round_id,d.state.player_id),f=r.get(m);if(d.expectedVersion===void 0){if(f)return{ok:!1,reason:"state_version"}}else if(!f||f.version!==d.expectedVersion)return{ok:!1,reason:"state_version"};for(let h of d.audit)if(a.has(h.id))throw new Error("audit_record_exists");o.set(p,structuredClone(d.play)),r.set(m,{state:structuredClone(d.state),version:d.expectedVersion===void 0?0:d.expectedVersion+1});for(let h of d.audit)a.set(h.id,structuredClone(h));return d.score&&n.set(Ne(d.tenant,d.score.roundId,d.playerId),d.score.score),{ok:!0}}}}function vA(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function _A(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open},challenge_instance_id:null,challenge:{prompt:e.prompt,target:e.target,target_label:e.targetLabel,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function bA(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function wA(e,t){let r=e.result!==void 0;return{archetype:"forecast",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open&&!r,results_available:r,solution_revealed:r,closed:!e.open||r},challenge_instance_id:null,challenge:{prompt:e.prompt,options:e.options.map(n=>({key:n.key,label:n.label})),...r?{result:e.result}:{}}},secret:{options:e.options,...r?{result:e.result}:{},pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function kA(e,t){switch(e.archetype){case"hunt":return vA(e,t);case"push":return _A(e,t);case"group":return bA(e,t);case"forecast":return wA(e,t)}}function sa(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(sa).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${sa(o)}`).join(",")}}`}function xA(e,t){let r=o=>{let{server_time:n,snapshot:i,...a}=o,{version:s,...c}=a;return c};return sa({round:r(e.round),secret:e.secret,limits:e.limits,archetype:e.archetype})===sa({round:r(t.round),secret:t.secret,limits:t.limits,archetype:t.archetype??"hunt"})}async function e_(e,t,r,o,n=!0,i,a){let s=i??On(r),c=await e.getRound(t,s),l=kA(r,o);if(l.round.id=s,a&&(l.round.origin=a),c&&xA(l,c))return await e.putRound(t,{...c,archetype:l.archetype},n),{roundId:s,version:c.round.version,changed:!1,current:n};let d=c?c.round.version+1:1,p={round:{...l.round,version:d},secret:l.secret,limits:l.limits,archetype:l.archetype};return await e.putRound(t,p,n),await e.appendAudit({id:`round_${s}_v${d}`,at:new Date().toISOString(),tenant:t,round_id:s,player_id:null,action:c?"round.replaced":"round.provisioned",detail:{version:d,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:s,version:d,changed:!0,current:n}}var Zp={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},Ge=(e,t)=>({status:e,headers:{"content-type":"application/json",...Zp},body:t}),Ze=(e,t,r,o=!1)=>Ge(e,{error:{code:t,message:r,retryable:o}});function kt(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var xt={runtime:kt(Q.runtime),currentRound:kt(Q.currentRound),round:kt(Q.round),plays:kt(Q.plays),roundState:kt(Q.roundState),profile:kt(Q.profile),leaderboard:kt(Q.leaderboard),session:kt(Q.session)},SA=Ze(404,"not_found","No such route on the player API."),t_=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...Zp},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}});async function n_(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:Zp,body:void 0};if(e.method==="GET"&&n===`${Xi}/health`)return Ge(200,{status:"ok"});let i=xt.session.exec(n);if(i){if(e.method!=="POST")return Ze(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),c=o?.check(kp(s,wp(e)));if(c&&!c.allowed)return t_(c.retryAfterSeconds);let l=r?.issue(s);return l?Ge(200,{server_time:"",snapshot:"",token:l.token,player_id:l.playerId,kind:"anonymous"}):Ze(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",xt.runtime],["currentRound",xt.currentRound],["plays",xt.plays],["roundState",xt.roundState],["profile",xt.profile],["leaderboard",xt.leaderboard],["round",xt.round]];for(let[s,c]of a){let l=c.exec(n);if(!l)continue;let d=decodeURIComponent(l[1]),p=l[2]?decodeURIComponent(l[2]):void 0,m=o?.check(kp(d,wp(e)));if(m&&!m.allowed)return t_(m.retryAfterSeconds);let f=s==="plays";if(f?e.method!=="POST":e.method!=="GET")return Ze(405,"method_not_allowed",`This route accepts ${f?"POST":"GET"}.`);let h;try{h=await t.forPlayer(d,e)}catch{return Ze(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!h)return Ze(404,"not_found",`No game with id "${d}".`);try{switch(s){case"runtime":return Ge(200,await h.getRuntime());case"currentRound":return Ge(200,await h.getCurrentRound());case"round":{let b=await h.getRound(p);return b?Ge(200,b):Ze(404,"not_found","No such round.")}case"roundState":return Ge(200,await h.getRoundState(p));case"profile":return Ge(200,await h.getProfile());case"leaderboard":return Ge(200,await h.getLeaderboard());case"plays":{let b=Qy.safeParse(e.body);if(!b.success)return Ze(422,"invalid_request",b.error.issues.map(j=>`${j.path.join(".")||"body"}: ${j.message}`).join("; "));let S=await h.play(p,b.data),O=Ge(200,S);return S.outcome==="busy"&&S.retry_after_seconds&&(O.headers["retry-after"]=String(S.retry_after_seconds)),O}}}catch(b){return b instanceof Error&&b.message==="round_not_found"?Ze(404,"not_found","No such round."):(console.error("engine_error",{path:e.path,method:e.method,game:d,name:b instanceof Error?b.name:"unknown"}),Ze(500,"internal","Something went wrong at our end.",!0))}}return SA}import{createPublicKey as sI,generateKeyPairSync as cI}from"node:crypto";var Kt=new TextEncoder,Kr=new TextDecoder,ca=new TextDecoder("utf-8",{fatal:!0}),HD=2**32;function la(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function nt(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var ua=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function $A(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function r_(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw ua(t.name);if(t.hash&&o.hash?.name!==t.hash)throw ua(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw ua(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw ua(t.length,"algorithm.length");$A(e,r)}function o_(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var i_=(e,...t)=>o_("Key must be ",e,...t),Bp=(e,t,...r)=>o_(`Key for the ${e} algorithm must be `,t,...r);var se=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},$e=class extends se{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Vr=class extends se{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},da=class extends se{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},ee=class extends se{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var W=class extends se{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},St=class extends se{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var Wr=class extends se{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Vn=class extends se{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},pa=class extends se{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},ma=class extends se{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},fa=class extends se{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}};var Wn=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},Kp=e=>e?.[Symbol.toStringTag]==="KeyObject",Vp=e=>Wn(e)||Kp(e);function Wp(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function ha(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Hr(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:Kr.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=Kr.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return ha(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function Hn(e){let t=e;return typeof t=="string"&&(t=Kt.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):Wp(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var EA=e=>typeof e=="object"&&e!==null;function Re(e){if(!EA(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ga(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var Hp=e=>Re(e)&&typeof e.kty=="string",a_=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),s_=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,c_=e=>e.kty==="oct"&&typeof e.k=="string";function Jp(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function qp(e,t,r){try{return Hr(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function l_(e,t,r){try{return nt(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function u_(e,t,r){let o;try{o=JSON.parse(ca.decode(Hr(e)))}catch{throw new t(r)}if(!Re(o))throw new t(r);return o}var AA='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';function IA(e,t){if(!e.kty.includes(t.kty))throw new ee(AA);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function ya(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new ee('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=IA(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var Jn=e=>e[Symbol.toStringTag],Yp=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},CA=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:p_,key:t};if(Hp(t)){if(c_(t)&&Yp(e,t,r))return{kind:va,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Vp(t))throw new TypeError(Bp(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Jn(t)} instances for symmetric algorithms must be of type "secret"`);return Wn(t)?{kind:Xp,key:t}:{kind:Qp,key:t}},PA=(e,t,r)=>{let{alg:o}=e;if(Hp(t))switch(r){case"decrypt":case"sign":if(a_(t)&&Yp(e,t,r))return{kind:va,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(s_(t)&&Yp(e,t,r))return{kind:va,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Vp(t))throw new TypeError(Bp(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Jn(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${Jn(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Jn(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${Jn(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Jn(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return Wn(t)?{kind:Xp,key:t}:{kind:Qp,key:t}},p_=Symbol(),Xp=Symbol(),Qp=Symbol(),va=Symbol();function OA(e,t,r){return e.symmetric?CA(e,t,r):PA(e,t,r)}var _a,NA={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function m_(e,t){return _a||=new WeakMap,_a.get(e)?.[t]}function f_(e,t,r){let o=_a.get(e);return o?o[t]=r:_a.set(e,{[t]:r}),r}var d_=async(e,t,r)=>{let o=m_(e,r.alg);if(o)return o;let n=await ya(r,{...t,alg:r.alg});return f_(e,r.alg,n)},RA=(e,t)=>{let r=m_(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=NA[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return f_(e,t.alg,e.toCryptoKey(s,o,n))};async function ba(e,t,r){let o=OA(e,t,r);switch(o.kind){case p_:case Xp:return o.key;case va:{if(o.key.k)return Hr(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return d_(o.key,o.key,e)}case Qp:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?RA(n,e):d_(n,n.export({format:"jwk"}),e)}}}function Jr(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var jA={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},DA={public:[],private:["deriveBits"]},xa={public:[],private:[]};function wa(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:jA,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function ka(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new ee('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:DA,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function em(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:xa,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function tm(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:xa,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function nm(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:xa,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}var LA=Jr({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:xa,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":wa(1),"RSA-OAEP-256":wa(256),"RSA-OAEP-384":wa(384),"RSA-OAEP-512":wa(512),"ECDH-ES":ka(),"ECDH-ES+A128KW":ka(128),"ECDH-ES+A192KW":ka(192),"ECDH-ES+A256KW":ka(256),A128KW:em(128),A192KW:em(192),A256KW:em(256),A128GCMKW:tm(128),A192GCMKW:tm(192),A256GCMKW:tm(256),"PBES2-HS256+A128KW":nm(256,128),"PBES2-HS384+A192KW":nm(384,192),"PBES2-HS512+A256KW":nm(512,256)}),h_={public:[],private:[]},g_={encrypt:"encrypt",decrypt:"decrypt"};function rm(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:h_,keyOps:g_,cekBits:e,ivBits:96,cbc:!1}}function om(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:h_,keyOps:g_,cekBits:e,ivBits:128,cbc:!0}}var vL=Jr({A128GCM:rm(128),A192GCM:rm(192),A256GCM:rm(256),"A128CBC-HS256":om(256),"A192CBC-HS384":om(384),"A256CBC-HS512":om(512)});function y_(e){return LA[e]}function zA(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function MA(e,t,r){r_(t,e.subtle,r),e.minModulusLength&&zA(e.alg,t)}async function v_(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(MA(e,t,r),t)}async function __(e,t,r){let o=await v_(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function b_(e,t,r,o){let n=await v_(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var Sa=new Map([["b64",!0]]);function w_(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function k_(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function $a(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new ee(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var qr={public:["verify"],private:["sign"]};function im(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:qr}}function qn(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:qr,minModulusLength:2048}}function am(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:qr}}function x_(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:qr}}function sm(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:qr}}var S_=Jr({HS256:im(256),HS384:im(384),HS512:im(512),RS256:qn("RSASSA-PKCS1-v1_5",256),RS384:qn("RSASSA-PKCS1-v1_5",384),RS512:qn("RSASSA-PKCS1-v1_5",512),PS256:qn("RSA-PSS",256,32),PS384:qn("RSA-PSS",384,48),PS512:qn("RSA-PSS",512,64),ES256:am("P-256",256),ES384:am("P-384",384),ES512:am("P-521",512),EdDSA:x_(),Ed25519:x_(),"ML-DSA-44":sm("ML-DSA-44"),"ML-DSA-65":sm("ML-DSA-65"),"ML-DSA-87":sm("ML-DSA-87")});function Ea(e){let t=S_[e];if(!t)throw new ee(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Ta(e){return S_[e]}function $_(e){return{algorithms:e&&w_("algorithms",e.algorithms),crit:e?.crit}}async function UA(e,t,r){let o={};e.protected&&(o=u_(e.protected,W,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!ga(o,e.header))throw new W("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=$a(W,Sa,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new W('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new W('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new da('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new W("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new W("JWS Payload must be a string or an Uint8Array instance");let c=!1;typeof r=="function"&&(r=await r(o,e),c=!0);let l=Ea(s),d=la(e.protected!==void 0?nt(e.protected):new Uint8Array,nt("."),typeof e.payload=="string"?a?t.b64p??=l_(e.payload,"payload",W):Kt.encode(e.payload):e.payload),p=qp(e.signature,"signature",W),m=await ba(l,r,"verify");if(!await b_(l,m,p,d))throw new fa;let h;return a?h=qp(e.payload,"payload",W):typeof e.payload=="string"?h=Kt.encode(e.payload):h=e.payload,{payload:h,parsedProt:o,b64:a,key:m,resolvedKey:c}}async function E_(e,t,r){if(e instanceof Uint8Array&&(e=Kr.decode(e)),typeof e!="string")throw new W("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new W("Invalid Compact JWS");return UA({payload:n,protected:o,signature:i},t,r)}var $t=e=>Math.floor(e.getTime()/1e3),A_=60,I_=A_*60,cm=I_*24,FA=cm*7,GA=cm*365.25,ZA=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Yr(e){let t=ZA.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*A_);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*I_);break;case"day":case"days":case"d":n=Math.round(r*cm);break;case"week":case"weeks":case"w":n=Math.round(r*FA);break;default:n=Math.round(r*GA);break}return t[1]==="-"||t[4]==="ago"?-n:n}function rt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}var T_=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,BA=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;function C_(e,t,r={}){let o;try{o=JSON.parse(ca.decode(t))}catch{}if(!Re(o))throw new St("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||T_(e.typ)!==T_(n)))throw new $e('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:l}=r,d=[...i];l!==void 0&&d.push("iat"),c!==void 0&&d.push("aud"),s!==void 0&&d.push("sub"),a!==void 0&&d.push("iss");for(let h of new Set(d.reverse()))if(!(h in o))throw new $e(`missing required "${h}" claim`,o,h,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new $e('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new $e('unexpected "sub" claim value',o,"sub","check_failed");if(c!==void 0&&!BA(o.aud,typeof c=="string"?[c]:c))throw new $e('unexpected "aud" claim value',o,"aud","check_failed");let p;switch(typeof r.clockTolerance){case"string":p=Yr(r.clockTolerance);break;case"number":p=r.clockTolerance;break;case"undefined":p=0;break;default:throw new TypeError("Invalid clockTolerance option type")}rt("clockTolerance option",p);let{currentDate:m}=r,f=rt("currentDate option",$t(m||new Date));if((o.iat!==void 0||l!==void 0)&&typeof o.iat!="number")throw new $e('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new $e('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>f+p)throw new $e('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new $e('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=f-p)throw new Vr('"exp" claim timestamp check failed',o,"exp","check_failed")}if(l!==void 0){let h=f-o.iat,b=typeof l=="number"?l:Yr(l);if(h-p>b)throw new Vr('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(h<0-p)throw new $e('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var Aa=class{#e;constructor(t){if(!Re(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return Kt.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=rt("setNotBefore",t):t instanceof Date?this.#e.nbf=rt("setNotBefore",$t(t)):this.#e.nbf=$t(new Date)+Yr(t)}set exp(t){typeof t=="number"?this.#e.exp=rt("setExpirationTime",t):t instanceof Date?this.#e.exp=rt("setExpirationTime",$t(t)):this.#e.exp=$t(new Date)+Yr(t)}set iat(t){t===void 0?this.#e.iat=$t(new Date):t instanceof Date?this.#e.iat=rt("setIssuedAt",$t(t)):typeof t=="string"?this.#e.iat=rt("setIssuedAt",$t(new Date)+Yr(t)):this.#e.iat=rt("setIssuedAt",t)}};async function lm(e,t,r){let o=await E_(e,$_(r),t);if(!o.b64)throw new St("JWTs MUST NOT use unencoded payload");let i={payload:C_(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}function Ia(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function P_(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!ga(r,o))throw new W("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};k_(W,r);let i=$a(W,Sa,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new W('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new W('JWS "alg" (Algorithm) Header Parameter missing or invalid');let c=Ea(s),l,d;if(a){let O=e.encoded??={};O.b64??=Hn(e.payload),O.raw??=nt(O.b64),l=O.b64,d=O.raw}else d=e.payload,l="";let p,m;r?(p=Hn(JSON.stringify(r)),m=nt(p)):(p="",m=new Uint8Array);let f=la(m,nt("."),d),h=await ba(c,t,"sign"),b=await __(c,h,f),S={signature:Hn(b),payload:l};return r&&(S.protected=p),S}var Ca=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return Jp(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return Jp(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new W("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await P_({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}};var Pa=class{#e;#t;constructor(t){this.#e=new Ca(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(Ia(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}};var Xr=class{#e;#t;constructor(t={}){this.#t=new Aa(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Pa(this.#t.data());if(o.setProtectedHeader(this.#e),Ia(this.#e))throw new St("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}};function O_(){return new ee('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function N_(e){if(typeof e!="string")throw O_();let t=Ta(e)??y_(e);if(!t)throw O_();return t}var um=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},KA=e=>({data:e,pos:0}),dm=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},Qr=e=>{let t=dm(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|dm(e);return o}return t};var eo=(e,t,r)=>{if(dm(e)!==t)throw new Error(r)},R_=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},VA=e=>{eo(e,6,"Expected algorithm OID");let t=Qr(e);return R_(e,t)};function WA(e){eo(e,48,"Invalid PKCS#8 structure"),Qr(e),eo(e,2,"Expected version field");let t=Qr(e);e.pos+=t,eo(e,48,"Expected algorithm identifier");let r=Qr(e);return{algIdStart:e.pos,algIdLength:r}}var HA=e=>{let t=VA(e);if(um(t,[43,101,110]))return"X25519";if(!um(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");eo(e,6,"Expected curve OID");let r=Qr(e),o=R_(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(um(o,i))return n;throw new Error("Unsupported named curve")},JA=async(e,t,r,o)=>{let n=N_(r);if(n.symmetric)throw new ee('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new ee("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},qA=(e,t)=>ha(e.replace(t,"")),j_=(e,t,r)=>{let o=qA(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=KA(i);return WA(a),HA(a)}),JA("pkcs8",o,t,n)};function YA(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function XA(e){if(Kp(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:Hn(e)};if(!Wn(e))throw new TypeError(i_(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=YA(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function pm(e){return XA(e)}function QA(e){let t=typeof e=="string"?Ta(e):void 0;if(!t||t.symmetric)throw new ee('Unsupported "alg" value for a JSON Web Key Set');return t}function eI(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(tI)}function tI(e){return Re(e)}var mm=class{#e;#t=new WeakMap;constructor(t){if(!eI(t))throw new Wr("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=QA(o),a=this.#e.keys.filter(l=>{let d=i.kty.includes(l.kty);return d&&typeof n=="string"&&(d=n===l.kid),d&&(typeof l.alg=="string"||l.kty==="AKP")&&(d=o===l.alg),d&&typeof l.use=="string"&&(d=l.use==="sig"),d&&Array.isArray(l.key_ops)&&(d=l.key_ops.includes("verify")),d&&i.crv&&(d=l.crv===i.crv),d}),{0:s,length:c}=a;if(c===0)throw new Vn;if(c!==1){let l=new pa,d=this.#t;throw l[Symbol.asyncIterator]=async function*(){for(let p of a)try{yield await D_(d,p,i)}catch{}},l}return D_(this.#t,s,i)}};async function D_(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await ya(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Wr("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function fm(e){let t=new mm(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}function nI(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var hm;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(hm="jose/v6.2.5");var L_=Symbol();async function rI(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new ma:i});if(n.status!==200)throw new se("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new se("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var Oa=Symbol();function oI(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!Re(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Re))}var gm=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),hm&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",hm),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[L_],r?.[Oa]!==void 0&&(this.#s=r?.[Oa],oI(r?.[Oa],this.#c)&&(this.#i=this.#s.uat,this.#a=fm(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof Vn&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&nI()&&(this.#r=void 0),this.#r||=rI(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=fm(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}};function ym(e,t){let r=new gm(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}async function vm(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return j_(e,t,r)}var z_=new Map;function iI(e){let t=z_.get(e);return t||(t=ym(new URL(e)),z_.set(e,t)),t}var aI="id:";function M_(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await lm(r,iI(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${aI}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var Na="/.well-known/jwks.json";async function _m(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Na}`,{privateKey:n,publicKey:i}=cI("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await vm(n,"RS256"),s=await pm(sI(i)),c="gamestage-dev",l={keys:[{...s,kid:c,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:l,resolver:M_({issuer:r,jwksUri:o}),async mint(d,p={}){let m=Math.floor(Date.now()/1e3);return new Xr({name:d}).setProtectedHeader({alg:"RS256",kid:c}).setIssuer(r).setSubject(d).setIssuedAt(m).setExpirationTime(m+(p.expiresInSeconds??3600)).sign(a)}}}import{randomBytes as uI}from"node:crypto";var dI="x-gamestage-player";async function pI(e){let t=Qv({tenant:e.game,rounds:[],currentRoundId:""});await e_(t,e.game,e.round,"local",!0,void 0,{source:"manifest"});let r=Jv({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return qv({tenant:e.game,playerId:n.playerId??Br(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,round:{archetype:e.round.archetype}})}}}async function mI(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function Ra(e){let t=await pI(e),r=uI(32).toString("base64"),o={issue:()=>Fv(r)},n=e.devIdentity,i=lI((a,s)=>{(async()=>{let c=new URL(a.url??"/","http://localhost");if(n&&c.pathname===Na){let m=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}let l=a.headers[dI],d=a.headers.authorization,p=await n_({method:a.method??"GET",path:c.pathname,body:await mI(a),...(({playerId:m,refused:f})=>({playerId:m,identityRefusal:f}))(await Mv({token:d?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(l)?l[0]:l,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(p.status,p.headers),s.end(p.body===void 0?void 0:JSON.stringify(p.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}async function hI(e){let t;try{t=await fI(e,"utf8")}catch{return}let r=_e(t);if(!r.ok){P(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${$.cyan(o.path)} ${o.message}`));return}return r.manifest}async function gI(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:aa(r),what:"fixture",game:"conformance-game"};let o=await hI(e.manifest??"gamestage.yaml");if(!o)return{server:aa(r),what:"fixture",game:"conformance-game"};let n=o.backend.round;if(!n)return{server:aa(r),what:"fixture",game:o.app.id,title:o.app.title};let i=o.backend.archetype;return i&&i!==n.archetype&&P(`The manifest declares the ${i} archetype and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),Bt.includes(n.archetype)||P(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${Bt.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await Ra({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}async function U_(e){let t=await gI(e),{server:r}=t,o=()=>new Promise((l,d)=>{r.close(p=>p?d(p):l())}),n=new Promise(l=>{let d=async()=>{process.off("SIGINT",d),process.off("SIGTERM",d),await o(),l()};process.once("SIGINT",d),process.once("SIGTERM",d)});await new Promise((l,d)=>{r.once("error",d),r.listen(Number(e.port),"127.0.0.1",()=>l())});let i=r.address();if(!i||typeof i=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${i.port}`,s,c;if(t.as&&(s=await _m(a),r.attachDevIdentity?.(s),c=await s.mint(t.as)),L())M({ok:!0,status:"listening",serving:t.what,baseUrl:a,game:t.game,round:t.round?{number:t.round.number,id:`round-${t.round.number}`}:null,...s&&c?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:c,required:!0}}:{}});else if(t.what==="engine"){I(t.title??t.game);let l=It(t.containerLabel);T("Serving",`your ${It(t.containerLabel,{lower:!0})}, through the real Engine`),T(l,`${t.round.number} (round-${t.round.number})`),T("API",a),T("Game id",t.game),v(),A(`window.GAMESTAGE_API = "${a}"`),A(`window.GAMESTAGE_GAME = "${t.game}"`),c&&A(`window.GAMESTAGE_TOKEN = "${c}"`),v(),s&&c&&(T("Playing as",`${t.as} (${$.cyan(`id:${t.as}`)})`),T("Identity","required, so an anonymous play is refused here too"),T("Keys",s.jwksUri),v(),A("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),A(`This harness cannot be deployed: its issuer is a loopback URL, and ${$.cyan("gamestage manifest validate")} refuses a manifest that names one.`),v()),A(`Edit the ${It(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),v()}else I("Serving the contract fixture"),T("API",a),T("Game id",t.game),v(),A("No round in the manifest, so there is nothing of yours to serve."),A("Add `backend.round` and restart, and this becomes your game."),v();await n}import{readFile as Em}from"node:fs/promises";import{dirname as H_,resolve as Tm}from"node:path";import{spawn as yI}from"node:child_process";import{createHash as vI,randomBytes as G_}from"node:crypto";import{constants as _I}from"node:fs";import{access as bI,mkdtemp as wI,rm as Z_}from"node:fs/promises";import{request as kI}from"node:http";import{homedir as ja,tmpdir as xI}from"node:os";import{join as to}from"node:path";var SI="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";function bm(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??G_(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}var km=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,c=n&127,l=2;if(c===126){if(this.buffered.length<l+2)break;c=this.buffered.readUInt16BE(l),l+=2}else if(c===127){if(this.buffered.length<l+8)break;let m=this.buffered.readBigUInt64BE(l);if(m>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");c=Number(m),l+=8}let d=l;if(s&&(l+=4),this.buffered.length<l+c)break;let p=Buffer.from(this.buffered.subarray(l,l+c));if(s)for(let m=0;m<p.length;m++)p[m]^=this.buffered[d+m%4];if(this.buffered=this.buffered.subarray(l+c),a===8||a===9||a===10)r.push({opcode:a,payload:p});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:p}):(this.fragmentedOpcode=a,this.fragments=[p])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(p),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},xm=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new km;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(bm(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(bm(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(bm(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},Sm=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,c=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(c.split(`
7156
+ `,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function Kn(e,t,r){let o=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r}});o.ok||C(`Upload refused with ${o.status}. Ask for a fresh URL and retry.`)}function pa(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function eA(e){switch(JT(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function tA(e,t,r){let o=YT(r),n;try{n=Fp(o)}catch{throw C(`Cannot read ${r}.`),new Error("unreachable")}let i=await e.uploadTarget(t,"index.html"),a=e_(Vr(n.toString("utf8")),`${i.playerApiOrigin}`,t);await Kn(i.uploadUrl,a,"text/html; charset=utf-8");let s=await e.uploadTarget(t,we);await Kn(s.uploadUrl,Ht,"text/javascript; charset=utf-8");let c=await e.uploadTarget(t,ke);await Kn(c.uploadUrl,Jt,"text/javascript; charset=utf-8");let l=await e.uploadTarget(t,Qe);return await Kn(l.uploadUrl,Kr,"image/svg+xml"),R()||(v(),A(`Uploaded ${r} to ${pa(i)}`),A(`Wired it to ${i.playerApiOrigin} as "${t}"`),A(`Shipped @monterosa/gamestage beside it (${Yt})`),A(`Shipped the player client beside it (${rr})`)),pa(i)}async function nA(e,t,r){let o;try{o=Up(r)}catch(m){throw C(m instanceof Error?m.message:`Cannot read ${r}.`),new Error("unreachable")}let n=o.find(m=>m.relativePath==="index.html");n||C(`Directory ${r} must contain an index.html file.`);let i=Fp(n.path,"utf8"),a=Lp(i),s=o.some(m=>m.relativePath==="favicon.ico"),c=o.some(m=>m.relativePath===Qe),l=!a&&!s,p=l&&!c,d;for(let m of o){let f=await e.uploadTarget(t,m.relativePath);m.relativePath==="index.html"&&(d=f);let h=Fp(m.path),_=m.relativePath==="index.html"?e_(l?Vr(h.toString("utf8")):h.toString("utf8"),f.playerApiOrigin,t):h;await Kn(f.uploadUrl,_,eA(m.relativePath))}if(p){let m=await e.uploadTarget(t,Qe);await Kn(m.uploadUrl,Kr,"image/svg+xml")}if(await e.pruneBundle(t,[...o.map(m=>m.relativePath),...p?[Qe]:[]]),!R()&&d&&(v(),A(`Uploaded ${o.length} files from ${r}`),A(`Playground: ${pa(d)}`),A(`Wired it to ${d.playerApiOrigin} as "${t}"`),p&&A("Added a replaceable starter favicon")),!d)throw new Error("The directory index was not uploaded.");return pa(d)}import{readFile as FI}from"node:fs/promises";var r_="player-conformance",Kp="round-current",rA="sha256:emulator-conformance";function et(e){return structuredClone(e)}function tt(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:rA}}function oA(e){let t=e==="per-player-challenge";return{...tt(),id:Kp,number:412,version:2,can:{accepting_plays:!0,results_available:!1,solution_revealed:!1,closed:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function t_(e,t){let r=t==="mistakes";return{...tt(),player_id:r_,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function iA(e){let t=oA(e),r=new Map([[t.id,t]]),o=new Map([[t.id,t_(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",t_("round-revealed",e))),{runtime:{...tt(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"forecast":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...tt(),round_id:Kp,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1},profile:{...tt(),player_id:r_,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,nextPlay:1}}function n_(e,t){return{...tt(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function Vp(e){let t=iA(e);return{async getRuntime(){return et(t.runtime)},async getCurrentRound(){return et(t.rounds.get(Kp))},async getRound(r){let o=t.rounds.get(r);return o?et(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return n_(t,"round_not_found");let i=t.plays.get(o.idempotency_key);if(i)return{...et(i),outcome:"duplicate"};if(o.round_version!==n.version)return{...tt(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return n_(t,"challenge_instance_id");let a=t.roundStates.get(r),s=t.runtime.marking==="at_settlement",c={...a,...tt(),attempts_used:a.attempts_used+1,score:a.score+(s?0:10),finished:!s,outcome:s?"pending":"won"},l={...tt(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!s,feedback:s?[]:[{key:"answer",verdict:"correct"}],round_state:et(c)};return t.roundStates.set(r,c),t.plays.set(o.idempotency_key,l),c.finished&&!a.finished&&(t.profile=oa(t.profile,c.outcome)),et(l)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return et(o)},async getProfile(){return et(t.profile)},async getLeaderboard(){return et(t.leaderboard)}}}function aA(){return e=>Vp(e)}var KD=aA();import{createServer as sA}from"node:http";function Ft(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var cA=Ft(ee.runtime),lA=Ft(ee.currentRound),uA=Ft(ee.round),dA=Ft(ee.plays),pA=Ft(ee.roundState),mA=Ft(ee.profile),fA=Ft(ee.leaderboard);function bt(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function Vn(e,t,r,o){bt(e,t,{error:{code:r,message:o,retryable:!1}})}async function hA(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function gA(e,t,r){if(!e.url){Vn(t,400,"invalid_request","The request URL is missing.");return}let n=new URL(e.url,"http://localhost").pathname;if(e.method==="GET"){if(cA.test(n)){bt(t,200,await r.getRuntime());return}if(lA.test(n)){bt(t,200,await r.getCurrentRound());return}let i=uA.exec(n);if(i){let s=await r.getRound(decodeURIComponent(i[2]));if(!s){Vn(t,404,"round_not_found","The requested round was not found.");return}bt(t,200,s);return}let a=pA.exec(n);if(a){let s=decodeURIComponent(a[2]);try{bt(t,200,await r.getRoundState(s))}catch{Vn(t,404,"round_not_found","The requested round was not found.")}return}if(mA.test(n)){bt(t,200,await r.getProfile());return}if(fA.test(n)){bt(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let i=dA.exec(n);if(i){try{let a=await hA(e);bt(t,200,await r.play(decodeURIComponent(i[2]),a))}catch(a){Vn(t,400,"invalid_request",a instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}Vn(t,404,"not_found","The requested player API route was not found.")}function fa(e="default"){let t=Vp(e);return sA((r,o)=>{gA(r,o,t).catch(()=>{o.headersSent?o.destroy():Vn(o,500,"internal_error","The emulator could not answer the request.")})})}import{createServer as DI}from"node:http";import{createHmac as yA,randomBytes as vA,timingSafeEqual as _A}from"node:crypto";var Wp="anon:";function Hp(e){return e.startsWith(Wp)}function Hr(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${Wp}${t||"unknown"}`}var bA={async resolve(){}};async function o_(e){if(!e.token)return e.sessionSecret?{playerId:kA(e.anonymousId,e.sessionSecret)??Hr(void 0)}:{playerId:Hr(e.anonymousId)};let t=e.resolver??bA,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:Hr(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}var i_=".";function a_(e){let t=`${Wp}${vA(16).toString("base64url")}`;return{playerId:t,token:wA(t,e)}}function s_(e,t){return yA("sha256",t).update(e).digest("base64url")}function wA(e,t){return`${e}${i_}${s_(e,t)}`}function kA(e,t){if(!e)return;let r=e.lastIndexOf(i_);if(r<=0)return;let o=e.slice(0,r);if(!Hp(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(s_(o,t));if(n.length===i.length)return _A(n,i)?o:void 0}var xA="engine_error",SA="engine_integrity_violation";function Jp(e){return e instanceof Error?e.name:"unknown"}function Jr(e){console.error(xA,e)}function c_(e,t){console.error(SA,{violation:e,...t})}var Yp="round_not_found";function l_(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),c=()=>({server_time:i(),snapshot:e.runtime.snapshot}),l=f=>f;function p(f,h){return!n.settle||!f.round.can.results_available||h.outcome!=="pending"?h:n.settle({secret:f.secret,state:h,limits:f.limits,now:i()})}async function d(f,h){let _=await o.getState(t,f,r);return _?{state:_.state,version:_.version}:{state:n.initialState({playerId:r,roundId:f,limits:h,now:i()}),version:void 0}}let m=(f,h,_)=>({...c(),play_id:s(),outcome:f,reason:h,round_version:_,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...c()}},async getCurrentRound(){let f=await o.getCurrentRound(t);if(!f)throw new Error(Yp);return{...f.round,...c()}},async getRound(f){let h=await o.getRound(t,f);return h?{...h.round,...c()}:void 0},async getRoundState(f){let h=await o.getRound(t,f);if(!h)throw new Error(Yp);let _=l(h),{state:S}=await d(f,_.limits);return{...p(_,S),...c()}},async getProfile(){return{...await o.getProfile(t,r),...c()}},async getLeaderboard(){let h=(await o.getCurrentRound(t))?.round.id??"";return{...await o.getLeaderboard(t,h),...c()}},async play(f,h){let _=await o.getRound(t,f);if(!_)return m("rejected",Yp,0);let S=l(_);if(e.runtime.identity?.required&&Hp(r))return m("rejected",e.identityRefusal??"identity_required",S.round.version);if(S.limits.playsPerSecond!==void 0){let q=i().slice(0,19),Kt=await o.countPlay(t,f,q,r),D=Math.max(1,Math.ceil(S.limits.playsPerSecond/Kt.buckets));if(Kt.inBucket>D)return{...m("busy","capped",S.round.version),retry_after_seconds:1}}let O=await o.getPlay(t,r,h.idempotency_key);if(O)return{...O.result,...c(),outcome:"duplicate"};let{state:z,version:ne}=await d(f,S.limits),G=n.admissible({accepting:S.round.can.accepting_plays,roundVersion:S.round.version,playedVersion:h.round_version,challengeInstanceId:S.round.challenge_instance_id??null,playedChallengeInstanceId:h.challenge_instance_id??null,state:z,secret:S.secret,limits:S.limits});if(!G.ok){let q=G.reason==="round_version"?"stale":"rejected";return m(q,G.reason,S.round.version)}let N=n.mark({payload:h.payload,secret:S.secret,state:z,limits:S.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(N.outcome!=="accepted")return m("rejected",N.reason??"rejected",S.round.version);let Y={...c(),play_id:s(),outcome:N.outcome,round_version:S.round.version,marked:N.marked,feedback:N.feedback,round_state:{...N.next,...c()}},$t=`play:${JSON.stringify([t,r,h.idempotency_key])}`,ot=[{id:$t,at:Y.server_time,tenant:t,round_id:f,player_id:r,action:"play.committed",detail:{play_id:Y.play_id,idempotency_key:h.idempotency_key,outcome:Y.outcome,marked:Y.marked,round_version:Y.round_version,score_before:z.score,score_after:N.next.score,attempts_used:N.next.attempts_used,attempts_allowed:N.next.attempts_allowed,mistakes_used:N.next.mistakes_used,mistakes_allowed:N.next.mistakes_allowed,...n.auditDetail({secret:S.secret,before:z,decision:N,payload:h.payload})}}];N.marked&&ot.push({id:`score:${JSON.stringify([t,r,h.idempotency_key])}`,at:Y.server_time,tenant:t,round_id:f,player_id:r,action:"score.recorded",detail:{play_id:Y.play_id,score_before:z.score,score_after:N.next.score,marked:!0,outcome:N.next.outcome}});let Bt=N.next.finished&&!z.finished?oa(await o.getProfile(t,r),N.next.outcome):void 0,er=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:h.idempotency_key,play:{result:Y},state:N.next,expectedVersion:ne,audit:ot,...N.marked?{score:{roundId:f,score:N.next.score}}:{},...Bt?{profile:Bt}:{}});if(!er.ok&&er.reason==="play_exists"){let q=await o.getPlay(t,r,h.idempotency_key);return q?{...q.result,...c(),outcome:"duplicate"}:(Jr({stage:"play_receipt_missing",tenant:t,round_id:f,player_id:r}),m("rejected","play_conflict",S.round.version))}return er.ok?Y:(await o.appendAudit({id:$t,at:Y.server_time,tenant:t,round_id:f,player_id:r,action:"play.refused",detail:{play_id:Y.play_id,idempotency_key:h.idempotency_key,reason:"round_version",attempt_spent:!1}}),m("stale","round_version",S.round.version))}}}function $A(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function EA(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter(O=>r.targets.includes(O)&&!i.has(O)),s=t.picks.filter(O=>!r.targets.includes(O)),c=o.attempts_used+1,l=o.mistakes_used+(s.length>0?1:0);for(let O of a)i.add(O);let p=i.size>=r.required,d=l>=n.mistakesAllowed,m=c>=n.attemptsAllowed,f=p||d||m,h=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(p?r.completionBonus:0),_={...o,server_time:e.now,attempts_used:c,attempts_allowed:n.attemptsAllowed,mistakes_used:l,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:h,finished:f,outcome:e.markAtSettlement?"pending":p?"won":f?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:_}:{outcome:"accepted",marked:!0,feedback:t.picks.map(O=>({key:O,verdict:r.targets.includes(O)?"correct":"wrong"})),next:_}}function TA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var qp={archetype:"hunt",admissible:$A,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return EA({...e,attempt:{picks:t}})},initialState:TA,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}};function Xp(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function AA(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function IA(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function CA(e){let{secret:t,state:r,limits:o}=e,n=Xp(r),i=O=>({outcome:"rejected",reason:O,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,c=a.entries.find(O=>O.key===s);if(!c)return i("not_on_slate");let l=n.total+c.value,p=l>t.target,d=[...n.picks,{slate:a.id,key:c.key,label:c.label,value:c.value}],m=r.attempts_used+1,f=m>=o.picksAllowed,h=p||f,_={...r,server_time:e.now,attempts_used:m,attempts_allowed:o.picksAllowed,progress:{total:l,picks:d,bust:p,...h?{tier:AA(t,l)}:{}},score:e.markAtSettlement?r.score:p?0:l,finished:h,outcome:e.markAtSettlement?"pending":p?"lost":h?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:_}:{outcome:"accepted",marked:!0,feedback:[{key:c.key,verdict:p?"wrong":"correct",label:String(c.value)}],next:_}}function PA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Qp={archetype:"push",admissible:IA,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return CA({...e,attempt:{picks:t}})},initialState:PA,auditDetail({secret:e,before:t,decision:r}){let o=Xp(t),n=Xp(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}};var OA=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,NA=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;function RA(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function jA(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(N=>!i.has(N.key)),c=s.find(N=>OA(N.members,t.picks)),l=o.attempts_used+1,p=o.mistakes_used+(c?0:1);c&&(i.add(c.key),a.push({key:c.key,label:c.label,members:[...c.members]}));let d=i.size>=r.groups.length,m=p>=n.mistakesAllowed,f=l>=n.attemptsAllowed,h=d||m||f,_=e.markAtSettlement?o.score:o.score+(c?r.pointsPerGroup:0)+(d?r.completionBonus:0),S={...o,server_time:e.now,attempts_used:l,attempts_allowed:n.attemptsAllowed,mistakes_used:p,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:_,finished:h,outcome:e.markAtSettlement?"pending":d?"won":h?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:S};let O=s.reduce((N,Y)=>Math.max(N,NA(t.picks,Y)),0),z=!c&&t.picks.length>1&&O===t.picks.length-1,ne=c?"correct":z?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map(N=>({key:N,verdict:ne,...c?{label:c.label}:{}})),next:S}}function DA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var u_={archetype:"group",admissible:RA,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return jA({...e,attempt:{picks:t}})},initialState:DA,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}};function LA(e,t){return e.options.find(r=>r.key===t)?.points??e.pointsForCorrect}function zA(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function MA(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=r.options.some(l=>l.key===t.pick),a=o.attempts_used+1;if(!i)return{outcome:"rejected",reason:"unknown_option",marked:!1,feedback:[],next:o};let s=[...Array.isArray(o.progress.picks)?o.progress.picks:[],t.pick],c={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,picks:s},finished:a>=n.attemptsAllowed};return r.result===void 0?{outcome:"accepted",marked:!1,feedback:[],next:{...c,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:UA(r,t.pick),next:d_(r,c,t.pick)}}function UA(e,t){return[{key:t,verdict:t===e.result?"correct":"wrong",...e.options.find(r=>r.key===e.result)?.label?{label:e.options.find(r=>r.key===e.result).label}:{}}]}function d_(e,t,r){let o=r===e.result;return{...t,score:o?LA(e,r):0,finished:!0,outcome:o?"won":"lost"}}function FA(e){let{secret:t,state:r}=e;if(t.result===void 0)return r;let o=Array.isArray(r.progress.picks)?r.progress.picks:[];return o.length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...d_(t,r,o[0]),server_time:e.now}}function GA(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{picks:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var p_={archetype:"forecast",admissible:zA,mark(e){let t=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:"";return MA({...e,attempt:{pick:t}})},initialState:GA,settle:FA,auditDetail({secret:e,decision:t,payload:r}){return{predicted:typeof r.pick=="string"?r.pick:null,settled_at_commit:e.result!==void 0,marked:t.marked,options_offered:e.options.length}}};var m_={hunt:qp,push:Qp,group:u_,forecast:p_},Gt=Object.keys(m_);function ZA(e){return m_[We(e)]}function f_(e){return ZA(e.archetype??"hunt")}function h_(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard"]}}function g_(e){let t=f_(e.round);if(t)return l_({...e,rules:t})}import{createHash as BA}from"node:crypto";var y_=128;function v_(e){return BA("sha256").update(e,"utf8").digest()[0]&127}var Te=(...e)=>e.join("#");function __(e){let t=new Map,r=new Map,o=new Map,n=new Map,i=new Map,a=new Map,s=new Map,c=e.currentRoundId,l,p=e.now??Date.now;for(let d of e.rounds)t.set(d.round.id,d);for(let d of e.states??[])r.set(Te(e.tenant,d.round_id,d.player_id),{state:d,version:0});return{async getRound(d,m){let f=t.get(m);return f?structuredClone(f):void 0},async putRound(d,m,f){t.set(m.round.id,structuredClone(m)),f&&(c=m.round.id,l=void 0)},async setRotation(d,m,f){l={roundIds:[...m],windowSeconds:f}},async getCurrentRound(){let d=l?l.roundIds[Math.floor(p()/1e3/l.windowSeconds)%l.roundIds.length]:c,m=t.get(d);return m?structuredClone(m):void 0},async getState(d,m,f){let h=r.get(Te(d,m,f));return h?structuredClone(h):void 0},async putStateIfVersion(d,m,f){let h=Te(d,m.round_id,m.player_id),_=r.get(h);return f===void 0?_?!1:(r.set(h,{state:structuredClone(m),version:0}),!0):!_||_.version!==f?!1:(r.set(h,{state:structuredClone(m),version:_.version+1}),!0)},async getPlay(d,m,f){let h=o.get(Te(d,m,f));return h?structuredClone(h):void 0},async putPlayIfAbsent(d,m,f,h){let _=Te(d,m,f);return o.has(_)?!1:(o.set(_,structuredClone(h)),!0)},async getLeaderboard(d,m){if(e.leaderboard)return structuredClone(e.leaderboard);let f=[...n.entries()].filter(([h])=>h.startsWith(Te(d,m)+"#")).map(([h,_])=>({rank:0,player_id:h.slice(h.lastIndexOf("#")+1),display_name:h.slice(h.lastIndexOf("#")+1),score:_})).sort((h,_)=>_.score-h.score).map((h,_)=>({...h,rank:_+1}));return{server_time:"",snapshot:"",round_id:m,order:"high_first",tie_break:"earliest_play",entries:f,total:f.length}},async getProfile(d,m){let f=s.get(Te(d,m));return f?structuredClone(f):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:m,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(d,m,f,h){let _=Te(d,m,f,String(v_(h))),S=(i.get(_)??0)+1;return i.set(_,S),{inBucket:S,buckets:y_}},async recordScore(d,m,f,h){n.set(Te(d,m,f),h)},async appendAudit(d){if(a.has(d.id))throw c_("audit_record_overwrite",{tenant:d.tenant,round_id:d.round_id,action:d.action,record_id:d.id}),new Error("audit_record_exists");a.set(d.id,structuredClone(d))},async commitPlay(d){let m=Te(d.tenant,d.playerId,d.idempotencyKey);if(o.has(m))return{ok:!1,reason:"play_exists"};let f=Te(d.tenant,d.state.round_id,d.state.player_id),h=r.get(f);if(d.expectedVersion===void 0){if(h)return{ok:!1,reason:"state_version"}}else if(!h||h.version!==d.expectedVersion)return{ok:!1,reason:"state_version"};for(let _ of d.audit)if(a.has(_.id))throw new Error("audit_record_exists");o.set(m,structuredClone(d.play)),r.set(f,{state:structuredClone(d.state),version:d.expectedVersion===void 0?0:d.expectedVersion+1});for(let _ of d.audit)a.set(_.id,structuredClone(_));return d.score&&n.set(Te(d.tenant,d.score.roundId,d.playerId),d.score.score),d.profile&&s.set(Te(d.tenant,d.playerId),structuredClone(d.profile)),{ok:!0}}}}function KA(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function VA(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open},challenge_instance_id:null,challenge:{prompt:e.prompt,target:e.target,target_label:e.targetLabel,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function WA(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function HA(e,t){let r=e.result!==void 0;return{archetype:"forecast",round:{server_time:"",snapshot:t,id:On(e),number:e.number,can:{accepting_plays:e.open&&!r,results_available:r,solution_revealed:r,closed:!e.open||r},challenge_instance_id:null,challenge:{prompt:e.prompt,options:e.options.map(n=>({key:n.key,label:n.label})),...r?{result:e.result}:{}}},secret:{options:e.options,...r?{result:e.result}:{},pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond}}}}function JA(e,t){switch(e.archetype){case"hunt":return KA(e,t);case"push":return VA(e,t);case"group":return WA(e,t);case"forecast":return HA(e,t)}}function ha(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(ha).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${ha(o)}`).join(",")}}`}function YA(e,t){let r=o=>{let{server_time:n,snapshot:i,...a}=o,{version:s,...c}=a;return c};return ha({round:r(e.round),secret:e.secret,limits:e.limits,archetype:e.archetype})===ha({round:r(t.round),secret:t.secret,limits:t.limits,archetype:t.archetype??"hunt"})}async function b_(e,t,r,o,n=!0,i,a){let s=i??On(r),c=await e.getRound(t,s),l=JA(r,o);if(l.round.id=s,a&&(l.round.origin=a),c&&YA(l,c))return await e.putRound(t,{...c,archetype:l.archetype},n),{roundId:s,version:c.round.version,changed:!1,current:n};let p=c?c.round.version+1:1,d={round:{...l.round,version:p},secret:l.secret,limits:l.limits,archetype:l.archetype};return await e.putRound(t,d,n),await e.appendAudit({id:`round_${s}_v${p}`,at:new Date().toISOString(),tenant:t,round_id:s,player_id:null,action:c?"round.replaced":"round.provisioned",detail:{version:p,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:s,version:p,changed:!0,current:n}}var em={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},Ge=(e,t)=>({status:e,headers:{"content-type":"application/json",...em},body:t}),Ze=(e,t,r,o=!1)=>Ge(e,{error:{code:t,message:r,retryable:o}});function wt(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var kt={runtime:wt(ee.runtime),currentRound:wt(ee.currentRound),round:wt(ee.round),plays:wt(ee.plays),roundState:wt(ee.roundState),profile:wt(ee.profile),leaderboard:wt(ee.leaderboard),session:wt(ee.session)},qA=Ze(404,"not_found","No such route on the player API."),w_=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...em},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}});async function k_(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:em,body:void 0};if(e.method==="GET"&&n===`${ra}/health`)return Ge(200,{status:"ok"});let i=kt.session.exec(n);if(i){if(e.method!=="POST")return Ze(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),c=o?.check(Pp(s,Cp(e)));if(c&&!c.allowed)return w_(c.retryAfterSeconds);let l=r?.issue(s);return l?Ge(200,{server_time:"",snapshot:"",token:l.token,player_id:l.playerId,kind:"anonymous"}):Ze(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",kt.runtime],["currentRound",kt.currentRound],["plays",kt.plays],["roundState",kt.roundState],["profile",kt.profile],["leaderboard",kt.leaderboard],["round",kt.round]];for(let[s,c]of a){let l=c.exec(n);if(!l)continue;let p=decodeURIComponent(l[1]),d=l[2]?decodeURIComponent(l[2]):void 0,m=o?.check(Pp(p,Cp(e)));if(m&&!m.allowed)return w_(m.retryAfterSeconds);let f=s==="plays";if(f?e.method!=="POST":e.method!=="GET")return Ze(405,"method_not_allowed",`This route accepts ${f?"POST":"GET"}.`);let h;try{h=await t.forPlayer(p,e)}catch(_){return Jr({path:e.path,method:e.method,game:p,stage:"resolve",name:Jp(_)}),Ze(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!h)return Ze(404,"not_found",`No game with id "${p}".`);try{switch(s){case"runtime":return Ge(200,await h.getRuntime());case"currentRound":return Ge(200,await h.getCurrentRound());case"round":{let _=await h.getRound(d);return _?Ge(200,_):Ze(404,"not_found","No such round.")}case"roundState":return Ge(200,await h.getRoundState(d));case"profile":return Ge(200,await h.getProfile());case"leaderboard":return Ge(200,await h.getLeaderboard());case"plays":{let _=uv.safeParse(e.body);if(!_.success)return Ze(422,"invalid_request",_.error.issues.map(z=>`${z.path.join(".")||"body"}: ${z.message}`).join("; "));let S=await h.play(d,_.data),O=Ge(200,S);return S.outcome==="busy"&&S.retry_after_seconds&&(O.headers["retry-after"]=String(S.retry_after_seconds)),O}}}catch(_){return _ instanceof Error&&_.message==="round_not_found"?Ze(404,"not_found","No such round."):(Jr({path:e.path,method:e.method,game:p,name:Jp(_)}),Ze(500,"internal","Something went wrong at our end.",!0))}}return qA}import{createPublicKey as RI,generateKeyPairSync as jI}from"node:crypto";var Zt=new TextEncoder,Yr=new TextDecoder,ga=new TextDecoder("utf-8",{fatal:!0}),NL=2**32;function ya(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function nt(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var va=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function XA(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function x_(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw va(t.name);if(t.hash&&o.hash?.name!==t.hash)throw va(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw va(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw va(t.length,"algorithm.length");XA(e,r)}function S_(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var $_=(e,...t)=>S_("Key must be ",e,...t),tm=(e,t,...r)=>S_(`Key for the ${e} algorithm must be `,t,...r);var ce=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Ae=class extends ce{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},qr=class extends ce{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},_a=class extends ce{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},te=class extends ce{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var H=class extends ce{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},xt=class extends ce{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var Xr=class extends ce{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Wn=class extends ce{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},ba=class extends ce{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},wa=class extends ce{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},ka=class extends ce{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}};var Hn=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},nm=e=>e?.[Symbol.toStringTag]==="KeyObject",rm=e=>Hn(e)||nm(e);function om(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function xa(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Qr(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:Yr.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=Yr.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return xa(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function Jn(e){let t=e;return typeof t=="string"&&(t=Zt.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):om(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var QA=e=>typeof e=="object"&&e!==null;function je(e){if(!QA(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Sa(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var im=e=>je(e)&&typeof e.kty=="string",E_=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),T_=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,A_=e=>e.kty==="oct"&&typeof e.k=="string";function am(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function sm(e,t,r){try{return Qr(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function I_(e,t,r){try{return nt(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function C_(e,t,r){let o;try{o=JSON.parse(ga.decode(Qr(e)))}catch{throw new t(r)}if(!je(o))throw new t(r);return o}var tI='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';function nI(e,t){if(!e.kty.includes(t.kty))throw new te(tI);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function $a(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new te('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=nI(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var Yn=e=>e[Symbol.toStringTag],cm=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},rI=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:O_,key:t};if(im(t)){if(A_(t)&&cm(e,t,r))return{kind:Ea,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!rm(t))throw new TypeError(tm(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Yn(t)} instances for symmetric algorithms must be of type "secret"`);return Hn(t)?{kind:lm,key:t}:{kind:um,key:t}},oI=(e,t,r)=>{let{alg:o}=e;if(im(t))switch(r){case"decrypt":case"sign":if(E_(t)&&cm(e,t,r))return{kind:Ea,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(T_(t)&&cm(e,t,r))return{kind:Ea,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!rm(t))throw new TypeError(tm(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Yn(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${Yn(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Yn(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${Yn(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Yn(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return Hn(t)?{kind:lm,key:t}:{kind:um,key:t}},O_=Symbol(),lm=Symbol(),um=Symbol(),Ea=Symbol();function iI(e,t,r){return e.symmetric?rI(e,t,r):oI(e,t,r)}var Ta,aI={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function N_(e,t){return Ta||=new WeakMap,Ta.get(e)?.[t]}function R_(e,t,r){let o=Ta.get(e);return o?o[t]=r:Ta.set(e,{[t]:r}),r}var P_=async(e,t,r)=>{let o=N_(e,r.alg);if(o)return o;let n=await $a(r,{...t,alg:r.alg});return R_(e,r.alg,n)},sI=(e,t)=>{let r=N_(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=aI[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return R_(e,t.alg,e.toCryptoKey(s,o,n))};async function Aa(e,t,r){let o=iI(e,t,r);switch(o.kind){case O_:case lm:return o.key;case Ea:{if(o.key.k)return Qr(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return P_(o.key,o.key,e)}case um:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?sI(n,e):P_(n,n.export({format:"jwk"}),e)}}}function eo(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var cI={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},lI={public:[],private:["deriveBits"]},Pa={public:[],private:[]};function Ia(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:cI,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Ca(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:lI,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function dm(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:Pa,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function pm(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:Pa,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function mm(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:Pa,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}var uI=eo({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:Pa,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":Ia(1),"RSA-OAEP-256":Ia(256),"RSA-OAEP-384":Ia(384),"RSA-OAEP-512":Ia(512),"ECDH-ES":Ca(),"ECDH-ES+A128KW":Ca(128),"ECDH-ES+A192KW":Ca(192),"ECDH-ES+A256KW":Ca(256),A128KW:dm(128),A192KW:dm(192),A256KW:dm(256),A128GCMKW:pm(128),A192GCMKW:pm(192),A256GCMKW:pm(256),"PBES2-HS256+A128KW":mm(256,128),"PBES2-HS384+A192KW":mm(384,192),"PBES2-HS512+A256KW":mm(512,256)}),j_={public:[],private:[]},D_={encrypt:"encrypt",decrypt:"decrypt"};function fm(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:j_,keyOps:D_,cekBits:e,ivBits:96,cbc:!1}}function hm(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:j_,keyOps:D_,cekBits:e,ivBits:128,cbc:!0}}var r1=eo({A128GCM:fm(128),A192GCM:fm(192),A256GCM:fm(256),"A128CBC-HS256":hm(256),"A192CBC-HS384":hm(384),"A256CBC-HS512":hm(512)});function L_(e){return uI[e]}function dI(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function pI(e,t,r){x_(t,e.subtle,r),e.minModulusLength&&dI(e.alg,t)}async function z_(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(pI(e,t,r),t)}async function M_(e,t,r){let o=await z_(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function U_(e,t,r,o){let n=await z_(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var Oa=new Map([["b64",!0]]);function F_(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function G_(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function Na(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new te(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var to={public:["verify"],private:["sign"]};function gm(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:to}}function qn(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:to,minModulusLength:2048}}function ym(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:to}}function Z_(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:to}}function vm(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:to}}var B_=eo({HS256:gm(256),HS384:gm(384),HS512:gm(512),RS256:qn("RSASSA-PKCS1-v1_5",256),RS384:qn("RSASSA-PKCS1-v1_5",384),RS512:qn("RSASSA-PKCS1-v1_5",512),PS256:qn("RSA-PSS",256,32),PS384:qn("RSA-PSS",384,48),PS512:qn("RSA-PSS",512,64),ES256:ym("P-256",256),ES384:ym("P-384",384),ES512:ym("P-521",512),EdDSA:Z_(),Ed25519:Z_(),"ML-DSA-44":vm("ML-DSA-44"),"ML-DSA-65":vm("ML-DSA-65"),"ML-DSA-87":vm("ML-DSA-87")});function Ra(e){let t=B_[e];if(!t)throw new te(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function ja(e){return B_[e]}function K_(e){return{algorithms:e&&F_("algorithms",e.algorithms),crit:e?.crit}}async function mI(e,t,r){let o={};e.protected&&(o=C_(e.protected,H,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!Sa(o,e.header))throw new H("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=Na(H,Oa,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new H('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new H('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new _a('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new H("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new H("JWS Payload must be a string or an Uint8Array instance");let c=!1;typeof r=="function"&&(r=await r(o,e),c=!0);let l=Ra(s),p=ya(e.protected!==void 0?nt(e.protected):new Uint8Array,nt("."),typeof e.payload=="string"?a?t.b64p??=I_(e.payload,"payload",H):Zt.encode(e.payload):e.payload),d=sm(e.signature,"signature",H),m=await Aa(l,r,"verify");if(!await U_(l,m,d,p))throw new ka;let h;return a?h=sm(e.payload,"payload",H):typeof e.payload=="string"?h=Zt.encode(e.payload):h=e.payload,{payload:h,parsedProt:o,b64:a,key:m,resolvedKey:c}}async function V_(e,t,r){if(e instanceof Uint8Array&&(e=Yr.decode(e)),typeof e!="string")throw new H("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new H("Invalid Compact JWS");return mI({payload:n,protected:o,signature:i},t,r)}var St=e=>Math.floor(e.getTime()/1e3),H_=60,J_=H_*60,_m=J_*24,fI=_m*7,hI=_m*365.25,gI=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function no(e){let t=gI.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*H_);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*J_);break;case"day":case"days":case"d":n=Math.round(r*_m);break;case"week":case"weeks":case"w":n=Math.round(r*fI);break;default:n=Math.round(r*hI);break}return t[1]==="-"||t[4]==="ago"?-n:n}function rt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}var W_=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,yI=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;function Y_(e,t,r={}){let o;try{o=JSON.parse(ga.decode(t))}catch{}if(!je(o))throw new xt("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||W_(e.typ)!==W_(n)))throw new Ae('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:l}=r,p=[...i];l!==void 0&&p.push("iat"),c!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),a!==void 0&&p.push("iss");for(let h of new Set(p.reverse()))if(!(h in o))throw new Ae(`missing required "${h}" claim`,o,h,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new Ae('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new Ae('unexpected "sub" claim value',o,"sub","check_failed");if(c!==void 0&&!yI(o.aud,typeof c=="string"?[c]:c))throw new Ae('unexpected "aud" claim value',o,"aud","check_failed");let d;switch(typeof r.clockTolerance){case"string":d=no(r.clockTolerance);break;case"number":d=r.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}rt("clockTolerance option",d);let{currentDate:m}=r,f=rt("currentDate option",St(m||new Date));if((o.iat!==void 0||l!==void 0)&&typeof o.iat!="number")throw new Ae('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new Ae('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>f+d)throw new Ae('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new Ae('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=f-d)throw new qr('"exp" claim timestamp check failed',o,"exp","check_failed")}if(l!==void 0){let h=f-o.iat,_=typeof l=="number"?l:no(l);if(h-d>_)throw new qr('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(h<0-d)throw new Ae('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var Da=class{#e;constructor(t){if(!je(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return Zt.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=rt("setNotBefore",t):t instanceof Date?this.#e.nbf=rt("setNotBefore",St(t)):this.#e.nbf=St(new Date)+no(t)}set exp(t){typeof t=="number"?this.#e.exp=rt("setExpirationTime",t):t instanceof Date?this.#e.exp=rt("setExpirationTime",St(t)):this.#e.exp=St(new Date)+no(t)}set iat(t){t===void 0?this.#e.iat=St(new Date):t instanceof Date?this.#e.iat=rt("setIssuedAt",St(t)):typeof t=="string"?this.#e.iat=rt("setIssuedAt",St(new Date)+no(t)):this.#e.iat=rt("setIssuedAt",t)}};async function bm(e,t,r){let o=await V_(e,K_(r),t);if(!o.b64)throw new xt("JWTs MUST NOT use unencoded payload");let i={payload:Y_(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}function La(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function q_(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!Sa(r,o))throw new H("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};G_(H,r);let i=Na(H,Oa,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new H('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new H('JWS "alg" (Algorithm) Header Parameter missing or invalid');let c=Ra(s),l,p;if(a){let O=e.encoded??={};O.b64??=Jn(e.payload),O.raw??=nt(O.b64),l=O.b64,p=O.raw}else p=e.payload,l="";let d,m;r?(d=Jn(JSON.stringify(r)),m=nt(d)):(d="",m=new Uint8Array);let f=ya(m,nt("."),p),h=await Aa(c,t,"sign"),_=await M_(c,h,f),S={signature:Jn(_),payload:l};return r&&(S.protected=d),S}var za=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return am(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return am(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new H("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await q_({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}};var Ma=class{#e;#t;constructor(t){this.#e=new za(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(La(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}};var ro=class{#e;#t;constructor(t={}){this.#t=new Da(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Ma(this.#t.data());if(o.setProtectedHeader(this.#e),La(this.#e))throw new xt("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}};function X_(){return new te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function Q_(e){if(typeof e!="string")throw X_();let t=ja(e)??L_(e);if(!t)throw X_();return t}var wm=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},vI=e=>({data:e,pos:0}),km=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},oo=e=>{let t=km(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|km(e);return o}return t};var io=(e,t,r)=>{if(km(e)!==t)throw new Error(r)},eb=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},_I=e=>{io(e,6,"Expected algorithm OID");let t=oo(e);return eb(e,t)};function bI(e){io(e,48,"Invalid PKCS#8 structure"),oo(e),io(e,2,"Expected version field");let t=oo(e);e.pos+=t,io(e,48,"Expected algorithm identifier");let r=oo(e);return{algIdStart:e.pos,algIdLength:r}}var wI=e=>{let t=_I(e);if(wm(t,[43,101,110]))return"X25519";if(!wm(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");io(e,6,"Expected curve OID");let r=oo(e),o=eb(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(wm(o,i))return n;throw new Error("Unsupported named curve")},kI=async(e,t,r,o)=>{let n=Q_(r);if(n.symmetric)throw new te('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new te("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},xI=(e,t)=>xa(e.replace(t,"")),tb=(e,t,r)=>{let o=xI(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=vI(i);return bI(a),wI(a)}),kI("pkcs8",o,t,n)};function SI(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function $I(e){if(nm(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:Jn(e)};if(!Hn(e))throw new TypeError($_(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=SI(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function xm(e){return $I(e)}function EI(e){let t=typeof e=="string"?ja(e):void 0;if(!t||t.symmetric)throw new te('Unsupported "alg" value for a JSON Web Key Set');return t}function TI(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(AI)}function AI(e){return je(e)}var Sm=class{#e;#t=new WeakMap;constructor(t){if(!TI(t))throw new Xr("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=EI(o),a=this.#e.keys.filter(l=>{let p=i.kty.includes(l.kty);return p&&typeof n=="string"&&(p=n===l.kid),p&&(typeof l.alg=="string"||l.kty==="AKP")&&(p=o===l.alg),p&&typeof l.use=="string"&&(p=l.use==="sig"),p&&Array.isArray(l.key_ops)&&(p=l.key_ops.includes("verify")),p&&i.crv&&(p=l.crv===i.crv),p}),{0:s,length:c}=a;if(c===0)throw new Wn;if(c!==1){let l=new ba,p=this.#t;throw l[Symbol.asyncIterator]=async function*(){for(let d of a)try{yield await nb(p,d,i)}catch{}},l}return nb(this.#t,s,i)}};async function nb(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await $a(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Xr("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function $m(e){let t=new Sm(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}function II(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var Em;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Em="jose/v6.2.5");var rb=Symbol();async function CI(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new wa:i});if(n.status!==200)throw new ce("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new ce("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var Ua=Symbol();function PI(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!je(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,je))}var Tm=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),Em&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",Em),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[rb],r?.[Ua]!==void 0&&(this.#s=r?.[Ua],PI(r?.[Ua],this.#c)&&(this.#i=this.#s.uat,this.#a=$m(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof Wn&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&II()&&(this.#r=void 0),this.#r||=CI(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=$m(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}};function Am(e,t){let r=new Tm(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}async function Im(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return tb(e,t,r)}var ob=new Map;function OI(e){let t=ob.get(e);return t||(t=Am(new URL(e)),ob.set(e,t)),t}var NI="id:";function ib(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await bm(r,OI(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${NI}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var Fa="/.well-known/jwks.json";async function Cm(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Fa}`,{privateKey:n,publicKey:i}=jI("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await Im(n,"RS256"),s=await xm(RI(i)),c="gamestage-dev",l={keys:[{...s,kid:c,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:l,resolver:ib({issuer:r,jwksUri:o}),async mint(p,d={}){let m=Math.floor(Date.now()/1e3);return new ro({name:p}).setProtectedHeader({alg:"RS256",kid:c}).setIssuer(r).setSubject(p).setIssuedAt(m).setExpirationTime(m+(d.expiresInSeconds??3600)).sign(a)}}}import{randomBytes as LI}from"node:crypto";var zI="x-gamestage-player";async function MI(e){let t=__({tenant:e.game,rounds:[],currentRoundId:""});await b_(t,e.game,e.round,"local",!0,void 0,{source:"manifest"});let r=h_({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return g_({tenant:e.game,playerId:n.playerId??Hr(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function UI(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function Ga(e){let t=await MI(e),r=LI(32).toString("base64"),o={issue:()=>a_(r)},n=e.devIdentity,i=DI((a,s)=>{(async()=>{let c=new URL(a.url??"/","http://localhost");if(n&&c.pathname===Fa){let m=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}let l=a.headers[zI],p=a.headers.authorization,d=await k_({method:a.method??"GET",path:c.pathname,body:await UI(a),...(({playerId:m,refused:f})=>({playerId:m,identityRefusal:f}))(await o_({token:p?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(l)?l[0]:l,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(d.status,d.headers),s.end(d.body===void 0?void 0:JSON.stringify(d.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}async function GI(e){let t;try{t=await FI(e,"utf8")}catch{return}let r=_e(t);if(!r.ok){C(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${$.cyan(o.path)} ${o.message}`));return}return r.manifest}async function ZI(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:fa(r),what:"fixture",game:"conformance-game"};let o=await GI(e.manifest??"gamestage.yaml");if(!o)return{server:fa(r),what:"fixture",game:"conformance-game"};let n=o.backend.round;if(!n)return{server:fa(r),what:"fixture",game:o.app.id,title:o.app.title};let i=o.backend.archetype;return i&&i!==n.archetype&&C(`The manifest declares the ${i} archetype and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),Gt.includes(n.archetype)||C(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${Gt.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await Ga({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}async function ab(e){let t=await ZI(e),{server:r}=t,o=()=>new Promise((l,p)=>{r.close(d=>d?p(d):l())}),n=new Promise(l=>{let p=async()=>{process.off("SIGINT",p),process.off("SIGTERM",p),await o(),l()};process.once("SIGINT",p),process.once("SIGTERM",p)});await new Promise((l,p)=>{r.once("error",p),r.listen(Number(e.port),"127.0.0.1",()=>l())});let i=r.address();if(!i||typeof i=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${i.port}`,s,c;if(t.as&&(s=await Cm(a),r.attachDevIdentity?.(s),c=await s.mint(t.as)),R())j({ok:!0,status:"listening",serving:t.what,baseUrl:a,game:t.game,round:t.round?{number:t.round.number,id:`round-${t.round.number}`}:null,...s&&c?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:c,required:!0}}:{}});else if(t.what==="engine"){I(t.title??t.game);let l=Tt(t.containerLabel);E("Serving",`your ${Tt(t.containerLabel,{lower:!0})}, through the real Engine`),E(l,`${t.round.number} (round-${t.round.number})`),E("API",a),E("Game id",t.game),v(),A(`window.GAMESTAGE_API = "${a}"`),A(`window.GAMESTAGE_GAME = "${t.game}"`),c&&A(`window.GAMESTAGE_TOKEN = "${c}"`),v(),s&&c&&(E("Playing as",`${t.as} (${$.cyan(`id:${t.as}`)})`),E("Identity","required, so an anonymous play is refused here too"),E("Keys",s.jwksUri),v(),A("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),A(`This harness cannot be deployed: its issuer is a loopback URL, and ${$.cyan("gamestage manifest validate")} refuses a manifest that names one.`),v()),A(`Edit the ${Tt(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),v()}else I("Serving the contract fixture"),E("API",a),E("Game id",t.game),v(),A("No round in the manifest, so there is nothing of yours to serve."),A("Add `backend.round` and restart, and this becomes your game."),v();await n}import{readFile as Lm}from"node:fs/promises";import{dirname as fb,resolve as zm}from"node:path";import{spawn as BI}from"node:child_process";import{createHash as KI,randomBytes as cb}from"node:crypto";import{constants as VI}from"node:fs";import{access as WI,mkdtemp as HI,rm as lb}from"node:fs/promises";import{request as JI}from"node:http";import{homedir as Za,tmpdir as YI}from"node:os";import{join as ao}from"node:path";var qI="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";function Pm(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??cb(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}var Nm=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,c=n&127,l=2;if(c===126){if(this.buffered.length<l+2)break;c=this.buffered.readUInt16BE(l),l+=2}else if(c===127){if(this.buffered.length<l+8)break;let m=this.buffered.readBigUInt64BE(l);if(m>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");c=Number(m),l+=8}let p=l;if(s&&(l+=4),this.buffered.length<l+c)break;let d=Buffer.from(this.buffered.subarray(l,l+c));if(s)for(let m=0;m<d.length;m++)d[m]^=this.buffered[p+m%4];if(this.buffered=this.buffered.subarray(l+c),a===8||a===9||a===10)r.push({opcode:a,payload:d});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:d}):(this.fragmentedOpcode=a,this.fragments=[d])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(d),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},Rm=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new Nm;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(Pm(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(Pm(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(Pm(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},jm=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,c=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(c.split(`
7376
7157
  `)[0].replace(/^[A-Za-z]*Error:\s*/,""))}),this.on("Network.requestWillBeSent",a=>{let s=String(a.requestId);this.requests.set(s,a.request??{}),this.inflight.add(s),this.lastNetworkActivity=Date.now()});let i=a=>{this.inflight.delete(String(a.requestId)),this.lastNetworkActivity=Date.now()};this.on("Network.loadingFinished",i),this.on("Network.loadingFailed",i)}cdp;sessionId;child;profile;pageErrors=[];requests=new Map;inflight=new Set;lastNetworkActivity=Date.now();closed=!1;static async create(t,r,o,n){let i=new e(t,r,o,n);return await Promise.all([i.send("Page.enable"),i.send("Runtime.enable"),i.send("Network.enable")]),i}async addScriptToEvaluateOnNewDocument(t){await this.send("Page.addScriptToEvaluateOnNewDocument",{source:t})}async navigate(t,r=2e4){let o=Date.now()+r,n=this.waitForEvent("Page.loadEventFired",r,"page load"),i=await this.send("Page.navigate",{url:t});if(i.errorText)throw new Error(i.errorText);await n,await this.waitForNetworkIdle(Math.max(1,o-Date.now()))}query(t){return this.evaluate(`Array.from(document.querySelectorAll(${JSON.stringify(t)}), (_, index) => index)`)}isVisible(t,r){return this.evaluate(`(() => {
7377
7158
  const element = document.querySelectorAll(${JSON.stringify(t)})[${r}];
7378
7159
  if (!element) return false;
@@ -7390,22 +7171,24 @@ window.GAMESTAGE_IC_LOOKUP = true;
7390
7171
  if ("disabled" in element && element.disabled) return { ok: false, error: "Element is disabled." };
7391
7172
  element.click();
7392
7173
  return { ok: true };
7393
- })()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await wm(50)}throw new Error(`Timed out after ${r}ms waiting for ${t}.`)}waitForResponse(t){let r=t.timeout??15e3;return new Promise((o,n)=>{let i=!1,a=l=>{i||(i=!0,clearTimeout(c),s(),l())},s=this.on("Network.responseReceived",l=>{let d=String(l.requestId),p=this.requests.get(d);p?.url?.includes(t.urlIncludes)&&p.method?.toUpperCase()===t.method.toUpperCase()&&a(()=>o({json:async()=>JSON.parse(await this.responseBody(d,r))}))}),c=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await K_(this.child),await Z_(this.profile,{recursive:!0,force:!0}))}send(t,r={}){return this.cdp.send(t,r,this.sessionId)}on(t,r){return this.cdp.on(t,r,this.sessionId)}async evaluate(t){let r=await this.send("Runtime.evaluate",{expression:t,awaitPromise:!0,returnByValue:!0});if(r.exceptionDetails)throw new Error(r.exceptionDetails.exception?.description??r.exceptionDetails.text??"The page could not evaluate browser code.");return r.result.value}waitForEvent(t,r,o){return new Promise((n,i)=>{let a=l=>{clearTimeout(c),s(),l()},s=this.on(t,()=>a(n)),c=setTimeout(()=>a(()=>i(new Error(`Timed out after ${r}ms waiting for ${o}.`))),r)})}async waitForNetworkIdle(t){let r=Date.now()+t;for(;Date.now()<r;){if(this.inflight.size===0&&Date.now()-this.lastNetworkActivity>=500)return;await wm(50)}throw new Error("Timed out after 20000ms waiting for the network to settle.")}async responseBody(t,r){let o=Date.now()+r,n=new Error("The response body was not available.");for(;Date.now()<o;)try{let i=await this.send("Network.getResponseBody",{requestId:t});return i.base64Encoded?Buffer.from(i.body,"base64").toString("utf8"):i.body}catch(i){n=i instanceof Error?i:n,await wm(25)}throw n}},$I=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",to(ja(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),to(ja(),"Applications/Chromium.app/Contents/MacOS/Chromium"),to(ja(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),to(ja(),"Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),"/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/opt/google/chrome/chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/lib/chromium/chromium","/snap/bin/chromium","/usr/bin/brave-browser","/usr/bin/brave-browser-stable","/opt/brave.com/brave/brave-browser","/usr/bin/microsoft-edge","/usr/bin/microsoft-edge-stable","/opt/microsoft/msedge/msedge"];async function B_(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??$I].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await bI(s,_I.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await wI(to(xI(),"gamestage-chrome-")),i=yI(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await TI(await EI(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:c}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await Sm.create(a,c,i,n)}}catch(s){throw a?.close(),await K_(i),await Z_(n,{recursive:!0,force:!0}),s}}function EI(e,t){return new Promise((r,o)=>{let n="",i=d=>{clearTimeout(l),e.stderr?.off("data",a),e.off("error",s),e.off("close",c),d()},a=d=>{n=(n+d.toString("utf8")).slice(-4e3);let p=n.match(/DevTools listening on (ws:\/\/\S+)/);p&&i(()=>r(p[1]))},s=d=>i(()=>o(d)),c=d=>i(()=>o(new Error(`Chrome exited before DevTools was ready${d===null?"":` (code ${d})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",c);let l=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function TI(e){return new Promise((t,r)=>{let o=new URL(e),n=G_(16).toString("base64"),i=vI("sha1").update(n+SI).digest("base64"),a=kI({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,c,l)=>{s.headers["sec-websocket-accept"]!==i?(c.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new xm(c,l))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function K_(e){e.exitCode===null&&(e.kill("SIGTERM"),!await F_(e,1e3)&&(e.kill("SIGKILL"),await F_(e,1e3)))}function F_(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function wm(e){return new Promise(t=>setTimeout(t,e))}var AI=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],II=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;function $m(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function V_(e){let t=$m(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||II.test(t)||AI.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}var CI=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}];function W_(e){for(let t of CI)if(t.test.test(e))return{confidence:"likely",level:t.level,...t.setting?{setting:t.setting}:{},because:t.because};return{confidence:"possible",level:"project",because:"a fan reads it and nothing in the code says it changes per round or per edition"}}function PI(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
7174
+ })()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await Om(50)}throw new Error(`Timed out after ${r}ms waiting for ${t}.`)}waitForResponse(t){let r=t.timeout??15e3;return new Promise((o,n)=>{let i=!1,a=l=>{i||(i=!0,clearTimeout(c),s(),l())},s=this.on("Network.responseReceived",l=>{let p=String(l.requestId),d=this.requests.get(p);d?.url?.includes(t.urlIncludes)&&d.method?.toUpperCase()===t.method.toUpperCase()&&a(()=>o({json:async()=>JSON.parse(await this.responseBody(p,r))}))}),c=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await db(this.child),await lb(this.profile,{recursive:!0,force:!0}))}send(t,r={}){return this.cdp.send(t,r,this.sessionId)}on(t,r){return this.cdp.on(t,r,this.sessionId)}async evaluate(t){let r=await this.send("Runtime.evaluate",{expression:t,awaitPromise:!0,returnByValue:!0});if(r.exceptionDetails)throw new Error(r.exceptionDetails.exception?.description??r.exceptionDetails.text??"The page could not evaluate browser code.");return r.result.value}waitForEvent(t,r,o){return new Promise((n,i)=>{let a=l=>{clearTimeout(c),s(),l()},s=this.on(t,()=>a(n)),c=setTimeout(()=>a(()=>i(new Error(`Timed out after ${r}ms waiting for ${o}.`))),r)})}async waitForNetworkIdle(t){let r=Date.now()+t;for(;Date.now()<r;){if(this.inflight.size===0&&Date.now()-this.lastNetworkActivity>=500)return;await Om(50)}throw new Error("Timed out after 20000ms waiting for the network to settle.")}async responseBody(t,r){let o=Date.now()+r,n=new Error("The response body was not available.");for(;Date.now()<o;)try{let i=await this.send("Network.getResponseBody",{requestId:t});return i.base64Encoded?Buffer.from(i.body,"base64").toString("utf8"):i.body}catch(i){n=i instanceof Error?i:n,await Om(25)}throw n}},XI=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",ao(Za(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),ao(Za(),"Applications/Chromium.app/Contents/MacOS/Chromium"),ao(Za(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),ao(Za(),"Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),"/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/opt/google/chrome/chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/lib/chromium/chromium","/snap/bin/chromium","/usr/bin/brave-browser","/usr/bin/brave-browser-stable","/opt/brave.com/brave/brave-browser","/usr/bin/microsoft-edge","/usr/bin/microsoft-edge-stable","/opt/microsoft/msedge/msedge"];async function ub(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??XI].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await WI(s,VI.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await HI(ao(YI(),"gamestage-chrome-")),i=BI(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await e0(await QI(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:c}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await jm.create(a,c,i,n)}}catch(s){throw a?.close(),await db(i),await lb(n,{recursive:!0,force:!0}),s}}function QI(e,t){return new Promise((r,o)=>{let n="",i=p=>{clearTimeout(l),e.stderr?.off("data",a),e.off("error",s),e.off("close",c),p()},a=p=>{n=(n+p.toString("utf8")).slice(-4e3);let d=n.match(/DevTools listening on (ws:\/\/\S+)/);d&&i(()=>r(d[1]))},s=p=>i(()=>o(p)),c=p=>i(()=>o(new Error(`Chrome exited before DevTools was ready${p===null?"":` (code ${p})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",c);let l=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function e0(e){return new Promise((t,r)=>{let o=new URL(e),n=cb(16).toString("base64"),i=KI("sha1").update(n+qI).digest("base64"),a=JI({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,c,l)=>{s.headers["sec-websocket-accept"]!==i?(c.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new Rm(c,l))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function db(e){e.exitCode===null&&(e.kill("SIGTERM"),!await sb(e,1e3)&&(e.kill("SIGKILL"),await sb(e,1e3)))}function sb(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function Om(e){return new Promise(t=>setTimeout(t,e))}var t0=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],n0=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;function Dm(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function pb(e){let t=Dm(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||n0.test(t)||t0.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}var r0=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}];function mb(e){for(let t of r0)if(t.test.test(e))return{confidence:"likely",level:t.level,...t.setting?{setting:t.setting}:{},because:t.because};return{confidence:"possible",level:"project",because:"a fan reads it and nothing in the code says it changes per round or per edition"}}function o0(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
7394
7175
  `.repeat(n.split(`
7395
7176
  `).length-1)).replace(/<style[\s\S]*?<\/style>/gi,n=>`
7396
7177
  `.repeat(n.split(`
7397
7178
  `).length-1)).split(`
7398
- `).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let c=s.replace(/\s+/g," ");if(!V_(c))continue;let l=$m(c);t.push({text:l,...W_(l),file:e.relative,line:i+1})}}),t}function OI(e){let t=[];return e.text.split(`
7399
- `).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!V_(i))continue;let a=$m(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...W_(a),file:e.relative,line:o+1})}}),t}function Da(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...PI(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...OI(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}function NI(e){switch(e){case"hunt":return Te.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Te.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Te.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"forecast":return Te.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function RI(e,t,r){return(dv({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=vp[i.key];return a?[[i.key,a]]:[]})}function jI(e){let t=e.filter(o=>o.status==="open").length,r=e.filter(o=>o.status==="skipped").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r}:{outcome:"verified",exitCode:0,open:t,skipped:r}}function Am(e,t){if(t.archetype==="hunt"){let n=t.targets;if(n.length===0)return[];let i=n.filter(a=>new RegExp(`["'\`]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`,"i").test(e));return i.length===n.length?i:[]}if(t.archetype==="forecast")return[];if(t.archetype==="group"){let n=[];for(let i of t.groups){if(new RegExp(`["\`']${i.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(e)){n.push(i.label);continue}e.split(`
7400
- `).some(c=>i.members.every(l=>new RegExp(`["\`']${l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(c)))&&n.push(i.label)}return n}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`(?:${a})[^\\n]{0,120}?\\b${i.value}\\b`,"i"),c=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?(?:${a})`,"i");(s.test(e)||c.test(e))&&o.push(i.label)}return o}function Im(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}var La="button.pick, [data-pick]",J_="#submit, button[type=submit], .submit",q_="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])";async function DI(e,t,r){let o;try{o=await B_()}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${i instanceof Error?i.message:""}`.trim()}}if(o.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:o.detail};let n=o.browser;try{await n.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(t)};window.GAMESTAGE_GAME = ${JSON.stringify(r)};`),await n.navigate(e,2e4);let i=n.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{});for(let h=0;h<3&&!((await n.query(La)).length>0);h++){let b=await n.query("[data-gamestage-start]:not([disabled])"),S;for(let O of b)if(await n.isVisible("[data-gamestage-start]:not([disabled])",O)){S=O;break}if(S===void 0)break;await n.click("[data-gamestage-start]:not([disabled])",S).catch(()=>{}),await n.waitForSelector(La,5e3).catch(()=>{})}let a=await n.query(La);if(a.length===0){let h=n.pageErrors[0],b=await n.query("#prompt").then(()=>n.html()).then(O=>/id="prompt"[^>]*>([^<]{0,160})/.exec(O)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${h?` The page threw: ${h}`:b?` The page says: ${b}`:""}`}}let s=0;for(let h of a)if(await n.click(La,h).catch(()=>{}),s+=1,(await n.query(q_)).length>0)break;let c=await n.query(J_);if(c.length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"No way to submit a play was found on the page."};if((await n.query(q_)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${a.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await n.click(J_,c[0]);let l=await i;if(!l)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let d=await l.json();if(n.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${n.pageErrors[0]}`};let p=await n.html(),m=d.round_state?.score,f=m===void 0||p.includes(String(m))||p.includes(m.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:f?"verified":"open",detail:f?`The play went to the Engine and came back ${d.outcome}.`:`The Engine committed a score of ${m} and the page does not show it.`}}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:i instanceof Error?i.message:"The page could not be played."}}finally{await n.close().catch(()=>{})}}var LI=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"];function zI(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>LI.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}var MI=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]);function UI(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||MI.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}function Y_(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function FI(e,t){let{files:r,skippedLinks:o}=Ip(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let c=zI(s.relativePath);if(c){i.has(c)||(i.add(c),n.push({path:`${c}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(UI(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let l=await Ap(s.path);if(l===void 0)continue;a+=1;let d=_e(l);if(d.ok&&d.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let p=Am(l,t);if(p.length){n.push({path:s.relativePath,why:Im(t,p),fatal:!0});continue}let m;try{let f=JSON.parse(l);f&&Array.isArray(f.sourcesContent)&&(m=f)}catch{}if(m){let f=m.sourcesContent.filter(b=>typeof b=="string").join(`
7401
- `),h=f?Am(f,t):[];if(h.length){n.push({path:s.relativePath,why:`${Im(t,h)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}Y_(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)Y_(s.relativePath)&&!n.some(c=>c.path===s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1});return{files:r,read:a,findings:n}}async function X_(e){let t=e.manifest??"gamestage.yaml",r;try{let D=_e(await Em(t,"utf8"));if(!D.ok)return P(`${t} is not a valid App Manifest.`,D.issues.map(Be=>`${$.cyan(Be.path)} ${Be.message}`));r=D.manifest}catch{return P(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let o=r.backend.round??NI(r.backend.archetype),n=r.backend.round?{source:"manifest",archetype:o.archetype,detail:"The Engine used this game's own backend.round from the manifest."}:{source:"stand-in",archetype:o.archetype,detail:`The manifest carries no round, so the Engine used a representative ${o.archetype} stand-in supplied by Gamestage. It did not test the game's production content from Studio.`};if(!Bt.includes(o.archetype))return P(`No Engine here serves the ${o.archetype} archetype yet.`,[`Built so far: ${Bt.join(", ")}.`]);let i=Tm(e.file??"index.html"),a;try{a=await Em(i,"utf8")}catch{return P(`Cannot read ${e.file??"index.html"}.`)}let s=[],c=Tm(e.dir??H_(i)),l;try{l=await FI(c,o)}catch(D){return P(`Cannot read the publish set at ${e.dir??H_(i)}.`,[D instanceof Error?D.message:"The directory could not be walked."])}let d=l.findings.filter(D=>D.fatal),p=Am(a,o),m=p.length>0||d.length>0;s.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${l.files.length} file${l.files.length===1?"":"s"}, ${l.read} read)`,status:m?"open":"verified",detail:m?[p.length?Im(o,p):void 0,...d.map(D=>`${D.path}: ${D.why}`)].filter(Boolean).join(" "):void 0});let f=await ra(l.files),h=f.map(D=>D.text).join(`
7402
- `),b=Qi(h),S=RI(r,o.archetype,b).filter(([,D])=>!_p(h,D)).map(([D])=>D);s.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(b.length?`, and it offers ${b.length} more for controls it has (${b.join(", ")})`:""),status:S.length?"open":"verified",detail:S.length?`The page does not read: ${S.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let O=Da(f),te=l.files.some(D=>{let Be=D.relativePath.split("/").pop();return Be===we||Be===be})||a.includes(we)||a.includes(be),G=a.includes("createPlayerClient")||/\bstart\s*\(/.test(a);s.push({id:"client-present",what:"the client the page imports is there",status:te||!G?"verified":"open",detail:G&&!te?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let N=await Ra({game:r.app.id,round:o,title:r.app.title});await new Promise(D=>N.listen(0,"127.0.0.1",()=>D()));let q=N.address(),Et=q&&typeof q!="string"?`http://127.0.0.1:${q.port}`:"",ot=await import("node:http").then(({createServer:D})=>D(async(Be,Ua)=>{let Om=(Be.url??"/").split("?")[0],Nm=Om==="/"?i:Tm(i,"..",Om.slice(1));try{let yb=await Em(Nm);Ua.writeHead(200,{"content-type":Nm.endsWith(".js")?"text/javascript":"text/html"}),Ua.end(yb)}catch{Ua.writeHead(404).end()}}));await new Promise(D=>ot.listen(0,"127.0.0.1",()=>D()));let Tt=ot.address(),it=Tt&&typeof Tt!="string"?`http://127.0.0.1:${Tt.port}/`:"";try{s.push(e.noBrowser?{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Asked not to open a browser."}:await DI(it,Et,r.app.id))}finally{N.close(),ot.close()}let oe=jI(s),Xn=l.findings.filter(D=>!D.fatal);if(L()){M({ok:oe.outcome==="verified",outcome:oe.outcome,exitCode:oe.exitCode,checks:s,open:oe.open,skipped:oe.skipped,round:n,copy_candidates:O,publish_set:{directory:c,files:l.files.map(D=>D.relativePath),read:l.read,warnings:Xn}}),oe.exitCode!==0&&process.exit(oe.exitCode);return}I(oe.outcome==="verified"?"Verified":oe.outcome==="failed"?"Verification failed":"Verification incomplete"),T("round used for verification",n.source),v(` ${$.dim(n.detail)}`);for(let D of s){let Be=D.status==="verified"?$.green("ok"):D.status==="open"?$.yellow("open"):$.dim("skipped");T(D.what,Be),D.detail&&v(` ${$.dim(D.detail)}`)}if(Xn.length){v(),v($.dim(" Also in the publish set, and a deploy would upload it:"));for(let D of Xn)v(` ${$.dim("\xB7")} ${$.cyan(D.path)} ${$.dim(D.why)}`)}if(O.length){v(),v($.dim(" Copy a producer may need to own:"));for(let D of O)v(` ${$.dim("\xB7")} ${$.cyan(`${D.file}:${D.line}`)} ${D.text} ${$.dim(`(${D.confidence}, ${D.level})`)}`)}v(),oe.outcome==="verified"?A("The Engine decided the outcome and the page showed it. That is the migration done."):oe.outcome==="failed"?A("A check remains open, so the game failed verification. Read the open check and fix its cause."):A("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),v(),oe.exitCode!==0&&process.exit(oe.exitCode)}import{stat as GI}from"node:fs/promises";async function Q_(){let e=[],[t]=process.versions.node.split(".").map(Number);e.push({id:"node",label:"Node.js",ok:t>=20,detail:t>=20?`v${process.versions.node}`:`v${process.versions.node} - Gamestage needs Node 20 or newer`,blocking:!0}),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${Zi} bundled`,blocking:!1});let r=!1;try{await GI("gamestage.yaml"),r=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:r,detail:r?"gamestage.yaml found":"none here yet \u2014 `gamestage inspect .` or `gamestage create` makes one",blocking:!1}),e.push({id:"auth",label:"Signed in",ok:!1,detail:"not signed in \u2014 only needed to deploy",blocking:!1});let o=e.filter(n=>!n.ok&&n.blocking);L()&&(M({ok:o.length===0,checks:e}),process.exit(o.length===0?0:1)),I("Environment");for(let n of e){let i=n.ok?$.green("ok"):n.blocking?$.red("blocked"):$.dim("--");v(` ${i.padEnd(18)} ${n.label.padEnd(16)} ${$.dim(n.detail)}`)}v(),o.length&&(v(` ${$.red("Fix the blocked items above before continuing.")}`),v(),process.exit(1)),v(` ${$.green("Ready.")}`),v()}import{readFile as r0,stat as o0,writeFile as i0}from"node:fs/promises";import{createHash as a0}from"node:crypto";import{basename as s0}from"node:path";import{readdir as ZI,readFile as za,stat as Cm}from"node:fs/promises";import{basename as BI,extname as KI,join as Pm,relative as VI}from"node:path";var WI=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),HI=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);async function JI(e,t=200){let r=await Cm(e),o=[];if(r.isFile())return o.push({path:e,relative:BI(e),text:await za(e,"utf8")}),o;let n=async i=>{if(o.length>=t)return;let a=await ZI(i,{withFileTypes:!0});for(let s of a){if(o.length>=t)return;if(s.name.startsWith(".")&&s.name!==".openai")continue;let c=Pm(i,s.name);if(s.isDirectory()){if(WI.has(s.name))continue;await n(c)}else if(HI.has(KI(s.name)))try{o.push({path:c,relative:VI(e,c),text:await za(c,"utf8")})}catch{}}};return await n(e),o}function qI(e,t){let r=e.text.split(`
7403
- `);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function YI(e,t){if(!(await Cm(e)).isFile())try{let o=JSON.parse(await za(Pm(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=eb(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=eb(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function eb(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var XI=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],QI=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],e0=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"forecast",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function t0(e){let t=e.map(s=>s.text).join(`
7404
- `),r=e0.map(s=>{let c=s.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:s.archetype,hits:c.length,because:c}}).filter(s=>s.hits>0).sort((s,c)=>c.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function n0(e,t){let o=(await Cm(e)).isFile()?null:e;if(o)try{let i=await za(Pm(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},c=s.next?"Next.js":s.react?"React":s.vue?"Vue":s.svelte?"Svelte":void 0,l=s.vite?"Vite":s.webpack?"webpack":void 0;return{kind:"node_project",framework:c,build:l}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(i=>/\.html?$/.test(i.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function tb(e){let t=await JI(e);if(t.length===0)throw new Error(`No inspectable source found at ${e}. Point inspect at a game file or a project directory.`);let r=await n0(e,t),o=t0(t),n=[];for(let p of XI){let m=[];for(let f of t){for(let h of p.patterns){let b=qI(f,h);if(b){m.push(b);break}}if(m.length>=3)break}if(m.length>0){let f=o?p.remedies?.[o.archetype]??p.remedy:p.remedy;n.push({...f?{remedy:f}:{},id:p.id,title:p.title,detail:p.detail,evidence:m})}}let i=t.map(p=>p.text).join(`
7405
- `),a=QI.filter(p=>!p.present.test(i)).map(p=>({id:p.id,title:p.title,detail:p.detail,evidence:[]})),s=[];t.some(p=>/<(div|section|main|canvas)/i.test(p.text))&&s.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(p=>({file:p.relative}))});let l=Da(t),d=[];return r.kind==="standalone_html"&&d.push("Where is this deployed today, and who owns that hosting?"),d.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),n.some(p=>p.id==="client-play-limit")&&d.push("Is the play limit per device or per person? That decides whether identity is required at launch."),{target:e,scanned_files:t.length,stack:r,keep:s,move_behind_authority:n,missing_integrations:a,copy_to_studio:l,unknowns:d,archetype:o,name:await YI(e,t)}}var c0=e=>s0(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",l0=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function u0(e,t){let r=c0(e.name??e.target),o=t&&_v(t)?t:ta(r),n=e.name??l0(r),i=Yi(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),Mt.parse(i)}async function d0(e,t){let r=await Pe();if(!r)return!1;Zn();let o=e.backend.archetype;return o?(await Un({baseUrl:me,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${a0("sha256").update(t).digest("hex")}`,conformance:Ce(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Rn.map(i=>({section:i,status:e[i].status}))}),!0):!1}async function p0(e){try{let t=_e(await r0(e,"utf8"));return t.ok?t.manifest.app.id:void 0}catch{return}}async function m0(e){try{return await o0(e),!0}catch{return!1}}async function nb(e,t){let r;try{r=await tb(e)}catch(l){return P(l instanceof Error?l.message:"Inspection failed")}let o=u0(r,await p0(typeof t.write=="string"?t.write:"gamestage.yaml")),n=Ce(o),i=qi(o),a=!1,s;try{a=await d0(o,i)}catch(l){s=l instanceof Error?l.message:"The control plane did not answer."}let c=null;if(t.write){if(c=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await m0(c))return P(`${c} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${$.cyan(`gamestage manifest validate ${c}`)} check what you have`,`${$.cyan("gamestage inspect . --force")} replace it anyway`]);await i0(c,i,"utf8")}if(L()){M({ok:!0,report:r,manifest:o,conformance:{computed:n.computed,blockers:n.blockers},manifest_yaml:i,written_to:c,registered:a,...s?{registration_failed:s}:{}});return}if(I(`Inspection report ${$.dim(r.target)}`),T("Files inspected",String(r.scanned_files)),T("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),r.archetype&&T("Archetype",`${r.archetype.archetype} ${$.dim(`(${r.archetype.confidence} confidence)`)}`),r.keep.length){I("Keep as yours");for(let l of r.keep)A($.green(l.title)),v(` ${$.dim(l.detail)}`)}if(r.move_behind_authority.length){I("Must move behind an authoritative boundary");for(let l of r.move_behind_authority){A($.yellow(l.title)),v(` ${$.dim(l.detail)}`);for(let d of l.evidence.slice(0,2)){let p=d.line?`${d.file}:${d.line}`:d.file;v(` ${$.dim("\u2192")} ${$.cyan(p)}${d.excerpt?$.dim(" "+d.excerpt):""}`)}l.remedy&&(v(` ${$.dim("delete")} ${l.remedy.delete}`),v(` ${$.dim("call")} ${$.cyan(l.remedy.call)}`),l.remedy.render&&v(` ${$.dim("render")} ${l.remedy.render}`),l.remedy.move&&v(` ${$.dim("move")} ${l.remedy.move}`),v(` ${$.dim("keep")} ${l.remedy.keep}`))}}if(r.missing_integrations.length){I("Platform integrations not present yet");for(let l of r.missing_integrations)A(l.title),v(` ${$.dim(l.detail)}`)}if(r.unknowns.length){I("Needs a human answer");for(let l of r.unknowns)A(l,"?")}if(I("App Manifest"),T("Conformance",`${n.computed} ${n.computedName}`),n.blockers.length){v(),v($.dim(" To reach the next level:"));for(let l of n.blockers)v(` ${$.dim("\xB7")} ${l.requirement}`)}v(),c?v(` Written to ${$.cyan(c)}`):v($.dim(" Re-run with --write to save this manifest.")),v(a?" Registered in Studio as a draft.":s?` Not registered in Studio: ${s} (${me})`:" No account found, so registration was skipped."),v()}var rb="https://github.com",f0="https://api.github.com",Ma=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function ob(){let e=await fetch(`${rb}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Ma,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function ib(e){let r=await(await fetch(`${rb}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Ma,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await h0(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function h0(e){let t=await fetch(`${f0}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}var g0=e=>new Promise(t=>setTimeout(t,e));async function ab(){let{client:e}=await Se();try{let t=await ob();L()?M({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Ma}):(I("Link GitHub"),T("Code",t.user_code),T("Open",t.verification_uri),v(),A("Enter the code on that page. This waits until you do."),v());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await g0(o*1e3);let n=await ib(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return P("You declined the request on GitHub.");if(n.status==="expired")return P("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(L())return M({ok:!0,status:"linked",github:i.github});I("Linked"),T("Account",n.login),v(),A("Your first deploy is no longer gated. Run `gamestage deploy`."),v();return}P("The code expired before it was entered.")}catch(t){Oe(t)}}var y0=e=>new Promise(t=>setTimeout(t,e));async function sb(){let e=await Pe();if(e){if(L()){M({ok:!0,status:"already_signed_in",email:e.email});return}I("Already signed in"),T("Account",e.email??e.userId??"unknown"),v(),A("Run `gamestage logout` first to sign in as someone else."),v();return}let t;try{t=await fv()}catch(c){P("Could not reach the sign-in service.",[String(c)])}L()?M({ok:!0,status:"awaiting_approval",user_code:t.user_code,verification_uri:t.verification_uri,verification_uri_complete:t.verification_uri_complete,expires_in:t.expires_in}):(I("Sign in to Gamestage"),v(" This also creates your account if you do not have one. No approval,"),v(" no waitlist. Google or email."),v(),T("Open",t.verification_uri),T("Code",t.user_code),v(),v(" Waiting for you to confirm in the browser..."),gv(t.verification_uri_complete));let r=Date.now()+t.expires_in*1e3,o=t.interval*1e3,n=null;for(;Date.now()<r;){await y0(o);let c=await hv(t.device_code);if(c.status==="ok"){n=c.session;break}if(c.status==="slow_down"){o+=5e3;continue}c.status!=="pending"&&(c.status==="expired"&&P("That code expired.",["Run `gamestage login` again."]),P("Sign-in was refused.",[c.reason]))}n||P("Timed out waiting for approval.",["Run `gamestage login` again."]);let i=await Ep(n),{client:a}=await Se(),s=await bv(a);if(L()){M({ok:s.ok,status:s.ok?"signed_in":"signed_in_control_plane_unreachable",email:n.email,stored_in:i,control_plane:me,...s.ok?{}:{error:s.reason,detail:s.detail}}),s.ok||process.exit(1);return}v(),I("Signed in"),T("Account",n.email??n.userId??"unknown"),T("Token stored in",i==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),v(),A("Never written into the project, and never passed to your agent."),A("`gamestage logout` removes it."),v(),s.ok||P(s.reason,s.detail)}async function cb(){let e=await Pe();if(await vv(),L()){M({ok:!0,status:e?"signed_out":"not_signed_in"});return}I(e?"Signed out":"Not signed in"),e&&T("Removed",e.email??"session"),v()}async function lb(){let e=await Pe();if(L()){M(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){I("Not signed in"),v(),A("Inspecting, scaffolding and local rounds need no account."),A("Run `gamestage login` when you want to deploy a playground."),v();return}I("Signed in"),T("Account",e.email??"unknown"),e.userId&&T("User",e.userId),v()}import{readdir as v0,readFile as _0,stat as b0}from"node:fs/promises";async function w0(e){let t=[];try{t=await v0(e)}catch{}let r=t.filter(a=>!a.startsWith(".")),o=[];for(let a of r)/\.html?$/.test(a)&&o.push(a);let n=!1,i;for(let a of["gamestage.yaml","gamestage.yml"])try{await b0(`${e}/${a}`),n=!0;try{let s=_e(await _0(`${e}/${a}`,"utf8"));s.ok&&(i=!!s.manifest.backend.round)}catch{}break}catch{}return{has_manifest:n,has_package_json:r.includes("package.json"),html_files:o,is_empty:r.length===0,has_round:i}}async function ub(){let e=process.cwd(),t=await w0(e),r=t.has_manifest?t.has_round===!1?"round":t.has_round===!0?"play":"continue":t.has_package_json||t.html_files.length>0?"inspect":"create",o={continue:{command:je("manifest validate gamestage.yaml"),why:"This project already has an App Manifest. Check where it stands."},round:{command:"edit gamestage.yaml, add backend.round",why:`The manifest names an archetype but no round, so there is no game for the Engine to serve yet. The round is the content the server owns: the board a player sees and the answers they never do. Until it is there, \`${je("dev")}\` serves the contract fixture rather than your game, and \`${je("verify")}\` has nothing to verify.`},play:{command:je("dev"),why:"The manifest declares a round. Serve it locally, through the real Engine."},inspect:{command:je("inspect ."),why:"There is a game here already. Read it read-only and produce an inspection report."},create:{command:je("create"),why:"Nothing to inspect. Start a new game from a concept."}};if(L()){M({ok:!0,cwd:e,detected:t,route:r,next:o[r],docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:Ba(),authentication:`Not required for inspect, create, validate or local development. First needed at \`${je("deploy")}\`.`});return}if(I("Gamestage"),v($.dim(" Take an agent-built game to production, on the platform behind the")),v($.dim(" world's biggest fan experiences.")),I("Where you are"),t.has_manifest&&t.has_round===!1)v(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)v(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)v(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let n=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);v(` Found ${n.join(" and ")}. This looks like a game to inspect.`)}else v(" Nothing here yet. This looks like a fresh start.");I("Do this next"),v(` ${$.cyan(o[r].command)}`),v(` ${$.dim(o[r].why)}`),I("Good to know"),v($.dim(` Nothing needs an account yet. Inspect, create, validate and local
7179
+ `).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let c=s.replace(/\s+/g," ");if(!pb(c))continue;let l=Dm(c);t.push({text:l,...mb(l),file:e.relative,line:i+1})}}),t}function i0(e){let t=[];return e.text.split(`
7180
+ `).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!pb(i))continue;let a=Dm(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...mb(a),file:e.relative,line:o+1})}}),t}function Ba(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...o0(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...i0(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}function a0(e){switch(e){case"hunt":return Pe.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Pe.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Pe.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"forecast":return Pe.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function s0(e,t,r){return($v({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=Tp[i.key];return a?[[i.key,a]]:[]})}function c0(e){let t=e.filter(o=>o.status==="open").length,r=e.filter(o=>o.status==="skipped").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r}:{outcome:"verified",exitCode:0,open:t,skipped:r}}function Mm(e,t){if(t.archetype==="hunt"){let n=t.targets;if(n.length===0)return[];let i=n.filter(a=>new RegExp(`["'\`]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`,"i").test(e));return i.length===n.length?i:[]}if(t.archetype==="forecast")return[];if(t.archetype==="group"){let n=[];for(let i of t.groups){if(new RegExp(`["\`']${i.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(e)){n.push(i.label);continue}e.split(`
7181
+ `).some(c=>i.members.every(l=>new RegExp(`["\`']${l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(c)))&&n.push(i.label)}return n}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`(?:${a})[^\\n]{0,120}?\\b${i.value}\\b`,"i"),c=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?(?:${a})`,"i");(s.test(e)||c.test(e))&&o.push(i.label)}return o}function Um(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}var Ka="button.pick, [data-pick]",hb="#submit, button[type=submit], .submit",gb="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])";async function l0(e,t,r){let o;try{o=await ub()}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${i instanceof Error?i.message:""}`.trim()}}if(o.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:o.detail};let n=o.browser;try{await n.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(t)};window.GAMESTAGE_GAME = ${JSON.stringify(r)};`),await n.navigate(e,2e4);let i=n.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{});for(let h=0;h<3&&!((await n.query(Ka)).length>0);h++){let _=await n.query("[data-gamestage-start]:not([disabled])"),S;for(let O of _)if(await n.isVisible("[data-gamestage-start]:not([disabled])",O)){S=O;break}if(S===void 0)break;await n.click("[data-gamestage-start]:not([disabled])",S).catch(()=>{}),await n.waitForSelector(Ka,5e3).catch(()=>{})}let a=await n.query(Ka);if(a.length===0){let h=n.pageErrors[0],_=await n.query("#prompt").then(()=>n.html()).then(O=>/id="prompt"[^>]*>([^<]{0,160})/.exec(O)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${h?` The page threw: ${h}`:_?` The page says: ${_}`:""}`}}let s=0;for(let h of a)if(await n.click(Ka,h).catch(()=>{}),s+=1,(await n.query(gb)).length>0)break;let c=await n.query(hb);if(c.length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"No way to submit a play was found on the page."};if((await n.query(gb)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${a.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await n.click(hb,c[0]);let l=await i;if(!l)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let p=await l.json();if(n.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${n.pageErrors[0]}`};let d=await n.html(),m=p.round_state?.score,f=m===void 0||d.includes(String(m))||d.includes(m.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:f?"verified":"open",detail:f?`The play went to the Engine and came back ${p.outcome}.`:`The Engine committed a score of ${m} and the page does not show it.`}}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:i instanceof Error?i.message:"The page could not be played."}}finally{await n.close().catch(()=>{})}}var u0=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"];function d0(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>u0.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}var p0=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]);function m0(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||p0.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}function yb(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function f0(e,t){let{files:r,skippedLinks:o}=Mp(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let c=d0(s.relativePath);if(c){i.has(c)||(i.add(c),n.push({path:`${c}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(m0(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let l=await zp(s.path);if(l===void 0)continue;a+=1;let p=_e(l);if(p.ok&&p.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let d=Mm(l,t);if(d.length){n.push({path:s.relativePath,why:Um(t,d),fatal:!0});continue}let m;try{let f=JSON.parse(l);f&&Array.isArray(f.sourcesContent)&&(m=f)}catch{}if(m){let f=m.sourcesContent.filter(_=>typeof _=="string").join(`
7182
+ `),h=f?Mm(f,t):[];if(h.length){n.push({path:s.relativePath,why:`${Um(t,h)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}yb(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)yb(s.relativePath)&&!n.some(c=>c.path===s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1});return{files:r,read:a,findings:n}}async function vb(e){let t=e.manifest??"gamestage.yaml",r;try{let D=_e(await Lm(t,"utf8"));if(!D.ok)return C(`${t} is not a valid App Manifest.`,D.issues.map(Be=>`${$.cyan(Be.path)} ${Be.message}`));r=D.manifest}catch{return C(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let o=r.backend.round??a0(r.backend.archetype),n=r.backend.round?{source:"manifest",archetype:o.archetype,detail:"The Engine used this game's own backend.round from the manifest."}:{source:"stand-in",archetype:o.archetype,detail:`The manifest carries no round, so the Engine used a representative ${o.archetype} stand-in supplied by Gamestage. It did not test the game's production content from Studio.`};if(!Gt.includes(o.archetype))return C(`No Engine here serves the ${o.archetype} archetype yet.`,[`Built so far: ${Gt.join(", ")}.`]);let i=zm(e.file??"index.html"),a;try{a=await Lm(i,"utf8")}catch{return C(`Cannot read ${e.file??"index.html"}.`)}let s=[],c=zm(e.dir??fb(i)),l;try{l=await f0(c,o)}catch(D){return C(`Cannot read the publish set at ${e.dir??fb(i)}.`,[D instanceof Error?D.message:"The directory could not be walked."])}let p=l.findings.filter(D=>D.fatal),d=Mm(a,o),m=d.length>0||p.length>0;s.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${l.files.length} file${l.files.length===1?"":"s"}, ${l.read} read)`,status:m?"open":"verified",detail:m?[d.length?Um(o,d):void 0,...p.map(D=>`${D.path}: ${D.why}`)].filter(Boolean).join(" "):void 0});let f=await da(l.files),h=f.map(D=>D.text).join(`
7183
+ `),_=aa(h),S=s0(r,o.archetype,_).filter(([,D])=>!Ap(h,D)).map(([D])=>D);s.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(_.length?`, and it offers ${_.length} more for controls it has (${_.join(", ")})`:""),status:S.length?"open":"verified",detail:S.length?`The page does not read: ${S.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let O=Ba(f),ne=l.files.some(D=>{let Be=D.relativePath.split("/").pop();return Be===ke||Be===we})||a.includes(ke)||a.includes(we),G=a.includes("createPlayerClient")||/\bstart\s*\(/.test(a);s.push({id:"client-present",what:"the client the page imports is there",status:ne||!G?"verified":"open",detail:G&&!ne?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let N=await Ga({game:r.app.id,round:o,title:r.app.title});await new Promise(D=>N.listen(0,"127.0.0.1",()=>D()));let Y=N.address(),$t=Y&&typeof Y!="string"?`http://127.0.0.1:${Y.port}`:"",ot=await import("node:http").then(({createServer:D})=>D(async(Be,Ja)=>{let Zm=(Be.url??"/").split("?")[0],Bm=Zm==="/"?i:zm(i,"..",Zm.slice(1));try{let Fb=await Lm(Bm);Ja.writeHead(200,{"content-type":Bm.endsWith(".js")?"text/javascript":"text/html"}),Ja.end(Fb)}catch{Ja.writeHead(404).end()}}));await new Promise(D=>ot.listen(0,"127.0.0.1",()=>D()));let Bt=ot.address(),er=Bt&&typeof Bt!="string"?`http://127.0.0.1:${Bt.port}/`:"";try{s.push(e.noBrowser?{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Asked not to open a browser."}:await l0(er,$t,r.app.id))}finally{N.close(),ot.close()}let q=c0(s),Kt=l.findings.filter(D=>!D.fatal);if(R()){j({ok:q.outcome==="verified",outcome:q.outcome,exitCode:q.exitCode,checks:s,open:q.open,skipped:q.skipped,round:n,copy_candidates:O,publish_set:{directory:c,files:l.files.map(D=>D.relativePath),read:l.read,warnings:Kt}}),q.exitCode!==0&&process.exit(q.exitCode);return}I(q.outcome==="verified"?"Verified":q.outcome==="failed"?"Verification failed":"Verification incomplete"),E("round used for verification",n.source),v(` ${$.dim(n.detail)}`);for(let D of s){let Be=D.status==="verified"?$.green("ok"):D.status==="open"?$.yellow("open"):$.dim("skipped");E(D.what,Be),D.detail&&v(` ${$.dim(D.detail)}`)}if(Kt.length){v(),v($.dim(" Also in the publish set, and a deploy would upload it:"));for(let D of Kt)v(` ${$.dim("\xB7")} ${$.cyan(D.path)} ${$.dim(D.why)}`)}if(O.length){v(),v($.dim(" Copy a producer may need to own:"));for(let D of O)v(` ${$.dim("\xB7")} ${$.cyan(`${D.file}:${D.line}`)} ${D.text} ${$.dim(`(${D.confidence}, ${D.level})`)}`)}v(),q.outcome==="verified"?A("The Engine decided the outcome and the page showed it. That is the migration done."):q.outcome==="failed"?A("A check remains open, so the game failed verification. Read the open check and fix its cause."):A("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),v(),q.exitCode!==0&&process.exit(q.exitCode)}import{stat as h0}from"node:fs/promises";async function _b(){let e=[],[t]=process.versions.node.split(".").map(Number);e.push({id:"node",label:"Node.js",ok:t>=20,detail:t>=20?`v${process.versions.node}`:`v${process.versions.node} - Gamestage needs Node 20 or newer`,blocking:!0}),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${Hi} bundled`,blocking:!1});let r=!1;try{await h0("gamestage.yaml"),r=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:r,detail:r?"gamestage.yaml found":"none here yet \u2014 `gamestage inspect .` or `gamestage create` makes one",blocking:!1}),e.push({id:"auth",label:"Signed in",ok:!1,detail:"not signed in \u2014 only needed to deploy",blocking:!1});let o=e.filter(n=>!n.ok&&n.blocking);R()&&(j({ok:o.length===0,checks:e}),process.exit(o.length===0?0:1)),I("Environment");for(let n of e){let i=n.ok?$.green("ok"):n.blocking?$.red("blocked"):$.dim("--");v(` ${i.padEnd(18)} ${n.label.padEnd(16)} ${$.dim(n.detail)}`)}v(),o.length&&(v(` ${$.red("Fix the blocked items above before continuing.")}`),v(),process.exit(1)),v(` ${$.green("Ready.")}`),v()}import{readFile as C0,stat as P0,writeFile as O0}from"node:fs/promises";import{createHash as N0}from"node:crypto";import{basename as R0}from"node:path";import{readdir as g0,readFile as Va,stat as Fm}from"node:fs/promises";import{basename as y0,extname as v0,join as Gm,relative as _0}from"node:path";var b0=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),w0=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);async function k0(e,t=200){let r=await Fm(e),o=[];if(r.isFile())return o.push({path:e,relative:y0(e),text:await Va(e,"utf8")}),o;let n=async i=>{if(o.length>=t)return;let a=await g0(i,{withFileTypes:!0});for(let s of a){if(o.length>=t)return;if(s.name.startsWith(".")&&s.name!==".openai")continue;let c=Gm(i,s.name);if(s.isDirectory()){if(b0.has(s.name))continue;await n(c)}else if(w0.has(v0(s.name)))try{o.push({path:c,relative:_0(e,c),text:await Va(c,"utf8")})}catch{}}};return await n(e),o}function x0(e,t){let r=e.text.split(`
7184
+ `);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function S0(e,t){if(!(await Fm(e)).isFile())try{let o=JSON.parse(await Va(Gm(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=bb(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=bb(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function bb(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var $0=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],E0=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],T0=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"forecast",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function A0(e){let t=e.map(s=>s.text).join(`
7185
+ `),r=T0.map(s=>{let c=s.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:s.archetype,hits:c.length,because:c}}).filter(s=>s.hits>0).sort((s,c)=>c.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function I0(e,t){let o=(await Fm(e)).isFile()?null:e;if(o)try{let i=await Va(Gm(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},c=s.next?"Next.js":s.react?"React":s.vue?"Vue":s.svelte?"Svelte":void 0,l=s.vite?"Vite":s.webpack?"webpack":void 0;return{kind:"node_project",framework:c,build:l}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(i=>/\.html?$/.test(i.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function wb(e){let t=await k0(e);if(t.length===0)throw new Error(`No inspectable source found at ${e}. Point inspect at a game file or a project directory.`);let r=await I0(e,t),o=A0(t),n=[];for(let d of $0){let m=[];for(let f of t){for(let h of d.patterns){let _=x0(f,h);if(_){m.push(_);break}}if(m.length>=3)break}if(m.length>0){let f=o?d.remedies?.[o.archetype]??d.remedy:d.remedy;n.push({...f?{remedy:f}:{},id:d.id,title:d.title,detail:d.detail,evidence:m})}}let i=t.map(d=>d.text).join(`
7186
+ `),a=E0.filter(d=>!d.present.test(i)).map(d=>({id:d.id,title:d.title,detail:d.detail,evidence:[]})),s=[];t.some(d=>/<(div|section|main|canvas)/i.test(d.text))&&s.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(d=>({file:d.relative}))});let l=Ba(t),p=[];return r.kind==="standalone_html"&&p.push("Where is this deployed today, and who owns that hosting?"),p.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),n.some(d=>d.id==="client-play-limit")&&p.push("Is the play limit per device or per person? That decides whether identity is required at launch."),{target:e,scanned_files:t.length,stack:r,keep:s,move_behind_authority:n,missing_integrations:a,copy_to_studio:l,unknowns:p,archetype:o,name:await S0(e,t)}}var j0=e=>R0(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",D0=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function L0(e,t){let r=j0(e.name??e.target),o=t&&jv(t)?t:ca(r),n=e.name??D0(r),i=na(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),Lt.parse(i)}async function z0(e,t){let r=await $e();if(!r)return!1;Zn();let o=e.backend.archetype;return o?(await Un({baseUrl:se,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${N0("sha256").update(t).digest("hex")}`,conformance:Re(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Rn.map(i=>({section:i,status:e[i].status}))}),!0):!1}async function M0(e){try{let t=_e(await C0(e,"utf8"));return t.ok?t.manifest.app.id:void 0}catch{return}}async function U0(e){try{return await P0(e),!0}catch{return!1}}async function kb(e,t){let r;try{r=await wb(e)}catch(l){return C(l instanceof Error?l.message:"Inspection failed")}let o=L0(r,await M0(typeof t.write=="string"?t.write:"gamestage.yaml")),n=Re(o),i=ta(o),a=!1,s;try{a=await z0(o,i)}catch(l){s=l instanceof Error?l.message:"The control plane did not answer."}let c=null;if(t.write){if(c=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await U0(c))return C(`${c} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${$.cyan(`gamestage manifest validate ${c}`)} check what you have`,`${$.cyan("gamestage inspect . --force")} replace it anyway`]);await O0(c,i,"utf8")}if(R()){j({ok:!0,report:r,manifest:o,conformance:{computed:n.computed,blockers:n.blockers},manifest_yaml:i,written_to:c,registered:a,...s?{registration_failed:s}:{}});return}if(I(`Inspection report ${$.dim(r.target)}`),E("Files inspected",String(r.scanned_files)),E("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),r.archetype&&E("Archetype",`${r.archetype.archetype} ${$.dim(`(${r.archetype.confidence} confidence)`)}`),r.keep.length){I("Keep as yours");for(let l of r.keep)A($.green(l.title)),v(` ${$.dim(l.detail)}`)}if(r.move_behind_authority.length){I("Must move behind an authoritative boundary");for(let l of r.move_behind_authority){A($.yellow(l.title)),v(` ${$.dim(l.detail)}`);for(let p of l.evidence.slice(0,2)){let d=p.line?`${p.file}:${p.line}`:p.file;v(` ${$.dim("\u2192")} ${$.cyan(d)}${p.excerpt?$.dim(" "+p.excerpt):""}`)}l.remedy&&(v(` ${$.dim("delete")} ${l.remedy.delete}`),v(` ${$.dim("call")} ${$.cyan(l.remedy.call)}`),l.remedy.render&&v(` ${$.dim("render")} ${l.remedy.render}`),l.remedy.move&&v(` ${$.dim("move")} ${l.remedy.move}`),v(` ${$.dim("keep")} ${l.remedy.keep}`))}}if(r.missing_integrations.length){I("Platform integrations not present yet");for(let l of r.missing_integrations)A(l.title),v(` ${$.dim(l.detail)}`)}if(r.unknowns.length){I("Needs a human answer");for(let l of r.unknowns)A(l,"?")}if(I("App Manifest"),E("Conformance",`${n.computed} ${n.computedName}`),n.blockers.length){v(),v($.dim(" To reach the next level:"));for(let l of n.blockers)v(` ${$.dim("\xB7")} ${l.requirement}`)}v(),c?v(` Written to ${$.cyan(c)}`):v($.dim(" Re-run with --write to save this manifest.")),v(a?" Registered in Studio as a draft.":s?` Not registered in Studio: ${s} (${se})`:" No account found, so registration was skipped."),v()}var xb="https://github.com",F0="https://api.github.com",Wa=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function Sb(){let e=await fetch(`${xb}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Wa,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function $b(e){let r=await(await fetch(`${xb}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Wa,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await G0(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function G0(e){let t=await fetch(`${F0}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}var Z0=e=>new Promise(t=>setTimeout(t,e));async function Eb(){let{client:e}=await be();try{let t=await Sb();R()?j({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Wa}):(I("Link GitHub"),E("Code",t.user_code),E("Open",t.verification_uri),v(),A("Enter the code on that page. This waits until you do."),v());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await Z0(o*1e3);let n=await $b(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return C("You declined the request on GitHub.");if(n.status==="expired")return C("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(R())return j({ok:!0,status:"linked",github:i.github});I("Linked"),E("Account",n.login),v(),A("Your first deploy is no longer gated. Run `gamestage deploy`."),v();return}C("The code expired before it was entered.")}catch(t){Ee(t)}}var B0=e=>new Promise(t=>setTimeout(t,e));function K0(e){process.stderr.write(JSON.stringify({ok:!0,status:"awaiting_approval",user_code:e.user_code,verification_uri:e.verification_uri,verification_uri_complete:e.verification_uri_complete,expires_in:e.expires_in},null,2)+`
7187
+ `)}async function Tb(e,t){let{client:r}=await be(),o=Br(await la(r));if(R()){j({ok:o.ok,status:o.status,access:o.access,...o.code?{code:o.code}:{},message:o.message,next:o.next,email:e.email,...t?{stored_in:t}:{},control_plane:se}),o.ok||process.exit(1);return}v(),I("Signed in"),E("Account",e.email??e.userId??"unknown"),t&&E("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),v(),A("Never written into the project, and never passed to your agent."),A("`gamestage logout` removes it."),Bn(o),o.ok||process.exit(1)}async function Ab(){let e=await $e();if(e){await Tb(e);return}let t;try{t=await Cv()}catch(a){C("Could not reach the sign-in service.",[String(a)])}R()?K0(t):(I("Sign in to Gamestage"),v(" This also creates your account if you do not have one. Google or email."),v(" A new account is approved by a person, so this may end in a wait."),v(),E("Open",t.verification_uri_complete),E("Or enter",`${t.user_code} at ${t.verification_uri}`),v(),v(" Waiting for you to confirm in the browser..."),Ov(t.verification_uri_complete));let r=Date.now()+t.expires_in*1e3,o=t.interval*1e3,n=null;for(;Date.now()<r;){await B0(o);let a=await Pv(t.device_code);if(a.status==="ok"){n=a.session;break}if(a.status==="slow_down"){o+=5e3;continue}a.status!=="pending"&&(a.status==="expired"&&C("That code expired.",["Run `gamestage login` again."]),C("Sign-in was refused.",[a.reason]))}n||C("Timed out waiting for approval.",["Run `gamestage login` again."]);let i=await jp(n);await Tb(n,i)}async function Ib(){let e=await $e();if(await Rv(),R()){j({ok:!0,status:e?"signed_out":"not_signed_in"});return}I(e?"Signed out":"Not signed in"),e&&E("Removed",e.email??"session"),v()}async function Cb(){let e=await $e();if(R()){j(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){I("Not signed in"),v(),A("Inspecting, scaffolding and local rounds need no account."),A("Run `gamestage login` when you want to deploy a playground."),v();return}I("Signed in"),E("Account",e.email??"unknown"),e.userId&&E("User",e.userId),v(),A("`gamestage status` says whether this account is approved."),v()}import{readdir as V0,readFile as W0,stat as H0}from"node:fs/promises";async function J0(e){let t=[];try{t=await V0(e)}catch{}let r=t.filter(a=>!a.startsWith(".")),o=[];for(let a of r)/\.html?$/.test(a)&&o.push(a);let n=!1,i;for(let a of["gamestage.yaml","gamestage.yml"])try{await H0(`${e}/${a}`),n=!0;try{let s=_e(await W0(`${e}/${a}`,"utf8"));s.ok&&(i=!!s.manifest.backend.round)}catch{}break}catch{}return{has_manifest:n,has_package_json:r.includes("package.json"),html_files:o,is_empty:r.length===0,has_round:i}}async function Pb(){let e=process.cwd(),t=await J0(e),r=t.has_manifest?t.has_round===!1?"round":t.has_round===!0?"play":"continue":t.has_package_json||t.html_files.length>0?"inspect":"create",o={continue:{command:Ie("manifest validate gamestage.yaml"),why:"This project already has an App Manifest. Check where it stands."},round:{command:"edit gamestage.yaml, add backend.round",why:`The manifest names an archetype but no round, so there is no game for the Engine to serve yet. The round is the content the server owns: the board a player sees and the answers they never do. Until it is there, \`${Ie("dev")}\` serves the contract fixture rather than your game, and \`${Ie("verify")}\` has nothing to verify.`},play:{command:Ie("dev"),why:"The manifest declares a round. Serve it locally, through the real Engine."},inspect:{command:Ie("inspect ."),why:"There is a game here already. Read it read-only and produce an inspection report."},create:{command:Ie("create"),why:"Nothing to inspect. Start a new game from a concept."}};if(R()){j({ok:!0,cwd:e,detected:t,route:r,next:o[r],docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:Qa(),authentication:`Not required for inspect, create, validate or local development. First needed at \`${Ie("deploy")}\`.`});return}if(I("Gamestage"),v($.dim(" Take an agent-built game to production, on the platform behind the")),v($.dim(" world's biggest fan experiences.")),I("Where you are"),t.has_manifest&&t.has_round===!1)v(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)v(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)v(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let n=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);v(` Found ${n.join(" and ")}. This looks like a game to inspect.`)}else v(" Nothing here yet. This looks like a fresh start.");I("Do this next"),v(` ${$.cyan(o[r].command)}`),v(` ${$.dim(o[r].why)}`),I("Good to know"),v($.dim(` Nothing needs an account yet. Inspect, create, validate and local
7406
7188
  development all run anonymously. Sign-in arrives when you deploy,
7407
- which is what puts the game at a URL a fan can open.`)),v()}var Yn=class extends Error{};function db(e){let t=e.what.trim();if(!t)throw new Yn("Say what you were trying to build.");if(t.length>2e3)throw new Yn(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function pb(e){return JSON.stringify(e,null,2)}var k0=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function mb(e,t,r){let o;try{o=db({what:e,closest:t.closest,cliVersion:r})}catch(a){throw a instanceof Yn&&P(a.message),a}if(!t.send){if(L()){M({sent:!1,would_send:o});return}I("This is everything that would be sent"),v(),v(pb(o)),v(),A("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),A(`Send it with ${je('suggest "..." --send')}.`);return}let n;try{n=await fetch(k0,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(a){P("Could not reach Gamestage to send that.",[a instanceof Error?a.message:String(a)])}let i=await n.json().catch(()=>({}));if(n.ok||P(`Gamestage refused that suggestion (${n.status}).`,[i.error?.message??"It said nothing more."]),L()){M({sent:!0,reference:i.reference??null});return}I("Sent"),i.reference&&A(`Reference ${i.reference}. Quote it if you follow up.`),A("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}import{readFile as x0}from"node:fs/promises";async function fb(e,t){let r;try{r=await x0(e,"utf8")}catch{return P(`Cannot read ${e}`)}let o=_e(r);if(!o.ok)return L()&&(M({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),P(`${e} is not a valid App Manifest`,o.issues.map(l=>`${$.cyan(l.path)} ${l.message}`));let n=o.manifest,i=Ce(n),a=null;if(t.level){let l=yt.safeParse(t.level.toUpperCase());if(!l.success)return P(`Unknown level "${t.level}". Use L0 through L5.`);a=l.data}let s=a?Wg(n,a):null,c=!i.overclaimed&&(s?.ok??!0);if(L()&&(M({ok:c,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results}),process.exit(c?0:1)),I(`${n.app.title} ${$.dim(n.app.id)}`),T("Schema",n.manifest.schema_version),T("Revision",String(n.manifest.revision)),T("Conformance",i.overclaimed?`${$.red(i.claimed)} claimed, ${$.bold(i.computed)} evidenced`:`${$.green(i.computed)} ${i.computedName}`),i.overclaimed){I("Overclaimed"),v($.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let l of i.blockers)A($.red(l.requirement))}if(a&&s&&!s.ok){I(`Not yet ${a}`);for(let l of s.missing)A(`${$.yellow(l.id)} ${l.requirement}`)}if(c&&(v(),v(` ${$.green("Valid")}${a?` at ${a}`:""}.`),i.blockers.length)){v(),v($.dim(" Next level needs:"));for(let l of i.blockers)v(` ${$.dim("\xB7")} ${l.requirement}`)}v(),process.exit(c?0:1)}for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var hb="0.1.0",H=new Wt;H.name("gamestage").description(`Take an agent-built game prototype to a production fan game.
7408
- Inspect, create, validate and local development need no account.`).version(hb).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{Lm(!!e.opts().json)});H.command("start").description("read the current directory and point at the right next step").action(ub);H.command("doctor").description("check the local environment").action(Q_);H.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(nb);H.command("create").option("--name <name>","game name").option("--archetype <archetype>","authority model for the game").option("--write [path]","manifest path (default gamestage.yaml)").description("start a new game, choosing its authority before scaffolding").action(wv);H.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done").action(e=>X_({...e,noBrowser:e.browser===!1}));H.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(Mm);var gb=H.command("manifest").description("work with the App Manifest");gb.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(Ov);gb.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(fb);H.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(Av);H.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").description("publish a snapshot to a playground, and the round it puts on").action(Iv);H.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(Cv);H.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(Pv);H.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>Rp(e,!1));H.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>Rp(e,!0));H.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(Nv);H.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(Rv);H.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").description("serve your round locally, through the Engine that will serve it in the cloud").action(U_);H.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("<what>","what you were trying to build").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>mb(e,t,hb));H.command("login").description("sign in, or create an account (only needed to deploy)").action(sb);var S0=H.command("link").description("connect an account Gamestage needs (requires sign-in)");S0.command("github").description("link your GitHub account, which a first deploy requires").action(ab);H.command("logout").description("forget the stored session").action(cb);H.command("whoami").description("show who the CLI is signed in as").action(lb);H.parseAsync(process.argv).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
7189
+ which is what puts the game at a URL a fan can open.`)),v()}var Xn=class extends Error{};function Ob(e){let t=e.what.trim();if(!t)throw new Xn("Say what you were trying to build.");if(t.length>2e3)throw new Xn(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function Nb(e){return JSON.stringify(e,null,2)}var Y0=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function Rb(e,t,r){let o;try{o=Ob({what:e,closest:t.closest,cliVersion:r})}catch(a){throw a instanceof Xn&&C(a.message),a}if(!t.send){if(R()){j({sent:!1,would_send:o});return}I("This is everything that would be sent"),v(),v(Nb(o)),v(),A("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),A(`Send it with ${Ie('suggest "..." --send')}.`);return}let n;try{n=await fetch(Y0,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(a){C("Could not reach Gamestage to send that.",[a instanceof Error?a.message:String(a)])}let i=await n.json().catch(()=>({}));if(n.ok||C(`Gamestage refused that suggestion (${n.status}).`,[i.error?.message??"It said nothing more."]),R()){j({sent:!0,reference:i.reference??null});return}I("Sent"),i.reference&&A(`Reference ${i.reference}. Quote it if you follow up.`),A("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var Qn=class extends Error{};function jb(e){let t=e.what.trim();if(!t)throw new Qn("Say what went wrong.");if(t.length>2e3)throw new Qn(`That is ${t.length} characters and the limit is 2000. Send what broke and how to hit it; we will ask for the rest.`);let r=(e.game??"").trim();return{kind:"issue",what:t,game:r||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function Db(e){return JSON.stringify(e,null,2)}var q0=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function Lb(e,t,r){let o;try{o=jb({what:e,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(a){throw a instanceof Qn&&C(a.message),a}if(!t.send){if(R()){j({sent:!1,would_send:o});return}I("This is everything that would be sent"),v(),v(Db(o)),v(),A("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),A(`Send it with ${Ie('issue "..." --send')}.`);return}let n;try{n=await fetch(q0,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(a){C("Could not reach Gamestage to send that.",[a instanceof Error?a.message:String(a)])}let i=await n.json().catch(()=>({}));if(n.ok||C(`Gamestage refused that report (${n.status}).`,[i.error?.message??"It said nothing more."]),R()){j({sent:!0,reference:i.reference??null});return}I("Reported"),i.reference&&A(`Reference ${i.reference}. Quote it if you follow up.`),A("It is in the backlog now. Somebody at Monterosa reads these.")}import{readFile as X0}from"node:fs/promises";async function zb(e,t){let r;try{r=await X0(e,"utf8")}catch{return C(`Cannot read ${e}`)}let o=_e(r);if(!o.ok)return R()&&(j({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),C(`${e} is not a valid App Manifest`,o.issues.map(l=>`${$.cyan(l.path)} ${l.message}`));let n=o.manifest,i=Re(n),a=null;if(t.level){let l=gt.safeParse(t.level.toUpperCase());if(!l.success)return C(`Unknown level "${t.level}". Use L0 through L5.`);a=l.data}let s=a?oy(n,a):null,c=!i.overclaimed&&(s?.ok??!0);if(R()&&(j({ok:c,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results}),process.exit(c?0:1)),I(`${n.app.title} ${$.dim(n.app.id)}`),E("Schema",n.manifest.schema_version),E("Revision",String(n.manifest.revision)),E("Conformance",i.overclaimed?`${$.red(i.claimed)} claimed, ${$.bold(i.computed)} evidenced`:`${$.green(i.computed)} ${i.computedName}`),i.overclaimed){I("Overclaimed"),v($.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let l of i.blockers)A($.red(l.requirement))}if(a&&s&&!s.ok){I(`Not yet ${a}`);for(let l of s.missing)A(`${$.yellow(l.id)} ${l.requirement}`)}if(c&&(v(),v(` ${$.green("Valid")}${a?` at ${a}`:""}.`),i.blockers.length)){v(),v($.dim(" Next level needs:"));for(let l of i.blockers)v(` ${$.dim("\xB7")} ${l.requirement}`)}v(),process.exit(c?0:1)}var Ha="0.10.0";for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var W=new Wt;W.name("gamestage").description(`Take an agent-built game prototype to a production fan game.
7190
+ Inspect, create and validate need no account. Running, proving and
7191
+ publishing a game go through an approved account.`).version(Ha).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{Hm(!!e.opts().json)});W.command("start").description("read the current directory and point at the right next step").action(Pb);W.command("doctor").description("check the local environment").action(_b);W.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(kb);W.command("create").option("--name <name>","game name").option("--archetype <archetype>","authority model for the game").option("--write [path]","manifest path (default gamestage.yaml)").description("start a new game, choosing its authority before scaffolding").action(Uv);W.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done").action(e=>vb({...e,noBrowser:e.browser===!1}));W.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(Ym);var Mb=W.command("manifest").description("work with the App Manifest");Mb.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(Jv);Mb.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(zb);W.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(Kv);W.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").description("publish a snapshot to a playground, and the round it puts on").action(Vv);W.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(Wv);W.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(Hv);W.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>Bp(e,!1));W.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>Bp(e,!0));W.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(Yv);W.command("art").argument("<game>","game id").description("draw this game's picture, or draw it again").action(qv);W.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(Qv);W.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").description("serve your round locally, through the Engine that will serve it in the cloud").action(ab);W.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("<what>","what you were trying to build").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>Rb(e,t,Ha));W.command("issue").description("report something that went wrong (no account needed)").argument("<what>","what went wrong").option("--game <id>","the game it happened on, if it was about one").option("--send","actually send it, having seen what it says",!1).action((e,t)=>Lb(e,t,Ha));W.command("login").description("sign in, or create an account (only needed to deploy)").action(Ab);var Q0=W.command("link").description("connect an account Gamestage needs (requires sign-in)");Q0.command("github").description("link your GitHub account, which a first deploy requires").action(Eb);var Ub=W.command("admin").description("approve or refuse a creator's account (operators only)");Ub.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>Zp(e,"approved"));Ub.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>Zp(e,"refused"));W.command("logout").description("forget the stored session").action(Ib);W.command("whoami").description("show who the CLI is signed in as").action(Cb);W.parseAsync(process.argv).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
7409
7192
  `),process.exit(1)});
7410
7193
  /*! Bundled license information:
7411
7194